Description:
When attempting to migrate a Sybase v16.0 SP01 PL03 schema to MySQL, the Python code doesn't handle the string returned in getServerVersion. With this, then entire migration fails. Errors are below:
Starting...
Connect to source DBMS...
- Connecting to source...
Connecting to Sybase@PhBIT Tadpole...
Opening ODBC connection to DSN=PhBIT Tadpole;DATABASE=tadpole;UID=phbit;PWD=XXXX...
ERROR: Connection failed: No open connection to Sybase@PhBIT Tadpole
Traceback (most recent call last):
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\db_sybase_re_grt.py", line 195, in connect
con = db_driver.connect(connection, password)
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\workbench\db_driver.py", line 91, in connect
connection = library.connect(connection_string, password=password)
pyodbc.Error: ('ZZZZZ', '[ZZZZZ] [SAP][ASE ODBC Driver][Adaptive Server Enterprise]Login failed.\n (4002) (SQLDriverConnect); [ZZZZZ] [SAP][ASE ODBC Driver][Adaptive Server Enterprise]Login failed.\n (4002)')
Connecting to Sybase@PhBIT Tadpole...
Opening ODBC connection to DSN=PhBIT Tadpole;DATABASE=tadpole;UID=phbit;PWD=XXXX...
Traceback (most recent call last):
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\db_sybase_re_grt.py", line 222, in connect
_connections[connection.__id__]["version"] = getServerVersion(connection)
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\db_sybase_re_grt.py", line 255, in getServerVersion
ver_parts = [ int(part) for part in ver_string.split('.') ] + 4*[ 0 ]
ValueError: invalid literal for int() with base 10: '0 SP01 PL03'
Traceback (most recent call last):
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\workbench\wizard_progress_page_widget.py", line 66, in run
self.func()
File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules\migration_source_selection.py", line 444, in task_connect
raise e
SystemError: ValueError("invalid literal for int() with base 10: '0 SP01 PL03'"): error calling Python module function DbSybaseRE.connect
ERROR: Error during Connect to source DBMS: ValueError("invalid literal for int() with base 10: '0 SP01 PL03'"): error calling Python module function DbSybaseRE.connect
ERROR: Exception in task 'Connect to source DBMS': SystemError('ValueError("invalid literal for int() with base 10: \'0 SP01 PL03\'"): error calling Python module function DbSybaseRE.connect',)
Failed
How to repeat:
Define an ODBC source to a Sybase V16.0 database. Choose either "ODBC Data Source" or "ODBC (Native)". When migration initiates, the above error will occur.
Suggested fix:
It looks like the Python code for the Sybase version can only handle numeric results, but v16.0 is now returning a string. Not sure what version validation is performed, but it looks like a string now needs to be handled.