summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-05-05 12:55:09 +0400
committerunknown <konstantin@mysql.com>2005-05-05 12:55:09 +0400
commitc758512a9176b40532f8431e7771f8dbeed77111 (patch)
tree63803fbeb418fd4efd8e3bc6fe890e46fef1ee1e /sql/item.h
parentf3883ad0fa972a10c88431e92768a05bda8d774b (diff)
downloadmariadb-git-c758512a9176b40532f8431e7771f8dbeed77111.tar.gz
A fix and test case for Bug#9777 " Empty set returned by Prepared Statement when it
should return a non empty one" (see comments for the changed files for details). mysql-test/r/ps.result: A test case for Bug#9777: tests results fixed. mysql-test/t/ps.test: A test case for Bug#9777 sql/item.cc: A fix for Bug#9777: when creating a constant item from within Item_int_with_ref::new_item, create the item by value, not by name. This should work with prepared statements placeholders. Item_int_with_ref is a special optimization case used when we compare datetime constants with datetime value. Converting the item to integer early is OK as it is in line with the purpose of Item_int_with_ref - to speed up comparison by using integers. Minor cleanups. sql/item.h: Declaration for Item_int_with_ref::new_item
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/item.h b/sql/item.h
index 3f3ff491bb5..6f1f56451ab 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -651,6 +651,7 @@ class Item_uint :public Item_int
{
public:
Item_uint(const char *str_arg, uint length);
+ Item_uint(const char *str_arg, longlong i, uint length);
Item_uint(uint32 i) :Item_int((longlong) i, 10)
{ unsigned_flag= 1; }
double val()
@@ -1046,11 +1047,7 @@ public:
{
return ref->save_in_field(field, no_conversions);
}
- Item *new_item()
- {
- return (ref->unsigned_flag)? new Item_uint(ref->name, ref->max_length) :
- new Item_int(ref->name, ref->max_length);
- }
+ Item *new_item();
};