google-code-export / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

DROP DOMAIN does not work with schema prefix #306

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
How to reproduce:

New domain:
CREATE DOMAIN EMAIL AS VARCHAR(255) CHECK (POSITION('@', VALUE) > 1);

Drop it:

DROP DOMAIN "PUBLIC"."EMAIL";

or without quotes

DROP DOMAIN PUBLIC.EMAIL;

Result:
org.h2.jdbc.JdbcSQLException: Syntax Fehler in SQL Befehl "DROP DOMAIN 
PUBLIC.[*]EMAIL "
Syntax error in SQL statement "DROP DOMAIN PUBLIC.[*]EMAIL "; SQL statement:
DROP DOMAIN PUBLIC.EMAIL  [42000-153]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
    at org.h2.message.DbException.get(DbException.java:167)
    at org.h2.message.DbException.get(DbException.java:144)
    at org.h2.message.DbException.getSyntaxError(DbException.java:179)
    at org.h2.command.Parser.getSyntaxError(Parser.java:480)
    at org.h2.command.Parser.prepareCommand(Parser.java:229)
    at org.h2.engine.Session.prepareLocal(Session.java:426)
    at org.h2.engine.Session.prepareCommand(Session.java:374)
    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1100)
    at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:164)
    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152)

Original issue reported on code.google.com by axel.fontaine.business@gmail.com on 26 Mar 2011 at 1:43

GoogleCodeExporter commented 9 years ago
Hi,

What is your use case?

CREATE DOMAIN doesn't work with schema prefix, why should DROP DOMAIN work with 
one?

Original comment by thomas.t...@gmail.com on 26 Mar 2011 at 2:20

GoogleCodeExporter commented 9 years ago
Hi Thomas,

I'm currently in the process of adding multiple schema support to Flyway 
(http://code.google.com/p/flyway).

In the process, I am removing single schema assumptions from the code.

I had noticed that INFORMATION_SCHEMA.DOMAINS contains a DOMAIN_SCHEMA column, 
so I assumed DOMAINs could be defined on a per schema basis.

Is there a reason why this is currently not the case?

Original comment by axel.fontaine.business@gmail.com on 26 Mar 2011 at 3:59

GoogleCodeExporter commented 9 years ago
> Is there a reason why this is currently not the case?

Well, I thought it's not necessary :-)

Original comment by thomas.t...@gmail.com on 1 Apr 2011 at 7:59

GoogleCodeExporter commented 9 years ago
This is already in the roadmap ("Support schema specific domains"), I will 
increase the priority a bit. But I will not implement it in the near future, 
sorry.

Original comment by thomas.t...@gmail.com on 8 Apr 2011 at 12:56