Bug #91196 dbt2 script has a bug
Submitted: 9 Jun 2018 8:37 Modified: 11 Jun 2018 5:13
Reporter: haochen he Email Updates:
Status: Verified Impact on me:
None 
Category:Tests Severity:S3 (Non-critical)
Version:0.37.50.15 OS:Any
Assigned to: CPU Architecture:Any
Tags: DBT2

[9 Jun 2018 8:37] haochen he
Description:
in dbt2, dbt2/script/mysql/mysql_load_db.sh line 543, there should not be a whitespace between -p and $DB_PASSWORD.

the original script is like:
if [ "$DB_PASSWORD" != "" ]; then
  MYSQL_ARGS="-p $DB_PASSWORD"
fi
this cause ERROR 1049 (42000): Unknown database '123'
where 123 is my password

How to repeat:
./mysql_load_db.sh --path /Users/username/mysql-datagen/  --mysql-path /usr/local/mysql/bin/mysql --socket /tmp/mysql.sock --host localhost --port 3306 --user root --password123

Suggested fix:
delete the whitespace between -p and $DB_PASSWORD.
like 
if [ "$DB_PASSWORD" != "" ]; then
  MYSQL_ARGS="-p$DB_PASSWORD"
fi
[11 Jun 2018 5:13] Umesh Shastry
Hello haochen he,

Thank you for the report!
Verifying based on code review.

Thanks,
Umesh
[13 Jun 2018 12:37] Mikael Ronström
Posted by developer:
 
Fixed and will be shipped soon in dbt2-0.37.50.16