Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen committed Nov 19, 2024
1 parent fa7dd18 commit c78a636
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions edb/pgsql/resolver/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
def _resolve(
expr: pgast.Base, *, ctx: context.ResolverContextLevel
) -> pgast.Base:
expr.dump()
_raise_unsupported(expr)


Expand Down
5 changes: 4 additions & 1 deletion edb/pgsql/resolver/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ def eval_FuncCall(
return value

raise errors.QueryError(
"function set_config is not supported", span=expr.span
"function set_config is not supported",
span=expr.span,
pgext_code=pgerror.ERROR_FEATURE_NOT_SUPPORTED,
)

if fn_name == 'current_setting':
Expand All @@ -329,6 +331,7 @@ def eval_FuncCall(
raise errors.QueryError(
f"function pg_catalog.{fn_name} is not supported",
span=expr.span,
pgext_code=pgerror.ERROR_FEATURE_NOT_SUPPORTED,
)

if fn_name == "pg_get_serial_sequence":
Expand Down
5 changes: 2 additions & 3 deletions edb/server/compiler/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,8 @@ def compile_sql(
else:
unit.cardinality = enums.Cardinality.MANY
else:
raise errors.UnsupportedFeatureError(
f"SQL {stmt.__class__.__name__} is not supported"
)
from edb.pgsql import resolver as pg_resolver
pg_resolver.dispatch._raise_unsupported(stmt)

unit.stmt_name = compute_stmt_name(unit.query, tx_state).encode("utf-8")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_sql_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ async def test_sql_query_unsupported_01(self):
with self.assertRaisesRegex(
asyncpg.FeatureNotSupportedError,
"not supported: CREATE",
position="14", # TODO: this is confusing
# position="14", # TODO: this is confusing
):
await self.squery_values('CREATE TABLE a();')

Expand Down

0 comments on commit c78a636

Please sign in to comment.