diff options
author | Monty <monty@mariadb.org> | 2016-06-18 14:28:34 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2016-06-22 22:04:55 +0300 |
commit | 34eb10e4064a7f38fc7d41016a6bcc5443ebe0c3 (patch) | |
tree | 45f76f02034419697e5bff5f539b20eaac8f8c8d /mysql-test/r/show_check.result | |
parent | e4062d4d203a6be596d3f61dfe4db1b4f91e24aa (diff) | |
download | mariadb-git-34eb10e4064a7f38fc7d41016a6bcc5443ebe0c3.tar.gz |
MDEV-10138 Support for decimals up to 38 digits
Decimals with float, double and decimal now works the following way:
- DECIMAL_NOT_SPECIFIED is used when declaring DECIMALS without a firm number
of decimals. It's only used in asserts and my_decimal_int_part.
- FLOATING_POINT_DECIMALS (31) is used to mark that a FLOAT or DOUBLE
was defined without decimals. This is regarded as a floating point value.
- Max decimals allowed for FLOAT and DOUBLE is FLOATING_POINT_DECIMALS-1
- Clients assumes that float and double with decimals >= NOT_FIXED_DEC are
floating point values (no decimals)
- In the .frm decimals=FLOATING_POINT_DECIMALS are used to define
floating point for float and double (31, like before)
To ensure compatibility with old clients we do:
- When storing float and double, we change NOT_FIXED_DEC to
FLOATING_POINT_DECIMALS.
- When creating fields from .frm we change for float and double
FLOATING_POINT_DEC to NOT_FIXED_DEC
- When sending definition for a float/decimal field without decimals
to the client as part of a result set we convert NOT_FIXED_DEC to
FLOATING_POINT_DECIMALS.
- variance() and std() has changed to limit the decimals to
FLOATING_POINT_DECIMALS -1 to not get the double converted floating point.
(This was to preserve compatiblity)
- FLOAT and DOUBLE still have 30 as max number of decimals.
Bugs fixed:
variance() printed more decimals than we support for double values.
New behaviour:
- Strings now have 38 decimals instead of 30 when converted to decimal
- CREATE ... SELECT with a decimal with > 30 decimals will create a column
with a smaller range than before as we are trying to preserve the number of
decimals.
Other changes
- We are now using the obsolete bit FIELDFLAG_LEFT_FULLSCREEN to specify
decimals > 31
- NOT_FIXED_DEC is now declared in one place
- For clients, NOT_FIXED_DEC is always 31 (to ensure compatibility).
On the server NOT_FIXED_DEC is DECIMAL_NOT_SPECIFIED (39)
- AUTO_SEC_PART_DIGITS is taken from DECIMAL_NOT_SPECIFIED
- DOUBLE conversion functions are now using DECIMAL_NOT_SPECIFIED instead of
NOT_FIXED_DEC
Diffstat (limited to 'mysql-test/r/show_check.result')
-rw-r--r-- | mysql-test/r/show_check.result | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index c3e7588a56d..ce1d8b9d187 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -12,51 +12,51 @@ insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4); -- after Bug#29394 is implemented. check table t1 fast; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 27 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 27 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status Table is already up to date check table t1 fast; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 27 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 27 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status Table is already up to date check table t1 changed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK insert into t1 values (5,5,5); check table t1 changed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK check table t1 medium; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK check table t1 extended; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 5 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 5 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 check status OK show index from t1; @@ -85,10 +85,10 @@ ERROR 23000: Duplicate entry '5' for key 'PRIMARY' -- after Bug#29394 is implemented. optimize table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 8 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 8 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 optimize status OK optimize table t1; @@ -157,10 +157,10 @@ insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0 -- after Bug#29394 is implemented. analyze table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 7 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 7 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 analyze status OK show index from t1; @@ -174,10 +174,10 @@ t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE -- after Bug#29394 is implemented. repair table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 128 7 Y 0 31 8 -def Op 253 10 6 Y 0 31 8 -def Msg_type 253 10 6 Y 0 31 8 -def Msg_text 250 393216 2 Y 0 31 8 +def Table 253 128 7 Y 0 39 8 +def Op 253 10 6 Y 0 39 8 +def Msg_type 253 10 6 Y 0 39 8 +def Msg_text 250 393216 2 Y 0 39 8 Table Op Msg_type Msg_text test.t1 repair status OK show index from t1; @@ -886,8 +886,8 @@ latin1_bin latin1 47 Yes 1 ---------------------------------------------------------------- SHOW CREATE DATABASE mysqltest1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Database 253 192 10 N 1 31 33 -def Create Database 253 3072 69 N 1 31 33 +def Database 253 192 10 N 1 39 33 +def Create Database 253 3072 69 N 1 39 33 Database Create Database mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */ ---------------------------------------------------------------- @@ -899,8 +899,8 @@ mysqltest1 ---------------------------------------------------------------- SHOW CREATE TABLE t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 192 2 N 1 31 33 -def Create Table 253 3072 102 N 1 31 33 +def Table 253 192 2 N 1 39 33 +def Create Table 253 3072 102 N 1 39 33 Table Create Table t1 CREATE TABLE `t1` ( `c` int(11) NOT NULL, @@ -1061,10 +1061,10 @@ def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW N ---------------------------------------------------------------- SHOW CREATE VIEW v1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def View 253 192 2 N 1 31 33 -def Create View 253 3072 103 N 1 31 33 -def character_set_client 253 96 6 N 1 31 33 -def collation_connection 253 96 6 N 1 31 33 +def View 253 192 2 N 1 39 33 +def Create View 253 3072 103 N 1 39 33 +def character_set_client 253 96 6 N 1 39 33 +def collation_connection 253 96 6 N 1 39 33 View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` binary binary ---------------------------------------------------------------- @@ -1088,12 +1088,12 @@ def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary UNDEFIN ---------------------------------------------------------------- SHOW CREATE PROCEDURE p1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Procedure 253 192 2 N 1 31 33 -def sql_mode 253 126 42 N 1 31 33 -def Create Procedure 253 3072 59 Y 0 31 33 -def character_set_client 253 96 6 N 1 31 33 -def collation_connection 253 96 6 N 1 31 33 -def Database Collation 253 96 17 N 1 31 33 +def Procedure 253 192 2 N 1 39 33 +def sql_mode 253 126 42 N 1 39 33 +def Create Procedure 253 3072 59 Y 0 39 33 +def character_set_client 253 96 6 N 1 39 33 +def collation_connection 253 96 6 N 1 39 33 +def Database Collation 253 96 17 N 1 39 33 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SELECT 1 binary binary latin1_swedish_ci @@ -1143,12 +1143,12 @@ p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DE ---------------------------------------------------------------- SHOW CREATE FUNCTION f1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Function 253 192 2 N 1 31 33 -def sql_mode 253 126 42 N 1 31 33 -def Create Function 253 3072 74 Y 0 31 33 -def character_set_client 253 96 6 N 1 31 33 -def collation_connection 253 96 6 N 1 31 33 -def Database Collation 253 96 17 N 1 31 33 +def Function 253 192 2 N 1 39 33 +def sql_mode 253 126 42 N 1 39 33 +def Create Function 253 3072 74 Y 0 39 33 +def character_set_client 253 96 6 N 1 39 33 +def collation_connection 253 96 6 N 1 39 33 +def Database Collation 253 96 17 N 1 39 33 Function sql_mode Create Function character_set_client collation_connection Database Collation f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN 1 binary binary latin1_swedish_ci @@ -1268,8 +1268,8 @@ PRIMARY KEY (Codigo) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; show create table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 64 2 N 1 31 7 -def Create Table 253 1024 445 N 1 31 7 +def Table 253 64 2 N 1 39 7 +def Create Table 253 1024 445 N 1 39 7 Table Create Table t1 CREATE TABLE `t1` ( `Codigo` int(10) unsigned NOT NULL AUTO_INCREMENT, |