[Rt-commit] rt branch, 4.4/mysql8-quoted-tables, repushed

Aaron Trevena ast at bestpractical.com
Thu Sep 3 07:15:46 EDT 2020


The branch 4.4/mysql8-quoted-tables was deleted and repushed:
       was e92fcdc1a2adb026dbe848f8636db93b064b6c13
       now 5652201fe56c7835affbaa6e6d6d042757eac0e5

1: 353b51435e ! 1: 43061702cb Update mysql schema for mysql 8 making Groups reserved word
    @@ -1,6 +1,9 @@
     Author: Aaron Trevena <ast at bestpractical.com>
     
    -    Update mysql DDL for version 8
    +    Update mysql schema for mysql 8 making Groups reserved word
    +    
    +    MySQL made Groups a reserved word in version 8.0.2 which causes unquoted use of
    +    the Groups table name in RT a syntax error.
     
     diff --git a/etc/acl.mysql b/etc/acl.mysql
     --- a/etc/acl.mysql
2: f8647c777b ! 2: d61dc3c5f1 Update queries and user creation for Mysql 8
    @@ -1,6 +1,14 @@
     Author: Aaron Trevena <ast at bestpractical.com>
     
    -    Add table quoting for mysql 8
    +    Update queries and user creation for Mysql 8
    +    
    +    MySQL 8.0.2 made Groups a reserved word causing unquoted use of the Groups table
    +    name in RT a syntax error.
    +    
    +    Mysql 8 also removed implicit user creation from the GRANT command, causing user
    +    creation in setup and tests to fail.
    +    
    +    Table name quoting requires an updated DBIx::SearchBuilder with tablename quoting
     
     diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
     --- a/lib/RT/Handle.pm
3: e92fcdc1a2 ! 3: 5652201fe5 Update tests for mysql 8
    @@ -1,6 +1,10 @@
     Author: Aaron Trevena <ast at bestpractical.com>
     
    -    Update tests for mysql 8 and table quoting
    +    Update tests for mysql 8
    +    
    +    Tests fail due to new Groups reserved word and other changes in mysql 8, requiring
    +    Groups table to be escaped and the rt-validator to be run with resolve a second time
    +    for some tests.
         
         Add debug and workaround for rt-validator not fully resolving integrity failures
     
    @@ -17,13 +21,8 @@
              $res,
              qr/Transactions references a nonexistent record in CustomFields/,
     @@
    - 
    -     RT::Test->db_is_valid;
    - 
    --    $RT::Handle->dbh->do( "DELETE FROM Users where id=" . $user->id );
    --    $RT::Handle->dbh->do( "DELETE FROM Principals where id=" . $user->PrincipalId );
    -+    my $rv1 = $RT::Handle->dbh->do( "DELETE FROM Users where id=" . $user->id );
    -+    my $rv2 = $RT::Handle->dbh->do( "DELETE FROM Principals where id=" . $user->PrincipalId );
    +     $RT::Handle->dbh->do( "DELETE FROM Users where id=" . $user->id );
    +     $RT::Handle->dbh->do( "DELETE FROM Principals where id=" . $user->PrincipalId );
      
     -    my ( $ecode, $res ) = RT::Test->run_validator( resolve => 1 );
     -    isnt( $ecode, 0, 'non-zero exit code' );
    @@ -60,3 +59,15 @@
          RT::Test->db_is_valid;
      }
      
    +
    +diff --git a/t/web/query_log.t b/t/web/query_log.t
    +--- a/t/web/query_log.t
    ++++ b/t/web/query_log.t
    +@@
    + $m->text_contains("/index.html", "we include info about a page we hit while logging in");
    + $m->text_contains("Stack:", "stack traces");
    + $m->text_like(qr{/autohandler:\d+}, "stack trace includes mason components");
    +-$m->text_contains("SELECT * FROM Principals WHERE id = '".$root->id."'", "we interpolate bind params");
    ++
    ++my $id = $root->id;
    ++$m->text_like(qr/SELECT.\*.FROM.`?Principals`?.WHERE.id.=.'$id'/, "we interpolate bind params");



More information about the rt-commit mailing list