ricomariani / CG-SQL-author

CG-SQL Author's Cut: CG/SQL is a compiler that converts a SQL Stored Procedure like language into C for SQLite. SQLite has no stored procedures of its own. CG/CQL can also generate other useful artifacts for testing and schema maintenance.
https://ricomariani.github.io/CG-SQL-author/
Other
10 stars 3 forks source link

Error in forcing-nonnull-types example #95

Closed mingodad closed 2 months ago

mingodad commented 2 months ago

In https://ricomariani.github.io/CG-SQL-author/docs/user_guide/03_expressions_fundamentals/#forcing-nonnull-types

CREATE PROC square_if_odd(a INT NOT NULL, OUT result INT)
BEGIN
  IF a % 2 = 0 THEN
    SET result := NULL;
  ELSE
    SET result := a * a;
  END IF;
END;

-- `x` has type `INT`, but we know it can't be `NULL`
let x := call square_if_odd(3);

-- `y` has type `INT NOT NULL`
let y := ifnull_crash(x);

Output:

cql0 --in nullable-bug.cql
nullable-bug.cql:11:1: error: syntax error, unexpected CALL
Parse errors found, no further passes will run.

If we remove the call then there is no error.

mingodad commented 2 months ago

That's strange because it should be an error missing parameter or assigning from a procedure that doesn't return anything :

CREATE PROC square_if_odd(a INT NOT NULL, OUT result INT)
BEGIN
  IF a % 2 = 0 THEN
    SET result := NULL;
  ELSE
    SET result := a * a;
  END IF;
END;

-- `x` has type `INT`, but we know it can't be `NULL`
let x := square_if_odd(3);

-- `y` has type `INT NOT NULL`
let y := ifnull_crash(x);

Output:

cql0 --echo --in nullable-bug.cql
PROC square_if_odd (a INT!, OUT result INT)
BEGIN
  IF a % 2 = 0 THEN
    SET result := NULL;
  ELSE
    SET result := a * a;
  END;
END;

LET x := square_if_odd(3);

LET y := ifnull_crash(x);
mingodad commented 2 months ago

Ok I found the explanation for it here https://ricomariani.github.io/CG-SQL-author/docs/user_guide/04_procedures_functions_control_flow/#procedures-as-functions-motivation-and-example, probably adding a link to that example after removing the call would help other people while reading the documentaion.

mingodad commented 2 months ago

Also there is an error in https://ricomariani.github.io/CG-SQL-author/docs/user_guide/03_expressions_fundamentals/#case-expressions-2:

DECLARE PROC printf NO CHECK;
create proc go()
begin
let y := 'yy';
let z := 'z';
DECLARE C CURSOR FOR select case
  when y = 'y' then 1
  when z = 'z' then 2
  else 3
end;
  LOOP FETCH C
  BEGIN
    CALL printf("%s\n", C.da);
  END;
end;
@echo lua, "function printf(...) io.write(cql_printf(...)) end\n";
@echo lua, "go(sqlite3.open_memory())\n";

Output:

code.cql:11:1: error: in str : CQL0055: all columns in the select must have a name
semantic errors present; no code gen.

And then when adding a name I discovered that it doesn't accept that name in an order by clause but sqlite3 does:

DECLARE PROC printf NO CHECK;
create proc go()
begin
let y := 'yy';
let z := 'z';
DECLARE C CURSOR FOR select case
  when y = 'y' then 1
  when z = 'z' then 2
  else 3
end as da order by da;
  LOOP FETCH C
  BEGIN
    CALL printf("%s\n", C.da);
  END;
end;
@echo lua, "function printf(...) io.write(cql_printf(...)) end\n";
@echo lua, "go(sqlite3.open_memory())\n";

Output:

code.cql:10:1: error: in str : CQL0069: name not found 'da'
code.cql:11:1: error: in str : CQL0069: name not found 'C'
semantic errors present; no code gen.
ricomariani commented 2 months ago

Sigh most of these are cut and paste errors. I go and re-verify the samples from time to time but I miss things.

I can fix the examples and add more docs for this.

I'm looking into the orderby thing. Something is fishy. I remember there being an issue here and I don't see it reflected in the code anymore. Maybe I broke something.

mingodad commented 2 months ago

Also looking at https://ricomariani.github.io/CG-SQL-author/docs/user_guide/03_expressions_fundamentals/#select-expressions-1 it seems unfortunate that the CQL also supports these more tolerant forms is not using then to separate the result (consistency is nice) and it can become confusing.

set x_ := (select x from somewhere where id = 1 if nothing or null -1);
ricomariani commented 2 months ago

ok I figured out the order by thing. This issue is that PUSH_JOIN_BLOCK uses a null jptr to indicate that you should stop the search but that also happens if you have an empty from clause. This means that we don't search past the empty from clause to the select columns. This is a little weird because this really can only happen if there is only the one row so it's exceedingly rare that you would sort your one row. This is why we never caught it.

It's easy enough to make a test for this. The fix is to use a sentinel to represent "block" (stop searching) rather than NULL.

There are lots of cases where you want to search a subset of the context hence JOIN_BLOCK.

ricomariani commented 2 months ago

the most common form of "nothing" handlers is:

(select x from somewhere where id = 1 if nothing null);

it could have been (select x from somewhere where id = 1 if nothing then null);

I guess I wasn't feeling wordy that day.

Also there is if nothing throw

I could allow then as an option but I don't want to force a breaking change for this. It was used a lot inside Meta. We actually enforced it because people kept forgetting to handle the nothing case.

mingodad commented 2 months ago

Thank you again for reply ! In this case I only added the order by to test if it accepts an alias name because of the initial error and I know that it's a non sense to sort only one row, but it seems to have surfaced another problem.

ricomariani commented 2 months ago

The call in the first example is straight up wrong. I'm sure I copied the code from a previous version that used call and out variables and didn't remove the call. The idea was to introduce proc as func syntax sooner in the docs and I screwed it up. Sigh.

mingodad commented 2 months ago

Probably on my fork I'll allow/enforce the use of then.

ricomariani commented 2 months ago

The bug in the order by code and join block is righteous if rare. What you did should have worked even though its weird. The aliasing problem I was remembering was fixed another way. That's in there still. I'll sort this all out tomorrow.

ricomariani commented 2 months ago

Probably on my fork I'll allow/enforce the use of then.

I think I will too. It doesn't really cost anything. It's a few grammar productions. We could even change gen_sql.c so it the default. I use cql --echo to normalize input it's a pretty good auto-formatter at this point. It does lose comments though.

ricomariani commented 2 months ago

ok I figured out the order by thing. This issue is that PUSH_JOIN_BLOCK uses a null jptr to indicate that you should stop the search but that also happens if you have an empty from clause. This means that we don't search past the empty from clause to the select columns. This is a little weird because this really can only happen if there is only the one row so it's exceedingly rare that you would sort your one row. This is why we never caught it.

It's easy enough to make a test for this. The fix is to use a sentinel to represent "block" (stop searching) rather than NULL.

There are lots of cases where you want to search a subset of the context hence JOIN_BLOCK.

This has been fixed in https://github.com/ricomariani/CG-SQL-author/commit/e2c1b28a721ed6134e764e067f24764dd9c80766

ricomariani commented 2 months ago

Fixed the other doc things too.

mingodad commented 2 months ago

Doing a search for if nothing on this project folders shows that there is several places that probably need to be updated to use IF NOTHING THEN:

