summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2001-09-27 21:45:48 +0300
committerunknown <monty@tik.mysql.fi>2001-09-27 21:45:48 +0300
commit05794bca08a0a6107233536c2198b9ba4772a3c5 (patch)
treebacb3c051e2ae3debd9dedea9b0eb2efd094a961 /sql/item_func.cc
parent5e0851e1b37debb59dbe184fcc3485470872ac64 (diff)
downloadmariadb-git-05794bca08a0a6107233536c2198b9ba4772a3c5.tar.gz
Final fixes for INSERT into MERGE tables.
Move MAX_BLOB_WIDTH to be global Added full support for unsigned BIGINT Fixed spelling errors BUILD/compile-pentium-debug-max: Don't use openssl by default Docs/manual.texi: Cleanup of MERGE tables, Access usage and UDF functions acinclude.m4: Cleanup ssl usage configure.in: Added message when using --with-tools include/mysql_com.h: Move MAX_BLOB_WIDTH to be global myisammrg/myrg_create.c: Fix problem with MERGE TABLES and INSERT myisammrg/myrg_static.c: Fix problem with MERGE TABLES and INSERT mysql-test/r/bigint.result: Added test of unsigned BIGINT mysql-test/r/merge.result: Tests for INSERT mysql-test/r/type_ranges.result: Fixed tests for unsigned bigint mysql-test/t/bigint.test: Added test of unsigned BIGINT mysql-test/t/merge.test: Tests for INSERT mysys/typelib.c: Cleanup sql/field.h: Fixed unsigned BIGINT sql/ha_berkeley.cc: Cleanup sql/ha_gemini.cc: Cleanup sql/ha_myisam.cc: Cleanup sql/ha_myisammrg.cc: Fixed INSERT into MERGE tables sql/item.cc: Fixed unsigned BIGINT sql/item.h: Fixed unsigned BIGINT sql/item_func.cc: Fixed unsigned BIGINT sql/item_strfunc.cc: Fixed spelling errors sql/item_sum.cc: Fixed unsigned BIGINT sql/item_sum.h: Fixed unsigned BIGINT sql/mf_iocache.cc: Fixed spelling errors sql/mysql_priv.h: Moved MAX_BLOB_WIDTH to be global sql/mysqld.cc: Fixed spelling errors sql/opt_range.cc: Fixed spelling errors sql/sql_base.cc: Fixed bug in SHOW OPEN TABLES sql/sql_insert.cc: Fixed spelling errors sql/sql_lex.h: Fixed spelling errors sql/sql_parse.cc: Fixed spelling errors sql/sql_select.cc: Fix for unsigned BIGINT sql/structs.h: Fixed spelling errors sql/time.cc: Fixed spelling errors sql/unireg.cc: Fixed spelling errors
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc28
1 files changed, 22 insertions, 6 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 3ef5ed5d7a3..a4d0e1a7ed1 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -184,8 +184,10 @@ String *Item_num_func::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0; /* purecov: inspected */
- else
+ else if (!unsigned_flag)
str->set(nr);
+ else
+ str->set((ulonglong) nr);
}
else
{
@@ -213,18 +215,26 @@ String *Item_int_func::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
- else
+ else if (!unsigned_flag)
str->set(nr);
+ else
+ str->set((ulonglong) nr);
return str;
}
-/* Change from REAL_RESULT (default) to INT_RESULT if both arguments are integers */
+/*
+ Change from REAL_RESULT (default) to INT_RESULT if both arguments are
+ integers
+*/
void Item_num_op::find_num_type(void)
{
if (args[0]->result_type() == INT_RESULT &&
args[1]->result_type() == INT_RESULT)
+ {
hybrid_type=INT_RESULT;
+ unsigned_flag=args[0]->unsigned_flag | args[1]->unsigned_flag;
+ }
}
String *Item_num_op::val_str(String *str)
@@ -234,8 +244,10 @@ String *Item_num_op::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0; /* purecov: inspected */
- else
+ else if (!unsigned_flag)
str->set(nr);
+ else
+ str->set((ulonglong) nr);
}
else
{
@@ -667,8 +679,10 @@ String *Item_func_min_max::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
- else
+ else if (!unsigned_flag)
str->set(nr);
+ else
+ str->set((ulonglong) nr);
return str;
}
case REAL_RESULT:
@@ -1306,8 +1320,10 @@ String *Item_func_udf_int::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
- else
+ else if (!unsigned_flag)
str->set(nr);
+ else
+ str->set((ulonglong) nr);
return str;
}