Changeset: 10686cbf3739 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/10686cbf3739 Branch: Jan2022 Log Message:
Merge heads diffs (truncated from 716 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -616,7 +616,11 @@ This package contains files needed to de %files SQL-server5-devel %defattr(-,root,root) +%{_includedir}/monetdb/exception_buffer.h +%{_includedir}/monetdb/opt_backend.h +%{_includedir}/monetdb/rel_*.h %{_includedir}/monetdb/sql*.h +%{_includedir}/monetdb/store_*.h %package embedded Summary: MonetDB as an embedded library diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -179,7 +179,7 @@ def main(): print(r' <Directory Id="include" Name="include">') print(r' <Directory Id="monetdb" Name="monetdb">') id = comp(extend, id, 16, - sorted([r'include\monetdb\{}'.format(x) for x in filter(lambda x: (x.startswith('gdk') or x.startswith('monet') or x.startswith('mal') or x.startswith('sql')) and x.endswith('.h'), os.listdir(os.path.join(sys.argv[3], 'include', 'monetdb')))] + + sorted([r'include\monetdb\{}'.format(x) for x in filter(lambda x: (x.startswith('gdk') or x.startswith('monet') or x.startswith('mal') or x.startswith('sql') or x.startswith('rel') or x.startswith('store') or x.startswith('exception') or x.startswith('opt_backend')) and x.endswith('.h'), os.listdir(os.path.join(sys.argv[3], 'include', 'monetdb')))] + [r'include\monetdb\copybinary.h', r'include\monetdb\mapi.h', r'include\monetdb\matomic.h', diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1433,6 +1433,27 @@ const char *wlrRef; Workingset workingset[THREADS]; const char *zero_or_oneRef; +# monetdbe +char *monetdbe_append(monetdbe_database dbhdl, const char *schema, const char *table, monetdbe_column **input, size_t column_count); +char *monetdbe_bind(monetdbe_statement *stmt, void *data, size_t parameter_nr); +char *monetdbe_cleanup_result(monetdbe_database dbhdl, monetdbe_result *result); +char *monetdbe_cleanup_statement(monetdbe_database dbhdl, monetdbe_statement *stmt); +int monetdbe_close(monetdbe_database db); +char *monetdbe_dump_database(monetdbe_database dbhdl, const char *backupfile); +char *monetdbe_dump_table(monetdbe_database dbhdl, const char *schema_name, const char *table_name, const char *backupfile); +char *monetdbe_error(monetdbe_database db); +char *monetdbe_execute(monetdbe_statement *stmt, monetdbe_result **result, monetdbe_cnt *affected_rows); +char *monetdbe_get_autocommit(monetdbe_database dbhdl, int *result); +char *monetdbe_get_columns(monetdbe_database dbhdl, const char *schema_name, const char *table_name, size_t *column_count, monetdbe_column **columns); +int monetdbe_in_transaction(monetdbe_database dbhdl); +const void *monetdbe_null(monetdbe_database dbhdl, monetdbe_types t); +int monetdbe_open(monetdbe_database *db, char *url, monetdbe_options *opts); +char *monetdbe_prepare(monetdbe_database dbhdl, char *query, monetdbe_statement **stmt, monetdbe_result **result); +char *monetdbe_query(monetdbe_database dbhdl, char *query, monetdbe_result **result, monetdbe_cnt *affected_rows); +char *monetdbe_result_fetch(monetdbe_result *mres, monetdbe_column **res, size_t column_index); +char *monetdbe_set_autocommit(monetdbe_database dbhdl, int value); +const char *monetdbe_version(void); + # stream stream *block_stream(stream *s); stream *block_stream2(stream *s, size_t bufsiz, compression_method comp); diff --git a/debian/monetdb5-sql-dev.install b/debian/monetdb5-sql-dev.install --- a/debian/monetdb5-sql-dev.install +++ b/debian/monetdb5-sql-dev.install @@ -1,1 +1,5 @@ +debian/tmp/usr/include/monetdb/exception_buffer.h usr/include/monetdb +debian/tmp/usr/include/monetdb/opt_backend.h usr/include/monetdb +debian/tmp/usr/include/monetdb/rel_*.h usr/include/monetdb debian/tmp/usr/include/monetdb/sql*.h usr/include/monetdb +debian/tmp/usr/include/monetdb/store_*.h usr/include/monetdb diff --git a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 --- a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 +++ b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 @@ -5200,6 +5200,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -5280,6 +5281,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -5299,7 +5322,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -5488,7 +5511,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out --- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out +++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out @@ -4605,6 +4605,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -4685,6 +4686,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -4704,7 +4727,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -4893,7 +4916,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit --- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit +++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit @@ -4605,6 +4605,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -4685,6 +4686,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -4704,7 +4727,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -4893,7 +4916,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 --- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 +++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 @@ -4605,6 +4605,7 @@ drop view sys.dump_create_roles; drop view sys.describe_functions; drop view sys.describe_partition_tables; drop view sys.describe_privileges; +drop view sys.fully_qualified_functions; drop view sys.describe_comments; drop view sys.describe_tables; drop view sys.describe_sequences; @@ -4685,6 +4686,28 @@ CREATE VIEW sys.describe_tables AS AND s.id = t.schema_id AND ts.table_type_id = t.type AND s.name <> 'tmp'; +CREATE VIEW sys.fully_qualified_functions AS + WITH fqn(id, tpe, sig, num) AS + ( + SELECT + f.id, + ft.function_type_keyword, + CASE WHEN a.type IS NULL THEN + sys.fqn(s.name, f.name) || '()' + ELSE + sys.fqn(s.name, f.name) || '(' || group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ',') OVER (PARTITION BY f.id ORDER BY a.number) || ')' + END, + a.number + FROM sys.schemas s, sys.function_types ft, sys.functions f LEFT JOIN sys.args a ON f.id = a.func_id + WHERE s.id= f.schema_id AND f.type = ft.function_type_id + ) + SELECT + fqn1.id id, + fqn1.tpe tpe, + fqn1.sig nme + FROM + fqn fqn1 JOIN (SELECT id, max(num) FROM fqn GROUP BY id) fqn2(id, num) + ON fqn1.id = fqn2.id AND (fqn1.num = fqn2.num OR fqn1.num IS NULL AND fqn2.num is NULL); CREATE VIEW sys.describe_comments AS SELECT o.id id, @@ -4704,7 +4727,7 @@ CREATE VIEW sys.describe_comments AS UNION ALL SELECT seq.id, 'SEQUENCE', sys.FQN(s.name, seq.name) FROM sys.sequences seq, sys.schemas s WHERE seq.schema_id = s.id UNION ALL - SELECT f.id, ft.function_type_keyword, sys.FQN(s.name, f.name) FROM sys.functions f, sys.function_types ft, sys.schemas s WHERE f.type = ft.function_type_id AND f.schema_id = s.id + SELECT f.id, ft.function_type_keyword, qf.nme FROM sys.functions f, sys.function_types ft, sys.schemas s, sys.fully_qualified_functions qf WHERE f.type = ft.function_type_id AND f.schema_id = s.id AND qf.id = f.id ) AS o(id, tpe, nme) JOIN sys.comments c ON c.id = o.id; CREATE VIEW sys.describe_privileges AS @@ -4893,7 +4916,7 @@ GRANT SELECT ON sys.describe_partition_t GRANT SELECT ON sys.describe_sequences TO PUBLIC; GRANT SELECT ON sys.describe_functions TO PUBLIC; update sys.functions set system = true where system <> true and name in ('sq', 'fqn', 'get_merge_table_partition_expressions', 'get_remote_table_expressions', 'schema_guard') and schema_id = 2000 and type = 1; -update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; +update sys._tables set system = true where name in ('describe_constraints', 'describe_tables', 'fully_qualified_functions', 'describe_comments', 'describe_privileges', 'describe_partition_tables', 'describe_sequences', 'describe_functions') AND schema_id = 2000; CREATE VIEW sys.dump_create_roles AS SELECT 'CREATE ROLE ' || sys.dq(name) || ';' stmt, diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list