-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQL: forced, hidden versioning [closes #32]
- Loading branch information
Showing
10 changed files
with
118 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright (c) 2016, MariaDB corporation. All rights reserved. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; version 2 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
MYSQL_ADD_PLUGIN(versioning versioning.cc | ||
MODULE_ONLY MODULE_OUTPUT_NAME "versioning" COMPONENT Test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* Copyright (c) 2016, MariaDB corporation. All rights | ||
reserved. | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; version 2 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ | ||
|
||
#include <mysql_version.h> | ||
#include <mysqld.h> | ||
#include "sql_plugin.h" // st_plugin_int | ||
|
||
/* | ||
Disable __attribute__() on non-gcc compilers. | ||
*/ | ||
#if !defined(__attribute__) && !defined(__GNUC__) | ||
#define __attribute__(A) | ||
#endif | ||
|
||
static int forced_versioning_init(void *p __attribute__ ((unused))) | ||
{ | ||
|
||
DBUG_ENTER("forced_versioning_init"); | ||
vers_force= true; | ||
vers_hide= true; | ||
DBUG_RETURN(0); | ||
} | ||
|
||
static int forced_versioning_deinit(void *p __attribute__ ((unused))) | ||
{ | ||
DBUG_ENTER("forced_versioning_deinit"); | ||
vers_force= false; | ||
vers_hide= false; | ||
DBUG_RETURN(0); | ||
} | ||
|
||
|
||
struct st_mysql_daemon forced_versioning_plugin= | ||
{ MYSQL_DAEMON_INTERFACE_VERSION }; | ||
|
||
/* | ||
Plugin library descriptor | ||
*/ | ||
|
||
maria_declare_plugin(forced_versioning) | ||
{ | ||
MYSQL_DAEMON_PLUGIN, | ||
&forced_versioning_plugin, | ||
"forced_versioning", | ||
"Natsys Lab", | ||
"Enable System Vesioning for all newly created tables", | ||
PLUGIN_LICENSE_GPL, | ||
forced_versioning_init, /* Plugin Init */ | ||
forced_versioning_deinit, /* Plugin Deinit */ | ||
0x0100 /* 1.0 */, | ||
NULL, /* status variables */ | ||
NULL, /* system variables */ | ||
"1.0", /* string version */ | ||
MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */ | ||
} | ||
maria_declare_plugin_end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters