Changeset: 7ae910ab6c3f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7ae910ab6c3f
Modified Files:
monetdb5/modules/kernel/bat5.c
sql/backends/monet5/Tests/pyapi10.stable.err
sql/backends/monet5/Tests/pyapi10.stable.out
sql/backends/monet5/Tests/pyapi25.stable.err
sql/backends/monet5/Tests/pyapi25.stable.out
sql/backends/monet5/UDF/pyapi/pytypes.c
sql/server/rel_updates.c
sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out.Windows
Branch: default
Log Message:
Merge with Dec2016 branch.
diffs (204 lines):
diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.c
+++ b/monetdb5/modules/kernel/bat5.c
@@ -1056,7 +1056,7 @@ BKCshrinkBAT(bat *ret, const bat *bid, c
BBPunfix(b->batCacheid);
throw(MAL, "bat.shrink", RUNTIME_OBJECT_MISSING);
}
- bn= COLnew(0, b->ttype, BATcount(b) - BATcount(d) , TRANSIENT);
+ bn= COLnew(0, b->ttype, BATcount(b) - BATcount(d), b->batRole);
if (bn == NULL) {
BBPunfix(b->batCacheid);
BBPunfix(d->batCacheid);
@@ -1221,7 +1221,7 @@ BKCreuseBAT(bat *ret, const bat *bid, co
BBPunfix(b->batCacheid);
throw(MAL, "bat.reuse", RUNTIME_OBJECT_MISSING);
}
- bn= COLnew(b->hseqbase, b->ttype, BATcount(b) - BATcount(d), TRANSIENT);
+ bn= COLnew(b->hseqbase, b->ttype, BATcount(b) - BATcount(d),
b->batRole);
if (bn == NULL) {
BBPunfix(b->batCacheid);
BBPunfix(d->batCacheid);
diff --git a/sql/backends/monet5/Tests/pyapi10.stable.err
b/sql/backends/monet5/Tests/pyapi10.stable.err
--- a/sql/backends/monet5/Tests/pyapi10.stable.err
+++ b/sql/backends/monet5/Tests/pyapi10.stable.err
@@ -33,7 +33,7 @@ stderr of test 'pyapi10` in directory 's
MAPI = (monetdb) /var/tmp/mtest-30156/.s.monetdb.35525
QUERY = SELECT AVG(pyapi10_error(i,j)) FROM pyapi10_random_table_nulls(5000);
-ERROR = !MALException:pyapi.eval:Could not parse Python code
+ERROR = !Could not parse Python code
!
! 1. def pyfun(i,j,_columns,_column_types,_conn):
!> 2. return(i*j
@@ -41,7 +41,7 @@ ERROR = !MALException:pyapi.eval:Could n
!invalid syntax (<string>, line 2)
MAPI = (monetdb) /var/tmp/mtest-30156/.s.monetdb.35525
QUERY = SELECT AVG(pyapi10_indentation_error(i,j)) FROM
pyapi10_random_table_nulls(5000);
-ERROR = !MALException:pyapi.eval:Could not parse Python code
+ERROR = !Could not parse Python code
! 7. f = 6
! 8. g = 7
!> 9. h = 8
@@ -50,7 +50,7 @@ ERROR = !MALException:pyapi.eval:Could n
!unexpected indent (<string>, line 9)
MAPI = (monetdb) /var/tmp/mtest-30156/.s.monetdb.35525
QUERY = SELECT AVG(pyapi10_runtime_exception(i,j)) FROM
pyapi10_random_table_nulls(5000);
-ERROR = !MALException:pyapi.eval:Python exception
+ERROR = !Python exception
! 4. mydivision = 0
! 5. # comments
!> 6. hello = myint / mydivision
diff --git a/sql/backends/monet5/Tests/pyapi10.stable.out
b/sql/backends/monet5/Tests/pyapi10.stable.out
--- a/sql/backends/monet5/Tests/pyapi10.stable.out
+++ b/sql/backends/monet5/Tests/pyapi10.stable.out
@@ -65,14 +65,14 @@ Ready.
# return(i*j
#};
#SELECT AVG(pyapi10_mult(i,j)) FROM pyapi10_random_table(5000);
-% .L3 # table_name
-% L2 # name
+% .L6 # table_name
+% L5 # name
% double # type
% 24 # length
[ 2487.9556 ]
#SELECT AVG(pyapi10_mult(i,j)) FROM pyapi10_random_table_nulls(5000);
-% .L3 # table_name
-% L2 # name
+% .L6 # table_name
+% L5 # name
% double # type
% 24 # length
[ 5603.14638 ]
diff --git a/sql/backends/monet5/Tests/pyapi25.stable.err
b/sql/backends/monet5/Tests/pyapi25.stable.err
--- a/sql/backends/monet5/Tests/pyapi25.stable.err
+++ b/sql/backends/monet5/Tests/pyapi25.stable.err
@@ -34,7 +34,13 @@ stderr of test 'pyapi25` in directory 's
MAPI = (monetdb) /var/tmp/mtest-14818/.s.monetdb.37353
QUERY = SELECT * FROM pyapi25errortable();
ERROR = !SELECT: no such table 'hopefullynonexistanttable'
- !SELECT: no such table 'hopefullynonexistanttable'
+ !Python exception
+ !
+ ! 1. def pyfun(_columns,_column_types,_conn):
+ !> 2. _conn.execute('SELECT * FROM HOPEFULLYNONEXISTANTTABLE;')
+ ! 3. return 1
+ ! 4.
+ !SQL Query Failed: ParseException:SQLparser:42S02!SELECT: no such
table 'hopefullynonexistanttable'
# 12:40:01 >
# 12:40:01 > "Done."
diff --git a/sql/backends/monet5/Tests/pyapi25.stable.out
b/sql/backends/monet5/Tests/pyapi25.stable.out
--- a/sql/backends/monet5/Tests/pyapi25.stable.out
+++ b/sql/backends/monet5/Tests/pyapi25.stable.out
@@ -81,8 +81,8 @@ Great success!
# return res['i'] * i
#};
#SELECT pyapi25(i) FROM pyapi25table; #multiply by 3
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
% int # type
% 2 # length
[ 3 ]
@@ -92,8 +92,8 @@ Great success!
#UPDATE pyapi25multiplication SET i=10;
[ 1 ]
#SELECT pyapi25(i) FROM pyapi25table; #multiply by 10
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
% int # type
% 2 # length
[ 10 ]
@@ -114,8 +114,8 @@ Great success!
# return i
#};
#SELECT pyapi25(i) FROM pyapi25table;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
% int # type
% 1 # length
[ 1 ]
@@ -138,8 +138,8 @@ Great success!
[ 3 ]
[ 4 ]
#SELECT pyapi25map(i) FROM pyapi25table;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
% int # type
% 1 # length
[ 1 ]
@@ -170,8 +170,8 @@ Great success!
#};
#CREATE TABLE randomtable AS SELECT * FROM pyapi25randomtable() WITH DATA;
#SELECT pyapi25mediancompute(d) FROM randomtable;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
% double # type
% 24 # length
[ 1 ]
@@ -183,8 +183,8 @@ Great success!
[ 1 ]
[ 1 ]
#SELECT pyapi25checker(mean) FROM pyapi25medians;
-% sys.L1 # table_name
-% L1 # name
+% sys.L2 # table_name
+% L2 # name
% boolean # type
% 5 # length
[ true ]
diff --git a/sql/backends/monet5/UDF/pyapi/pytypes.c
b/sql/backends/monet5/UDF/pyapi/pytypes.c
--- a/sql/backends/monet5/UDF/pyapi/pytypes.c
+++ b/sql/backends/monet5/UDF/pyapi/pytypes.c
@@ -106,6 +106,9 @@ int PyType_ToBat(int type)
case NPY_SHORT: return TYPE_sht;
case NPY_INT: return TYPE_int;
case NPY_LONG:
+#if SIZEOF_LONG == 4
+ return TYPE_int;
+#endif
case NPY_LONGLONG: return TYPE_lng;
case NPY_UBYTE:
case NPY_USHORT:
diff --git a/sql/server/rel_updates.c b/sql/server/rel_updates.c
--- a/sql/server/rel_updates.c
+++ b/sql/server/rel_updates.c
@@ -1275,6 +1275,8 @@ copyfrom(mvc *sql, dlist *qname, dlist *
}
/* lock the store, for single user/transaction */
if (locked) {
+ if (headers)
+ return sql_error(sql, 02, "COPY INTO .. LOCKED: not
allowed with column lists");
store_lock();
while (store_nr_active > 1) {
store_unlock();
diff --git
a/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out.Windows
b/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out.Windows
---
a/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out.Windows
+++
b/sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out.Windows
@@ -28,12 +28,12 @@ Ready.
% .plan # table_name
% rel # name
% clob # type
-% 182 # length
+% 198 # length
insert(
| table(sys.cm_tmp) [ cm_tmp.i, cm_tmp.%TID% NOT NULL ]
| union (
-| | table sys.copyfrom(table(cm_tmp), varchar "|", varchar "\n", varchar
"NULL", varchar "null", varchar "a:\file1", bigint "-1", bigint "0", int "0",
int "0"), [ cm_tmp.i ] COUNT ,
-| | table sys.copyfrom(table(cm_tmp), varchar "|", varchar "\n", varchar
"NULL", varchar "null", varchar "Z:/file2", bigint "-1", bigint "0", int "0",
int "0"), [ cm_tmp.i ] COUNT
+| | table sys.copyfrom(table(cm_tmp), varchar "|", varchar "\n", varchar
"NULL", varchar "null", varchar "a:\file1", bigint "-1", bigint "0", int "0",
int "0", varchar "NULL"), [ cm_tmp.i ] COUNT ,
+| | table sys.copyfrom(table(cm_tmp), varchar "|", varchar "\n", varchar
"NULL", varchar "null", varchar "Z:/file2", bigint "-1", bigint "0", int "0",
int "0", varchar "NULL"), [ cm_tmp.i ] COUNT
| ) [ int "NULL" ]
)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list