Changeset: a961fc219e10 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a961fc219e10
Added Files:
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.sql
sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.err
sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.out
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_exp.c
sql/server/rel_exp.h
sql/server/sql_parser.y
sql/test/BugTracker-2012/Tests/All
Branch: default
Log Message:
Merged from Feb2013
diffs (truncated from 559 to 300 lines):
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -1552,6 +1552,14 @@ rel2bin_join( mvc *sql, sql_rel *rel, li
prop *p;
/* only handle simple joins here */
+ if (exp_has_func(e)) {
+ if (!join && !list_length(lje)) {
+ stmt *l = bin_first_column(sql->sa,
left);
+ stmt *r = bin_first_column(sql->sa,
right);
+ join = stmt_join(sql->sa, l, r,
cmp_all);
+ }
+ break;
+ }
if (list_length(lje) && (idx || e->type != e_cmp ||
e->flag != cmp_equal))
break;
diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c
--- a/sql/server/rel_exp.c
+++ b/sql/server/rel_exp.c
@@ -1034,6 +1034,44 @@ exp_is_atom( sql_exp *e )
}
static int
+exps_has_func( list *exps)
+{
+ node *n;
+ int has_func = 0;
+
+ for(n=exps->h; n && !has_func; n=n->next)
+ has_func |= exp_has_func(n->data);
+ return has_func;
+}
+
+int
+exp_has_func( sql_exp *e )
+{
+ switch (e->type) {
+ case e_atom:
+ return 0;
+ case e_convert:
+ return exp_has_func(e->l);
+ case e_func:
+ case e_aggr:
+ return 1;
+ case e_cmp:
+ if (e->flag == cmp_or) {
+ return (exps_has_func(e->l) || exps_has_func(e->r));
+ } else if (e->flag == cmp_in || e->flag == cmp_notin ||
get_cmp(e) == cmp_filter) {
+ return (exp_has_func(e->l) || exps_has_func(e->r));
+ } else {
+ return (exp_has_func(e->l) || exp_has_func(e->r) ||
+ (e->f && exp_has_func(e->f)));
+ }
+ case e_column:
+ case e_psm:
+ return 0;
+ }
+ return 0;
+}
+
+static int
exp_key( sql_exp *e )
{
if (e->name)
diff --git a/sql/server/rel_exp.h b/sql/server/rel_exp.h
--- a/sql/server/rel_exp.h
+++ b/sql/server/rel_exp.h
@@ -105,6 +105,7 @@ extern int exp_is_eqjoin(sql_exp *e);
extern int exp_is_correlation(sql_exp *e, sql_rel *r );
extern int exp_is_join_exp(sql_exp *e);
extern int exp_is_atom(sql_exp *e);
+extern int exp_has_func(sql_exp *e);
extern sql_exp *exps_bind_column( list *exps, char *cname, int *ambiguous);
extern sql_exp *exps_bind_column2( list *exps, char *rname, char *cname);
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
@@ -3763,7 +3763,7 @@ opt_alias_name:
atom:
literal
{
- if (m->emode == m_normal && m->caching && m->argc < 100) {
+ if (m->emode == m_normal && m->caching) {
/* replace by argument */
AtomNode *an = (AtomNode*)$1;
diff --git a/sql/test/BugTracker-2012/Tests/All
b/sql/test/BugTracker-2012/Tests/All
--- a/sql/test/BugTracker-2012/Tests/All
+++ b/sql/test/BugTracker-2012/Tests/All
@@ -82,3 +82,5 @@ update_crash.Bug-2655
tuples_INTERSECT_vs_count_intersect_differs.Bug-2659
large-number-operation-strange-results.Bug-2929
inet-casts.Bug-3205
+fixed_limit_for_prepare.Bug-3208
+exp_bin_assertion.Bug-3209
diff --git a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.sql
@@ -0,0 +1,4 @@
+create table t (id int, x int, y int);
+select * from t as t1, t as t2 where power((t1.x - t2.x),2) < power((t1.y -
+ t2.y),2);
+drop table t;
diff --git
a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.err
@@ -0,0 +1,39 @@
+stderr of test 'exp_bin_assertion.Bug-3209` in directory
'test/BugTracker-2012` itself:
+
+
+# 11:42:44 >
+# 11:42:44 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/Users/jennie/scratch/monet-install/Oct2012/debug/var/MonetDB"
"--set" "mapi_open=true" "--set" "mapi_port=33728" "--set"
"mapi_usock=/var/tmp/mtest-21808/.s.monetdb.33728" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2"
"--dbname=mTests_test_BugTracker-2012" "--set" "mal_listing=0"
+# 11:42:44 >
+
+# builtin opt gdk_dbname = demo
+# builtin opt gdk_dbfarm =
/Users/jennie/scratch/monet-install/Oct2012/debug/var/monetdb5/dbfarm
+# builtin opt gdk_debug = 0
+# builtin opt gdk_vmtrim = yes
+# builtin opt monet_prompt = >
+# builtin opt monet_daemon = no
+# builtin opt mapi_port = 50000
+# builtin opt mapi_open = false
+# builtin opt mapi_autosense = false
+# builtin opt sql_optimizer = default_pipe
+# builtin opt sql_debug = 0
+# cmdline opt gdk_nr_threads = 0
+# cmdline opt gdk_dbfarm =
/Users/jennie/scratch/monet-install/Oct2012/debug/var/MonetDB
+# cmdline opt mapi_open = true
+# cmdline opt mapi_port = 33728
+# cmdline opt mapi_usock = /var/tmp/mtest-21808/.s.monetdb.33728
+# cmdline opt monet_prompt =
+# cmdline opt mal_listing = 2
+# cmdline opt gdk_dbname = mTests_test_BugTracker-2012
+# cmdline opt mal_listing = 0
+
+
+
+
+# 11:42:44 >
+# 11:42:44 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-21808" "--port=33728"
+# 11:42:44 >
+
+# 11:42:45 >
+# 11:42:45 > "Done."
+# 11:42:45 >
+
diff --git
a/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/exp_bin_assertion.Bug-3209.stable.out
@@ -0,0 +1,60 @@
+stdout of test 'exp_bin_assertion.Bug-3209` in directory
'test/BugTracker-2012` itself:
+
+
+# 11:42:44 >
+# 11:42:44 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/Users/jennie/scratch/monet-install/Oct2012/debug/var/MonetDB"
"--set" "mapi_open=true" "--set" "mapi_port=33728" "--set"
"mapi_usock=/var/tmp/mtest-21808/.s.monetdb.33728" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2"
"--dbname=mTests_test_BugTracker-2012" "--set" "mal_listing=0"
+# 11:42:44 >
+
+# MonetDB 5 server v11.13.8
+# This is an unreleased version
+# Serving database 'mTests_test_BugTracker-2012', using 2 threads
+# Compiled for x86_64-apple-darwin11.4.2/64bit with 64bit OIDs dynamically
linked
+# Found 4.000 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://azrael.local:33728/
+# Listening for UNIX domain connection requests on
mapi:monetdb:///var/tmp/mtest-21808/.s.monetdb.33728
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_history.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_compress.sql
+# loading sql script: 18_dictionary.sql
+# loading sql script: 19_cluster.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 99_system.sql
+
+# 11:42:44 >
+# 11:42:44 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-21808" "--port=33728"
+# 11:42:44 >
+
+#create table t (id int, x int, y int);
+#select * from t as t1, t as t2 where t1.id <> t2.id and power((t1.x -
t2.x),2) < power((t1.y -
+# t2.y),2);
+% sys.t1, sys.t1, sys.t1, sys.t2, sys.t2, sys.t2 # table_name
+% id, x, y, id, x, y # name
+% int, int, int, int, int, int # type
+% 1, 1, 1, 1, 1, 1 # length
+#drop table t;
+
+# 11:43:54 >
+# 11:43:54 > "Done."
+# 11:43:54 >
+
diff --git
a/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.sql
b/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.sql
@@ -0,0 +1,69 @@
+CREATE TABLE wide("1" VARCHAR(255), "2" VARCHAR(255), "3" VARCHAR(255), "4"
+ VARCHAR(255), "5" VARCHAR(255), "6" VARCHAR(255), "7" VARCHAR(255), "8"
+ VARCHAR(255), "9" VARCHAR(255), "10" VARCHAR(255), "11" VARCHAR(255),
"12"
+ VARCHAR(255), "13" VARCHAR(255), "14" VARCHAR(255), "15" VARCHAR(255),
"16"
+ VARCHAR(255), "17" VARCHAR(255), "18" VARCHAR(255), "19" VARCHAR(255),
"20"
+ VARCHAR(255), "21" VARCHAR(255), "22" VARCHAR(255), "23" VARCHAR(255),
"24"
+ VARCHAR(255), "25" VARCHAR(255), "26" VARCHAR(255), "27" VARCHAR(255),
"28"
+ VARCHAR(255), "29" VARCHAR(255), "30" VARCHAR(255), "31" VARCHAR(255),
"32"
+ VARCHAR(255), "33" VARCHAR(255), "34" VARCHAR(255), "35" VARCHAR(255),
"36"
+ VARCHAR(255), "37" VARCHAR(255), "38" VARCHAR(255), "39" VARCHAR(255),
"40"
+ VARCHAR(255), "41" VARCHAR(255), "42" VARCHAR(255), "43" VARCHAR(255),
"44"
+ VARCHAR(255), "45" VARCHAR(255), "46" VARCHAR(255), "47" VARCHAR(255),
"48"
+ VARCHAR(255), "49" VARCHAR(255), "50" VARCHAR(255), "51" VARCHAR(255),
"52"
+ VARCHAR(255), "53" VARCHAR(255), "54" VARCHAR(255), "55" VARCHAR(255),
"56"
+ VARCHAR(255), "57" VARCHAR(255), "58" VARCHAR(255), "59" VARCHAR(255),
"60"
+ VARCHAR(255), "61" VARCHAR(255), "62" VARCHAR(255), "63" VARCHAR(255),
"64"
+ VARCHAR(255), "65" VARCHAR(255), "66" VARCHAR(255), "67" VARCHAR(255),
"68"
+ VARCHAR(255), "69" VARCHAR(255), "70" VARCHAR(255), "71" VARCHAR(255),
"72"
+ VARCHAR(255), "73" VARCHAR(255), "74" VARCHAR(255), "75" VARCHAR(255),
"76"
+ VARCHAR(255), "77" VARCHAR(255), "78" VARCHAR(255), "79" VARCHAR(255),
"80"
+ VARCHAR(255), "81" VARCHAR(255), "82" VARCHAR(255), "83" VARCHAR(255),
"84"
+ VARCHAR(255), "85" VARCHAR(255), "86" VARCHAR(255), "87" VARCHAR(255),
"88"
+ VARCHAR(255), "89" VARCHAR(255), "90" VARCHAR(255), "91" VARCHAR(255),
"92"
+ VARCHAR(255), "93" VARCHAR(255), "94" VARCHAR(255), "95" VARCHAR(255),
"96"
+ VARCHAR(255), "97" VARCHAR(255), "98" VARCHAR(255), "99" VARCHAR(255),
"100"
+ VARCHAR(255), "101" VARCHAR(255), "102" VARCHAR(255), "103"
VARCHAR(255), "104"
+ VARCHAR(255), "105" VARCHAR(255), "106" VARCHAR(255), "107"
VARCHAR(255), "108"
+ VARCHAR(255), "109" VARCHAR(255), "110" VARCHAR(255), "111"
VARCHAR(255), "112"
+ VARCHAR(255), "113" VARCHAR(255), "114" VARCHAR(255), "115"
VARCHAR(255), "116"
+ VARCHAR(255), "117" VARCHAR(255), "118" VARCHAR(255), "119"
VARCHAR(255), "120"
+ VARCHAR(255), "121" VARCHAR(255), "122" VARCHAR(255), "123"
VARCHAR(255), "124"
+ VARCHAR(255), "125" VARCHAR(255), "126" VARCHAR(255), "127"
VARCHAR(255), "128"
+ VARCHAR(255), "129" VARCHAR(255), "130" VARCHAR(255), "131"
VARCHAR(255), "132"
+ VARCHAR(255), "133" VARCHAR(255), "134" VARCHAR(255), "135"
VARCHAR(255), "136"
+ VARCHAR(255), "137" VARCHAR(255), "138" VARCHAR(255), "139"
VARCHAR(255), "140"
+ VARCHAR(255), "141" VARCHAR(255), "142" VARCHAR(255), "143"
VARCHAR(255), "144"
+ VARCHAR(255), "145" VARCHAR(255), "146" VARCHAR(255), "147"
VARCHAR(255), "148"
+ VARCHAR(255), "149" VARCHAR(255), "150" VARCHAR(255));
+PREPARE INSERT INTO wide("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
+ "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23",
+ "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35",
"36",
+ "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48",
"49",
+ "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61",
"62",
+ "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74",
"75",
+ "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87",
"88",
+ "89", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99",
"100", "101",
+ "102", "103", "104", "105", "106", "107", "108", "109", "110", "111",
"112",
+ "113", "114", "115", "116", "117", "118", "119", "120", "121", "122",
"123",
+ "124", "125", "126", "127", "128", "129", "130", "131", "132", "133",
"134",
+ "135", "136", "137", "138", "139", "140", "141", "142", "143", "144",
"145",
+ "146", "147", "148", "149", "150")
+VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
+ ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?,
+ ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?,
+ ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?,
+ ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?,
+ ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?);
+
+EXEC 0('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '',
+ '', '', '', '', '', '', '', '', '', '', '', '', '');
+
+select count(*) from wide;
+drop TABLE wide;
diff --git
a/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.err
b/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.stable.err
@@ -0,0 +1,37 @@
+stderr of test 'fixed_limit_for_prepare.Bug-3208` in directory
'test/BugTracker-2012` itself:
+
+
+# 18:08:17 >
+# 18:08:17 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"gdk_dbfarm=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB" "--set"
"mapi_open=true" "--set" "mapi_port=36971" "--set"
"mapi_usock=/var/tmp/mtest-22422/.s.monetdb.36971" "--set" "monet_prompt="
"--trace" "--forcemito" "--set" "mal_listing=2"
"--dbname=mTests_test_BugTracker-2012" "--set" "mal_listing=0"
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list