From a3d5f3d3464a5842cda213766c2ed0d52dce5a18 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Fri, 19 Oct 2012 17:10:40 -0600 Subject: [PATCH] Add hint to error messages about what to do if the table doesn't exist. --- bin/pt-query-digest | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/bin/pt-query-digest b/bin/pt-query-digest index 6f84877a..11370e2f 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -13452,14 +13452,16 @@ sub main { $qv_dbh->do($sql); } - # Check for existence and the permissions to insert into the - # table. + # Check for the existence of the table. if ( !$tp->check_table( - dbh => $qv_dbh, - db => $db_tbl[0], - tbl => $db_tbl[1]) ) + dbh => $qv_dbh, + db => $db_tbl[0], + tbl => $db_tbl[1]) ) { - die "The query review table $db_tbl does not exist"; + die "The query review table $db_tbl does not exist. " + . "Specify --create-review-table to create it, " + . "and ensure that the MySQL user has privileges to create " + . "and update the table.\n"; } # Set up the new QueryReview object. @@ -13493,14 +13495,16 @@ sub main { $qv_dbh2->do($sql); } - # Check for existence and the permissions to insert into the - # table. + # Check for the existence of the table. if ( !$tp->check_table( dbh => $qv_dbh2, db => $hdb_tbl[0], tbl => $hdb_tbl[1]) ) { - die "The query review history table $hdb_tbl does not exist"; + die "The query review history table $hdb_tbl does not exist. " + . "Specify --create-review-history-table to create it, " + . "and ensure that the MySQL user has privileges to create " + . "and update the table.\n"; } # Inspect for MAGIC_history_cols. Add them to the --select list