diff --git a/src/DataTypes/DataTypesNumber.cpp b/src/DataTypes/DataTypesNumber.cpp index 3fbf81791dd..7fe6f64f6c6 100644 --- a/src/DataTypes/DataTypesNumber.cpp +++ b/src/DataTypes/DataTypesNumber.cpp @@ -46,8 +46,8 @@ void registerDataTypeNumbers(DataTypeFactory & factory) factory.registerDataType("Int16", createNumericDataType); factory.registerDataType("Int32", createNumericDataType); factory.registerDataType("Int64", createNumericDataType); - factory.registerDataType("Float32", createNumericDataType); - factory.registerDataType("Float64", createNumericDataType); + factory.registerDataType("Float32", createNumericDataType); + factory.registerDataType("Float64", createNumericDataType); /// These synonyms are added for compatibility. diff --git a/tests/queries/0_stateless/01268_data_numeric_parameters.reference b/tests/queries/0_stateless/01268_data_numeric_parameters.reference new file mode 100644 index 00000000000..fd76fd4ef54 --- /dev/null +++ b/tests/queries/0_stateless/01268_data_numeric_parameters.reference @@ -0,0 +1,3 @@ +Int8 Int8 Int16 Int16 Int32 Int32 Int64 Int64 +Float32 Float32 Float32 Float64 Float64 Float64 +String String diff --git a/tests/queries/0_stateless/01268_data_numeric_parameters.sql b/tests/queries/0_stateless/01268_data_numeric_parameters.sql new file mode 100644 index 00000000000..eceba51e7f5 --- /dev/null +++ b/tests/queries/0_stateless/01268_data_numeric_parameters.sql @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS ints; +DROP TABLE IF EXISTS floats; +DROP TABLE IF EXISTS strings; + +CREATE TABLE ints ( + a TINYINT, + b TINYINT(8), + c SMALLINT, + d SMALLINT(16), + e INT, + f INT(32), + g BIGINT, + h BIGINT(64) +) engine=Memory; + +INSERT INTO ints VALUES (1, 8, 11, 16, 21, 32, 41, 64); + +SELECT toTypeName(a), toTypeName(b), toTypeName(c), toTypeName(d), toTypeName(e), toTypeName(f), toTypeName(g), toTypeName(h) FROM ints; + +CREATE TABLE floats ( + a FLOAT, + b FLOAT(12), + c FLOAT(15, 22), + d DOUBLE, + e DOUBLE(12), + f DOUBLE(4, 18) + +) engine=Memory; + +INSERT INTO floats VALUES (1.1, 1.2, 1.3, 41.1, 41.1, 42.1); + +SELECT toTypeName(a), toTypeName(b), toTypeName(c), toTypeName(d), toTypeName(e), toTypeName(f) FROM floats; + + +CREATE TABLE strings ( + a VARCHAR, + b VARCHAR(11) +) engine=Memory; + +INSERT INTO strings VALUES ('test', 'string'); + +SELECT toTypeName(a), toTypeName(b) FROM strings;