在Liquibase中,无论何时我为大型数据库寻找generateChangeLog
,它都会给我带来错误,而对于小型数据库,它运行正常。
我的错误控制台如下:
命令到cmd:
E:\liquibase-3.3.1-bin>liquibase
--driver=com.mysql.jdbc.Driver
--classpath=mysql-connector-java-5.1.6-bin.jar
--changeLogFile=xml\test11.xml
--url="jdbc:mysql://localhost:4928/test"
--username=root
--password=root
--diffTypes="tables,columns, foreignkeys,primarykeys, uniqueconstraints,
data" generateChangeLog
错误: 运行Liquibase时出现意外错误:liquibase.exception.DatabaseException:java.lang.StringIndexOutO fBoundsException:字符串索引超出范围:-1
FULL TRACKTRACE:
liquibase: liquibase.exception.DatabaseException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:155)
at liquibase.integration.commandline.Main.doMigration(Main.java:939)
at liquibase.integration.commandline.Main.run(Main.java:177)
at liquibase.integration.commandline.Main.main(Main.java:96)
Caused by: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:13)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)
... 3 more
Caused by: liquibase.exception.DatabaseException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at liquibase.snapshot.jvm.ColumnSnapshotGenerator.snapshotObject(ColumnS
napshotGenerator.java:69)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGen
erator.java:60)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorC
hain.java:50)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:163
)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.ja
va:241)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnap
shot.java:195)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:177
)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.ja
va:241)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.ja
va:263)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnap
shot.java:195)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:177
)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:60)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:37)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.j
ava:25)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe
neratorFactory.java:126)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGe
neratorFactory.java:119)
at liquibase.command.DiffCommand.createReferenceSnapshot(DiffCommand.jav
a:190)
at liquibase.command.DiffCommand.createDiffResult(DiffCommand.java:140)
at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogComma
nd.java:45)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)
... 4 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
-1
at java.lang.String.substring(Unknown Source)
at liquibase.util.SqlUtil.parseValue(SqlUtil.java:101)
at liquibase.snapshot.jvm.ColumnSnapshotGenerator.readDefaultValue(Colum
nSnapshotGenerator.java:345)
at liquibase.snapshot.jvm.ColumnSnapshotGenerator.readColumn(ColumnSnaps
hotGenerator.java:200)
at liquibase.snapshot.jvm.ColumnSnapshotGenerator.snapshotObject(ColumnS
napshotGenerator.java:45)
... 23 more