>/home/mingo/local/scite/bin/SciTE -grep ~~~~ "*.c *.cxx *.h *" "if nothing"
CG-SQL-author/docs/developer_guide/03_c_code_generation.md:1549:  * this is the same as the `IF NOTHING THROW` variant of construct, that's the default
CG-SQL-author/docs/developer_guide/03_c_code_generation.md:1565:    IF NOTHING '');
CG-SQL-author/docs/developer_guide/03_c_code_generation.md:1588:There is also the `IF NOTHING OR NULL` variant which is left as an exercise to the reader.
CG-SQL-author/docs/developer_guide/04_testing.md:656:    if nothing null);
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1250:set x_ := (select x from somewhere where id = 1 if nothing -1);
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1257:set x_ := (select x from somewhere where id = 1 if nothing or null -1);
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1272:The `if nothing or null` form above is equivalent to the following, but it is
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1276:set x_ := (select ifnull(x, -1) from somewhere where id = 1 if nothing -1);
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1288:* In `(select ... if nothing)`, the result type is not null if and only if both
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1291:* In `(select ... if nothing or null)`, the result type is not null if and only
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1294:Finally, the form `(select ... if nothing throw)` is allowed; this form is
CG-SQL-author/docs/user_guide/03_expressions_fundamentals.md:1297:even if `@enforce_strict select if nothing` is in force.
CG-SQL-author/docs/user_guide/09_statements_summary_and_error_checking.md:852:  * `SELECT IF NOTHING` indicates `(select ...)` expressions must include an `IF NOTHING` clause if they have a `FROM` part
CG-SQL-author/docs/user_guide/09_statements_summary_and_error_checking.md:993:nullability is computed as the aggregate.  Note that if nothing matches,
CG-SQL-author/docs/user_guide/10_schema_management.md:439:                       WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/docs/user_guide/16_advanced_blob_features.md:143:let b := (select news_info from info where id = id_ if nothing null);
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2950:### CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2952:`@enforce_strict select if nothing` has been enabled.  This means that select expressions must include
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2953:`if nothing throw` (the old default) `if nothing [value]` or `if nothing or null [value]`.  This options exists
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2955:without the `if nothing` options.
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2965:### CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2974:  set x := (select foo from bar where baz if nothing 0);
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2975:  if (select foo from bar where baz if nothing 1) then ... end if;
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2981:  select foo from bar where (select something from somewhere if nothing null);
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2982:  delete from foo where (select something from somewhere if nothing 1);
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:2986:simply doesn't understand if nothing at all. This error makes it so that you'll
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:3060:### CQL0372: SELECT ... IF NOTHING OR NULL NULL is redundant; use SELECT ... IF NOTHING NULL instead.
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:3062:It is always the case that `SELECT ... IF NOTHING OR NULL NULL` is equivalent to `SELECT ... IF NOTHING NULL`. As such, do not do this:
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:3065:select foo from bar where baz if nothing or null null
CG-SQL-author/docs/user_guide/appendices/04_error_codes.md:3071:select foo from bar where baz if nothing null
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:287:-- If nothing matches the cases, the result is null.
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:450:-- You can use IF NOTHING forms to handle other cases such as:
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:453:          if nothing -1);  --> r = -1
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:458:          if nothing or null -1);  --> r = -1
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:460:-- With no IF NOTHING clause, lack of a row will cause the SELECT expression to throw
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:461:-- an exception.  IF NOTHING THROW merely makes this explicit.
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:462:set r := (select r from T1 where id = 2 if nothing throw);  --> will throw
CG-SQL-author/docs/user_guide/appendices/06_cql_in_20_minutes.md:480:  set z := (select r from T1 where id = x if nothing or null -1);
CG-SQL-author/docs/user_guide/appendices/08_best_practices.md:145:purpose if nothing else is serviceable.
CG-SQL-author/playground/examples/cql_in_20_minutes.sql:336:  -- If nothing matches the cases, the result is null.
CG-SQL-author/playground/examples/cql_in_20_minutes.sql:545:  _!("### Use IF NOTHING forms to handle no rows or null\n");
CG-SQL-author/playground/examples/cql_in_20_minutes.sql:551:  EXAMPLE!((select r from T3 where id = 2 if nothing -1));
CG-SQL-author/playground/examples/cql_in_20_minutes.sql:552:  EXAMPLE!((select _null from T3 where id = 1 if nothing -1));
CG-SQL-author/playground/examples/cql_in_20_minutes.sql:553:  EXAMPLE!((select _null from T3 where id = 1 if nothing or null -1));
CG-SQL-author/playground/examples/cql_in_20_minutes.sql:556:  ERROR!((select r from T3 where id = 2 if nothing throw), "-- Merely makes it explicit");
CG-SQL-author/release/cql_amalgam.c:8307:// "Select ... if nothing throw" is exactly the same codegen as regular select. The throwing
CG-SQL-author/release/cql_amalgam.c:8317:// (SELECT ... IF NOTHING ...) forms.  Importantly the result type of the select
CG-SQL-author/release/cql_amalgam.c:8361:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/release/cql_amalgam.c:8374:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real.
CG-SQL-author/release/cql_amalgam.c:8415:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/release/cql_amalgam.c:8427:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/release/cql_amalgam.c:19270:// select if nothing is exactly the same codegen as regular select
CG-SQL-author/release/cql_amalgam.c:19280:// (SELECT ... IF NOTHING ...) forms.  Importantly the result type of the
CG-SQL-author/release/cql_amalgam.c:19325:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/release/cql_amalgam.c:19337:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/release/cql_amalgam.c:19388:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/release/cql_amalgam.c:19399:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/release/cql_amalgam.c:25054:  // We still use the IF NOTHING -1 pattern so that it doesn't produce spurious errors when there is no row, that's not an error.
CG-SQL-author/release/cql_amalgam.c:25061:  bprintf(decls, "    SET _version := (SELECT version FROM %s_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);\n", global_proc_name);
CG-SQL-author/release/cql_amalgam.c:33154:  gen_printf(" IF NOTHING THROW )");
CG-SQL-author/release/cql_amalgam.c:35873:      gen_printf("SELECT IF NOTHING");
CG-SQL-author/release/cql_amalgam.c:36575:  EXPR_INIT(select_if_nothing_throw_expr, gen_expr_select_if_nothing_throw, "IF NOTHING THROW", EXPR_PRI_ROOT);
CG-SQL-author/release/cql_amalgam.c:36576:  EXPR_INIT(select_if_nothing_expr, gen_expr_select_if_nothing, "IF NOTHING", EXPR_PRI_ROOT);
CG-SQL-author/release/cql_amalgam.c:36577:  EXPR_INIT(select_if_nothing_or_null_expr, gen_expr_select_if_nothing, "IF NOTHING OR NULL", EXPR_PRI_ROOT);
CG-SQL-author/release/cql_amalgam.c:41601:  bool_t strict_if_nothing;           // (select ..) expressions must include the if nothing form
CG-SQL-author/release/cql_amalgam.c:48156:// nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/release/cql_amalgam.c:65058:  // this tells us if we might be the left side of a select if nothing
CG-SQL-author/release/cql_amalgam.c:65065:    report_error(parent, "CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML", NULL);
CG-SQL-author/release/cql_amalgam.c:65082:  // For purposes of testing "strict if nothing", a select on the left side of the if nothing
CG-SQL-author/release/cql_amalgam.c:65083:  // operator is in an if nothing context  but the right side is not in an if nothing context.
CG-SQL-author/release/cql_amalgam.c:65085:  // in (select foo from bar if nothing (select baz)) the (select baz) is not in an
CG-SQL-author/release/cql_amalgam.c:65086:  // if nothing context and hence would generate an error if "strict if nothing" is on.
CG-SQL-author/release/cql_amalgam.c:65097:    report_error(ast, "CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'", NULL);
CG-SQL-author/release/cql_amalgam.c:65148:// If nothing throw is exactly the same as a normal select expr
CG-SQL-author/release/cql_amalgam.c:65149:// the only difference is that it is legal inside of strict select if nothing
CG-SQL-author/release/cql_amalgam.c:65159:// Despite the unusual nature of SELECT .. IF NOTHING ... the net semantic rules
CG-SQL-author/release/cql_amalgam.c:65165://   * special case SELECT ... IF NOTHING OR NULL ... is not null if the right are is not null
CG-SQL-author/release/cql_amalgam.c:65194:        report_error(ast, "CQL0372: SELECT ... IF NOTHING OR NULL NULL is redundant; use SELECT ... IF NOTHING NULL instead", NULL);
CG-SQL-author/release/cql_amalgam.c:66671:  EXPR_INIT(select_if_nothing_throw_expr, sem_expr_select_if_nothing_throw, "IF NOTHING THROW");
CG-SQL-author/release/cql_amalgam.c:66672:  EXPR_INIT(select_if_nothing_expr, sem_expr_select_if_nothing, "IF NOTHING");
CG-SQL-author/release/cql_amalgam.c:66673:  EXPR_INIT(select_if_nothing_or_null_expr, sem_expr_select_if_nothing, "IF NOTHING OR NULL");
CG-SQL-author/sources/cg_c.c:2859:// "Select ... if nothing throw" is exactly the same codegen as regular select. The throwing
CG-SQL-author/sources/cg_c.c:2869:// (SELECT ... IF NOTHING ...) forms.  Importantly the result type of the select
CG-SQL-author/sources/cg_c.c:2913:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/cg_c.c:2926:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real.
CG-SQL-author/sources/cg_c.c:2967:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/cg_c.c:2979:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/cg_lua.c:1785:// select if nothing is exactly the same codegen as regular select
CG-SQL-author/sources/cg_lua.c:1795:// (SELECT ... IF NOTHING ...) forms.  Importantly the result type of the
CG-SQL-author/sources/cg_lua.c:1840:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/cg_lua.c:1852:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/cg_lua.c:1903:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/cg_lua.c:1914:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/cg_schema.c:240:  // We still use the IF NOTHING -1 pattern so that it doesn't produce spurious errors when there is no row, that's not an error.
CG-SQL-author/sources/cg_schema.c:247:  bprintf(decls, "    SET _version := (SELECT version FROM %s_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);\n", global_proc_name);
CG-SQL-author/sources/cql.y:1271:  | '(' select_stmt IF NOTHING expr ')'  { $basic_expr = new_ast_select_if_nothing_expr($select_stmt, $expr); }
CG-SQL-author/sources/cql.y:1272:  | '(' select_stmt IF NOTHING THEN expr ')'  { $basic_expr = new_ast_select_if_nothing_expr($select_stmt, $expr); }
CG-SQL-author/sources/cql.y:1273:  | '(' select_stmt IF NOTHING OR NULL_ expr ')'  { $basic_expr = new_ast_select_if_nothing_or_null_expr($select_stmt, $expr); }
CG-SQL-author/sources/cql.y:1274:  | '(' select_stmt IF NOTHING OR NULL_ THEN expr ')'  { $basic_expr = new_ast_select_if_nothing_or_null_expr($select_stmt, $expr); }
CG-SQL-author/sources/cql.y:1275:  | '(' select_stmt IF NOTHING THROW')'  { $basic_expr = new_ast_select_if_nothing_throw_expr($select_stmt); }
CG-SQL-author/sources/cql.y:1276:  | '(' select_stmt IF NOTHING THEN THROW')'  { $basic_expr = new_ast_select_if_nothing_throw_expr($select_stmt); }
CG-SQL-author/sources/cql.y:2527:  | SELECT IF NOTHING { $enforcement_options = new_ast_option(ENFORCE_SELECT_IF_NOTHING); }
CG-SQL-author/sources/find-copy-paste-acl.output.diff:2168:>   EXPR_INIT(select_if_nothing_throw_expr, gen_expr_select_if_nothing_throw, "IF NOTHING THROW", EXPR_PRI_ROOT);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:2169:>   EXPR_INIT(select_if_nothing_expr, gen_expr_select_if_nothing, "IF NOTHING", EXPR_PRI_ROOT);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:2170:>   EXPR_INIT(select_if_nothing_or_null_expr, gen_expr_select_if_nothing, "IF NOTHING OR NULL", EXPR_PRI_ROOT);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:3336:>   EXPR_INIT(select_if_nothing_throw_expr, sem_expr_select_if_nothing_throw, "IF NOTHING THROW");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:3337:>   EXPR_INIT(select_if_nothing_expr, sem_expr_select_if_nothing, "IF NOTHING");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:3338:>   EXPR_INIT(select_if_nothing_or_null_expr, sem_expr_select_if_nothing, "IF NOTHING OR NULL");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:5792:<   EXPR_INIT(select_if_nothing_throw_expr, gen_expr_select_if_nothing_throw, "IF NOTHING THROW", EXPR_PRI_ROOT);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:5793:<   EXPR_INIT(select_if_nothing_expr, gen_expr_select_if_nothing, "IF NOTHING", EXPR_PRI_ROOT);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:5794:<   EXPR_INIT(select_if_nothing_or_null_expr, gen_expr_select_if_nothing, "IF NOTHING OR NULL", EXPR_PRI_ROOT);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:7415:<   EXPR_INIT(select_if_nothing_throw_expr, sem_expr_select_if_nothing_throw, "IF NOTHING THROW");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:7416:<   EXPR_INIT(select_if_nothing_expr, sem_expr_select_if_nothing, "IF NOTHING");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:7417:<   EXPR_INIT(select_if_nothing_or_null_expr, sem_expr_select_if_nothing, "IF NOTHING OR NULL");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:10067:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:10080:<   // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real.
CG-SQL-author/sources/find-copy-paste-acl.output.diff:10106:>   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:10118:>   // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/find-copy-paste-acl.output.diff:11486:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:11498:<   // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/find-copy-paste-acl.output.diff:11524:>   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:11535:>   // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/find-copy-paste-acl.output.diff:15219:<       gen_printf("SELECT IF NOTHING");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:17815:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:17831:>   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:17864:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:17881:>   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:21916:<   // We still use the IF NOTHING -1 pattern so that it doesn't produce spurious errors when there is no row, that's not an error.
CG-SQL-author/sources/find-copy-paste-acl.output.diff:29331:< // "Select ... if nothing throw" is exactly the same codegen as regular select. The throwing
CG-SQL-author/sources/find-copy-paste-acl.output.diff:31917:<   bprintf(decls, "    SET _version := (SELECT version FROM %s_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);\n", global_proc_name);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:44655:< // select if nothing is exactly the same codegen as regular select
CG-SQL-author/sources/find-copy-paste-acl.output.diff:62431:>   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:66397:>   | SELECT IF NOTHING { $enforcement_options = new_ast_option(ENFORCE_SELECT_IF_NOTHING); }
CG-SQL-author/sources/find-copy-paste-acl.output.diff:72487:> // If nothing throw is exactly the same as a normal select expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:72488:> // the only difference is that it is legal inside of strict select if nothing
CG-SQL-author/sources/find-copy-paste-acl.output.diff:72757:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:73951:> // "Select ... if nothing throw" is exactly the same codegen as regular select. The throwing
CG-SQL-author/sources/find-copy-paste-acl.output.diff:74951:>   gen_printf(" IF NOTHING THROW )");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:75671:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:78601:>   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:89560:>   | '(' select_stmt IF NOTHING expr ')'  { $basic_expr = new_ast_select_if_nothing_expr($select_stmt, $expr); }
CG-SQL-author/sources/find-copy-paste-acl.output.diff:93954:> // nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/find-copy-paste-acl.output.diff:95049:> // nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/find-copy-paste-acl.output.diff:95368:> // select if nothing is exactly the same codegen as regular select
CG-SQL-author/sources/find-copy-paste-acl.output.diff:96593:>   | '(' select_stmt IF NOTHING expr ')'  { $basic_expr = new_ast_select_if_nothing_expr($select_stmt, $expr); }
CG-SQL-author/sources/find-copy-paste-acl.output.diff:96949:< // nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/find-copy-paste-acl.output.diff:107291:<   gen_printf(" IF NOTHING THROW )");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:108593:>   bprintf(decls, "    SET _version := (SELECT version FROM %s_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);\n", global_proc_name);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:109474:> // If nothing throw is exactly the same as a normal select expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:109475:> // the only difference is that it is legal inside of strict select if nothing
CG-SQL-author/sources/find-copy-paste-acl.output.diff:113216:>   bprintf(decls, "    SET _version := (SELECT version FROM %s_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);\n", global_proc_name);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:120452:> // Despite the unusual nature of SELECT .. IF NOTHING ... the net semantic rules
CG-SQL-author/sources/find-copy-paste-acl.output.diff:120458:> //   * special case SELECT ... IF NOTHING OR NULL ... is not null if the right are is not null
CG-SQL-author/sources/find-copy-paste-acl.output.diff:124357:> // Despite the unusual nature of SELECT .. IF NOTHING ... the net semantic rules
CG-SQL-author/sources/find-copy-paste-acl.output.diff:124363:> //   * special case SELECT ... IF NOTHING OR NULL ... is not null if the right are is not null
CG-SQL-author/sources/find-copy-paste-acl.output.diff:124955:> // nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/find-copy-paste-acl.output.diff:130709:<   gen_printf(" IF NOTHING THROW )");
CG-SQL-author/sources/find-copy-paste-acl.output.diff:131696:>   | '(' select_stmt IF NOTHING THROW')'  { $basic_expr = new_ast_select_if_nothing_throw_expr($select_stmt); }
CG-SQL-author/sources/find-copy-paste-acl.output.diff:131835:< // (SELECT ... IF NOTHING ...) forms.  Importantly the result type of the select
CG-SQL-author/sources/find-copy-paste-acl.output.diff:134643:> // Despite the unusual nature of SELECT .. IF NOTHING ... the net semantic rules
CG-SQL-author/sources/find-copy-paste-acl.output.diff:134649:> //   * special case SELECT ... IF NOTHING OR NULL ... is not null if the right are is not null
CG-SQL-author/sources/find-copy-paste-acl.output.diff:135397:>     report_error(parent, "CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML", NULL);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:136109:>     report_error(ast, "CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'", NULL);
CG-SQL-author/sources/find-copy-paste-acl.output.diff:141141:> // nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/find-copy-paste-acl.output.diff:141671:> // nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/find-copy-paste-acl.output.diff:149046:< // "Select ... if nothing throw" is exactly the same codegen as regular select. The throwing
CG-SQL-author/sources/find-copy-paste-acl.output.diff:150677:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:151118:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:151786:<   | SELECT IF NOTHING { $enforcement_options = new_ast_option(ENFORCE_SELECT_IF_NOTHING); }
CG-SQL-author/sources/find-copy-paste-acl.output.diff:152980:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/find-copy-paste-acl.output.diff:154164:<   // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/gen_sql.c:2149:  gen_printf(" IF NOTHING THEN THROW )");
CG-SQL-author/sources/gen_sql.c:4868:      gen_printf("SELECT IF NOTHING");
CG-SQL-author/sources/gen_sql.c:5570:  EXPR_INIT(select_if_nothing_throw_expr, gen_expr_select_if_nothing_throw, "IF NOTHING THEN THROW", EXPR_PRI_ROOT);
CG-SQL-author/sources/gen_sql.c:5571:  EXPR_INIT(select_if_nothing_expr, gen_expr_select_if_nothing, "IF NOTHING THEN", EXPR_PRI_ROOT);
CG-SQL-author/sources/gen_sql.c:5572:  EXPR_INIT(select_if_nothing_or_null_expr, gen_expr_select_if_nothing, "IF NOTHING OR NULL THEN", EXPR_PRI_ROOT);
CG-SQL-author/sources/sem.c:297:  bool_t strict_if_nothing;           // (select ..) expressions must include the if nothing form
CG-SQL-author/sources/sem.c:6886:// nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/sem.c:23788:  // this tells us if we might be the left side of a select if nothing
CG-SQL-author/sources/sem.c:23795:    report_error(parent, "CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML", NULL);
CG-SQL-author/sources/sem.c:23812:  // For purposes of testing "strict if nothing", a select on the left side of the if nothing
CG-SQL-author/sources/sem.c:23813:  // operator is in an if nothing context  but the right side is not in an if nothing context.
CG-SQL-author/sources/sem.c:23815:  // in (select foo from bar if nothing (select baz)) the (select baz) is not in an
CG-SQL-author/sources/sem.c:23816:  // if nothing context and hence would generate an error if "strict if nothing" is on.
CG-SQL-author/sources/sem.c:23827:    report_error(ast, "CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'", NULL);
CG-SQL-author/sources/sem.c:23878:// If nothing throw is exactly the same as a normal select expr
CG-SQL-author/sources/sem.c:23879:// the only difference is that it is legal inside of strict select if nothing
CG-SQL-author/sources/sem.c:23889:// Despite the unusual nature of SELECT .. IF NOTHING ... the net semantic rules
CG-SQL-author/sources/sem.c:23895://   * special case SELECT ... IF NOTHING OR NULL ... is not null if the right are is not null
CG-SQL-author/sources/sem.c:23924:        report_error(ast, "CQL0372: SELECT ... IF NOTHING OR NULL NULL is redundant; use SELECT ... IF NOTHING NULL instead", NULL);
CG-SQL-author/sources/sem.c:25401:  EXPR_INIT(select_if_nothing_throw_expr, sem_expr_select_if_nothing_throw, "IF NOTHING THROW");
CG-SQL-author/sources/sem.c:25402:  EXPR_INIT(select_if_nothing_expr, sem_expr_select_if_nothing, "IF NOTHING");
CG-SQL-author/sources/sem.c:25403:  EXPR_INIT(select_if_nothing_or_null_expr, sem_expr_select_if_nothing, "IF NOTHING OR NULL");
CG-SQL-author/sources/cql-verify/cql-verify.c:320:    WHERE rowid = last_rowid IF NOTHING FALSE );
CG-SQL-author/sources/cql-verify/cql-verify.c:411:    LIMIT 1 IF NOTHING 0 );
CG-SQL-author/sources/cql-verify/cql-verify.sql:117:      if nothing false);
CG-SQL-author/sources/cql-verify/cql-verify.sql:144:    if nothing 0);
CG-SQL-author/sources/out/__temp.c:27959:    LET z := ( SELECT 1 AS z IF NOTHING 1 );
CG-SQL-author/sources/out/__temp.c:28045:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL 1 );
CG-SQL-author/sources/out/__temp.c:32297:    FROM bar IF NOTHING -1 );
CG-SQL-author/sources/out/__temp.c:32335:    FROM bar IF NOTHING THROW );
CG-SQL-author/sources/out/__temp.c:32363:    FROM bar IF NOTHING OR NULL -1 );
CG-SQL-author/sources/out/__temp.c:32405:    FROM bar IF NOTHING "" );
CG-SQL-author/sources/out/__temp.c:32443:    FROM bar IF NOTHING OR NULL "garbonzo" );
CG-SQL-author/sources/out/cg_test_c.c:17151:    LET z := ( SELECT 1 AS z IF NOTHING 1 );
CG-SQL-author/sources/out/cg_test_c.c:17205:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL 1 );
CG-SQL-author/sources/out/cg_test_c.c:19872:    FROM bar IF NOTHING -1 );
CG-SQL-author/sources/out/cg_test_c.c:19893:    FROM bar IF NOTHING THROW );
CG-SQL-author/sources/out/cg_test_c.c:19909:    FROM bar IF NOTHING OR NULL -1 );
CG-SQL-author/sources/out/cg_test_c.c:19932:    FROM bar IF NOTHING "" );
CG-SQL-author/sources/out/cg_test_c.c:19953:    FROM bar IF NOTHING OR NULL "garbonzo" );
CG-SQL-author/sources/out/cg_test_c_with_header.c:17151:    LET z := ( SELECT 1 AS z IF NOTHING 1 );
CG-SQL-author/sources/out/cg_test_c_with_header.c:17205:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL 1 );
CG-SQL-author/sources/out/cg_test_c_with_header.c:19872:    FROM bar IF NOTHING -1 );
CG-SQL-author/sources/out/cg_test_c_with_header.c:19893:    FROM bar IF NOTHING THROW );
CG-SQL-author/sources/out/cg_test_c_with_header.c:19909:    FROM bar IF NOTHING OR NULL -1 );
CG-SQL-author/sources/out/cg_test_c_with_header.c:19932:    FROM bar IF NOTHING "" );
CG-SQL-author/sources/out/cg_test_c_with_header.c:19953:    FROM bar IF NOTHING OR NULL "garbonzo" );
CG-SQL-author/sources/out/cg_test_c_with_namespace.c:17151:    LET z := ( SELECT 1 AS z IF NOTHING 1 );
CG-SQL-author/sources/out/cg_test_c_with_namespace.c:17205:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL 1 );
CG-SQL-author/sources/out/cg_test_c_with_namespace.c:19872:    FROM bar IF NOTHING -1 );
CG-SQL-author/sources/out/cg_test_c_with_namespace.c:19893:    FROM bar IF NOTHING THROW );
CG-SQL-author/sources/out/cg_test_c_with_namespace.c:19909:    FROM bar IF NOTHING OR NULL -1 );
CG-SQL-author/sources/out/cg_test_c_with_namespace.c:19932:    FROM bar IF NOTHING "" );
CG-SQL-author/sources/out/cg_test_c_with_namespace.c:19953:    FROM bar IF NOTHING OR NULL "garbonzo" );
CG-SQL-author/sources/out/cg_test_lua.lua:8635:    LET z := ( SELECT 1 AS z IF NOTHING 1 );
CG-SQL-author/sources/out/cg_test_lua.lua:8679:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL 1 );
CG-SQL-author/sources/out/cg_test_lua.lua:10683:    FROM bar IF NOTHING -1 );
CG-SQL-author/sources/out/cg_test_lua.lua:10703:    FROM bar IF NOTHING THROW );
CG-SQL-author/sources/out/cg_test_lua.lua:10719:    FROM bar IF NOTHING OR NULL -1 );
CG-SQL-author/sources/out/cg_test_lua.lua:10742:    FROM bar IF NOTHING "" );
CG-SQL-author/sources/out/cg_test_lua.lua:10762:    FROM bar IF NOTHING OR NULL "garbonzo" );
CG-SQL-author/sources/out/cg_test_schema_min_version_upgrade.out:428:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/cg_test_schema_partial_upgrade.c:172:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/cg_test_schema_partial_upgrade.out:183:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/cg_test_schema_upgrade.c:256:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/cg_test_schema_upgrade.out:428:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/cql.y.output:515:  405           | '(' select_stmt IF NOTHING expr ')'
CG-SQL-author/sources/out/cql.y.output:516:  406           | '(' select_stmt IF NOTHING OR "NULL" expr ')'
CG-SQL-author/sources/out/cql.y.output:517:  407           | '(' select_stmt IF NOTHING THROW ')'
CG-SQL-author/sources/out/cql.y.output:1186:  888                    | SELECT IF NOTHING
CG-SQL-author/sources/out/cql.y.output:5417:  405           | '(' . select_stmt IF NOTHING expr ')'
CG-SQL-author/sources/out/cql.y.output:5418:  406           | '(' . select_stmt IF NOTHING OR "NULL" expr ')'
CG-SQL-author/sources/out/cql.y.output:5419:  407           | '(' . select_stmt IF NOTHING THROW ')'
CG-SQL-author/sources/out/cql.y.output:9589:  888 enforcement_options: SELECT . IF NOTHING
CG-SQL-author/sources/out/cql.y.output:9830:  405           | '(' select_stmt . IF NOTHING expr ')'
CG-SQL-author/sources/out/cql.y.output:9831:  406           | '(' select_stmt . IF NOTHING OR "NULL" expr ')'
CG-SQL-author/sources/out/cql.y.output:9832:  407           | '(' select_stmt . IF NOTHING THROW ')'
CG-SQL-author/sources/out/cql.y.output:24622:  888 enforcement_options: SELECT IF NOTHING .
CG-SQL-author/sources/out/cql.y.output:24984:  405 basic_expr: '(' select_stmt IF NOTHING . expr ')'
CG-SQL-author/sources/out/cql.y.output:24985:  406           | '(' select_stmt IF NOTHING . OR "NULL" expr ')'
CG-SQL-author/sources/out/cql.y.output:24986:  407           | '(' select_stmt IF NOTHING . THROW ')'
CG-SQL-author/sources/out/cql.y.output:28363:  406 basic_expr: '(' select_stmt IF NOTHING OR . "NULL" expr ')'
CG-SQL-author/sources/out/cql.y.output:28370:  407 basic_expr: '(' select_stmt IF NOTHING THROW . ')'
CG-SQL-author/sources/out/cql.y.output:28377:  405 basic_expr: '(' select_stmt IF NOTHING expr . ')'
CG-SQL-author/sources/out/cql.y.output:31070:  406 basic_expr: '(' select_stmt IF NOTHING OR "NULL" . expr ')'
CG-SQL-author/sources/out/cql.y.output:31147:  407 basic_expr: '(' select_stmt IF NOTHING THROW ')' .
CG-SQL-author/sources/out/cql.y.output:31154:  405 basic_expr: '(' select_stmt IF NOTHING expr ')' .
CG-SQL-author/sources/out/cql.y.output:32971:  406 basic_expr: '(' select_stmt IF NOTHING OR "NULL" expr . ')'
CG-SQL-author/sources/out/cql.y.output:34303:  406 basic_expr: '(' select_stmt IF NOTHING OR "NULL" expr ')' .
CG-SQL-author/sources/out/cql_amalgam.c:8310:// "Select ... if nothing throw" is exactly the same codegen as regular select. The throwing
CG-SQL-author/sources/out/cql_amalgam.c:8320:// (SELECT ... IF NOTHING ...) forms.  Importantly the result type of the select
CG-SQL-author/sources/out/cql_amalgam.c:8364:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/out/cql_amalgam.c:8377:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real.
CG-SQL-author/sources/out/cql_amalgam.c:8418:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/out/cql_amalgam.c:8430:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/out/cql_amalgam.c:19273:// select if nothing is exactly the same codegen as regular select
CG-SQL-author/sources/out/cql_amalgam.c:19283:// (SELECT ... IF NOTHING ...) forms.  Importantly the result type of the
CG-SQL-author/sources/out/cql_amalgam.c:19328:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/out/cql_amalgam.c:19340:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/out/cql_amalgam.c:19391:  // SELECT [select_opts] [select_expr_list_con] IF NOTHING expr
CG-SQL-author/sources/out/cql_amalgam.c:19402:  // e.g. (select an_int from somewhere if nothing 2.5), the overall result is real
CG-SQL-author/sources/out/cql_amalgam.c:25057:  // We still use the IF NOTHING -1 pattern so that it doesn't produce spurious errors when there is no row, that's not an error.
CG-SQL-author/sources/out/cql_amalgam.c:25064:  bprintf(decls, "    SET _version := (SELECT version FROM %s_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);\n", global_proc_name);
CG-SQL-author/sources/out/cql_amalgam.c:33157:  gen_printf(" IF NOTHING THROW )");
CG-SQL-author/sources/out/cql_amalgam.c:35876:      gen_printf("SELECT IF NOTHING");
CG-SQL-author/sources/out/cql_amalgam.c:36578:  EXPR_INIT(select_if_nothing_throw_expr, gen_expr_select_if_nothing_throw, "IF NOTHING THROW", EXPR_PRI_ROOT);
CG-SQL-author/sources/out/cql_amalgam.c:36579:  EXPR_INIT(select_if_nothing_expr, gen_expr_select_if_nothing, "IF NOTHING", EXPR_PRI_ROOT);
CG-SQL-author/sources/out/cql_amalgam.c:36580:  EXPR_INIT(select_if_nothing_or_null_expr, gen_expr_select_if_nothing, "IF NOTHING OR NULL", EXPR_PRI_ROOT);
CG-SQL-author/sources/out/cql_amalgam.c:41604:  bool_t strict_if_nothing;           // (select ..) expressions must include the if nothing form
CG-SQL-author/sources/out/cql_amalgam.c:48159:// nullability is computed as the aggregate. Note that if nothing matches, the
CG-SQL-author/sources/out/cql_amalgam.c:65061:  // this tells us if we might be the left side of a select if nothing
CG-SQL-author/sources/out/cql_amalgam.c:65068:    report_error(parent, "CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML", NULL);
CG-SQL-author/sources/out/cql_amalgam.c:65085:  // For purposes of testing "strict if nothing", a select on the left side of the if nothing
CG-SQL-author/sources/out/cql_amalgam.c:65086:  // operator is in an if nothing context  but the right side is not in an if nothing context.
CG-SQL-author/sources/out/cql_amalgam.c:65088:  // in (select foo from bar if nothing (select baz)) the (select baz) is not in an
CG-SQL-author/sources/out/cql_amalgam.c:65089:  // if nothing context and hence would generate an error if "strict if nothing" is on.
CG-SQL-author/sources/out/cql_amalgam.c:65100:    report_error(ast, "CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'", NULL);
CG-SQL-author/sources/out/cql_amalgam.c:65151:// If nothing throw is exactly the same as a normal select expr
CG-SQL-author/sources/out/cql_amalgam.c:65152:// the only difference is that it is legal inside of strict select if nothing
CG-SQL-author/sources/out/cql_amalgam.c:65162:// Despite the unusual nature of SELECT .. IF NOTHING ... the net semantic rules
CG-SQL-author/sources/out/cql_amalgam.c:65168://   * special case SELECT ... IF NOTHING OR NULL ... is not null if the right are is not null
CG-SQL-author/sources/out/cql_amalgam.c:65197:        report_error(ast, "CQL0372: SELECT ... IF NOTHING OR NULL NULL is redundant; use SELECT ... IF NOTHING NULL instead", NULL);
CG-SQL-author/sources/out/cql_amalgam.c:66674:  EXPR_INIT(select_if_nothing_throw_expr, sem_expr_select_if_nothing_throw, "IF NOTHING THROW");
CG-SQL-author/sources/out/cql_amalgam.c:66675:  EXPR_INIT(select_if_nothing_expr, sem_expr_select_if_nothing, "IF NOTHING");
CG-SQL-author/sources/out/cql_amalgam.c:66676:  EXPR_INIT(select_if_nothing_or_null_expr, sem_expr_select_if_nothing, "IF NOTHING OR NULL");
CG-SQL-author/sources/out/generated_upgrade0.c:283:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/generated_upgrade1.c:285:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/generated_upgrade2.c:288:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/generated_upgrade3.c:289:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/generated_upgrade4.c:345:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/generated_upgrade_test.cql:183:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/generated_upgrader0.sql:122:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/generated_upgrader1.sql:139:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/generated_upgrader2.sql:141:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/generated_upgrader3.sql:161:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/generated_upgrader4.sql:183:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/lua_schema_upgrade0.lua:35:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/lua_schema_upgrade0.sql:122:    SET _version := (SELECT version FROM lua_upgrade_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/lua_schema_upgrade1.lua:35:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/lua_schema_upgrade1.sql:139:    SET _version := (SELECT version FROM lua_upgrade_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/lua_schema_upgrade2.lua:35:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/lua_schema_upgrade2.sql:141:    SET _version := (SELECT version FROM lua_upgrade_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/lua_schema_upgrade3.lua:35:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/lua_schema_upgrade3.sql:161:    SET _version := (SELECT version FROM lua_upgrade_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/out/lua_schema_upgrade4.lua:35:      LIMIT 1 IF NOTHING -1 );
CG-SQL-author/sources/out/lua_schema_upgrade4.sql:183:    SET _version := (SELECT version FROM lua_upgrade_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/test/cg_test.sql:3749:set i0_nullable := (select type from bar if nothing -1);
CG-SQL-author/sources/test/cg_test.sql:3751:-- TEST: normal code gen for if nothing throw
CG-SQL-author/sources/test/cg_test.sql:3753:-- + FROM bar IF NOTHING THEN THROW );
CG-SQL-author/sources/test/cg_test.sql:3760:set i0_nullable := (select type from bar if nothing throw);
CG-SQL-author/sources/test/cg_test.sql:3772:set i2 := (select type from bar if nothing or null -1);
CG-SQL-author/sources/test/cg_test.sql:3783:set t0_nullable := (select name from bar if nothing "");
CG-SQL-author/sources/test/cg_test.sql:3795:set t2 := (select name from bar if nothing or null "garbonzo");
CG-SQL-author/sources/test/cg_test.sql:5750:-- TEST: in_loop variation of select expression if nothing case
CG-SQL-author/sources/test/cg_test.sql:5757:     let z := (select 1 z if nothing 1);
CG-SQL-author/sources/test/cg_test.sql:5761:-- TEST: in_loop variation of select expression if nothing or null case
CG-SQL-author/sources/test/cg_test.sql:5768:     let z := (select 1 z if nothing or null 1);
CG-SQL-author/sources/test/cg_test_c.c.ref:17151:    LET z := ( SELECT 1 AS z IF NOTHING THEN 1 );
CG-SQL-author/sources/test/cg_test_c.c.ref:17205:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL THEN 1 );
CG-SQL-author/sources/test/cg_test_c.c.ref:19872:    FROM bar IF NOTHING THEN -1 );
CG-SQL-author/sources/test/cg_test_c.c.ref:19893:    FROM bar IF NOTHING THEN THROW );
CG-SQL-author/sources/test/cg_test_c.c.ref:19909:    FROM bar IF NOTHING OR NULL THEN -1 );
CG-SQL-author/sources/test/cg_test_c.c.ref:19932:    FROM bar IF NOTHING THEN "" );
CG-SQL-author/sources/test/cg_test_c.c.ref:19953:    FROM bar IF NOTHING OR NULL THEN "garbonzo" );
CG-SQL-author/sources/test/cg_test_c_with_header.c.ref:17151:    LET z := ( SELECT 1 AS z IF NOTHING THEN 1 );
CG-SQL-author/sources/test/cg_test_c_with_header.c.ref:17205:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL THEN 1 );
CG-SQL-author/sources/test/cg_test_c_with_header.c.ref:19872:    FROM bar IF NOTHING THEN -1 );
CG-SQL-author/sources/test/cg_test_c_with_header.c.ref:19893:    FROM bar IF NOTHING THEN THROW );
CG-SQL-author/sources/test/cg_test_c_with_header.c.ref:19909:    FROM bar IF NOTHING OR NULL THEN -1 );
CG-SQL-author/sources/test/cg_test_c_with_header.c.ref:19932:    FROM bar IF NOTHING THEN "" );
CG-SQL-author/sources/test/cg_test_c_with_header.c.ref:19953:    FROM bar IF NOTHING OR NULL THEN "garbonzo" );
CG-SQL-author/sources/test/cg_test_c_with_namespace.c.ref:17151:    LET z := ( SELECT 1 AS z IF NOTHING THEN 1 );
CG-SQL-author/sources/test/cg_test_c_with_namespace.c.ref:17205:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL THEN 1 );
CG-SQL-author/sources/test/cg_test_c_with_namespace.c.ref:19872:    FROM bar IF NOTHING THEN -1 );
CG-SQL-author/sources/test/cg_test_c_with_namespace.c.ref:19893:    FROM bar IF NOTHING THEN THROW );
CG-SQL-author/sources/test/cg_test_c_with_namespace.c.ref:19909:    FROM bar IF NOTHING OR NULL THEN -1 );
CG-SQL-author/sources/test/cg_test_c_with_namespace.c.ref:19932:    FROM bar IF NOTHING THEN "" );
CG-SQL-author/sources/test/cg_test_c_with_namespace.c.ref:19953:    FROM bar IF NOTHING OR NULL THEN "garbonzo" );
CG-SQL-author/sources/test/cg_test_lua.lua.ref:8635:    LET z := ( SELECT 1 AS z IF NOTHING THEN 1 );
CG-SQL-author/sources/test/cg_test_lua.lua.ref:8679:    LET z := ( SELECT 1 AS z IF NOTHING OR NULL THEN 1 );
CG-SQL-author/sources/test/cg_test_lua.lua.ref:10683:    FROM bar IF NOTHING THEN -1 );
CG-SQL-author/sources/test/cg_test_lua.lua.ref:10703:    FROM bar IF NOTHING THEN THROW );
CG-SQL-author/sources/test/cg_test_lua.lua.ref:10719:    FROM bar IF NOTHING OR NULL THEN -1 );
CG-SQL-author/sources/test/cg_test_lua.lua.ref:10742:    FROM bar IF NOTHING THEN "" );
CG-SQL-author/sources/test/cg_test_lua.lua.ref:10762:    FROM bar IF NOTHING OR NULL THEN "garbonzo" );
CG-SQL-author/sources/test/cg_test_lua.sql:3674:set i0_nullable := (select type from bar if nothing -1);
CG-SQL-author/sources/test/cg_test_lua.sql:3676:-- TEST: normal code gen for if nothing throw
CG-SQL-author/sources/test/cg_test_lua.sql:3682:set i0_nullable := (select type from bar if nothing throw);
CG-SQL-author/sources/test/cg_test_lua.sql:3693:set i2 := (select type from bar if nothing or null -1);
CG-SQL-author/sources/test/cg_test_lua.sql:3702:set t0_nullable := (select name from bar if nothing "");
CG-SQL-author/sources/test/cg_test_lua.sql:3715:set t2 := (select name from bar if nothing or null "garbonzo");
CG-SQL-author/sources/test/cg_test_lua.sql:5172:-- TEST: in_loop variation of select expression if nothing case
CG-SQL-author/sources/test/cg_test_lua.sql:5179:     let z := (select 1 z if nothing 1);
CG-SQL-author/sources/test/cg_test_lua.sql:5183:-- TEST: in_loop variation of select expression if nothing or null case
CG-SQL-author/sources/test/cg_test_lua.sql:5190:     let z := (select 1 z if nothing or null 1);
CG-SQL-author/sources/test/cg_test_schema_min_version_upgrade.out.ref:428:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/test/cg_test_schema_partial_upgrade.out.ref:183:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/test/cg_test_schema_upgrade.out.ref:428:    SET _version := (SELECT version FROM test_cql_schema_facets WHERE facet = _facet LIMIT 1 IF NOTHING -1);
CG-SQL-author/sources/test/run_test.sql:3798:  t1 := (select t from tdata if nothing "nothing");
CG-SQL-author/sources/test/run_test.sql:3802:  set `value one` := (select v from tdata if nothing -1);
CG-SQL-author/sources/test/run_test.sql:3806:  t1 := (select t from tdata if nothing "nothing");
CG-SQL-author/sources/test/run_test.sql:3809:  set `value one` := (select v from tdata if nothing -1);
CG-SQL-author/sources/test/run_test.sql:3812:  t1 := (select t from tdata if nothing or null "still nothing");
CG-SQL-author/sources/test/run_test.sql:3816:  set `value one` := (select v from tdata where id == 2 if nothing or null -1);
CG-SQL-author/sources/test/run_test.sql:3881:  bar := (select foo from simple_rc_table where id == id_ if nothing "bar");
CG-SQL-author/sources/test/run_test.sql:3887:  bar := (select foo from simple_rc_table where id == id_ if nothing throw);
CG-SQL-author/sources/test/sem_test.err.ref:1306:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1307:test/sem_test.sql:XXXX:1: error: in select_if_nothing_or_null_expr : CQL0372: SELECT ... IF NOTHING OR NULL NULL is redundant; use SELECT ... IF NOTHING NULL instead
CG-SQL-author/sources/test/sem_test.err.ref:1308:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1309:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1310:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1311:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1312:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1313:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1314:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1315:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.err.ref:1318:test/sem_test.sql:XXXX:1: error: in select_if_nothing_or_null_expr : CQL0009: incompatible types in expression 'IF NOTHING OR NULL'
CG-SQL-author/sources/test/sem_test.err.ref:1319:test/sem_test.sql:XXXX:1: error: in str : CQL0003: right operand cannot be an object in 'IF NOTHING OR NULL'
CG-SQL-author/sources/test/sem_test.err.ref:1322:test/sem_test.sql:XXXX:1: error: in select_if_nothing_expr : CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML
CG-SQL-author/sources/test/sem_test.err.ref:1323:test/sem_test.sql:XXXX:1: error: in select_if_nothing_expr : CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML
CG-SQL-author/sources/test/sem_test.out.ref:59829:@ENFORCE_STRICT SELECT IF NOTHING;
CG-SQL-author/sources/test/sem_test.out.ref:59839:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:59895:SET price_d := ( SELECT 1 IF NOTHING THEN -1 );
CG-SQL-author/sources/test/sem_test.out.ref:59919:SET price_d := ( SELECT 1 IF NOTHING OR NULL THEN -1 );
CG-SQL-author/sources/test/sem_test.out.ref:59943:SET price_d := ( SELECT 1 IF NOTHING OR NULL THEN NULL );
CG-SQL-author/sources/test/sem_test.out.ref:59945:test/sem_test.sql:XXXX:1: error: in select_if_nothing_or_null_expr : CQL0372: SELECT ... IF NOTHING OR NULL NULL is redundant; use SELECT ... IF NOTHING NULL instead
CG-SQL-author/sources/test/sem_test.out.ref:59968:SET price_d := ( SELECT 1 IF NOTHING OR NULL THEN ( SELECT NULL OR 1 ) );
CG-SQL-author/sources/test/sem_test.out.ref:60006:SET price_d := ( SELECT 1 IF NOTHING THEN ( SELECT id
CG-SQL-author/sources/test/sem_test.out.ref:60009:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60048:SET price_d := ( SELECT 1 IF NOTHING THEN ( SELECT 1 ) );
CG-SQL-author/sources/test/sem_test.out.ref:60085:  FROM foo IF NOTHING THEN THROW );
CG-SQL-author/sources/test/sem_test.out.ref:60345:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60384:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60424:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60464:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60503:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60545:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60631:test/sem_test.sql:XXXX:1: error: in select_stmt : CQL0368: strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.out.ref:60670:@ENFORCE_NORMAL SELECT IF NOTHING;
CG-SQL-author/sources/test/sem_test.out.ref:60677:SET price_d := ( SELECT 1 IF NOTHING THEN 2.0 );
CG-SQL-author/sources/test/sem_test.out.ref:60700:SET price_d := ( SELECT 3.0 IF NOTHING THEN 4 );
CG-SQL-author/sources/test/sem_test.out.ref:60723:SET price_d := ( SELECT 3.0 IF NOTHING THEN price_e );
CG-SQL-author/sources/test/sem_test.out.ref:60748:SET my_real := ( SELECT price_d IF NOTHING THEN price_e );
CG-SQL-author/sources/test/sem_test.out.ref:60773:SET price_d := ( SELECT "x" IF NOTHING OR NULL THEN price_e );
CG-SQL-author/sources/test/sem_test.out.ref:60775:test/sem_test.sql:XXXX:1: error: in select_if_nothing_or_null_expr : CQL0009: incompatible types in expression 'IF NOTHING OR NULL'
CG-SQL-author/sources/test/sem_test.out.ref:60798:SET price_d := ( SELECT "x" IF NOTHING OR NULL THEN obj_var );
CG-SQL-author/sources/test/sem_test.out.ref:60800:test/sem_test.sql:XXXX:1: error: in str : CQL0003: right operand cannot be an object in 'IF NOTHING OR NULL'
CG-SQL-author/sources/test/sem_test.out.ref:60833:SET real_nn := ( SELECT my_real IF NOTHING OR NULL THEN 1.0 );
CG-SQL-author/sources/test/sem_test.out.ref:60856:SET real_nn := ( SELECT my_real IF NOTHING THEN 1.0 );
CG-SQL-author/sources/test/sem_test.out.ref:60881:SET real_nn := ( SELECT NOT 'x' IF NOTHING THEN 1.0 );
CG-SQL-author/sources/test/sem_test.out.ref:60907:SELECT ( SELECT 0 IF NOTHING THEN -1 );
CG-SQL-author/sources/test/sem_test.out.ref:60909:test/sem_test.sql:XXXX:1: error: in select_if_nothing_expr : CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML
CG-SQL-author/sources/test/sem_test.out.ref:60944:DELETE FROM foo WHERE id = ( SELECT 33 IF NOTHING THEN 0 );
CG-SQL-author/sources/test/sem_test.out.ref:60946:test/sem_test.sql:XXXX:1: error: in select_if_nothing_expr : CQL0369: (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML
CG-SQL-author/sources/test/sem_test.sql:16284:-- TEST: strict if nothing
CG-SQL-author/sources/test/sem_test.sql:16287:@enforce_strict select if nothing;
CG-SQL-author/sources/test/sem_test.sql:16292:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16297:-- TEST: nested select in SQL (e.g. correlated subquery) is ok even in strict select if nothing mode
CG-SQL-author/sources/test/sem_test.sql:16303:-- TEST: select if nothing is allowed
CG-SQL-author/sources/test/sem_test.sql:16305:set price_d := (select 1 if nothing -1);
CG-SQL-author/sources/test/sem_test.sql:16307:-- TEST: select if nothing or null is allowed
CG-SQL-author/sources/test/sem_test.sql:16309:set price_d := (select 1 if nothing or null -1);
CG-SQL-author/sources/test/sem_test.sql:16314:-- * error: % SELECT ... IF NOTHING OR NULL NULL is redundant; use SELECT ... IF NOTHING NULL instead
CG-SQL-author/sources/test/sem_test.sql:16316:set price_d := (select 1 if nothing or null null);
CG-SQL-author/sources/test/sem_test.sql:16321:set price_d := (select 1 if nothing or null (select null or 1));
CG-SQL-author/sources/test/sem_test.sql:16326:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16328:set price_d := (select 1 if nothing (select id from foo));
CG-SQL-author/sources/test/sem_test.sql:16332:set price_d := (select 1 if nothing (select 1));
CG-SQL-author/sources/test/sem_test.sql:16334:-- TEST: explicit if nothing throw is ok
CG-SQL-author/sources/test/sem_test.sql:16337:set price_d := (select id from foo if nothing throw);
CG-SQL-author/sources/test/sem_test.sql:16339:--- TEST: IF NOTHING requirement not enforced for built-in aggregate function - count
CG-SQL-author/sources/test/sem_test.sql:16343:--- TEST: IF NOTHING requirement not enforced for built-in aggregate function - total
CG-SQL-author/sources/test/sem_test.sql:16347:--- TEST: IF NOTHING requirement not enforced for built-in aggregate function - avg
CG-SQL-author/sources/test/sem_test.sql:16351:--- TEST: IF NOTHING requirement not enforced for built-in aggregate function - sum
CG-SQL-author/sources/test/sem_test.sql:16355:--- TEST: IF NOTHING requirement not enforced for built-in aggregate function - group_concat
CG-SQL-author/sources/test/sem_test.sql:16359:--- TEST: IF NOTHING requirement not enforced for built-in aggregate function - max
CG-SQL-author/sources/test/sem_test.sql:16363:--- TEST: IF NOTHING requirement not enforced for built-in aggregate function - min
CG-SQL-author/sources/test/sem_test.sql:16367:--- TEST: IF NOTHING requirement is enforced for multi-argument scalar function max
CG-SQL-author/sources/test/sem_test.sql:16368:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16371:--- TEST: IF NOTHING requirement is enforced for multi-argument scalar function min
CG-SQL-author/sources/test/sem_test.sql:16372:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16375:--- TEST: IF NOTHING requirement is enforced for built-in aggregate functions when GROUP BY is used - min
CG-SQL-author/sources/test/sem_test.sql:16376:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16379:--- TEST: IF NOTHING requirement is enforced for built-in aggregate functions when GROUP BY is used - sum
CG-SQL-author/sources/test/sem_test.sql:16380:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16383:--- TEST: IF NOTHING requirement is enforced for built-in aggregate functions when a LIMIT less than one is used (and expression within LIMIT is evaluated)
CG-SQL-author/sources/test/sem_test.sql:16384:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16387:--- TEST: IF NOTHING requirement is enforced for built-in aggregate functions when a  LIMIT using a variable (and expression within LIMIT is evaluated)
CG-SQL-author/sources/test/sem_test.sql:16388:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16394:--- TEST: No IF NOTHING requirement is imposed for built-in aggregate functions when a  LIMIT is 1 or bigger (and expression within LIMIT is evaluated)
CG-SQL-author/sources/test/sem_test.sql:16398:--- TEST: IF NOTHING requirement is enforced for built-in aggregate functions when OFFSET is used
CG-SQL-author/sources/test/sem_test.sql:16399:-- * error: % strict select if nothing requires that all (select ...) expressions include 'if nothing'
CG-SQL-author/sources/test/sem_test.sql:16402:-- TEST: normal if nothing
CG-SQL-author/sources/test/sem_test.sql:16405:@enforce_normal select if nothing;
CG-SQL-author/sources/test/sem_test.sql:16413:set price_d := (select 1 if nothing 2.0);
CG-SQL-author/sources/test/sem_test.sql:16421:set price_d := (select 3.0 if nothing 4);
CG-SQL-author/sources/test/sem_test.sql:16430:set price_d := (select 3.0 if nothing price_e);
CG-SQL-author/sources/test/sem_test.sql:16439:set my_real := (select price_d if nothing price_e);
CG-SQL-author/sources/test/sem_test.sql:16446:-- * error: % incompatible types in expression 'IF NOTHING OR NULL'
CG-SQL-author/sources/test/sem_test.sql:16448:set price_d := (select "x" if nothing or null price_e);
CG-SQL-author/sources/test/sem_test.sql:16455:-- * error: % right operand cannot be an object in 'IF NOTHING OR NULL'
CG-SQL-author/sources/test/sem_test.sql:16457:set price_d := (select "x" if nothing or null obj_var);
CG-SQL-author/sources/test/sem_test.sql:16462:-- TEST: if nothing or null gets not null result if right side is not null
CG-SQL-author/sources/test/sem_test.sql:16468:set real_nn := (select my_real if nothing or null 1.0);
CG-SQL-author/sources/test/sem_test.sql:16470:-- TEST: if nothing does NOT get not null result if only right side is not null
CG-SQL-author/sources/test/sem_test.sql:16474:set real_nn := (select my_real if nothing 1.0);
CG-SQL-author/sources/test/sem_test.sql:16481:set real_nn := (select not 'x' if nothing 1.0);
CG-SQL-author/sources/test/sem_test.sql:16485:-- * error: % (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML
CG-SQL-author/sources/test/sem_test.sql:16487:select (select 0 if nothing -1);
CG-SQL-author/sources/test/sem_test.sql:16491:-- * error: % (SELECT ... IF NOTHING) construct is for use in top level expressions, not inside of other DML
CG-SQL-author/sources/test/sem_test.sql:16493:delete from foo where id = (select 33 if nothing 0);
CG-SQL-author/sources/test/test.out.ref:1513:@ENFORCE_STRICT SELECT IF NOTHING;
CG-SQL-author/sources/test/test.out.ref:1515:@ENFORCE_NORMAL SELECT IF NOTHING;
CG-SQL-author/sources/test/test.out.ref:1904:  FROM y IF NOTHING THEN 3 );
CG-SQL-author/sources/test/test.out.ref:1907:  FROM y IF NOTHING OR NULL THEN 3 );
CG-SQL-author/sources/test/test.out.ref:1910:  FROM y IF NOTHING THEN THROW );
CG-SQL-author/sources/test/test.sql:1103:@enforce_strict select if nothing;
CG-SQL-author/sources/test/test.sql:1105:@enforce_normal select if nothing;
CG-SQL-author/sources/test/test.sql:1452:set x := (select x from y if nothing 3);
CG-SQL-author/sources/test/test.sql:1454:set x := (select x from y if nothing or null 3);
CG-SQL-author/sources/test/test.sql:1456:set x := (select x from y if nothing throw);
CG-SQL-author/sources/test/test_exp.out.ref:1531:@ENFORCE_STRICT SELECT IF NOTHING;
CG-SQL-author/sources/test/test_exp.out.ref:1533:@ENFORCE_NORMAL SELECT IF NOTHING;
CG-SQL-author/sources/test/test_exp.out.ref:1922:  FROM y IF NOTHING THEN 3 );
CG-SQL-author/sources/test/test_exp.out.ref:1925:  FROM y IF NOTHING OR NULL THEN 3 );
CG-SQL-author/sources/test/test_exp.out.ref:1928:  FROM y IF NOTHING THEN THROW );
CG-SQL-author/sources/upgrade/upgrade_validate.sql:35:    if nothing null);
CG-SQL-author/sources/upgrade/upgrade_validate.sql:137:    if nothing null);