~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/slave/replication_schema.cc

  • Committer: David Shrewsbury
  • Date: 2011-02-23 16:49:25 UTC
  • mto: (2207.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2202.
  • Revision ID: shrewsbury.dave@gmail.com-20110223164925-s8wnolla2vwvlxiy
Changed slave services dedicated schema name from 'replication' to 'sys_replication' to avoid use of reserved word.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
  vector<string> sql;
37
37
 
38
38
  sql.push_back("COMMIT");
39
 
  sql.push_back("CREATE SCHEMA IF NOT EXISTS `replication`");
 
39
  sql.push_back("CREATE SCHEMA IF NOT EXISTS `sys_replication` REPLICATE=FALSE");
40
40
 
41
41
  if (not executeSQL(sql))
42
42
    return false;
47
47
 
48
48
  sql.clear();
49
49
  sql.push_back("COMMIT");
50
 
  sql.push_back("CREATE TABLE IF NOT EXISTS `replication`.`io_state` ("
 
50
  sql.push_back("CREATE TABLE IF NOT EXISTS `sys_replication`.`io_state` ("
51
51
                " `status` VARCHAR(20) NOT NULL,"
52
52
                " `error_msg` VARCHAR(250))"
53
53
                " COMMENT = 'VERSION 1.0'");
56
56
    return false;
57
57
 
58
58
  sql.clear();
59
 
  sql.push_back("SELECT COUNT(*) FROM `replication`.`io_state`");
 
59
  sql.push_back("SELECT COUNT(*) FROM `sys_replication`.`io_state`");
60
60
 
61
61
  {
62
62
    sql::ResultSet result_set(1);
69
69
    if (count == "0")
70
70
    {
71
71
      sql.clear();
72
 
      sql.push_back("INSERT INTO `replication`.`io_state` (`status`)"
 
72
      sql.push_back("INSERT INTO `sys_replication`.`io_state` (`status`)"
73
73
                    " VALUES ('STOPPED')");
74
74
      if (not executeSQL(sql))
75
75
        return false;
82
82
 
83
83
  sql.clear();
84
84
  sql.push_back("COMMIT");
85
 
  sql.push_back("CREATE TABLE IF NOT EXISTS `replication`.`applier_state`"
 
85
  sql.push_back("CREATE TABLE IF NOT EXISTS `sys_replication`.`applier_state`"
86
86
                " (`last_applied_commit_id` BIGINT NOT NULL PRIMARY KEY,"
87
87
                " `status` VARCHAR(20) NOT NULL,"
88
88
                " `error_msg` VARCHAR(250))"
92
92
    return false;
93
93
 
94
94
  sql.clear();
95
 
  sql.push_back("SELECT COUNT(*) FROM `replication`.`applier_state`");
 
95
  sql.push_back("SELECT COUNT(*) FROM `sys_replication`.`applier_state`");
96
96
 
97
97
  {
98
98
    sql::ResultSet result_set(1);
105
105
    if (count == "0")
106
106
    {
107
107
      sql.clear();
108
 
      sql.push_back("INSERT INTO `replication`.`applier_state`"
 
108
      sql.push_back("INSERT INTO `sys_replication`.`applier_state`"
109
109
                    " (`last_applied_commit_id`, `status`)"
110
110
                    " VALUES (0, 'STOPPED')");
111
111
      if (not executeSQL(sql))
119
119
 
120
120
  sql.clear();
121
121
  sql.push_back("COMMIT");
122
 
  sql.push_back("CREATE TABLE IF NOT EXISTS `replication`.`queue`"
 
122
  sql.push_back("CREATE TABLE IF NOT EXISTS `sys_replication`.`queue`"
123
123
                " (`trx_id` BIGINT NOT NULL, `seg_id` INT NOT NULL,"
124
124
                " `commit_order` BIGINT, `msg` BLOB,"
125
125
                " PRIMARY KEY(`trx_id`, `seg_id`))"