summaryrefslogtreecommitdiff
path: root/sql/item_subselect.h
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@macbook.gmz>2006-11-07 18:16:17 +0200
committerunknown <gkodinov/kgeorge@macbook.gmz>2006-11-07 18:16:17 +0200
commit5af4fd256321748a5ac7c8d4407f8ce977345e04 (patch)
tree0fe573c32a91a82f723712f6d142ef5daf5a1e93 /sql/item_subselect.h
parentc095f98ff7d18e2e5de1adf629147f2b199fbfaf (diff)
downloadmariadb-git-5af4fd256321748a5ac7c8d4407f8ce977345e04.tar.gz
Bug #11032: getObject() returns a String for a sub-query of type datetime
- When returning metadata for scalar subqueries the actual type of the column was calculated based on the value type, which limits the actual type of a scalar subselect to the set of (currently) 3 basic types : integer, double precision or string. This is the reason that columns of types other then the basic ones (e.g. date/time) are reported as being of the corresponding basic type. Fixed by storing/returning information for the column type in addition to the result type. mysql-test/r/subselect.result: Bug #11032: getObject() returns a String for a sub-query of type datetime - test case mysql-test/t/subselect.test: Bug #11032: getObject() returns a String for a sub-query of type datetime - test case sql/item_subselect.cc: Bug #11032: getObject() returns a String for a sub-query of type datetime - store and return the field type as well in addition to result type for single row subqueries sql/item_subselect.h: Bug #11032: getObject() returns a String for a sub-query of type datetime - store and return the field type as well in addition to result type for single row subqueries
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r--sql/item_subselect.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 93171ad64a1..7b064bfe92c 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -142,6 +142,7 @@ public:
longlong val_int ();
String *val_str (String *);
enum Item_result result_type() const;
+ enum_field_types field_type() const;
void fix_length_and_dec();
uint cols();
@@ -273,6 +274,7 @@ protected:
THD *thd; /* pointer to current THD */
Item_subselect *item; /* item, that use this engine */
enum Item_result res_type; /* type of results */
+ enum_field_types res_field_type; /* column type of the results */
bool maybe_null; /* may be null (first item in select) */
public:
@@ -282,6 +284,7 @@ public:
result= res;
item= si;
res_type= STRING_RESULT;
+ res_field_type= FIELD_TYPE_VAR_STRING;
maybe_null= 0;
}
virtual ~subselect_engine() {}; // to satisfy compiler
@@ -296,6 +299,7 @@ public:
virtual uint cols()= 0; /* return number of columnss in select */
virtual uint8 uncacheable()= 0; /* query is uncacheable */
enum Item_result type() { return res_type; }
+ enum_field_types field_type() { return res_field_type; }
virtual void exclude()= 0;
bool may_be_null() { return maybe_null; };
virtual table_map upper_select_const_tables()= 0;
@@ -303,6 +307,9 @@ public:
virtual void print(String *str)= 0;
virtual int change_item(Item_subselect *si, select_subselect *result)= 0;
virtual bool no_tables()= 0;
+
+protected:
+ void set_row(List<Item> &item_list, Item_cache **row);
};