Skip to content

Instantly share code, notes, and snippets.

@fouadz
Created November 15, 2013 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fouadz/7479903 to your computer and use it in GitHub Desktop.
Save fouadz/7479903 to your computer and use it in GitHub Desktop.
system:
- Fedora 19
- JDK 1.7 (oracle)
- mariaDB (fedora replaced mysql by mariadb)
MariaDB [(none)]> select version();
+-----------------+
| version() |
+-----------------+
| 5.5.33a-MariaDB |
+-----------------+
1 row in set (0.00 sec)
1) mvn jetty:run
2) basic initial setup.
WARN - InitializationFilter$InitializationCompletion$1.run(1592) |2013-11-15 01:05:47,369| Error while trying to update to the latest database version
org.openmrs.util.DatabaseUpdateException: There was an error while updating the database to the latest. file: liquibase-update-to-latest.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::200902142213::ewolodzko:
Reason: liquibase.exception.DatabaseException: Error executing SQL UPDATE `person_attribute_type` SET `sort_weight` = (select count(*) from (select * from person_attribute_type) pat where pat.name < person_attribute_type.name) WHERE sort_weight is null: You can't specify target table 'person_attribute_type' for update in FROM clause:
Caused By: Error executing SQL UPDATE `person_attribute_type` SET `sort_weight` = (select count(*) from (select * from person_attribute_type) pat where pat.name < person_attribute_type.name) WHERE sort_weight is null: You can't specify target table 'person_attribute_type' for update in FROM clause:
Caused By: You can't specify target table 'person_attribute_type' for update in FROM clause
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:155)
at org.openmrs.web.filter.initialization.InitializationFilter$InitializationCompletion$1.run(InitializationFilter.java:1586)
at java.lang.Thread.run(Thread.java:722)
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase-update-to-latest.xml::200902142213::ewolodzko:
Reason: liquibase.exception.DatabaseException: Error executing SQL UPDATE `person_attribute_type` SET `sort_weight` = (select count(*) from (select * from person_attribute_type) pat where pat.name < person_attribute_type.name) WHERE sort_weight is null: You can't specify target table 'person_attribute_type' for update in FROM clause:
Caused By: Error executing SQL UPDATE `person_attribute_type` SET `sort_weight` = (select count(*) from (select * from person_attribute_type) pat where pat.name < person_attribute_type.name) WHERE sort_weight is null: You can't specify target table 'person_attribute_type' for update in FROM clause:
Caused By: You can't specify target table 'person_attribute_type' for update in FROM clause
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)
at org.openmrs.util.DatabaseUpdater$1OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:202)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:230)
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:167)
at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:152)
... 2 more
Caused by: liquibase.exception.DatabaseException: Error executing SQL UPDATE `person_attribute_type` SET `sort_weight` = (select count(*) from (select * from person_attribute_type) pat where pat.name < person_attribute_type.name) WHERE sort_weight is null: You can't specify target table 'person_attribute_type' for update in FROM clause
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)
at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)
at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317)
... 8 more
Caused by: java.sql.SQLException: You can't specify target table 'person_attribute_type' for update in FROM clause
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3468)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1957)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2642)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2571)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:769)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:612)
at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
... 12 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment