summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantony@ltantony.mysql.com <>2005-05-07 14:46:54 +0100
committerantony@ltantony.mysql.com <>2005-05-07 14:46:54 +0100
commita5e9523364fe00df5675486a63ff3fe90dc9ebb6 (patch)
tree89b63f87f5c5415df67b939f829508fc665e77e2
parent687417be74f08f92da59335bcb3b9f3f84b68e0f (diff)
parent1af671bf36fad81244b1ed9cafa9c9243f07a8dc (diff)
downloadmariadb-git-a5e9523364fe00df5675486a63ff3fe90dc9ebb6.tar.gz
Merge ltantony.mysql.com:/usr/home/antony/work2/p4-bug9666
into ltantony.mysql.com:/usr/home/antony/work2/megapatch-4.1
-rw-r--r--mysql-test/r/create.result11
-rw-r--r--mysql-test/t/create.test11
-rw-r--r--sql/sql_yacc.yy6
3 files changed, 24 insertions, 4 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 123fdbd90bd..103bed598ef 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
{