Commit 8d273836 authored by Sergei Golubchik's avatar Sergei Golubchik

lp:740173 5.1-micro reports incorrect Length metadata for TIME expressions

parent e2d71ef3
...@@ -210,3 +210,9 @@ f1 ...@@ -210,3 +210,9 @@ f1
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
select cast('01:01:01' as time), cast('01:01:01' as time(2));
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def cast('01:01:01' as time) 11 9 8 Y 128 0 63
def cast('01:01:01' as time(2)) 11 12 11 Y 128 2 63
cast('01:01:01' as time) cast('01:01:01' as time(2))
01:01:01 01:01:01.00
...@@ -143,3 +143,11 @@ DROP VIEW v1; ...@@ -143,3 +143,11 @@ DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
--echo End of 5.0 tests --echo End of 5.0 tests
--enable_metadata
#
# lp:740173 5.1-micro reports incorrect Length metadata for TIME expressions
#
select cast('01:01:01' as time), cast('01:01:01' as time(2));
...@@ -698,7 +698,7 @@ public: ...@@ -698,7 +698,7 @@ public:
{ {
collation.set(&my_charset_bin); collation.set(&my_charset_bin);
maybe_null= 1; maybe_null= 1;
max_length= MAX_TIME_WIDTH; max_length= MIN_TIME_WIDTH;
if (decimals == NOT_FIXED_DEC) if (decimals == NOT_FIXED_DEC)
decimals= args[0]->decimals; decimals= args[0]->decimals;
if (decimals && decimals != NOT_FIXED_DEC) if (decimals && decimals != NOT_FIXED_DEC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment