Bug #24379 slash in table name isn't caught.
Submitted: 17 Nov 2006 0:36 Modified: 22 Nov 2006 13:37
Reporter: Carl Karsten (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Migration Toolkit Severity:S3 (Non-critical)
Version:1.1.5 rc OS:Windows (win2k)
Assigned to: CPU Architecture:Any

[17 Nov 2006 0:36] Carl Karsten
Description:
It seems the Access dba ended all the table names with /T for Table.  that is causing invalid table names.

How to repeat:
Create a table in access named 'foo/T' - 5 chars, the last 2 are / and T, not tab.

try to migrate it to MySql.

Suggested fix:

I would expect something to catch this and offer to convert invalid chars to _ or something.
[22 Nov 2006 13:37] Michael G. Zinner
All / are now changed to _ during the migration process.

Further, one can use the shell for more flexible renaming of objects.

On the Manual Editing page, press F4 to access the shell. Paste this script into the shell and press enter.

-- -----------------------------------------------------------------------------
-- @brief Renames tables
--
--   Renames the target tables based on the given find- and
--   replace strings.
--
-- @param findStr substring to find, please see Lua string.gsub()
--                for details
-- @param replaceStr replacement string, please see Lua string.gsub()
--                for details
--
-- @return nothing
-- -----------------------------------------------------------------------------

function renameTables(findStr, replaceStr)
  local i, j
  local schemas = grtV.getGlobal("/migration/targetCatalog/schemata")

  for j = 1, grtV.getn(schemas) do
    -- get views reference
    tables = schemas[j].tables;

    -- loop over all tables
    for i= 1, grtV.getn(tables) do
      tables[i].name= string.gsub(grtV.toLua(tables[i].name), findStr, replaceStr)
    end
  end

  -- re-create SQL statements
  local catalog= grtV.getGlobal("/migration/targetCatalog")
  local options= grtV.getGlobal("/migration/objectCreationParams")
  TransformationMysql:generateSqlCreateStatements({catalog, options})
end

Execute 
  renameTables("/T", "_T") 
to perform the rename command.

Please notice that you have to select a different filter to update the Migrated Objects listing on the Manual Editing page.