Changeset: a1d01022a000 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a1d01022a000
Modified Files:
        clients/Tests/SQL-dump.stable.out.int128
        sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
        sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128
        sql/benchmarks/tpch/Tests/01-22.stable.out.int128
        sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
        sql/benchmarks/tpch/Tests/14-plan.stable.out.int128
        sql/benchmarks/tpch/Tests/14.stable.out.int128
        sql/server/sql_parser.y
        sql/test/BugTracker-2014/Tests/ifthenelse.Bug-3546.stable.out.int128
Branch: default
Log Message:

fixed associativity of multiply/divide


diffs (158 lines):

diff --git a/clients/Tests/SQL-dump.stable.out.int128 
b/clients/Tests/SQL-dump.stable.out.int128
--- a/clients/Tests/SQL-dump.stable.out.int128
+++ b/clients/Tests/SQL-dump.stable.out.int128
@@ -6118,11 +6118,11 @@ CREATE TABLE "sys"."dependencies" (
        "depend_type" SMALLINT
 );
 COPY 229 RECORDS INTO "sys"."dependencies" FROM stdin USING DELIMITERS 
'\t','\n','"';
+418    5722    7
 417    5722    7
-418    5722    7
 1023   5722    7
+418    5726    7
 417    5726    7
-418    5726    7
 1023   5726    7
 5890   5919    5
 5900   5930    5
diff --git a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128 
b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
--- a/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
+++ b/sql/benchmarks/tpch/LOCKED/Tests/01-22.stable.out.int128
@@ -779,7 +779,7 @@ Ready.
 % promo_revenue # name
 % decimal # type
 % 41 # length
-[ 15.48        ]
+[ 15.48654     ]
 #select * from optimizer_stats() stats;
 % .stats,      .stats # table_name
 % rewrite,     count # name
diff --git a/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128 
b/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128
--- a/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128
+++ b/sql/benchmarks/tpch/LOCKED/Tests/14.stable.out.int128
@@ -34,7 +34,7 @@ Ready.
 % promo_revenue # name
 % decimal # type
 % 41 # length
-[ 15.48        ]
+[ 15.48654     ]
 #select * from optimizer_stats() stats;
 % .stats,      .stats # table_name
 % rewrite,     count # name
diff --git a/sql/benchmarks/tpch/Tests/01-22.stable.out.int128 
b/sql/benchmarks/tpch/Tests/01-22.stable.out.int128
--- a/sql/benchmarks/tpch/Tests/01-22.stable.out.int128
+++ b/sql/benchmarks/tpch/Tests/01-22.stable.out.int128
@@ -779,7 +779,7 @@ Ready.
 % promo_revenue # name
 % decimal # type
 % 41 # length
-[ 15.48        ]
+[ 15.48654     ]
 #select * from optimizer_stats() stats;
 % .stats,      .stats # table_name
 % rewrite,     count # name
diff --git a/sql/benchmarks/tpch/Tests/14-explain.stable.out.int128 
b/sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
--- a/sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
+++ b/sql/benchmarks/tpch/Tests/14-explain.stable.out.int128
@@ -44,17 +44,17 @@ Ready.
 % clob # type
 % 425 # length
 function 
