Skip to content

Commit 4d2d37d

Browse files
authored
fix: invalid metadata command (#124)
Fixes the Invalid MetaData command that could happen if a user entered a sql statement that contained `pg_catalog`, but was not an actual `psql` metadata command. The matcher would then return an error, instead of just trying to execute the sql statement that the user entered. Fixes b/200041331
1 parent 77e7421 commit 4d2d37d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/google/cloud/spanner/pgadapter/commands/InvalidMetaCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public Pattern getPattern() {
3737

3838
@Override
3939
public String translate() {
40-
throw new IllegalArgumentException("Unsupported Meta Command");
40+
// Just try to use the sql statement that was either generated by psql or manually entered by
41+
// the user.
42+
return sql;
4143
}
4244
}

0 commit comments

Comments
 (0)