mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Merge mysql.com:/home/hf/work/27921/my51-27921
into mysql.com:/home/hf/work/27957/my51-27957
This commit is contained in:
commit
76336751b7
3 changed files with 25 additions and 1 deletions
|
@ -3213,6 +3213,18 @@ EXPLAIN SELECT * FROM t1 UNION SELECT * FROM v1 ORDER BY a;
|
|||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #27921 View ignores precision for CAST()
|
||||
#
|
||||
CREATE VIEW v1 AS SELECT CAST( 1.23456789 AS DECIMAL( 7,5 ) ) AS col;
|
||||
SELECT * FROM v1;
|
||||
DESCRIBE v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
CREATE VIEW v1 AS SELECT CAST(1.23456789 AS DECIMAL(8,0)) AS col;
|
||||
SHOW CREATE VIEW v1;
|
||||
DROP VIEW v1;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
|
|
|
@ -3947,6 +3947,7 @@ Create_func_master_pos_wait::create_native(THD *thd, LEX_STRING name,
|
|||
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return func;
|
||||
}
|
||||
|
@ -4972,7 +4973,7 @@ find_qualified_function_builder(THD *thd)
|
|||
|
||||
|
||||
Item *
|
||||
create_func_cast(Item *a, Cast_target cast_type,
|
||||
create_func_cast(THD *thd, Item *a, Cast_target cast_type,
|
||||
const char *c_len, const char *c_dec,
|
||||
CHARSET_INFO *cs)
|
||||
{
|
||||
|
|
|
@ -208,6 +208,17 @@ my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec)
|
|||
}
|
||||
|
||||
|
||||
void my_decimal_trim(ulong *precision, uint *scale)
|
||||
{
|
||||
if (!(*precision) && !(*scale))
|
||||
{
|
||||
*precision= 10;
|
||||
*scale= 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
/* routines for debugging print */
|
||||
|
||||
|
|
Loading…
Reference in a new issue