[Commits] bad764d: Fixes
revision-id: bad764d536839a7bc27072809bbb16f3263ac59d () parent(s): 4be2bef1c928fe81d2f67ec9576fbaf58ed22e7f author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2021-10-21 18:19:49 +0300 message: Fixes --- README.md | 2 +- database-config.pl | 7 +++++++ histogram-test.pl | 19 ++++++++++--------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 44c8738..30637cf 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Edit the `database-config.pl` and set the database connection parameters accordi For example: ``` -./histogram-test.pl --db=mariadb,mysql,postgresql ./03-common-and-uncommon.pl +./histogram-test.pl --jira-tables --db=mariadb,mysql,postgresql ./03-common-and-uncommon.pl ``` will produce this output: diff --git a/database-config.pl b/database-config.pl index 23dff24..afae622 100644 --- a/database-config.pl +++ b/database-config.pl @@ -1,7 +1,14 @@ $conn_str_mariadb="dbi:mysql:test:127.0.0.1:3319"; +$conn_user_mariadb='root'; +$conn_password_mariadb=''; + $conn_str_mysql= "dbi:mysql:test:127.0.0.1:3312"; +$conn_user_mysql='root'; +$conn_password_mysql=''; $conn_str_postgresql= "dbi:Pg:dbname=test;host=localhost"; +$conn_user_postgresql=''; +$conn_password_postgresql='foo'; 1; diff --git a/histogram-test.pl b/histogram-test.pl index c91d1d5..54294eb 100755 --- a/histogram-test.pl +++ b/histogram-test.pl @@ -16,10 +16,10 @@ $print_jira_tables= 0; $db_arg= shift; if ($db_arg =~ /^--jira-tables$/) { - $print_jira_tables= 1; + $print_jira_tables= 1; + $db_arg= shift; } -$db_arg= shift; if ($db_arg =~ /^--db=(.*)$/) { #print "dbs=$1\n"; @databases= split(/,/, $1); @@ -162,10 +162,6 @@ $SEP= "| "; ## Main ## -#$database_type="mysql"; -#$database_type="mariadb"; -#$database_type="postgresql"; - foreach (@databases) { $database_type= $_; @@ -175,13 +171,18 @@ foreach (@databases) { if ($database_type eq "mariadb") { $conn_str= $conn_str_mariadb; - $conn_user='root'; + $conn_user=$conn_user_mariadb; + $conn_password=$conn_password_mariadb; + } elsif ($database_type eq "mysql") { $conn_str= $conn_str_mysql; - $conn_user='root'; + $conn_user=$conn_user_mysql; + $conn_password=$conn_password_mysql; + } elsif ($database_type eq "postgresql") { $conn_str= $conn_str_postgresql; - $conn_password= 'foo'; + $conn_user=$conn_user_postgresql; + $conn_password=$conn_password_postgresql; } else { die("Unknown database type $database_type"); }
participants (1)
-
psergey