1 /* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. 2 3 This program is free software; you can redistribute it and/or modify 4 it under the terms of the GNU General Public License, version 2.0, 5 as published by the Free Software Foundation. 6 7 This program is also distributed with certain software (including 8 but not limited to OpenSSL) that is licensed under separate terms, 9 as designated in a particular file or component or in included license 10 documentation. The authors of MySQL hereby grant you an additional 11 permission to link the program and your derivative works with the 12 separately licensed software that they have included with MySQL. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License, version 2.0, for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software Foundation, 21 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ 22 23 #ifndef GROUP_REPLICATION_AUTO_INCREMENT 24 #define GROUP_REPLICATION_AUTO_INCREMENT 25 26 #include "plugin_server_include.h" 27 28 #define SERVER_DEFAULT_AUTO_INCREMENT 1 29 #define SERVER_DEFAULT_AUTO_OFFSET 1 30 31 /* 32 @class Plugin_group_replication_auto_increment 33 34 This class will be used to configure auto_increment variables 35 (auto_increment_increment and auto_increment_offset) 36 */ 37 class Plugin_group_replication_auto_increment 38 { 39 public: 40 /** 41 Plugin_group_replication_auto_increment constructor 42 43 Set auto_increment_increment and auto_increment_offset in the server 44 */ 45 Plugin_group_replication_auto_increment(); 46 47 /** 48 Set auto_increment_increment and auto_increment_offset 49 50 @param increment the interval between successive column values 51 @param offset the starting point for the AUTO_INCREMENT column value 52 */ 53 54 void set_auto_increment_variables(ulong increment, ulong offset); 55 56 /** 57 Reset auto_increment_increment and auto_increment_offset, 58 if modified by this plugin in set function 59 */ 60 61 void reset_auto_increment_variables(); 62 63 private: 64 ulong group_replication_auto_increment; 65 ulong group_replication_auto_offset; 66 }; 67 68 #endif /* GROUP_REPLICATION_AUTO_INCREMENT */ 69