Bug 780263 (SOA-2660) - modeshape ddl scripts statement delimiter
Summary: modeshape ddl scripts statement delimiter
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-2660
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: EDS
Version: 5.1.0.ER5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.1.0.CR1
Assignee: Van Halbert
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-09 19:36 UTC by Aleksandar Kostadinov
Modified: 2011-02-08 16:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-08 16:02:43 UTC
Type: Bug


Attachments (Terms of Use)
schemas.zip (8.25 KB, application/zip)
2010-12-13 20:42 UTC, Van Halbert
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-2660 0 None None None Never

Description Aleksandar Kostadinov 2010-12-09 19:36:15 UTC
Workaround: Workaround Exists
project_key: SOA

I'm going through the supported set of databases trying to execute the modeshape ddl scripts with the native database administrative utilities. I'm looking at DB2 right now and wondering why '%' was chosen as statement delimiter.

`db2 -vf create.modeshape-jpa-connector.ddl` results in errors like:

create table MODE_SIMPLE_LARGE_VALUES (SHA1 varchar(40) not null, COMPRESSED smallint, DATA blob(255) not null, LENGTH bigint not null, TYPE varchar(255) not nu%l, primary key (SHA1))
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "%" was found following "primary key (SHA1)) ".
Expected tokens may include:  "END-OF-STATEMENT".  SQLSTATE=42601

One can workaround this by adding the -td% option but why not use ';' as a delimiter given there is a -t option that. Or even why not use simply new line as a separator given db2 utility uses that by default? I mean it makes most sense to use the default delimiter or ';' because of its wide use.

I'll update this issue if I see other glitches. IMHO the \r before statement delimiter should be removed. In the case of mssql and sybase I have yet to check how it works though.

Comment 1 Van Halbert 2010-12-09 20:11:29 UTC
the create table script above is strange.   I'm looking at the created script from SOA:

create table MODE_SIMPLE_LARGE_VALUES (SHA1 varchar(40) not null, COMPRESSED smallint, DATA blob(255) not null, LENGTH bigint not null, TYPE varchar(255) not null, primary key (SHA1))

and it has "null"  where "nu%l% is.


Comment 2 Van Halbert 2010-12-09 20:14:36 UTC
but we can go ahead and change all delimiters to ";"

Comment 3 Aleksandar Kostadinov 2010-12-09 20:28:59 UTC
I didn't quiet understand your first comment but please let me check mssql and sybase tomorrow. I'm almost sure mssql takes ';' but not so about sybase.

Comment 5 Aleksandar Kostadinov 2010-12-11 07:38:05 UTC
btw IIRC MS SQL server is using "go" as commit transaction but given we shouldn't really need these statement in separate transactions, ';' should be working fine there

Comment 6 Van Halbert 2010-12-13 14:37:08 UTC
While we're at renaming directories, lets rename MySQL5InnoDB to MySQL.

Comment 7 Aleksandar Kostadinov 2010-12-13 19:11:04 UTC
Why not.. hopefully there are not too many people running *the last good MySQL version* - 3.x :)

Comment 8 Van Halbert 2010-12-13 20:27:39 UTC
Link: Added: This issue is a dependency of MODE-1022


Comment 9 Van Halbert 2010-12-13 20:42:14 UTC
Here are the new version of the scripts creates from a soa build.   Unzip / replace the schema's directory under modeshape.

Comment 10 Van Halbert 2010-12-13 20:42:14 UTC
Attachment: Added: schemas.zip


Comment 11 Van Halbert 2010-12-14 19:32:09 UTC
The changes have been checked into ModeShape and into the soa build to handle producing ddl scripts with the requested delimiter and handle Sybase.

Comment 12 Aleksandar Kostadinov 2010-12-16 11:18:41 UTC
I see one issue with sybase - between statements I see \rGO\n instead of \nGO\n
Thanks! 

Comment 13 Aleksandar Kostadinov 2011-02-08 16:02:43 UTC
Everything looks fine to me now. We do not ship sybase DDL any more.


Note You need to log in before you can comment on or make changes to this bug.