user.s2_1{autoCommit=true}(A0:sht,A1:str,A2:bte,A3:bte,A4:bte,A5:date,A6:date,A7:int):void;
-    X_102:void := querylog.define("explain select\n\t100.00 * 
sum(case\n\t\twhen p_type like \\'PROMO%\\'\n\t\t\tthen l_extendedprice * (1 - 
l_discount)\n\t\telse 0\n\tend) / sum(l_extendedprice * (1 - l_discount)) as 
promo_revenue\nfrom\n\tlineitem,\n\tpart\nwhere\n\tl_partkey = p_partkey\n\tand 
l_shipdate >= date \\'1995-09-01\\'\n\tand l_shipdate < date \\'1995-09-01\\' + 
interval \\'1\\' month;","sequential_pipe",55);
+    X_105:void := querylog.define("explain select\n\t100.00 * 
sum(case\n\t\twhen p_type like \\'PROMO%\\'\n\t\t\tthen l_extendedprice * (1 - 
l_discount)\n\t\telse 0\n\tend) / sum(l_extendedprice * (1 - l_discount)) as 
promo_revenue\nfrom\n\tlineitem,\n\tpart\nwhere\n\tl_partkey = p_partkey\n\tand 
l_shipdate >= date \\'1995-09-01\\'\n\tand l_shipdate < date \\'1995-09-01\\' + 
interval \\'1\\' month;","sequential_pipe",55);
     X_10 := sql.mvc();
     X_14:bat[:oid,:date] := sql.bind(X_10,"sys","lineitem","l_shipdate",0);
     X_11:bat[:oid,:oid] := sql.tid(X_10,"sys","lineitem");
     X_22 := mtime.addmonths(A6,A7);
-    X_123 := algebra.subselect(X_14,X_11,A5,X_22,true,false,false);
+    X_126 := algebra.subselect(X_14,X_11,A5,X_22,true,false,false);
     (X_17,r1_18) := sql.bind(X_10,"sys","lineitem","l_shipdate",2);
-    X_124 := 
algebra.subselect(r1_18,nil:bat[:oid,:oid],A5,X_22,true,false,false);
+    X_127 := 
algebra.subselect(r1_18,nil:bat[:oid,:oid],A5,X_22,true,false,false);
     X_20:bat[:oid,:date] := sql.bind(X_10,"sys","lineitem","l_shipdate",1);
-    X_126 := algebra.subselect(X_20,X_11,A5,X_22,true,false,false);
-    X_23 := sql.subdelta(X_123,X_11,X_17,X_124,X_126);
+    X_129 := algebra.subselect(X_20,X_11,A5,X_22,true,false,false);
+    X_23 := sql.subdelta(X_126,X_11,X_17,X_127,X_129);
     X_25:bat[:oid,:int] := sql.bind(X_10,"sys","lineitem","l_partkey",0);
     (X_27,r1_33) := sql.bind(X_10,"sys","lineitem","l_partkey",2);
     X_29:bat[:oid,:int] := sql.bind(X_10,"sys","lineitem","l_partkey",1);
@@ -89,14 +89,14 @@ function user.s2_1{autoCommit=true}(A0:s
     X_82 := calc.hge(A3,33,4);
     X_84:bat[:oid,:hge] := batcalc.ifthenelse(X_57,X_81,X_82);
     X_85:hge := aggr.sum(X_84);
-    X_86 := calc.hge(4,X_85,39,8);
-    X_89 := calc.lng(A4,15,2);
-    X_90:bat[:oid,:lng] := batcalc.-(X_89,X_79);
-    X_91:bat[:oid,:hge] := batcalc.*(X_66,X_90);
-    X_92:hge := aggr.sum(X_91);
-    X_93 := calc./(X_86,X_92);
-    X_94 := calc.*(A0,X_93);
-    sql.exportValue(1,".L2","promo_revenue","decimal",39,2,10,X_94,"");
+    X_86 := calc.*(A0,X_85);
+    X_87 := calc.hge(5,X_86,39,9);
+    X_92 := calc.lng(A4,15,2);
+    X_94:bat[:oid,:lng] := batcalc.-(X_92,X_79);
+    X_95:bat[:oid,:hge] := batcalc.*(X_66,X_94);
+    X_96:hge := aggr.sum(X_95);
+    X_97 := calc./(X_87,X_96);
+    sql.exportValue(1,".L2","promo_revenue","decimal",39,5,10,X_97,"");
 end user.s2_1;
 
 # 22:53:29 >  
diff --git a/sql/benchmarks/tpch/Tests/14-plan.stable.out.int128 
b/sql/benchmarks/tpch/Tests/14-plan.stable.out.int128
--- a/sql/benchmarks/tpch/Tests/14-plan.stable.out.int128
+++ b/sql/benchmarks/tpch/Tests/14-plan.stable.out.int128
@@ -51,7 +51,7 @@ project (
 | | | table(sys.part) [ part.p_partkey NOT NULL HASHCOL , part.p_type NOT NULL 
] COUNT 
 | | ) [ lineitem.l_partkey NOT NULL = part.p_partkey NOT NULL HASHCOL  ]
 | ) [  ] [ sys.sum no nil 
(sys.ifthenelse(sys.ifthenelse(sys.isnull(sys.like(part.p_type NOT NULL, char 
"PROMO%")), boolean "false", sys.like(part.p_type NOT NULL, char "PROMO%")), 
sys.sql_mul(decimal(33,2)[lineitem.l_extendedprice NOT NULL] as 
lineitem.l_extendedprice, sys.sql_sub(decimal(15,2)[tinyint "1"], 
lineitem.l_discount NOT NULL)), decimal(33,4)[tinyint "0"])) as L1.L1, sys.sum 
no nil (sys.sql_mul(decimal(33,2)[lineitem.l_extendedprice NOT NULL] as 
lineitem.l_extendedprice, sys.sql_sub(decimal(15,2)[tinyint "1"], 
lineitem.l_discount NOT NULL))) as L2.L2 ]
-) [ sys.sql_mul(decimal(4,1) "1", sys.sql_div(decimal(39,8)[L1] as L1, L2)) as 
L2.promo_revenue ]
+) [ sys.sql_div(decimal(39,9)[sys.sql_mul(decimal(4,1) "1000", L1)], L2) as 
L2.promo_revenue ]
 
 # 22:46:32 >  
 # 22:46:32 >  "Done."
