LCOV - code coverage report
Current view: top level - export/scratch1/home/monet/testing/b50e8e2d6f02-1-1-1/build/sql/backends/monet5 - 76_dump.sql.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 2 2 100.0 %
Date: 2021-10-13 02:24:04 Functions: 1 1 100.0 %

          Line data    Source code
       1             : unsigned char _76_dump_sql[15965] = {
       2             : "CREATE VIEW sys.dump_create_roles AS\n"
       3             : "  SELECT\n"
       4             : "    'CREATE ROLE ' || sys.dq(name) || ';' stmt,\n"
       5             : "    name user_name\n"
       6             : "    FROM sys.auths\n"
       7             : "   WHERE name NOT IN (SELECT name FROM sys.db_user_info)\n"
       8             : "     AND grantor <> 0;\n"
       9             : "CREATE VIEW sys.dump_create_users AS\n"
      10             : "  SELECT\n"
      11             : "    'CREATE USER ' || sys.dq(ui.name) || ' WITH ENCRYPTED PASSWORD ' ||\n"
      12             : "      sys.sq(sys.password_hash(ui.name)) ||\n"
      13             : "      ' NAME ' || sys.sq(ui.fullname) || ' SCHEMA sys' || ifthenelse(ui.schema_path = '\"sys\"', '', ' SCHEMA PATH ' || sys.sq(ui.schema_path)) || ';' stmt,\n"
      14             : "    ui.name user_name\n"
      15             : "    FROM sys.db_user_info ui, sys.schemas s\n"
      16             : "   WHERE ui.default_schema = s.id\n"
      17             : "     AND ui.name <> 'monetdb'\n"
      18             : "     AND ui.name <> '.snapshot';\n"
      19             : "CREATE VIEW sys.dump_create_schemas AS\n"
      20             : "  SELECT\n"
      21             : "    'CREATE SCHEMA ' || sys.dq(s.name) || ifthenelse(a.name <> 'sysadmin', ' AUTHORIZATION ' || sys.dq(a.name), ' ') || ';' stmt,\n"
      22             : "    s.name schema_name\n"
      23             : "    FROM sys.schemas s, sys.auths a\n"
      24             : "   WHERE s.authorization = a.id AND s.system = FALSE;\n"
      25             : "CREATE VIEW sys.dump_add_schemas_to_users AS\n"
      26             : "  SELECT\n"
      27             : "    'ALTER USER ' || sys.dq(ui.name) || ' SET SCHEMA ' || sys.dq(s.name) || ';' stmt,\n"
      28             : "    s.name schema_name,\n"
      29             : "    ui.name user_name\n"
      30             : "    FROM sys.db_user_info ui, sys.schemas s\n"
      31             : "   WHERE ui.default_schema = s.id\n"
      32             : "     AND ui.name <> 'monetdb'\n"
      33             : "     AND ui.name <> '.snapshot'\n"
      34             : "     AND s.name <> 'sys';\n"
      35             : "CREATE VIEW sys.dump_grant_user_privileges AS\n"
      36             : "  SELECT\n"
      37             : "    'GRANT ' || sys.dq(a2.name) || ' ' || ifthenelse(a1.name = 'public', 'PUBLIC', sys.dq(a1.name)) || ';' stmt,\n"
      38             : "    a2.name grantee,\n"
      39             : "    a1.name grantor\n"
      40             : "    FROM sys.auths a1, sys.auths a2, sys.user_role ur\n"
      41             : "   WHERE a1.id = ur.login_id AND a2.id = ur.role_id;\n"
      42             : "CREATE VIEW sys.dump_table_constraint_type AS\n"
      43             : "  SELECT\n"
      44             : "    'ALTER TABLE ' || sys.DQ(sch) || '.' || sys.DQ(tbl) ||\n"
      45             : "      ' ADD CONSTRAINT ' || sys.DQ(con) || ' '||\n"
      46             : "      tpe || ' (' || GROUP_CONCAT(sys.DQ(col), ', ') || ');' stmt,\n"
      47             : "    sch schema_name,\n"
      48             : "    tbl table_name,\n"
      49             : "    con constraint_name\n"
      50             : "    FROM sys.describe_constraints GROUP BY sch, tbl, con, tpe;\n"
      51             : "CREATE VIEW sys.dump_table_grants AS\n"
      52             : "  WITH table_grants (sname, tname, grantee, grants, grantor, grantable)\n"
      53             : "  AS (SELECT s.name, t.name, a.name, sum(p.privileges), g.name, p.grantable\n"
      54             : "  FROM sys.schemas s, sys.tables t, sys.auths a, sys.privileges p, sys.auths g\n"
      55             : "       WHERE p.obj_id = t.id AND p.auth_id = a.id AND t.schema_id = s.id AND t.system = FALSE AND p.grantor = g.id GROUP BY s.name, t.name, a.name, g.name, p.grantable\n"
      56             : "       ORDER BY s.name, t.name, a.name, g.name, p.grantable)\n"
      57             : "  SELECT\n"
      58             : "    'GRANT ' || pc.privilege_code_name || ' ON TABLE ' || sys.dq(sname)\n"
      59             : "      || '.' || sys.dq(tname) || ' TO ' || ifthenelse(grantee = 'public', 'PUBLIC', sys.dq(grantee))\n"
      60             : "      || CASE WHEN grantable = 1 THEN ' WITH GRANT OPTION' ELSE '' END || ';' stmt,\n"
      61             : "    sname schema_name,\n"
      62             : "    tname table_name,\n"
      63             : "    grantee\n"
      64             : "    FROM table_grants LEFT OUTER JOIN sys.privilege_codes pc ON grants = pc.privilege_code_id;\n"
      65             : "CREATE VIEW sys.dump_column_grants AS\n"
      66             : "  SELECT\n"
      67             : "    'GRANT ' || pc.privilege_code_name || '(' || sys.dq(c.name) || ') ON '\n"
      68             : "      || sys.dq(s.name) || '.' || sys.dq(t.name) || ' TO ' || ifthenelse(a.name = 'public', 'PUBLIC', sys.dq(a.name))\n"
      69             : "      || CASE WHEN p.grantable = 1 THEN ' WITH GRANT OPTION' ELSE '' END || ';' stmt,\n"
      70             : "    s.name schema_name,\n"
      71             : "    t.name table_name,\n"
      72             : "    c.name column_name,\n"
      73             : "    a.name grantee\n"
      74             : "    FROM sys.schemas s,\n"
      75             : "   sys.tables t,\n"
      76             : "   sys.columns c,\n"
      77             : "   sys.auths a,\n"
      78             : "   sys.privileges p,\n"
      79             : "   sys.auths g,\n"
      80             : "   sys.privilege_codes pc\n"
      81             : "   WHERE p.obj_id = c.id\n"
      82             : "     AND c.table_id = t.id\n"
      83             : "     AND p.auth_id = a.id\n"
      84             : "     AND t.schema_id = s.id\n"
      85             : "     AND NOT t.system\n"
      86             : "     AND p.grantor = g.id\n"
      87             : "     AND p.privileges = pc.privilege_code_id\n"
      88             : "   ORDER BY s.name, t.name, c.name, a.name, g.name, p.grantable;\n"
      89             : "CREATE VIEW sys.dump_function_grants AS\n"
      90             : "  WITH func_args_all(func_id, number, max_number, func_arg) AS\n"
      91             : "  (SELECT a.func_id,\n"
      92             : "    a.number,\n"
      93             : "    max(a.number) OVER (PARTITION BY a.func_id ORDER BY a.number DESC),\n"
      94             : "    group_concat(sys.describe_type(a.type, a.type_digits, a.type_scale), ', ') OVER (PARTITION BY a.func_id ORDER BY a.number)\n"
      95             : "     FROM sys.args a\n"
      96             : "    WHERE a.inout = 1),\n"
      97             : "  func_args(func_id, func_arg) AS\n"
      98             : "  (SELECT func_id, func_arg FROM func_args_all WHERE number = max_number)\n"
      99             : "  SELECT\n"
     100             : "    'GRANT ' || pc.privilege_code_name || ' ON '\n"
     101             : "      || ft.function_type_keyword || ' '\n"
     102             : "      || sys.dq(s.name) || '.' || sys.dq(f.name) || '(' || coalesce(fa.func_arg, '') || ') TO '\n"
     103             : "      || ifthenelse(a.name = 'public', 'PUBLIC', sys.dq(a.name))\n"
     104             : "      || CASE WHEN p.grantable = 1 THEN ' WITH GRANT OPTION' ELSE '' END || ';' stmt,\n"
     105             : "    s.name schema_name,\n"
     106             : "    f.name function_name,\n"
     107             : "    a.name grantee\n"
     108             : "    FROM sys.schemas s,\n"
     109             : "   sys.functions f LEFT OUTER JOIN func_args fa ON f.id = fa.func_id,\n"
     110             : "   sys.auths a,\n"
     111             : "   sys.privileges p,\n"
     112             : "   sys.auths g,\n"
     113             : "   sys.function_types ft,\n"
     114             : "   sys.privilege_codes pc\n"
     115             : "   WHERE s.id = f.schema_id\n"
     116             : "     AND f.id = p.obj_id\n"
     117             : "     AND p.auth_id = a.id\n"
     118             : "     AND p.grantor = g.id\n"
     119             : "     AND p.privileges = pc.privilege_code_id\n"
     120             : "     AND f.type = ft.function_type_id\n"
     121             : "     AND NOT f.system\n"
     122             : "   ORDER BY s.name, f.name, a.name, g.name, p.grantable;\n"
     123             : "CREATE VIEW sys.dump_indices AS\n"
     124             : "  SELECT\n"
     125             : "    'CREATE ' || tpe || ' ' ||\n"
     126             : "      sys.DQ(ind) || ' ON ' || sys.DQ(sch) || '.' || sys.DQ(tbl) ||\n"
     127             : "      '(' || GROUP_CONCAT(col) || ');' stmt,\n"
     128             : "    sch schema_name,\n"
     129             : "    tbl table_name,\n"
     130             : "    ind index_name\n"
     131             : "    FROM sys.describe_indices GROUP BY ind, tpe, sch, tbl;\n"
     132             : "CREATE VIEW sys.dump_column_defaults AS\n"
     133             : "  SELECT 'ALTER TABLE ' || sys.FQN(sch, tbl) || ' ALTER COLUMN ' || sys.DQ(col) || ' SET DEFAULT ' || def || ';' stmt,\n"
     134             : "   sch schema_name,\n"
     135             : "   tbl table_name,\n"
     136             : "   col column_name\n"
     137             : "    FROM sys.describe_column_defaults;\n"
     138             : "CREATE VIEW sys.dump_foreign_keys AS\n"
     139             : "  SELECT\n"
     140             : "    'ALTER TABLE ' || sys.DQ(fk_s) || '.'|| sys.DQ(fk_t) || ' ADD CONSTRAINT ' || sys.DQ(fk) || ' ' ||\n"
     141             : "      'FOREIGN KEY(' || GROUP_CONCAT(sys.DQ(fk_c), ',') ||') ' ||\n"
     142             : "      'REFERENCES ' || sys.DQ(pk_s) || '.' || sys.DQ(pk_t) || '(' || GROUP_CONCAT(sys.DQ(pk_c), ',') || ') ' ||\n"
     143             : "      'ON DELETE ' || on_delete || ' ON UPDATE ' || on_update ||\n"
     144             : "      ';' stmt,\n"
     145             : "    fk_s foreign_schema_name,\n"
     146             : "    fk_t foreign_table_name,\n"
     147             : "    pk_s primary_schema_name,\n"
     148             : "    pk_t primary_table_name,\n"
     149             : "    fk key_name\n"
     150             : "    FROM sys.describe_foreign_keys GROUP BY fk_s, fk_t, pk_s, pk_t, fk, on_delete, on_update;\n"
     151             : "CREATE VIEW sys.dump_partition_tables AS\n"
     152             : "  SELECT\n"
     153             : "    sys.ALTER_TABLE(m_sch, m_tbl) || ' ADD TABLE ' || sys.FQN(p_sch, p_tbl) ||\n"
     154             : "      CASE\n"
     155             : "      WHEN tpe = 'VALUES' THEN ' AS PARTITION IN (' || pvalues || ')'\n"
     156             : "      WHEN tpe = 'RANGE' THEN ' AS PARTITION FROM ' || ifthenelse(minimum IS NOT NULL, sys.SQ(minimum), 'RANGE MINVALUE') || ' TO ' || ifthenelse(maximum IS NOT NULL, sys.SQ(maximum), 'RANGE MAXVALUE')\n"
     157             : "      WHEN tpe = 'FOR NULLS' THEN ' AS PARTITION FOR NULL VALUES'\n"
     158             : "      ELSE ''\n"
     159             : "      END ||\n"
     160             : "      CASE WHEN tpe in ('VALUES', 'RANGE') AND with_nulls THEN ' WITH NULL VALUES' ELSE '' END ||\n"
     161             : "      ';' stmt,\n"
     162             : "    m_sch merge_schema_name,\n"
     163             : "    m_tbl merge_table_name,\n"
     164             : "    p_sch partition_schema_name,\n"
     165             : "    p_tbl partition_table_name\n"
     166             : "    FROM sys.describe_partition_tables;\n"
     167             : "CREATE VIEW sys.dump_sequences AS\n"
     168             : "  SELECT\n"
     169             : "    'CREATE SEQUENCE ' || sys.FQN(sch, seq) || ' AS BIGINT ' ||\n"
     170             : "      CASE WHEN \"s\" <> 0 THEN 'START WITH ' || \"rs\" ELSE '' END ||\n"
     171             : "      CASE WHEN \"inc\" <> 1 THEN ' INCREMENT BY ' || \"inc\" ELSE '' END ||\n"
     172             : "      CASE WHEN \"mi\" <> 0 THEN ' MINVALUE ' || \"mi\" ELSE '' END ||\n"
     173             : "      CASE WHEN \"ma\" <> 0 THEN ' MAXVALUE ' || \"ma\" ELSE '' END ||\n"
     174             : "      CASE WHEN \"cache\" <> 1 THEN ' CACHE ' || \"cache\" ELSE '' END ||\n"
     175             : "      CASE WHEN \"cycle\" THEN ' CYCLE' ELSE '' END || ';' stmt,\n"
     176             : "    sch schema_name,\n"
     177             : "    seq seqname\n"
     178             : "    FROM sys.describe_sequences;\n"
     179             : "CREATE VIEW sys.dump_start_sequences AS\n"
     180             : "  SELECT\n"
     181             : "    'UPDATE sys.sequences seq SET start = ' || s ||\n"
     182             : "      ' WHERE name = ' || sys.SQ(seq) ||\n"
     183             : "      ' AND schema_id = (SELECT s.id FROM sys.schemas s WHERE s.name = ' || sys.SQ(sch) || ');' stmt,\n"
     184             : "    sch schema_name,\n"
     185             : "    seq sequence_name\n"
     186             : "    FROM sys.describe_sequences;\n"
     187             : "CREATE VIEW sys.dump_functions AS\n"
     188             : "  SELECT f.o o, sys.schema_guard(f.sch, f.fun, f.def) stmt,\n"
     189             : "   f.sch schema_name,\n"
     190             : "   f.fun function_name\n"
     191             : "    FROM sys.describe_functions f;\n"
     192             : "CREATE VIEW sys.dump_tables AS\n"
     193             : "  SELECT\n"
     194             : "    t.o o,\n"
     195             : "    CASE\n"
     196             : "      WHEN t.typ <> 'VIEW' THEN\n"
     197             : "      'CREATE ' || t.typ || ' ' || sys.FQN(t.sch, t.tab) || t.col || t.opt || ';'\n"
     198             : "      ELSE\n"
     199             : "      t.opt\n"
     200             : "      END stmt,\n"
     201             : "    t.sch schema_name,\n"
     202             : "    t.tab table_name\n"
     203             : "    FROM sys.describe_tables t;\n"
     204             : "CREATE VIEW sys.dump_triggers AS\n"
     205             : "  SELECT sys.schema_guard(sch, tab, def) stmt,\n"
     206             : "   sch schema_name,\n"
     207             : "   tab table_name,\n"
     208             : "   tri trigger_name\n"
     209             : "    FROM sys.describe_triggers;\n"
     210             : "CREATE VIEW sys.dump_comments AS\n"
     211             : "  SELECT 'COMMENT ON ' || c.tpe || ' ' || c.fqn || ' IS ' || sys.SQ(c.rem) || ';' stmt FROM sys.describe_comments c;\n"
     212             : "CREATE VIEW sys.dump_user_defined_types AS\n"
     213             : "  SELECT 'CREATE TYPE ' || sys.FQN(sch, sql_tpe) || ' EXTERNAL NAME ' || sys.DQ(ext_tpe) || ';' stmt,\n"
     214             : "   sch schema_name,\n"
     215             : "   sql_tpe type_name\n"
     216             : "    FROM sys.describe_user_defined_types;\n"
     217             : "CREATE PROCEDURE sys.EVAL(stmt STRING) EXTERNAL NAME sql.eval;\n"
     218             : "CREATE FUNCTION sys.esc(s STRING) RETURNS STRING BEGIN RETURN '\"' || sys.replace(sys.replace(sys.replace(s,E'\\\\', E'\\\\\\\\'), E'\\n', E'\\\\n'), '\"', E'\\\\\"') || '\"'; END;\n"
     219             : "CREATE FUNCTION sys.prepare_esc(s STRING, t STRING) RETURNS STRING\n"
     220             : "BEGIN\n"
     221             : "  RETURN\n"
     222             : "    CASE\n"
     223             : "    WHEN (t = 'varchar' OR t ='char' OR t = 'clob' OR t = 'json' OR t = 'geometry' OR t = 'url') THEN\n"
     224             : "    'CASE WHEN ' || sys.DQ(s) || ' IS NULL THEN ''null'' ELSE ' || 'sys.esc(' || sys.DQ(s) || ')' || ' END'\n"
     225             : "    ELSE\n"
     226             : "    'CASE WHEN ' || sys.DQ(s) || ' IS NULL THEN ''null'' ELSE CAST(' || sys.DQ(s) || ' AS STRING) END'\n"
     227             : "    END;\n"
     228             : "END;\n"
     229             : "CREATE TABLE sys.dump_statements(o INT, s STRING);\n"
     230             : "CREATE PROCEDURE sys.dump_table_data(sch STRING, tbl STRING)\n"
     231             : "BEGIN\n"
     232             : "  DECLARE k INT;\n"
     233             : "  SET k = (SELECT MIN(c.id) FROM sys.columns c, sys.tables t, sys.schemas s WHERE c.table_id = t.id AND t.name = tbl AND t.schema_id = s.id AND s.name = sch);\n"
     234             : "  IF k IS NOT NULL THEN\n"
     235             : "    DECLARE cname STRING;\n"
     236             : "    DECLARE ctype STRING;\n"
     237             : "    SET cname = (SELECT c.name FROM sys.columns c WHERE c.id = k);\n"
     238             : "    SET ctype = (SELECT c.type FROM sys.columns c WHERE c.id = k);\n"
     239             : "    DECLARE COPY_INTO_STMT STRING;\n"
     240             : "    DECLARE _cnt INT;\n"
     241             : "    SET _cnt = (SELECT count FROM sys.storage(sch, tbl, cname));\n"
     242             : "    IF _cnt > 0 THEN\n"
     243             : "      SET COPY_INTO_STMT = 'COPY ' || _cnt || ' RECORDS INTO ' || sys.FQN(sch, tbl) || '(' || sys.DQ(cname);\n"
     244             : "      DECLARE SELECT_DATA_STMT STRING;\n"
     245             : "      SET SELECT_DATA_STMT = 'SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), ' || sys.prepare_esc(cname, ctype);\n"
     246             : "      DECLARE M INT;\n"
     247             : "      SET M = (SELECT MAX(c.id) FROM sys.columns c, sys.tables t WHERE c.table_id = t.id AND t.name = tbl);\n"
     248             : "      WHILE (k < M) DO\n"
     249             : "  SET k = (SELECT MIN(c.id) FROM sys.columns c, sys.tables t WHERE c.table_id = t.id AND t.name = tbl AND c.id > k);\n"
     250             : "        SET cname = (SELECT c.name FROM sys.columns c WHERE c.id = k);\n"
     251             : "  SET ctype = (SELECT c.type FROM sys.columns c WHERE c.id = k);\n"
     252             : "  SET COPY_INTO_STMT = (COPY_INTO_STMT || ', ' || sys.DQ(cname));\n"
     253             : "  SET SELECT_DATA_STMT = SELECT_DATA_STMT || '|| ''|'' || ' || sys.prepare_esc(cname, ctype);\n"
     254             : "      END WHILE;\n"
     255             : "      SET COPY_INTO_STMT = (COPY_INTO_STMT || ') FROM STDIN USING DELIMITERS ''|'',E''\\\\n'',''\"'';');\n"
     256             : "      SET SELECT_DATA_STMT = SELECT_DATA_STMT || ' FROM ' || sys.FQN(sch, tbl);\n"
     257             : "      insert into sys.dump_statements VALUES ((SELECT COUNT(*) FROM sys.dump_statements) + 1, COPY_INTO_STMT);\n"
     258             : "      CALL sys.EVAL('INSERT INTO sys.dump_statements ' || SELECT_DATA_STMT || ';');\n"
     259             : "    END IF;\n"
     260             : "  END IF;\n"
     261             : "END;\n"
     262             : "CREATE PROCEDURE sys.dump_table_data()\n"
     263             : "BEGIN\n"
     264             : "  DECLARE i INT;\n"
     265             : "  SET i = (SELECT MIN(t.id) FROM sys.tables t, sys.table_types ts WHERE t.type = ts.table_type_id AND ts.table_type_name = 'TABLE' AND NOT t.system);\n"
     266             : "  IF i IS NOT NULL THEN\n"
     267             : "    DECLARE M INT;\n"
     268             : "    SET M = (SELECT MAX(t.id) FROM sys.tables t, sys.table_types ts WHERE t.type = ts.table_type_id AND ts.table_type_name = 'TABLE' AND NOT t.system);\n"
     269             : "    DECLARE sch STRING;\n"
     270             : "    DECLARE tbl STRING;\n"
     271             : "    WHILE i < M DO\n"
     272             : "      set sch = (SELECT s.name FROM sys.tables t, sys.schemas s WHERE s.id = t.schema_id AND t.id = i);\n"
     273             : "      set tbl = (SELECT t.name FROM sys.tables t, sys.schemas s WHERE s.id = t.schema_id AND t.id = i);\n"
     274             : "      CALL sys.dump_table_data(sch, tbl);\n"
     275             : "      SET i = (SELECT MIN(t.id) FROM sys.tables t, sys.table_types ts WHERE t.type = ts.table_type_id AND ts.table_type_name = 'TABLE' AND NOT t.system AND t.id > i);\n"
     276             : "    END WHILE;\n"
     277             : "    set sch = (SELECT s.name FROM sys.tables t, sys.schemas s WHERE s.id = t.schema_id AND t.id = i);\n"
     278             : "    set tbl = (SELECT t.name FROM sys.tables t, sys.schemas s WHERE s.id = t.schema_id AND t.id = i);\n"
     279             : "    CALL sys.dump_table_data(sch, tbl);\n"
     280             : "  END IF;\n"
     281             : "END;\n"
     282             : "CREATE FUNCTION sys.dump_database(describe BOOLEAN) RETURNS TABLE(o int, stmt STRING)\n"
     283             : "BEGIN\n"
     284             : "  SET SCHEMA sys;\n"
     285             : "  TRUNCATE sys.dump_statements;\n"
     286             : "  INSERT INTO sys.dump_statements VALUES (1, 'START TRANSACTION;');\n"
     287             : "  INSERT INTO sys.dump_statements VALUES ((SELECT COUNT(*) FROM sys.dump_statements) + 1, 'SET SCHEMA \"sys\";');\n"
     288             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_create_roles;\n"
     289             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_create_users;\n"
     290             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_create_schemas;\n"
     291             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_user_defined_types;\n"
     292             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_add_schemas_to_users;\n"
     293             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_grant_user_privileges;\n"
     294             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_sequences;\n"
     295             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(ORDER BY stmts.o), stmts.s\n"
     296             : "                              FROM (\n"
     297             : "                                SELECT f.o, f.stmt FROM sys.dump_functions f\n"
     298             : "                                 UNION\n"
     299             : "                                SELECT t.o, t.stmt FROM sys.dump_tables t\n"
     300             : "                              ) AS stmts(o, s);\n"
     301             : "  IF NOT DESCRIBE THEN\n"
     302             : "    CALL sys.dump_table_data();\n"
     303             : "  END IF;\n"
     304             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_start_sequences;\n"
     305             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_column_defaults;\n"
     306             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_table_constraint_type;\n"
     307             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_indices;\n"
     308             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_foreign_keys;\n"
     309             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_partition_tables;\n"
     310             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_triggers;\n"
     311             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_comments;\n"
     312             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_table_grants;\n"
     313             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_column_grants;\n"
     314             : "  INSERT INTO sys.dump_statements SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), stmt FROM sys.dump_function_grants;\n"
     315             : "  INSERT INTO sys.dump_statements VALUES ((SELECT COUNT(*) FROM sys.dump_statements) + 1, 'COMMIT;');\n"
     316             : "  RETURN sys.dump_statements;\n"
     317             : "END;\n"
     318             : };
     319             : #include "monetdb_config.h"
     320             : #include "sql_import.h"
     321             : #ifdef _MSC_VER
     322             : #undef read
     323             : #pragma section(".CRT$XCU",read)
     324             : #endif
     325         256 : LIB_STARTUP_FUNC(init_76_dump_sql)
     326         256 : { sql_register("76_dump", _76_dump_sql); }

Generated by: LCOV version 1.14