Skip to content

A tungsten Drupal database driver that works around a bug in tungsten-replicator's handling of the ANSI_QUOTES sql_mode

Notifications You must be signed in to change notification settings

grigarr/tungsten-drupal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Drupal 7 hardcode's a specific set of sql_mode options in it's MySQL PDO
driver.  Tungsten replicator incorrectly escapes queries using ANSI_QUOTES,
which causes replication to break with D7+MySQL+Tungsten.

This driver offers a work around that removes ANSI_QUOTES from the default
sql_mode.  Enable the driver by copying the contents of the mysqltungsten
directory to includes/database/mysqltungsten and switching to the mysqltungsten
database driver in settings.php:

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => '',
      'username' => '',
      'password' => '',
      'host' => '',
      'port' => '',
      'driver' => 'mysqltungsten',
      'prefix' => '',
      // The init_commands array allows arbitrary commands be executed for each
      // database connection. sql_mode can also be overridden here.
      'init_commands' =>
      array (
        sql_mode => "SET sql_mode='TRADITIONAL'",
        other_init_command => "SET SQL_BIG_SELECTS=1",
        ...
      ),
    ),
  ),
);

About

A tungsten Drupal database driver that works around a bug in tungsten-replicator's handling of the ANSI_QUOTES sql_mode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages