1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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

This commit is contained in:
Sergei Golubchik
2011-03-23 13:31:06 +01:00
parent e2d71ef3e6
commit 8d2738367e
3 changed files with 15 additions and 1 deletions

View File

@@ -210,3 +210,9 @@ f1
DROP VIEW v1;
DROP TABLE t1;
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

View File

@@ -143,3 +143,11 @@ DROP VIEW v1;
DROP TABLE t1;
--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));

View File

@@ -698,7 +698,7 @@ public:
{
collation.set(&my_charset_bin);
maybe_null= 1;
max_length= MAX_TIME_WIDTH;
max_length= MIN_TIME_WIDTH;
if (decimals == NOT_FIXED_DEC)
decimals= args[0]->decimals;
if (decimals && decimals != NOT_FIXED_DEC)