summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <holyfoot@mysql.com>2006-03-02 12:35:42 +0400
committerunknown <holyfoot@mysql.com>2006-03-02 12:35:42 +0400
commitf8967ea3627b8eedd1813ecda949d6ee021fd0a7 (patch)
tree14ee875cadab606ff7fb41c048b7b3d2c13310e1
parent6b47340069fb32c355cfbcd015883325e750b24a (diff)
parente0504f9abcdf50c2dc37824445946c12ef32f0d6 (diff)
downloadmariadb-git-f8967ea3627b8eedd1813ecda949d6ee021fd0a7.tar.gz
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.9088
-rw-r--r--mysql-test/r/bigint.result9
-rw-r--r--mysql-test/t/bigint.test9
-rw-r--r--sql/item.h5
-rw-r--r--sql/item_cmpfunc.cc3
4 files changed, 23 insertions, 3 deletions
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 84779858b75..3cdf4b17027 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -332,3 +332,12 @@ SELECT * FROM t1;
col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 fix1 fix2 fix3 fix4 fix5 fix6 fix7 fix8 fix9 fix10 fix11 fix12 fix13 fix14 fix15 fix16 fix17 fix18 fix19 fix20 fix21 fix22 fix23 fix24 fix25 fix26 fix27 fix28 fix29 fix30
9 99 999 9999 99999 999999 9999999 99999999 999999999 9999999999 99999999999 999999999999 9999999999999 99999999999999 999999999999999 9999999999999999 99999999999999999 999999999999999999 9999999999999999999 99999999999999999999 999999999999999999999 9999999999999999999999 99999999999999999999999 999999999999999999999999 9999999999999999999999999 99999999999999999999999999 999999999999999999999999999 9999999999999999999999999999 99999999999999999999999999999 999999999999999999999999999999 9999999999999999999999999999999 99999999999999999999999999999999 999999999999999999999999999999999 9999999999999999999999999999999999 99999999999999999999999999999999999 999999999999999999999999999999999999 9999999999999999999999999999999999999 99999999999999999999999999999999999999 9999999999999999999999999999999999999.9 999999999999999999999999999999999999.99 99999999999999999999999999999999999.999 9999999999999999999999999999999999.9999 999999999999999999999999999999999.99999 99999999999999999999999999999999.999999 9999999999999999999999999999999.9999999 999999999999999999999999999999.99999999 99999999999999999999999999999.999999999 9999999999999999999999999999.9999999999 999999999999999999999999999.99999999999 99999999999999999999999999.999999999999 9999999999999999999999999.9999999999999 999999999999999999999999.99999999999999 99999999999999999999999.999999999999999 9999999999999999999999.9999999999999999 999999999999999999999.99999999999999999 99999999999999999999.999999999999999999 9999999999999999999.9999999999999999999 999999999999999999.99999999999999999999 99999999999999999.999999999999999999999 9999999999999999.9999999999999999999999 999999999999999.99999999999999999999999 99999999999999.999999999999999999999999 9999999999999.9999999999999999999999999 999999999999.99999999999999999999999999 99999999999.999999999999999999999999999 9999999999.9999999999999999999999999999 999999999.99999999999999999999999999999 99999999.999999999999999999999999999999
DROP TABLE t1;
+create table t1 (bigint_col bigint unsigned);
+insert into t1 values (17666000000000000000);
+select * from t1 where bigint_col=17666000000000000000;
+bigint_col
+17666000000000000000
+select * from t1 where bigint_col='17666000000000000000';
+bigint_col
+17666000000000000000
+drop table t1;
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 7871b3647e3..35cda11646a 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -270,3 +270,12 @@ VALUES (9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999,
SELECT * FROM t1;
DROP TABLE t1;
+
+#bug #9088 BIGINT WHERE CLAUSE
+create table t1 (bigint_col bigint unsigned);
+insert into t1 values (17666000000000000000);
+select * from t1 where bigint_col=17666000000000000000;
+select * from t1 where bigint_col='17666000000000000000';
+drop table t1;
+
+
diff --git a/sql/item.h b/sql/item.h
index 2029658d476..a859b067632 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1887,9 +1887,10 @@ class Item_int_with_ref :public Item_int
{
Item *ref;
public:
- Item_int_with_ref(longlong i, Item *ref_arg) :Item_int(i), ref(ref_arg)
+ Item_int_with_ref(longlong i, Item *ref_arg, my_bool unsigned_arg) :
+ Item_int(i), ref(ref_arg)
{
- unsigned_flag= ref_arg->unsigned_flag;
+ unsigned_flag= unsigned_arg;
}
int save_in_field(Field *field, bool no_conversions)
{
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index d812ce913c5..7ba8a536ac7 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -216,7 +216,8 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item)
field->table->in_use->variables.sql_mode|= MODE_INVALID_DATES;
if (!(*item)->save_in_field(field, 1) && !((*item)->null_value))
{
- Item *tmp=new Item_int_with_ref(field->val_int(), *item);
+ Item *tmp=new Item_int_with_ref(field->val_int(), *item,
+ test(field->flags & UNSIGNED_FLAG));
field->table->in_use->variables.sql_mode= orig_sql_mode;
if (tmp)
thd->change_item_tree(item, tmp);