Changeset: 3c6eff05597a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c6eff05597a
Added Files:
sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.sql
Removed Files:
sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.SQL.py
Modified Files:
sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.stable.out
Branch: Jul2017
Log Message:
Simplify test.
Now that we have generate_series, there is no need for a Python script.
Note that we don't use sqrt(cast(1.21 as numeric(14,2))) which would
seemingly be closer to the original test since the SQL optimizer just
optimizes that to cast(1.1 as double), and we want cast(1.1 as real)
since that was the original problem.
diffs (55 lines):
diff --git a/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.SQL.py
b/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.SQL.py
deleted file mode 100644
--- a/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.SQL.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import os, sys
-try:
- from MonetDBtesting import process
-except ImportError:
- import process
-
-n = 100000000
-clt = process.client('sql',
- stdin = process.PIPE,
- stdout = process.PIPE,
- stderr = process.PIPE,
- interactive = False,
- echo = False)
-clt.stdin.write('start transaction;\n')
-clt.stdin.write('create table n8 (a numeric(14,2));\n')
-clt.stdin.write('copy %d records into n8 from stdin;\n' % n)
-s = '1.21\n' * 1000
-for i in xrange(n / 1000):
- clt.stdin.write(s)
-clt.stdin.write("select 'avg(sqrt(n8)) == 1.1', avg(sqrt(a)) from n8;\n")
-clt.stdin.write('rollback;\n')
-out, err = clt.communicate()
-sys.stdout.write(out)
-sys.stderr.write(err)
diff --git a/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.sql
b/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.sql
@@ -0,0 +1,1 @@
+select 'avg(sqrt(n8)) == 1.1', avg(cast(1.1 as real)) from
generate_series(cast(0 as integer), 100000000, 1);
diff --git a/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.stable.out
b/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.stable.out
--- a/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.stable.out
+++ b/sql/test/BugTracker-2009/Tests/AVG_of_SQRT.SF-2757642.stable.out
@@ -43,12 +43,12 @@ Ready.
# 15:20:08 > "/usr/bin/python" "AVG_of_SQRT.SF-2757642.SQL.py"
"AVG_of_SQRT.SF-2757642"
# 15:20:08 >
-[ 100000000 ]
-% .L2, sys.L6 # table_name
-% L2, L5 # name
+#select 'avg(sqrt(n8)) == 1.1', avg(cast(1.1 as real)) from
generate_series(cast(0 as integer), 100000000, 1);
+% .L6, .L13 # table_name
+% L6, L12 # name
% char, double # type
% 20, 24 # length
-[ "avg(sqrt(n8)) == 1.1", 1.1 ]
+[ "avg(sqrt(n8)) == 1.1", 1.100000024 ]
# 15:21:14 >
# 15:21:14 > "Done."
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list