Hello,
I have a problem with loading data from a file into a MySQL table in 3.4.1. I am trying to update from 3.0.8.
It works fine in all other previous versions.
The same problem occurs running through Spring or liquibase command tool.
Here is a changeset to create a simple table and populate it with reference data.
I have a problem with loading data from a file into a MySQL table in 3.4.1. I am trying to update from 3.0.8.
It works fine in all other previous versions.
The same problem occurs running through Spring or liquibase command tool.
Here is a changeset to create a simple table and populate it with reference data.
- changeSet
author="xxx" id="1429175025865-3"
context="run">
<createTable tableName="Organisation">
<column autoIncrement="true" name="id" type="BIGINT(19)">
<constraints primaryKey="true" />
</column>
<column name="approved" type="BIT(1)">
<constraints nullable="false" />
</column>
<column name="title" type="VARCHAR(255)">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
<changeSet author="xxx" id="16042015">
<validCheckSum>7:5bbcdefbcd53b3314f671dcd1e673fa9</validCheckSum>
<!-- only add if organisations table is empty, implies this is a new, empty DB and a new deployment -->
<preConditions onFail="MARK_RAN">
<sqlCheck expectedResult="0">select count(*) from Organisation</sqlCheck>
</preConditions>
<comment>Add Organisation table</comment>
<loadData tableName="Organisation" file="sqlUpdates/data/organisations.csv">
<column name="id" type="NUMERIC" />
<column name="approved" type="NUMERIC"/>
<column name="title" type="STRING"/>
</loadData>
</changeSet>
(I had to put in a 'validCheckSum' tag as the checksum calculation was different from my original checksum generated in liquibase 3.0.8.)
and here is a sample of our data set:
- id,approved,title
NULL,1,Aalborg University
NULL,1,Aalto University
NULL,1,Aarhus University
NULL,1,Abant Izzet Baysal University
NULL,1,Abdelmalek Essaadi University
which continues for 3824 rows.
The load data changeset doesn't seem able to cope with more than 50 rows. Here is the error:
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO ecat5_dev.Organisation (id, approved, title) VALUES (52, 1, 'Albion ' at line 2
There is nothing wrong with the row data - it just happens to be the
51st row. It is always the 51st row that is the offender.
If I truncate dataset to < 50 rows it works fine.
At present I've just updated to 3.3.5 as this is the latest version for which the data is loaded in properly.
Thanks
Richard