dcardon / play-migrate

Database version migration module for use in the Play! framework
10 stars 2 forks source link

Do not read stderr in runDBCommand() #4

Closed ykarikos closed 11 years ago

ykarikos commented 11 years ago

Fixes a problem with MySQL v5.6 that prints 'Warning: Using a password on the command line interface can be insecure.' in stderr upon all connections.

With this fix, all DB errors and warnings will not be read by the migrate module but seen directly in the console when migrate is run.

Without this fix, migrate does not know how to handle the MySQL warning and all migrations to MySQL 5.6 fail like this: ~ Database migration: ~ ~ Database: foodb (Alias:db1) ~ Version: Warning: ~ Status: Using a password on the command line interface can be insecure. 53 Successful Traceback (most recent call last): File "/Users/ykar/Programs/play-1.2.5/play", line 153, in status = cmdloader.commands[play_command].execute(command=play_command, app=play_app, args=remaining_args, env=play_env, cmdloader=cmdloader) File "/Users/ykar/Projects/test/modules/migrate-1.4/commands.py", line 425, in execute up() File "/Users/ykar/Projects/test/modules/migrate-1.4/commands.py", line 340, in up [maxindex, files_obj] = getMigrateFiles(db_alias,int(version)) ValueError: invalid literal for int() with base 10: 'Warning:'

dcardon commented 11 years ago

Good catch, Thanks!