Changeset: 49df0e8eaa06 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/49df0e8eaa06
Modified Files:
testing/Mtest.py.in
Branch: samloader
Log Message:
Merge with default branch.
diffs (242 lines):
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -7761,6 +7761,7 @@ sql_trans_create_ustr(sql_trans *tr, sql
sqlid ustr_id = store_next_oid(store);
int res;
base_init(NULL, &u->base, ustr_id, true, uname);
+ u->s = s;
if ((res = os_add(s->ustrs, tr, u->base.name, &u->base)))
return res;
if ((res = store->table_api.table_insert(tr, sysobs, &ustr_id, &uname,
diff --git a/sql/test/2024/Tests/returning.test
b/sql/test/2024/Tests/returning.test
--- a/sql/test/2024/Tests/returning.test
+++ b/sql/test/2024/Tests/returning.test
@@ -7,10 +7,8 @@ insert into foo values (1, 10), (2, 20),
query II nosort
delete from foo where i > 1 returning i*2, j*j as k
----
-4
-400
-6
-900
+4 400
+6 900
query I nosort
select count(*) from foo
@@ -26,10 +24,8 @@ insert into foo values (1, 10), (2, 20),
query II nosort
update foo set j = -j where i < 3 returning j+5 as bla, i+i
----
--5
-2
--15
-4
+-5 2
+-15 4
statement ok
truncate foo
@@ -59,8 +55,7 @@ update foo set i = -i returning sum(j)
query II nosort
update foo set i = -i where i >0 returning sum(j), count(j)
----
--60
-3
+-60 3
statement error 42000!SELECT: cannot use non GROUP BY column 'i' in query
results without an aggregate function
update foo set i = -i returning sum(j), i
@@ -227,7 +222,7 @@ table("sys"."foo") [ "foo"."i" NOT NULL
)
) [ "foo"."i" NOT NULL NUNIQUES 3.000000 MAX "3" MIN "1" ]')
----
-@project (@insert(@table("sys"."foo") [ "foo"."i" NOT NULL UNIQUE, "foo"."j"
NOT NULL, "foo"."%TID%" NOT NULL UNIQUE ]@ [ [ int(31) NULL, int(31) NULL ] as
"%4"."%4", [ int(31) "40", int(31) "50" ] as "%1"."%1" ]@) [ "%4"."%4" as
"foo"."i", "%1"."%1" as "foo"."j" ]@) [ "foo"."i" NOT NULL UNIQUE ]
+@project (@insert(@table("sys"."foo") [ "foo"."i" NOT NULL, "foo"."j" NOT
NULL, "foo"."%TID%" NOT NULL UNIQUE ]@ [ [ int(31) NULL, int(31) NULL ] as
"%4"."%4", [ int(31) "40", int(31) "50" ] as "%1"."%1" ]@) [ "%4"."%4" as
"foo"."i", "%1"."%1" as "foo"."j" ]@) [ "foo"."i" NOT NULL ]
# update foo set j = -j where j > 10 returning i
query T nosort
diff --git a/sql/test/rel-optimizers/Tests/split-select.test
b/sql/test/rel-optimizers/Tests/split-select.test
--- a/sql/test/rel-optimizers/Tests/split-select.test
+++ b/sql/test/rel-optimizers/Tests/split-select.test
@@ -105,8 +105,8 @@ EXPLAIN SHOW DETAILS SELECT i FROM split
project (
| select (
| | project (
-| | | table("sys"."split_test") [ "split_test"."i", "split_test"."j",
"split_test"."k" NOT NULL UNIQUE ]
-| | ) [ "split_test"."i", "sys"."case"(("split_test"."j") * = (int(6) NULL),
varchar["split_test"."k" NOT NULL UNIQUE] NOT NULL, varchar["split_test"."j"])
as "%2"."%2" ]
+| | | table("sys"."split_test") [ "split_test"."i", "split_test"."j",
"split_test"."k" NOT NULL ]
+| | ) [ "split_test"."i", "sys"."case"(("split_test"."j") * = (int(6) NULL),
varchar["split_test"."k" NOT NULL] NOT NULL, varchar["split_test"."j"]) as
"%2"."%2" ]
| ) [ ("%2"."%2") = (varchar "10") ]
) [ "split_test"."i" ]
@@ -157,3 +157,4 @@ SELECT i FROM split_test WHERE CASE WHEN
statement ok
DROP TABLE split_test
+
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1625,76 +1625,81 @@ def GetBitsAndModsAndThreads(env):
cmd.extend(mserver5_opts)
if procdebug:
print('GetBitsAndModsAndThreads: starting process "%s" (inpipe,
outpipe, errpipe)\n' % '" "'.join(cmd))
- with process.Popen(cmd, stdin=process.PIPE, stdout=process.PIPE,
- stderr=process.PIPE, text=True) as proc:
- stderr = proc.stderr
- proc.stdout = process._BufferedPipe(proc.stdout)
- proc.stderr = process._BufferedPipe(proc.stderr)
- proc.killed = False
- proc.onechild = True
- qOut = qErr = ''
- mods = []
- timeout = par['TIMEOUT'] != 0
- try:
- starttime = time.time()
- while not timeout or time.time() < starttime + 30:
- proc.poll()
- if proc.returncode is not None:
- qOut = proc.stdout.read()
- qErr = proc.stderr.read()
- break
- if os.path.exists(os.path.join(dbpath, '.started')):
- break
- time.sleep(0.1)
- if proc.returncode is None:
- with open(os.path.join(dbpath, '.conn')) as fil:
- connurl = fil.read()
- res = mapiportre.search(connurl)
- try:
- with pymonetdb.connect(username='monetdb',
- password='monetdb',
- hostname=HOST,
- port=int(res.group('port')),
- database=TSTPREF,
- autocommit=True,
- connect_timeout=1.0) as dbh:
- if timeout:
- dbh.settimeout(30)
- with dbh.cursor() as crs:
- try:
- crs.execute('select distinct module from
sys.malfunctions() order by module')
- except TimeoutError:
- pass
- else:
- mods = crs.fetchall()
- mods = [x[0] for x in mods]
+ try:
+ with process.Popen(cmd, stdin=process.PIPE, stdout=process.PIPE,
+ stderr=process.PIPE, text=True) as proc:
+ stderr = proc.stderr
+ proc.stdout = process._BufferedPipe(proc.stdout)
+ proc.stderr = process._BufferedPipe(proc.stderr)
+ proc.killed = False
+ proc.onechild = True
+ qOut = qErr = ''
+ mods = []
+ timeout = par['TIMEOUT'] != 0
+ try:
+ starttime = time.time()
+ while not timeout or time.time() < starttime + 30:
+ proc.poll()
+ if proc.returncode is not None:
+ qOut = proc.stdout.read()
+ qErr = proc.stderr.read()
+ break
+ if os.path.exists(os.path.join(dbpath, '.started')):
+ break
+ time.sleep(0.1)
+ if proc.returncode is None:
+ with open(os.path.join(dbpath, '.conn')) as fil:
+ connurl = fil.read()
+ res = mapiportre.search(connurl)
+ try:
+ with pymonetdb.connect(username='monetdb',
+ password='monetdb',
+ hostname=HOST,
+ port=int(res.group('port')),
+ database=TSTPREF,
+ autocommit=True,
+ connect_timeout=1.0) as dbh:
+ if timeout:
+ dbh.settimeout(30)
+ with dbh.cursor() as crs:
try:
- mods.remove('user')
- except ValueError:
+ crs.execute('select distinct module from
sys.malfunctions() order by module')
+ except TimeoutError:
pass
- except KeyboardInterrupt:
- raise
- except:
- print('Exception caught')
- print('Local variables:')
- print(locals())
- print('Global variables:')
- print(globals())
- raise
- proc.terminate()
- qOut = proc.stdout.read(timeout=5)
- qErr = proc.stderr.read(timeout=5)
- try:
- proc.wait(timeout=5)
- except process.TimeoutExpired:
- proc.kill()
+ else:
+ mods = crs.fetchall()
+ mods = [x[0] for x in mods]
+ try:
+ mods.remove('user')
+ except ValueError:
+ pass
+ except KeyboardInterrupt:
+ raise
+ except:
+ print('Exception caught')
+ print('Local variables:')
+ print(locals())
+ print('Global variables:')
+ print(globals())
+ raise
+ proc.terminate()
+ qOut = proc.stdout.read(timeout=5)
+ qErr = proc.stderr.read(timeout=5)
+ try:
+ proc.wait(timeout=5)
+ except process.TimeoutExpired:
+ proc.kill()
+ proc.wait()
+ finally:
+ if proc.returncode is None:
+ killProc(proc, stderr, cmd)
proc.wait()
- finally:
- if proc.returncode is None:
- killProc(proc, stderr, cmd)
- proc.wait()
- if procdebug:
- print('GetBitsAndModsAndThreads: process exited "%s" (%s)\n' %
('" "'.join(cmd), proc.returncode))
+ if procdebug:
+ print('GetBitsAndModsAndThreads: process exited "%s"
(%s)\n'
+ % ('" "'.join(cmd), proc.returncode))
+ except RuntimeError as e:
+ print(str(e))
+ return 1
env['TST_MODS'] = mods
env['TST_BITS'] = ''
env['TST_INT128'] = ''
diff --git a/testing/process.py b/testing/process.py
--- a/testing/process.py
+++ b/testing/process.py
@@ -253,7 +253,7 @@ class Popen(subprocess.Popen):
self.returncode < 0 and \
-self.returncode in _coresigs:
raise RuntimeError('process exited with coredump generating signal'
- f' {signal.Signals(-self.returncode)}')
+ f' {signal.strsignal(-self.returncode)}')
def __del__(self):
if self._child_created and self.returncode is None:
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]