DdlUtils
  1. DdlUtils
  2. DDLUTILS-275

platform.readModelFromDatabase(name) is not working if one of the table names contains underscore.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: Core - MySql
    • Labels:
    • Environment:
      Ubuntu 10.02, 64 bit, JDK 1.6.0_20, probably all others as well.

      Description

      org.apache.ddlutils.platform.JdbcModelReader
      lines 859, 900, 1007

      pkData = metaData.getPrimaryKeys(metaData.escapeForSearch(tableName));
      fkData = metaData.getForeignKeys(metaData.escapeForSearch(tableName));
      indexData = metaData.getIndices(metaData.escapeForSearch(tableName), false, false);

      should be replaced to:

      pkData = metaData.getPrimaryKeys(tableName);
      fkData = metaData.getForeignKeys(tableName);
      indexData = metaData.getIndices(tableName, false, false);

      According to MySQL 5 documentation "show create table" accepts table name, not table name pattern.
      http://dev.mysql.com/doc/refman/5.0/en/show-create-table.html

      If any of the table names contain underline this line bombs:
      Database db = platform.readModelFromDatabase( "test" );

        Activity

        Masker71 created issue -
        Masker71 made changes -
        Field Original Value New Value
        Attachment JdbcModelReader.java [ 12528685 ]

          People

          • Assignee:
            Thomas Dudziak
            Reporter:
            Masker71
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development