diff --git a/sql/benchmarks/tpch/Tests/14.stable.out.int128 
b/sql/benchmarks/tpch/Tests/14.stable.out.int128
--- a/sql/benchmarks/tpch/Tests/14.stable.out.int128
+++ b/sql/benchmarks/tpch/Tests/14.stable.out.int128
@@ -34,7 +34,7 @@ Ready.
 % promo_revenue # name
 % decimal # type
 % 41 # length
-[ 15.48        ]
+[ 15.48654     ]
 #select * from optimizer_stats() stats;
 % .stats,      .stats # table_name
 % rewrite,     count # name
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
@@ -527,8 +527,8 @@ int yydebug=1;
 %left <sval> COMPARISON /* <> < > <= >= */
 %left <operation> '+' '-' '&' '|' '^' LEFT_SHIFT RIGHT_SHIFT LEFT_SHIFT_ASSIGN 
RIGHT_SHIFT_ASSIGN CONCATSTRING SUBSTRING POSITION
 %right UMINUS
-%left <operation> '*' 
-%left <operation> '/' '%'
+%left <operation> '*' '/'
+%left <operation> '%'
 %left <operation> '~'
 
        /* literal keyword tokens */
diff --git 
a/sql/test/BugTracker-2014/Tests/ifthenelse.Bug-3546.stable.out.int128 
b/sql/test/BugTracker-2014/Tests/ifthenelse.Bug-3546.stable.out.int128
--- a/sql/test/BugTracker-2014/Tests/ifthenelse.Bug-3546.stable.out.int128
+++ b/sql/test/BugTracker-2014/Tests/ifthenelse.Bug-3546.stable.out.int128
@@ -49,10 +49,10 @@ Ready.
 % sys.L # table_name
 % r # name
 % decimal # type
-% 24 # length
-[ 0.00 ]
-[ -1.00        ]
-[ -1.00        ]
+% 27 # length
+[ 0.023        ]
+[ -1.000       ]
+[ -1.000       ]
 #rollback;
 
 # 20:44:31 >  
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to