Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL)
Description
I start mysql --column-type-info test and execute this script:
SELECT 1+1, 1*1; |
It reports the following metadata:
Field 1: `1+1`
|
Type: LONGLONG
|
Length: 3
|
|
Field 2: `1*1`
|
Type: LONGLONG
|
Length: 3
|
However, if I do:
CREATE OR REPLACE TABLE t1 AS SELECT 1+1,1*1; |
DESCRIBE t1;
|
It creates INT(3):
+-------+--------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+--------+------+-----+---------+-------+
|
| 1+1 | int(3) | NO | | 0 | |
|
| 1*1 | int(3) | NO | | 0 | |
|
+-------+--------+------+-----+---------+-------+
|
Metadata should be fixed to match the real column type created on CREATE..SELECT.
The same problem is repeatable for all Item_func_numhybrid descendants:
Item_func_numhybrid
|
Item_func_num1
|
Item_func_neg
|
Item_func_abs
|
Item_func_int_val
|
Item_func_ceiling
|
Item_func_floor
|
Item_num_op
|
Item_func_additive_op
|
Item_func_plus
|
Item_func_minus
|
Item_func_mul
|
Item_func_div
|
Item_func_mod
|
Item_func_round
|
Item_func_seconds_hybrid
|
Item_func_unix_timestamp
|
Item_func_time_to_sec
|
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
I start {{mysql --column-type-info test}} and
{code:sql} SELECT 1+1, 1*1; {code} {noformat} It reports the following metadata: {noformat} Field 1: `1+1` Type: LONGLONG Length: 3 Field 2: `1*1` Type: LONGLONG Length: 3 {noformat} However, if I do: {code:sql} CREATE OR REPLACE TABLE t1 AS SELECT 1+1,1*1; DESCRIBE t1; {code} It creates {{INT(3)}}: {noformat} +-------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+-------+ | 1+1 | int(3) | NO | | 0 | | | 1*1 | int(3) | NO | | 0 | | +-------+--------+------+-----+---------+-------+ {noformat} Metadata should be fixed to match the real column type created on {{CREATE..SELECT}}. |
I start {{mysql --column-type-info test}} and execute this script:
{code:sql} SELECT 1+1, 1*1; {code} {noformat} It reports the following metadata: {noformat} Field 1: `1+1` Type: LONGLONG Length: 3 Field 2: `1*1` Type: LONGLONG Length: 3 {noformat} However, if I do: {code:sql} CREATE OR REPLACE TABLE t1 AS SELECT 1+1,1*1; DESCRIBE t1; {code} It creates {{INT(3)}}: {noformat} +-------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+-------+ | 1+1 | int(3) | NO | | 0 | | | 1*1 | int(3) | NO | | 0 | | +-------+--------+------+-----+---------+-------+ {noformat} Metadata should be fixed to match the real column type created on {{CREATE..SELECT}}. |
Description |
I start {{mysql --column-type-info test}} and execute this script:
{code:sql} SELECT 1+1, 1*1; {code} {noformat} It reports the following metadata: {noformat} Field 1: `1+1` Type: LONGLONG Length: 3 Field 2: `1*1` Type: LONGLONG Length: 3 {noformat} However, if I do: {code:sql} CREATE OR REPLACE TABLE t1 AS SELECT 1+1,1*1; DESCRIBE t1; {code} It creates {{INT(3)}}: {noformat} +-------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+-------+ | 1+1 | int(3) | NO | | 0 | | | 1*1 | int(3) | NO | | 0 | | +-------+--------+------+-----+---------+-------+ {noformat} Metadata should be fixed to match the real column type created on {{CREATE..SELECT}}. |
I start {{mysql --column-type-info test}} and execute this script:
{code:sql} SELECT 1+1, 1*1; {code} It reports the following metadata: {noformat} Field 1: `1+1` Type: LONGLONG Length: 3 Field 2: `1*1` Type: LONGLONG Length: 3 {noformat} However, if I do: {code:sql} CREATE OR REPLACE TABLE t1 AS SELECT 1+1,1*1; DESCRIBE t1; {code} It creates {{INT(3)}}: {noformat} +-------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+-------+ | 1+1 | int(3) | NO | | 0 | | | 1*1 | int(3) | NO | | 0 | | +-------+--------+------+-----+---------+-------+ {noformat} Metadata should be fixed to match the real column type created on {{CREATE..SELECT}}. |
Description |
I start {{mysql --column-type-info test}} and execute this script:
{code:sql} SELECT 1+1, 1*1; {code} It reports the following metadata: {noformat} Field 1: `1+1` Type: LONGLONG Length: 3 Field 2: `1*1` Type: LONGLONG Length: 3 {noformat} However, if I do: {code:sql} CREATE OR REPLACE TABLE t1 AS SELECT 1+1,1*1; DESCRIBE t1; {code} It creates {{INT(3)}}: {noformat} +-------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+-------+ | 1+1 | int(3) | NO | | 0 | | | 1*1 | int(3) | NO | | 0 | | +-------+--------+------+-----+---------+-------+ {noformat} Metadata should be fixed to match the real column type created on {{CREATE..SELECT}}. |
I start {{mysql --column-type-info test}} and execute this script:
{code:sql} SELECT 1+1, 1*1; {code} It reports the following metadata: {noformat} Field 1: `1+1` Type: LONGLONG Length: 3 Field 2: `1*1` Type: LONGLONG Length: 3 {noformat} However, if I do: {code:sql} CREATE OR REPLACE TABLE t1 AS SELECT 1+1,1*1; DESCRIBE t1; {code} It creates {{INT(3)}}: {noformat} +-------+--------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------+------+-----+---------+-------+ | 1+1 | int(3) | NO | | 0 | | | 1*1 | int(3) | NO | | 0 | | +-------+--------+------+-----+---------+-------+ {noformat} Metadata should be fixed to match the real column type created on {{CREATE..SELECT}}. The same problem is repeatable for all {{Item_func_numhybrid}} descendants: {noformat} Item_func_numhybrid Item_func_num1 Item_func_neg Item_func_abs Item_func_int_val Item_func_ceiling Item_func_floor Item_num_op Item_func_additive_op Item_func_plus Item_func_minus Item_func_mul Item_func_div Item_func_mod Item_func_round Item_func_seconds_hybrid Item_func_unix_timestamp Item_func_time_to_sec {noformat} |
Labels | datatype |
issue.field.resolutiondate | 2017-05-23 08:51:30.0 | 2017-05-23 08:51:30.873 |
Fix Version/s | 10.3.1 [ 22532 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 80883 ] | MariaDB v4 [ 152198 ] |
Pushed into bb-10.2-ext