Skip to content

Commit

Permalink
Process parameters for CREATE SCHEMA
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Mar 17, 2022
1 parent ac6e3f3 commit ee0b666
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Expand Up @@ -758,6 +758,16 @@ protected Void visitAddColumn(AddColumn node, C context)
return null;
}

@Override
protected Void visitCreateSchema(CreateSchema node, C context)
{
for (Property property : node.getProperties()) {
process(property, context);
}

return null;
}

@Override
protected Void visitCreateTable(CreateTable node, C context)
{
Expand Down
Expand Up @@ -16,6 +16,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import io.trino.Session;
import io.trino.connector.MockConnectorFactory;
import io.trino.connector.MockConnectorPlugin;
import io.trino.connector.MockConnectorTableHandle;
Expand Down Expand Up @@ -210,6 +211,16 @@ public void testSchemaProperties()
.hasMessage("Catalog 'mock' schema property 'unknown_property' does not exist");
}

@Test
public void testExecuteWithSchemaProperties()
{
String query = "CREATE SCHEMA mock.test_schema WITH (boolean_schema_property = ?)";
Session session = Session.builder(getSession())
.addPreparedStatement("my_query", query)
.build();
computeActual(session, "EXECUTE my_query USING true");
}

@Test
public void testTableProperties()
{
Expand Down

0 comments on commit ee0b666

Please sign in to comment.