From f38d7d6d8da61b775153573ee9a32c05102fde7d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 Mar 2005 13:57:15 +0200 Subject: [PATCH 1/6] update results --- mysql-test/r/ps_7ndb.result | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 43ff9607c55..9c13f16327f 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -48,7 +48,7 @@ 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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -1144,7 +1144,7 @@ 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 +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 @@ -1783,7 +1783,7 @@ t5 CREATE TABLE `t5` ( `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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -1895,7 +1895,7 @@ 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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -1942,7 +1942,7 @@ 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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -1992,7 +1992,7 @@ 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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -2032,7 +2032,7 @@ 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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -2080,7 +2080,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -2124,7 +2124,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -2170,7 +2170,7 @@ 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 +Catalog Database Table Table_alias Column Column_alias 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 @@ -2208,7 +2208,7 @@ def @arg32 254 8192 6 Y 0 31 8 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 +Catalog Database Table Table_alias Column Column_alias 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 From ce3253cfd1a010d103eb9a6ca42fb65fa6667b9d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 Mar 2005 23:03:36 +0200 Subject: [PATCH 2/6] typo fixed --- strings/my_strtoll10-x86.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/my_strtoll10-x86.s b/strings/my_strtoll10-x86.s index e89e7ff5989..c04384667a7 100644 --- a/strings/my_strtoll10-x86.s +++ b/strings/my_strtoll10-x86.s @@ -394,7 +394,7 @@ my_strtoll10: popl %ebp ret -my_strtoll10_end: +.my_strtoll10_end: .size my_strtoll10,.my_strtoll10_end-my_strtoll10 .comm res,240,32 .comm end_ptr,120,32 From 3e2f7ed4f5e7d1611a074fac306419cfb4ad0cf4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 Mar 2005 23:31:56 +0200 Subject: [PATCH 3/6] Fedora now defines read(2)/write(2) as macros. Argh! --- include/violite.h | 4 ++-- vio/test-ssl.c | 4 ++-- vio/test-sslclient.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/violite.h b/include/violite.h index 855d8a3d490..b89b01f95f4 100644 --- a/include/violite.h +++ b/include/violite.h @@ -138,8 +138,8 @@ int vio_close_shared_memory(Vio * vio); #if defined(HAVE_VIO) && !defined(DONT_MAP_VIO) #define vio_delete(vio) (vio)->viodelete(vio) #define vio_errno(vio) (vio)->vioerrno(vio) -#define vio_read(vio, buf, size) (vio)->read(vio,buf,size) -#define vio_write(vio, buf, size) (vio)->write(vio, buf, size) +#define vio_read(vio, buf, size) ((vio)->read)(vio,buf,size) +#define vio_write(vio, buf, size) ((vio)->write)(vio, buf, size) #define vio_blocking(vio, set_blocking_mode, old_mode)\ (vio)->vioblocking(vio, set_blocking_mode, old_mode) #define vio_is_blocking(vio) (vio)->is_blocking(vio) diff --git a/vio/test-ssl.c b/vio/test-ssl.c index 88df6936a1f..a94eb1a21ff 100644 --- a/vio/test-ssl.c +++ b/vio/test-ssl.c @@ -115,7 +115,7 @@ main(int argc, char** argv) { /* child, therefore, client */ char xbuf[100]; - int r = client_vio->read(client_vio,xbuf, sizeof(xbuf)); + int r = vio_read(client_vio,xbuf, sizeof(xbuf)); if (r<=0) { my_free((gptr)ssl_acceptor,MYF(0)); my_free((gptr)ssl_connector,MYF(0)); @@ -130,7 +130,7 @@ main(int argc, char** argv) else { const char* s = "Huhuhuh"; - int r = server_vio->write(server_vio,(gptr)s, strlen(s)); + int r = vio_write(server_vio,(gptr)s, strlen(s)); if (r<=0) { my_free((gptr)ssl_acceptor,MYF(0)); my_free((gptr)ssl_connector,MYF(0)); diff --git a/vio/test-sslclient.c b/vio/test-sslclient.c index 231ce056d8c..3811ba0fb6a 100644 --- a/vio/test-sslclient.c +++ b/vio/test-sslclient.c @@ -77,13 +77,13 @@ main( int argc __attribute__((unused)), sa.sin_port = htons (1111); /* Server Port number */ err = connect(client_vio->sd, (struct sockaddr*) &sa, - sizeof(sa)); + sizeof(sa)); /* ----------------------------------------------- */ /* Now we have TCP conncetion. Start SSL negotiation. */ read(client_vio->sd,xbuf, sizeof(xbuf)); sslconnect(ssl_connector,client_vio,60L); - err = client_vio->read(client_vio,xbuf, sizeof(xbuf)); + err = vio_read(client_vio,xbuf, sizeof(xbuf)); if (err<=0) { my_free((gptr)ssl_connector,MYF(0)); fatal_error("client:SSL_read"); From fe811dd892f2301f6787033f16e84c3a4412eab2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Mar 2005 10:43:24 +0200 Subject: [PATCH 4/6] don't strcmp db if it's a pattern --- sql/sql_parse.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7d48489bf71..8f56b7cfcff 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2704,6 +2704,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, DBUG_PRINT("enter",("want_access: %lu master_access: %lu", want_access, thd->master_access)); ulong db_access,dummy; + bool db_is_pattern= test(want_access & GRANT_ACL); if (save_priv) *save_priv=0; else @@ -2725,9 +2726,9 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, */ db_access= thd->db_access; if (!(thd->master_access & SELECT_ACL) && - (db && (!thd->db || strcmp(db,thd->db)))) + (db && (!thd->db || db_is_pattern || strcmp(db,thd->db)))) db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, db, test(want_access & GRANT_ACL)); + thd->priv_user, db, db_is_pattern); *save_priv=thd->master_access | db_access; DBUG_RETURN(FALSE); } @@ -2745,9 +2746,9 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, if (db == any_db) DBUG_RETURN(FALSE); // Allow select on anything - if (db && (!thd->db || strcmp(db,thd->db))) + if (db && (!thd->db || db_is_pattern || strcmp(db,thd->db))) db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, db, test(want_access & GRANT_ACL)); + thd->priv_user, db, db_is_pattern); else db_access=thd->db_access; // Remove SHOW attribute and access rights we already have From 103dddfbd2d280acc4eab3ff6d0ed7d99de36757 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Mar 2005 14:10:27 +0500 Subject: [PATCH 5/6] Remove .opt file for faster test running. BitKeeper/deleted/.del-ctype_cp1251-master.opt~68be9a59ec8ee106: Delete: mysql-test/t/ctype_cp1251-master.opt --- mysql-test/r/ctype_cp1251.result | 4 ++-- mysql-test/t/ctype_cp1251-master.opt | 2 -- mysql-test/t/ctype_cp1251.test | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 mysql-test/t/ctype_cp1251-master.opt diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 647f8c6236c..c65055e726d 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -1,6 +1,6 @@ drop table if exists t1; SET NAMES cp1251; -create table t1 (a varchar(10) not null); +create table t1 (a varchar(10) not null) character set cp1251; insert into t1 values ("a"),("ab"),("abc"); select * from t1; a @@ -23,7 +23,7 @@ a b c drop table t1; -create table t1 (a char(15) binary, b binary(15)); +create table t1 (a char(15) binary, b binary(15)) character set cp1251; insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; upper(a) upper(b) diff --git a/mysql-test/t/ctype_cp1251-master.opt b/mysql-test/t/ctype_cp1251-master.opt deleted file mode 100644 index af089d9f176..00000000000 --- a/mysql-test/t/ctype_cp1251-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---default-character-set=cp1251 --new - diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 2d670ec3607..76873e6fa0e 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -10,7 +10,7 @@ SET NAMES cp1251; # Test problem with LEFT() (Bug #514) # -create table t1 (a varchar(10) not null); +create table t1 (a varchar(10) not null) character set cp1251; insert into t1 values ("a"),("ab"),("abc"); select * from t1; select a, left(a,1) as b from t1; @@ -21,7 +21,7 @@ drop table t1; # # Test of binary and upper/lower # -create table t1 (a char(15) binary, b binary(15)); +create table t1 (a char(15) binary, b binary(15)) character set cp1251; insert into t1 values ('aaa','bbb'),('AAA','BBB'); select upper(a),upper(b) from t1; select lower(a),lower(b) from t1; From 216ed8c7e282c0c993f50f19950813f5c8bf423e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Mar 2005 14:43:56 +0500 Subject: [PATCH 6/6] A fix (bug #9401: type_timestamp segfaults mysqld) sql/sql_select.cc: A fix (bug #9401: type_timestamp segfaults mysqld). 1. create_tmp_field_from_field() is modified to take 'Item_ref *item' and 'char *name' instead of 'bool modify_item' and 'Item *item'. 2. For Item_sum_min/max we should never modify item, so NULL is passed as item to the create_tmp_field_from_field(). --- sql/sql_select.cc | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c79912e7eae..364d1c199ac 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4604,14 +4604,14 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item) create_tmp_field_from_field() thd Thread handler org_field field from which new field will be created + name New field name item Item to create a field for table Temporary table - modify_item 1 if item->result_field should point to new item. - This is relevent for how fill_record() is going to - work: - If modify_item is 1 then fill_record() will update + item !=NULL if item->result_field should point to new field. + This is relevant for how fill_record() is going to work: + If item != NULL then fill_record() will update the record in the original table. - If modify_item is 0 then fill_record() will update + If item == NULL then fill_record() will update the temporary table convert_blob_length If >0 create a varstring(convert_blob_length) field instead of blob. @@ -4622,8 +4622,8 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item) */ static Field* create_tmp_field_from_field(THD *thd, Field* org_field, - Item *item, TABLE *table, - bool modify_item, + const char *name, TABLE *table, + Item_field *item, uint convert_blob_length) { Field *new_field; @@ -4636,10 +4636,10 @@ static Field* create_tmp_field_from_field(THD *thd, Field* org_field, new_field= org_field->new_field(thd->mem_root, table); if (new_field) { - if (modify_item) - ((Item_field *)item)->result_field= new_field; + if (item) + item->result_field= new_field; else - new_field->field_name= item->name; + new_field->field_name= name; if (org_field->maybe_null()) new_field->flags&= ~NOT_NULL_FLAG; // Because of outer join if (org_field->type() == FIELD_TYPE_VAR_STRING) @@ -4779,8 +4779,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, if (item_sum->args[0]->type() == Item::FIELD_ITEM) { *from_field= ((Item_field*) item_sum->args[0])->field; - return create_tmp_field_from_field(thd, *from_field, item, table, - modify_item, convert_blob_length); + return create_tmp_field_from_field(thd, *from_field, item->name, table, + NULL, convert_blob_length); } /* fall through */ default: @@ -4818,8 +4818,10 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, case Item::DEFAULT_VALUE_ITEM: { Item_field *field= (Item_field*) item; - return create_tmp_field_from_field(thd, (*from_field= field->field), item, - table, modify_item, convert_blob_length); + return create_tmp_field_from_field(thd, (*from_field= field->field), + item->name, table, + modify_item ? (Item_field*) item : NULL, + convert_blob_length); } case Item::FUNC_ITEM: case Item::COND_ITEM: @@ -4840,7 +4842,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type, { Field *example= ((Item_type_holder *)item)->example(); if (example) - return create_tmp_field_from_field(thd, example, item, table, 0, + return create_tmp_field_from_field(thd, example, item->name, table, NULL, convert_blob_length); return create_tmp_field_from_item(thd, item, table, copy_func, 0, convert_blob_length);