Issue 481 in flyway: Hexadecimal Value using x'1234' notation not parsed correctly

7 views
Skip to first unread message

fly...@googlecode.com

unread,
Apr 22, 2013, 11:40:50 AM4/22/13
to flywa...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 481 by david.be...@payworks.io: Hexadecimal Value using x'1234'
notation not parsed correctly
http://code.google.com/p/flyway/issues/detail?id=481

When using an sql script like so:

CREATE TABLE Tablename (
id binary(16) NOT NULL,
PRIMARY KEY (id)
);

INSERT INTO Tablename (id) VALUES (x'5B1A5933964C4AA59F3013D3B3F3414D');

the SQL Parser does not correctly pick up the delimiters of the hex value
entered as a string. This causes flyway to fail when migrating as sql
commands are not correctly parsed and split.

The culprit is:
extractStringLiteralDelimitingTokens in
com.googlecode.flyway.core.dbsupport.SqlStatementBuilder

It only checks if the string starts and ends with a " ' ".

Fix is easy.

As a workaround one can use
INSERT INTO Tablename (id) VALUES (0x5B1A5933964C4AA59F3013D3B3F3414D);

I am using flyway 2.1.1 with MySQL in a basic spring mvc setup.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

fly...@googlecode.com

unread,
May 24, 2013, 1:44:46 PM5/24/13
to flywa...@googlegroups.com
Updates:
Status: Fixed

Comment #1 on issue 481 by axel.fontai...@gmail.com: Hexadecimal
Value using x'1234' notation not parsed correctly
http://code.google.com/p/flyway/issues/detail?id=481

(No comment was entered for this change.)

fly...@googlecode.com

unread,
May 22, 2014, 5:41:49 PM5/22/14
to flywa...@googlegroups.com

Comment #2 on issue 481 by cr...@grindsoftware.com: Hexadecimal Value using
x'1234' notation not parsed correctly
http://code.google.com/p/flyway/issues/detail?id=481

With Flyway 3.0 I still seem to be having issues. For instance, with the
following INSERT statement in my migration:

INSERT INTO LTO.LANDING_PAGE_INFO (LNDNG_PAGE_NFO_OID, LOCK_SEQ_NO,
INTRODUCTION_ENGLISH,
INTRODUCTION_FRENCH,USER_GUIDE_LINK_ENGLISH,USER_GUIDE_LINK_FRENCH)
VALUES(x'032018018033022008016051053137', 1, 'English Value', 'French
Value', 'English Link', 'French Link');

I get this error:
com.ibm.db2.jcc.am.SqlSyntaxErrorException: An unexpected token "" was
found following "". Expected tokens may include: "ink', 'French Link')"..
SQLCODE=-104, SQLSTATE=42601, DRIVER=4.16.53

In SQuirreL using the same driver jar, it works fine...

fly...@googlecode.com

unread,
May 22, 2014, 5:48:11 PM5/22/14
to flywa...@googlegroups.com

Comment #3 on issue 481 by cr...@grindsoftware.com: Hexadecimal Value using
x'1234' notation not parsed correctly
http://code.google.com/p/flyway/issues/detail?id=481

Oh wow... it was the semi colon that was tripping it up...
Reply all
Reply to author
Forward
0 new messages