← Back
Editing: type_float.result
SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; SELECT 10,10.0,10.,.1e+2,100.0e-1; 10 10.0 10. .1e+2 100.0e-1 10 10.0 10 10 10 SELECT 6e-16, -6e-16, --6e-16, -6e-16+1.000000; 6e-16 -6e-16 --6e-16 -6e-16+1.000000 6e-16 -6e-16 6e-16 0.9999999999999994 SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; 1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1 10 10 10 10 10 10 0.1 0.1 0.1 SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; 0.001e+1 0.001e-1 -0.001e+01 -0.001e-01 0.01 0.0001 -0.01 -0.0001 SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; 123.23E+02 -123.23E-02 "123.23E+02"+0.0 "-123.23E-02"+0.0 12323 -1.2323 12323 -1.2323 SELECT 2147483647E+02,21474836.47E+06; 2147483647E+02 21474836.47E+06 214748364700 21474836470000 create table t1 (f1 float(24),f2 float(52)); show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment f1 float NULL YES NULL select,insert,update,references f2 double NULL YES NULL select,insert,update,references insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); Warnings: Warning 1264 Out of range value for column 'f1' at row 7 Warning 1264 Out of range value for column 'f1' at row 8 insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); select * from t1; f1 f2 10 10 100000 100000 1234570000 1234567890 10000000000 10000000000 1e15 1e15 1e20 1e20 3.40282e38 1e50 3.40282e38 1e150 -10 -10 0.00001 0.00001 0.0000000001 0.0000000001 0.000000000000001 0.000000000000001 1e-20 1e-20 0 1e-50 0 1e-150 drop table t1; create table t1 (datum double); insert into t1 values (0.5),(1.0),(1.5),(2.0),(2.5); select * from t1; datum 0.5 1 1.5 2 2.5 select * from t1 where datum < 1.5; datum 0.5 1 select * from t1 where datum > 1.5; datum 2 2.5 select * from t1 where datum = 1.5; datum 1.5 drop table t1; create table t1 (a decimal(7,3) not null, key (a)); insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1"); select a from t1 order by a; a -0.010 -0.002 0.000 0.000 1.000 select min(a) from t1; min(a) -0.010 drop table t1; create table t1 (c1 double, c2 varchar(20)); insert t1 values (121,"16"); select c1 + c1 * (c2 / 100) as col from t1; col 140.36 create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1; select * from t2; col1 col2 col3 col4 140.36 121 121 0.00000034785054261852176 show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `col1` double DEFAULT NULL, `col2` double DEFAULT NULL, `col3` double DEFAULT NULL, `col4` double DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci drop table t1,t2; create table t1 (a float); insert into t1 values (1); select max(a),min(a),avg(a) from t1; max(a) min(a) avg(a) 1 1 1 drop table t1; create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(7,6)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment f float NULL YES NULL select,insert,update,references f2 float NULL YES NULL select,insert,update,references f3 float(6,2) NULL YES NULL select,insert,update,references d double NULL YES NULL select,insert,update,references d2 double NULL YES NULL select,insert,update,references d3 double(10,3) NULL YES NULL select,insert,update,references de decimal(10,0) NULL YES NULL select,insert,update,references de2 decimal(6,0) NULL YES NULL select,insert,update,references de3 decimal(5,2) NULL YES NULL select,insert,update,references n decimal(10,0) NULL YES NULL select,insert,update,references n2 decimal(8,0) NULL YES NULL select,insert,update,references n3 decimal(7,6) NULL YES NULL select,insert,update,references drop table t1; create table t1 (a decimal(7,3) not null, key (a)); insert into t1 values ("0"),("-0.00"),("-0.01"),("-0.002"),("1"); select a from t1 order by a; a -0.010 -0.002 0.000 0.000 1.000 select min(a) from t1; min(a) -0.010 drop table t1; create table t1 (a float(200,100), b double(200,100)); ERROR 42000: Too big scale 100 specified for column 'a'. Maximum is 30. create table t1 (c20 char); insert into t1 values (5000.0); Warnings: Warning 1265 Data truncated for column 'c20' at row 1 insert into t1 values (0.5e4); Warnings: Warning 1265 Data truncated for column 'c20' at row 1 drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; create table t1 (d1 double, d2 double unsigned); Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. insert into t1 set d1 = -1.0; update t1 set d2 = d1; Warnings: Warning 1264 Out of range value for column 'd2' at row 1 select * from t1; d1 d2 -1 0 drop table t1; create table t1 (f float(4,3)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f' at row 2 Warning 1264 Out of range value for column 'f' at row 3 Warning 1264 Out of range value for column 'f' at row 4 Warning 1264 Out of range value for column 'f' at row 5 Warning 1264 Out of range value for column 'f' at row 6 select * from t1; f -9.999 -9.999 -9.999 9.999 9.999 9.999 drop table if exists t1; create table t1 (f double(4,3)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f' at row 2 Warning 1264 Out of range value for column 'f' at row 3 Warning 1264 Out of range value for column 'f' at row 4 Warning 1264 Out of range value for column 'f' at row 5 Warning 1264 Out of range value for column 'f' at row 6 select * from t1; f -9.999 -9.999 -9.999 9.999 9.999 9.999 drop table if exists t1; create table t1 (c char(20)); insert into t1 values (5e-28); select * from t1; c 5e-28 drop table t1; create table t1 (c char(6)); insert into t1 values (2e5),(2e6),(2e-4),(2e-5); select * from t1; c 200000 2e6 0.0002 2e-5 drop table t1; create table t1 (d double(10,1)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. create table t2 (d double(10,9)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. insert into t1 values ("100000000.0"); insert into t2 values ("1.23456780"); create table t3 select * from t2 union select * from t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. select * from t3; d 1.234567800 100000000.000000000 show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `d` double(18,9) DEFAULT NULL ) ENGINE=ENGINE DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci drop table t1, t2, t3; create table t1 select 105213674794682365.00 + 0.0 x; show warnings; Level Code Message desc t1; Field Type Null Key Default Extra x decimal(21,2) NO 0.00 drop table t1; create table t1 select 0.0 x; desc t1; Field Type Null Key Default Extra x decimal(2,1) NO 0.0 create table t2 select 105213674794682365.00 y; desc t2; Field Type Null Key Default Extra y decimal(20,2) NO 0.00 create table t3 select x+y a from t1,t2; show warnings; Level Code Message desc t3; Field Type Null Key Default Extra a decimal(21,2) NO 0.00 drop table t1,t2,t3; select 1e-308, 1.00000001e-300, 100000000e-300; 1e-308 1.00000001e-300 100000000e-300 1e-308 1.00000001e-300 1e-292 select 10e307; 10e307 1e308 create table t1(a int, b double(8, 2)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. insert into t1 values (1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75), (1, 217.08), (1, 7.94), (4, 96.07), (4, 6404.65), (4, -6500.72), (2, 100.00), (5, 5.00), (5, -2104.80), (5, 2033.80), (5, 0.07), (5, 65.93), (3, -4986.24), (3, 5.00), (3, 4857.34), (3, 123.74), (3, 0.16), (6, -1695.31), (6, 1003.77), (6, 499.72), (6, 191.82); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK explain select sum(b) s from t1 group by a; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 26 100.00 Using temporary Warnings: Note 1003 /* select#1 */ select sum(`test`.`t1`.`b`) AS `s` from `test`.`t1` group by `test`.`t1`.`a` select sum(b) s from t1 group by a; s -0.00 -0.00 0.00 0.00 0.00 100.00 select sum(b) s from t1 group by a having s <> 0; s 100.00 select sum(b) s from t1 group by a having s <> 0 order by s; s 100.00 select sum(b) s from t1 group by a having s <=> 0; s -0.00 -0.00 0.00 0.00 0.00 select sum(b) s from t1 group by a having s <=> 0 order by s; s -0.00 -0.00 0.00 0.00 0.00 alter table t1 add key (a, b); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK explain select sum(b) s from t1 group by a; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL index a a 14 NULL 26 100.00 Using index Warnings: Note 1003 /* select#1 */ select sum(`test`.`t1`.`b`) AS `s` from `test`.`t1` group by `test`.`t1`.`a` select sum(b) s from t1 group by a; s -0.00 0.00 0.00 0.00 0.00 100.00 select sum(b) s from t1 group by a having s <> 0; s 100.00 select sum(b) s from t1 group by a having s <> 0 order by s; s 100.00 select sum(b) s from t1 group by a having s <=> 0; s -0.00 0.00 0.00 0.00 0.00 select sum(b) s from t1 group by a having s <=> 0 order by s; s -0.00 0.00 0.00 0.00 0.00 drop table t1; End of 4.1 tests create table t1 (s1 float(0,2)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). create table t1 (s1 float(1,2)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). CREATE TABLE t1 ( f1 real zerofill, f2 double zerofill, f3 float zerofill); Warnings: Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1); PREPARE stmt1 FROM 'select f1, f2, f3 FROM t1'; select f1, f2, f3 FROM t1; f1 f2 f3 0000000000000003.14152 0000000000000003.14152 000003.14152 select f1, f2, f3 FROM t1; f1 f2 f3 0000000000000003.14152 0000000000000003.14152 000003.14152 EXECUTE stmt1; f1 f2 f3 0000000000000003.14152 0000000000000003.14152 000003.14152 DROP TABLE t1; create table t1 (f1 double(200, 0)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. insert into t1 values (1e199), (-1e199); insert into t1 values (1e200), (-1e200); insert into t1 values (2e200), (-2e200); Warnings: Warning 1264 Out of range value for column 'f1' at row 1 Warning 1264 Out of range value for column 'f1' at row 2 select f1 + 0e0 from t1; f1 + 0e0 1e199 -1e199 1e200 -1e200 1e200 -1e200 drop table t1; create table t1 (f1 float(30, 0)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. insert into t1 values (1e29), (-1e29); insert into t1 values (1e30), (-1e30); insert into t1 values (2e30), (-2e30); Warnings: Warning 1264 Out of range value for column 'f1' at row 1 Warning 1264 Out of range value for column 'f1' at row 2 select f1 + 0e0 from t1; f1 + 0e0 1.0000000150474662e29 -1.0000000150474662e29 1.0000000150474662e30 -1.0000000150474662e30 1.0000000150474662e30 -1.0000000150474662e30 drop table t1; create table t1 (c char(6)); insert into t1 values (2e6),(2e-5); select * from t1; c 2e6 2e-5 drop table t1; CREATE TABLE d1 (d DOUBLE); INSERT INTO d1 VALUES (1.7976931348623157E+308); SELECT * FROM d1; d 1.7976931348623157e308 INSERT INTO d1 VALUES (1.79769313486232e+308); ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing SELECT * FROM d1; d 1.7976931348623157e308 DROP TABLE d1; create table t1 (a char(20)); insert into t1 values (1.225e-05); select a+0 from t1; a+0 0.00001225 drop table t1; create table t1(d double, u bigint unsigned); insert into t1(d) values (9.22337203685479e18), (1.84e19); update t1 set u = d; select u from t1; u 9223372036854790144 18400000000000000000 drop table t1; CREATE TABLE t1 (f1 DOUBLE); INSERT INTO t1 VALUES(-1.79769313486231e+308); SELECT f1 FROM t1; f1 -1.79769313486231e308 DROP TABLE t1; # # Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL # # Ignoring output from misc. float operations select format(-1.7976931348623157E+307,256) as foo; select least(-1.1111111111111111111111111, - group_concat(1.7976931348623157E+308)) as foo; select concat((truncate((-1.7976931348623157E+307),(0x1e))), (99999999999999999999999999999999999999999999999999999999999999999)) into @a; End of 5.0 tests # # Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE... # select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo; foo 0 # # Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265 # (WARN_DATA_TRUNCATED) # CREATE TABLE t1 (f FLOAT); INSERT INTO t1 VALUES ('1.'); INSERT INTO t1 VALUES ('2.0.'); Warnings: Warning 1265 Data truncated for column 'f' at row 1 INSERT INTO t1 VALUES ('.'); Warnings: Warning 1265 Data truncated for column 'f' at row 1 SELECT * FROM t1 ORDER BY f; f 0 1 2 DROP TABLE t1; SET sql_mode = default; # # Bug#28225635 RUNTIME ERROR: 1E+52 IS OUTSIDE THE RANGE OF # REPRESENTABLE VALUES OF TYPE FLOAT # CREATE TABLE t5u(c1 FLOAT(58,0) UNSIGNED NOT NULL); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t5s(c1 FLOAT(58,0) SIGNED NOT NULL); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. INSERT INTO t5u VALUES('1e+52'); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5s VALUES('-1e+52'); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT * from t5u; c1 SELECT * from t5s; c1 DROP TABLE t5u, t5s; # # WL#12575: Deprecate AUTO_INCREMENT on DOUBLE and FLOAT # CREATE TABLE t1(a FLOAT PRIMARY KEY AUTO_INCREMENT); Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'a'. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'a'. CREATE TABLE t3(a FLOAT); ALTER TABLE t3 MODIFY COLUMN a FLOAT PRIMARY KEY AUTO_INCREMENT; Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'a'. CREATE TABLE t4(a INT PRIMARY KEY); ALTER TABLE t4 DROP PRIMARY KEY, ADD COLUMN b FLOAT PRIMARY KEY AUTO_INCREMENT; Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'b'. DROP TABLE t4, t3, t2, t1; CREATE TABLE t1(a DOUBLE PRIMARY KEY AUTO_INCREMENT); Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'a'. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'a'. CREATE TABLE t3(a DOUBLE); ALTER TABLE t3 MODIFY COLUMN a DOUBLE PRIMARY KEY AUTO_INCREMENT; Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'a'. CREATE TABLE t4(a INT PRIMARY KEY); ALTER TABLE t4 DROP PRIMARY KEY, ADD COLUMN b DOUBLE PRIMARY KEY AUTO_INCREMENT; Warnings: Warning 3856 AUTO_INCREMENT support for FLOAT/DOUBLE columns is deprecated and will be removed in a future release. Consider removing AUTO_INCREMENT from column 'b'. DROP TABLE t4, t3, t2, t1; # # WL#12595: Deprecate the ability to specify number of digits # for floating point types # CREATE TABLE t1(a FLOAT(255,0)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t4(a FLOAT); ALTER TABLE t4 MODIFY COLUMN a FLOAT(255,0); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b FLOAT(255,0); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t6(a FLOAT(12)); DROP TABLE t6, t5, t4, t3, t2, t1; CREATE TABLE t1(a DOUBLE(42,12)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t4(a DOUBLE); ALTER TABLE t4 MODIFY COLUMN a DOUBLE(42,12); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b DOUBLE(42,12); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. DROP TABLE t5, t4, t3, t2, t1; CREATE TABLE t1(a DOUBLE PRECISION(42,12)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t4(a DOUBLE); ALTER TABLE t4 MODIFY COLUMN a DOUBLE PRECISION(42,12); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b DOUBLE PRECISION(42,12); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. DROP TABLE t5, t4, t3, t2, t1; CREATE TABLE t1(a REAL(42,12)); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t4(a REAL); ALTER TABLE t4 MODIFY COLUMN a REAL(42,12); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b REAL(42,12); Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. DROP TABLE t5, t4, t3, t2, t1; CREATE FUNCTION f1(a FLOAT(255,0)) RETURNS DOUBLE(12,3) RETURN 1; Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. DROP FUNCTION f1; CREATE PROCEDURE p1(IN a FLOAT(255,0), OUT b DOUBLE(12,3)) BEGIN SELECT 1 INTO b; END|| Warnings: Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. DROP PROCEDURE p1; # # WL#12391: Deprecate unsigned attribute for DECIMAL and FLOAT data types # CREATE TABLE t1(a FLOAT UNSIGNED); Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t4(a FLOAT); ALTER TABLE t4 MODIFY COLUMN a FLOAT UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b FLOAT UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. DROP TABLE t5, t4, t3, t2, t1; CREATE TABLE t1(a DOUBLE UNSIGNED); Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t4(a DOUBLE); ALTER TABLE t4 MODIFY COLUMN a DOUBLE UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b DOUBLE UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. DROP TABLE t5, t4, t3, t2, t1; CREATE TABLE t1(a REAL UNSIGNED); Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t4(a REAL); ALTER TABLE t4 MODIFY COLUMN a REAL UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b REAL UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. DROP TABLE t5, t4, t3, t2, t1; CREATE TABLE t1(a DECIMAL(4,2) UNSIGNED); Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. ALTER TABLE t1 ADD COLUMN b INT; CREATE TABLE t2 LIKE t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t3 AS SELECT * FROM t1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t4(a DECIMAL(4,2)); ALTER TABLE t4 MODIFY COLUMN a DECIMAL(4,2) UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. CREATE TABLE t5(a INT PRIMARY KEY); ALTER TABLE t5 ADD COLUMN b DECIMAL(4,2) UNSIGNED; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. DROP TABLE t5, t4, t3, t2, t1; CREATE FUNCTION f1(a FLOAT UNSIGNED) RETURNS DOUBLE UNSIGNED RETURN 1; Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. DROP FUNCTION f1; CREATE PROCEDURE p1(IN a FLOAT UNSIGNED, OUT b DOUBLE UNSIGNED) BEGIN SELECT 1 INTO b; END|| Warnings: Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. DROP PROCEDURE p1;
Save File
Cancel