From aa0c40a33bffc2a82bf200e54c5d8b1234d59acf Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 May 2005 10:56:03 +0200 Subject: [PATCH 1/3] ndb - bug#8928 ndb/src/kernel/blocks/dbdict/Dbdict.cpp: same number of lh3distrbits for all frags --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 184db794057..0c4d20ca248 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -4043,12 +4043,14 @@ calcLHbits(Uint32 * lhPageBits, Uint32 * lhDistrBits, tmp <<= 1; distrBits++; }//while +#ifdef ndb_classical_lhdistrbits if (tmp != totalFragments) { tmp >>= 1; if ((fid >= (totalFragments - tmp)) && (fid < (tmp - 1))) { distrBits--; }//if }//if +#endif * lhPageBits = pageBits; * lhDistrBits = distrBits; From bb42494438aa33eba06506724fea1a1485979b1f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 May 2005 13:31:37 +0100 Subject: [PATCH 2/3] Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update" INSERT IGNORE...UPDATE causes break in protocol or unknown error message. Fix so that protocol doesn't break by properly ignoring dups. mysql-test/r/insert_update.result: Test for Bug#9725 mysql-test/t/insert_update.test: Test for Bug#9725 sql/sql_insert.cc: Ignore the failure in update_row when IGNORE is set. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/insert_update.result | 13 +++++++++++++ mysql-test/t/insert_update.test | 12 ++++++++++++ sql/sql_insert.cc | 4 ++++ 4 files changed, 30 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 5049352c8d4..1323f7a72f1 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -13,6 +13,7 @@ administrador@light.hegel.local ahlentz@co3064164-a.rochd1.qld.optusnet.com.au akishkin@work.mysql.com antony@ltantony.dsl-verizon.net +antony@ltantony.mysql.com antony@ltantony.rdg.cyberkinetica.com antony@ltantony.rdg.cyberkinetica.homeunix.net arjen@bitbike.com diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index ff7ec1ba73f..f78372541f2 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -167,3 +167,16 @@ a b c VALUES(a) 2 1 11 NULL DROP TABLE t1; DROP TABLE t2; +create table t1 (a int not null unique); +insert into t1 values (1),(2); +insert ignore into t1 select 1 on duplicate key update a=2; +select * from t1; +a +1 +2 +insert ignore into t1 select a from t1 on duplicate key update a=a+1 ; +select * from t1; +a +1 +3 +drop table t1; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 188de8a5379..0fa366586b3 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -80,3 +80,15 @@ 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; + +# +# Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update" +# INSERT INGORE...UPDATE gives bad error or breaks protocol. +# +create table t1 (a int not null unique); +insert into t1 values (1),(2); +insert ignore into t1 select 1 on duplicate key update a=2; +select * from t1; +insert ignore into t1 select a from t1 on duplicate key update a=a+1 ; +select * from t1; +drop table t1; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 3ced5921076..a3a42ce385d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -632,7 +632,11 @@ int write_record(TABLE *table,COPY_INFO *info) if (fill_record(*info->update_fields, *info->update_values, 0)) goto err; if ((error=table->file->update_row(table->record[1],table->record[0]))) + { + if ((error == HA_ERR_FOUND_DUPP_KEY) && info->ignore) + break; goto err; + } info->updated++; break; } From 76f63c975dde623e4d5e88ced4720d3d76fc2da8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 May 2005 13:51:29 +0100 Subject: [PATCH 3/3] Bug#9666 - Can't use 'DEFAULT FALSE' for column of type bool Fix bug by moving TRUE/FALSE in with other literals. mysql-test/r/create.result: Test for Bug#9666 mysql-test/t/create.test: Test for Bug#9666 sql/sql_yacc.yy: Move TRUE/FALSE in with other literals. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/create.result | 11 +++++++++++ mysql-test/t/create.test | 11 +++++++++++ sql/sql_yacc.yy | 6 ++---- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 5049352c8d4..1323f7a72f1 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -13,6 +13,7 @@ administrador@light.hegel.local ahlentz@co3064164-a.rochd1.qld.optusnet.com.au akishkin@work.mysql.com antony@ltantony.dsl-verizon.net +antony@ltantony.mysql.com antony@ltantony.rdg.cyberkinetica.com antony@ltantony.rdg.cyberkinetica.homeunix.net arjen@bitbike.com diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 92c825f547d..ac4f711e4d0 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -552,3 +552,14 @@ NULL 1 Test 0 NULL 1 drop table t1, t2, t3; +create table t1 (b bool not null default false); +create table t2 (b bool not null default true); +insert into t1 values (); +insert into t2 values (); +select * from t1; +b +0 +select * from t2; +b +1 +drop table t1,t2; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 6f222eedec1..ce85e530569 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -449,3 +449,14 @@ INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13: CREATE TABLE t3 SELECT t1.dsc,COUNT(DISTINCT t2.id) AS countOfRuns FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) GROUP BY t1.id; SELECT * FROM t3; drop table t1, t2, t3; + +# +# Bug#9666: Can't use 'DEFAULT FALSE' for column of type bool +# +create table t1 (b bool not null default false); +create table t2 (b bool not null default true); +insert into t1 values (); +insert into t2 values (); +select * from t1; +select * from t2; +drop table t1,t2; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 594077dd4f3..73845f7d645 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2959,8 +2959,6 @@ simple_expr: { $$= new Item_func_export_set($3, $5, $7, $9); } | EXPORT_SET '(' expr ',' expr ',' expr ',' expr ',' expr ')' { $$= new Item_func_export_set($3, $5, $7, $9, $11); } - | FALSE_SYM - { $$= new Item_int((char*) "FALSE",0,1); } | FORMAT_SYM '(' expr ',' NUM ')' { $$= new Item_func_format($3,atoi($5.str)); } | FROM_UNIXTIME '(' expr ')' @@ -3108,8 +3106,6 @@ simple_expr: { $$= new Item_func_trim($5,$3); } | TRUNCATE_SYM '(' expr ',' expr ')' { $$= new Item_func_round($3,$5,1); } - | TRUE_SYM - { $$= new Item_int((char*) "TRUE",1,1); } | UDA_CHAR_SUM '(' udf_expr_list ')' { if ($3 != NULL) @@ -4892,6 +4888,8 @@ literal: | NUM_literal { $$ = $1; } | NULL_SYM { $$ = new Item_null(); Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;} + | FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); } + | TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); } | HEX_NUM { $$ = new Item_varbinary($1.str,$1.length);} | UNDERSCORE_CHARSET HEX_NUM {