Changeset: 882e12ddac9d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=882e12ddac9d
Modified Files:
        sql/server/sql_parser.y
        
sql/test/BugTracker-2013/Tests/bogus_aggregation_casts.Bug-3342.stable.out
        sql/test/BugTracker-2013/Tests/median.Bug-3352.stable.out
        sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.sql
        sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.stable.out
        sql/test/Dump/Tests/dump.stable.out
        sql/test/quantiles/Tests/quantiles.stable.out
        sql/test/testdb/Tests/testdb-dump.stable.out
Branch: Oct2014
Log Message:

more decimal fixes


diffs (150 lines):

diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -4618,7 +4618,7 @@ data_type:
  |  sqlINTEGER         { sql_find_subtype(&$$, "int", 0, 0); }
  |  BIGINT             { sql_find_subtype(&$$, "bigint", 0, 0); }
 
- |  sqlDECIMAL         { sql_find_subtype(&$$, "decimal", 1, 0); }
+ |  sqlDECIMAL         { sql_find_subtype(&$$, "decimal", 18, 3); }
  |  sqlDECIMAL '(' nonzero ')'
                        { 
                          int d = $3;
diff --git 
a/sql/test/BugTracker-2013/Tests/bogus_aggregation_casts.Bug-3342.stable.out 
b/sql/test/BugTracker-2013/Tests/bogus_aggregation_casts.Bug-3342.stable.out
--- a/sql/test/BugTracker-2013/Tests/bogus_aggregation_casts.Bug-3342.stable.out
+++ b/sql/test/BugTracker-2013/Tests/bogus_aggregation_casts.Bug-3342.stable.out
@@ -42,9 +42,9 @@ Ready.
 #select sys.median(p_retailprice) from part;
 % sys.L1 # table_name
 % L1 # name
-% double # type
-% 24 # length
-[ 903  ]
+% decimal # type
+% 14 # length
+[ 903.00       ]
 #drop table part;
 
 # 21:17:25 >  
diff --git a/sql/test/BugTracker-2013/Tests/median.Bug-3352.stable.out 
b/sql/test/BugTracker-2013/Tests/median.Bug-3352.stable.out
--- a/sql/test/BugTracker-2013/Tests/median.Bug-3352.stable.out
+++ b/sql/test/BugTracker-2013/Tests/median.Bug-3352.stable.out
@@ -67,8 +67,8 @@ Ready.
 #select median(a) from t3352;
 % sys.L1 # table_name
 % L1 # name
-% double # type
-% 24 # length
+% decimal # type
+% 12 # length
 [ 41.18        ]
 #select median(b) from t3352;
 % sys.L1 # table_name
diff --git a/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.sql 
b/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.sql
--- a/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.sql
+++ b/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.sql
@@ -1,6 +1,7 @@
 START TRANSACTION;
 CREATE TABLE ceil_floor_round (a numeric);
 INSERT INTO ceil_floor_round VALUES ('-5.499999');
+INSERT INTO ceil_floor_round VALUES ('-5.499');
 INSERT INTO ceil_floor_round VALUES ('0.0');
 SELECT a, round(a, 0) FROM ceil_floor_round;
 ROLLBACK;
diff --git 
a/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.stable.out 
b/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.stable.out
--- a/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.stable.out
+++ b/sql/test/BugTracker-2014/Tests/round-properties.Bug-3515.stable.out
@@ -55,15 +55,18 @@ Ready.
 #CREATE TABLE ceil_floor_round (a numeric);
 #INSERT INTO ceil_floor_round VALUES ('-5.499999');
 [ 1    ]
+#INSERT INTO ceil_floor_round VALUES ('-5.499');
+[ 1    ]
 #INSERT INTO ceil_floor_round VALUES ('0.0');
 [ 1    ]
 #SELECT a, round(a, 0) FROM ceil_floor_round;
 % sys.ceil_floor_round,        sys.L # table_name
 % a,   round_a # name
 % decimal,     decimal # type
-% 2,   3 # length
-[ -4,  -4      ]
-[ 0,   0       ]
+% 20,  10 # length
+[ -5.500,      -6.000  ]
+[ -5.499,      -5.000  ]
+[ 0.000,       0.000   ]
 #ROLLBACK;
 
 # 16:17:57 >  
diff --git a/sql/test/Dump/Tests/dump.stable.out 
b/sql/test/Dump/Tests/dump.stable.out
--- a/sql/test/Dump/Tests/dump.stable.out
+++ b/sql/test/Dump/Tests/dump.stable.out
@@ -46,7 +46,7 @@ CREATE TABLE "sys"."typestest" (
        "bigint"         BIGINT,
        "double"         DOUBLE,
        "real"           REAL,
-       "decimal"        DECIMAL,
+       "decimal"        DECIMAL(18,3),
        "decimal9"       DECIMAL(9),
        "decimal83"      DECIMAL(8,3),
        "float"          DOUBLE,
@@ -83,7 +83,7 @@ CREATE TABLE "sys"."typestest" (
        "character10"    CHAR(10)
 );
 COPY 1 RECORDS INTO "sys"."typestest" FROM stdin USING DELIMITERS 
'\t','\n','"';
-true   10      10000   1000000 1000000 10000000000     1e+30   1.00000002e+20  
1       123456789       12345.678       3.1415000000000002      3.1415  3.1415  
2009-04-15      24      18      3       1728000.000     108000.000      
120000.000      100000.000      36000.000       6000.000        2000.000        
600.000 100.000 10.000  1995-07-15 07:30:00.000000      1995-07-15 
07:30:00.00000       1995-07-15 07:30:00.000000+00:00        1995-07-15 
07:30:00.00000+00:00 07:30:00        07:30:00.00000  07:30:00+00:00  
07:30:00.00000+00:00    123456  123456  "123456"        "123456"        "x"     
"varchar"       "0123456789"
+true   10      10000   1000000 1000000 10000000000     1e+30   1.00000002e+20  
1.000   123456789       12345.678       3.1415000000000002      3.1415  3.1415  
2009-04-15      24      18      3       1728000.000     108000.000      
120000.000      100000.000      36000.000       6000.000        2000.000        
600.000 100.000 10.000  1995-07-15 07:30:00.000000      1995-07-15 
07:30:00.00000       1995-07-15 07:30:00.000000+00:00        1995-07-15 
07:30:00.00000+00:00 07:30:00        07:30:00.00000  07:30:00+00:00  
07:30:00.00000+00:00    123456  123456  "123456"        "123456"        "x"     
"varchar"       "0123456789"
 CREATE TABLE "sys"."keytest1" (
        "key1" INTEGER       NOT NULL,
        "key2" INTEGER       NOT NULL,
diff --git a/sql/test/quantiles/Tests/quantiles.stable.out 
b/sql/test/quantiles/Tests/quantiles.stable.out
--- a/sql/test/quantiles/Tests/quantiles.stable.out
+++ b/sql/test/quantiles/Tests/quantiles.stable.out
@@ -102,9 +102,9 @@ Ready.
 #select median(l_extendedprice) from lit;
 % sys.L1 # table_name
 % L1 # name
-% double # type
-% 24 # length
-[ 36724.5      ]
+% decimal # type
+% 17 # length
+[ 36724.50     ]
 #select quantile(l_extendedprice,0.0) from lit;
 % sys.L1 # table_name
 % L1 # name
@@ -134,10 +134,10 @@ Ready.
 #select median(l_extendedprice) from lit group by l_returnflag;
 % sys.L1 # table_name
 % L1 # name
-% double # type
-% 24 # length
+% decimal # type
+% 17 # length
 [ 36960.68     ]
-[ 37144.2      ]
+[ 37144.20     ]
 [ 35937.88     ]
 #select quantile(l_extendedprice,0.0) from lit group by l_returnflag;
 % sys.L1 # table_name
diff --git a/sql/test/testdb/Tests/testdb-dump.stable.out 
b/sql/test/testdb/Tests/testdb-dump.stable.out
--- a/sql/test/testdb/Tests/testdb-dump.stable.out
+++ b/sql/test/testdb/Tests/testdb-dump.stable.out
@@ -101135,7 +101135,7 @@ CREATE TABLE "testschema"."typestest" (
        "bigint"         BIGINT,
        "double"         DOUBLE,
        "real"           REAL,
-       "decimal"        DECIMAL,
+       "decimal"        DECIMAL(18,3),
        "decimal9"       DECIMAL(9),
        "decimal83"      DECIMAL(8,3),
        "float"          DOUBLE,
@@ -101173,7 +101173,7 @@ CREATE TABLE "testschema"."typestest" (
        "uuid"           UUID
 );
 COPY 2 RECORDS INTO "testschema"."typestest" FROM stdin USING DELIMITERS 
'\t','\n','"';
-true   10      10000   1000000 1000000 10000000000     1e+30   1.00000002e+20  
1       123456789       12345.678       3.1415000000000002      3.1415  3.1415  
2009-04-15      24      18      3       1728000.000     108000.000      
120000.000      100000.000      36000.000       6000.000        2000.000        
600.000 100.000 10.000  1995-07-15 07:30:00.000000      1995-07-15 
07:30:00.00000       1995-07-15 07:30:00.000000+00:00        1995-07-15 
07:30:00.00000+00:00 07:30:00        07:30:00.00000  07:30:00+00:00  
07:30:00.00000+00:00    123456  123456  "123456"        "123456"        "x"     
"varchar"       "0123456789"    7d95a9ce-aeb8-4881-9cf7-60b4d55f9e45
+true   10      10000   1000000 1000000 10000000000     1e+30   1.00000002e+20  
1.000   123456789       12345.678       3.1415000000000002      3.1415  3.1415  
2009-04-15      24      18      3       1728000.000     108000.000      
120000.000      100000.000      36000.000       6000.000        2000.000        
600.000 100.000 10.000  1995-07-15 07:30:00.000000      1995-07-15 
07:30:00.00000       1995-07-15 07:30:00.000000+00:00        1995-07-15 
07:30:00.00000+00:00 07:30:00        07:30:00.00000  07:30:00+00:00  
07:30:00.00000+00:00    123456  123456  "123456"        "123456"        "x"     
"varchar"       "0123456789"    7d95a9ce-aeb8-4881-9cf7-60b4d55f9e45
 NULL   NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    
NULL    NULL    NULL    NULL
 CREATE TABLE "testschema"."keytest1" (
        "key1" INTEGER       NOT NULL,
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to