summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <brian@zim.(none)>2006-10-05 00:41:29 -0700
committerunknown <brian@zim.(none)>2006-10-05 00:41:29 -0700
commit76cdfbbdfee7928dee2fbc0f8f07e1e0ca0cba33 (patch)
treeb14998daff5232aed508cce3919ae3b222f894f1
parentc8b64ea17cf81dcab30f341160a1c07d5c6ccaae (diff)
downloadmariadb-git-76cdfbbdfee7928dee2fbc0f8f07e1e0ca0cba33.tar.gz
Added license information display to output of plugins schema, and tagged all plugins with GPL flag.
include/mysql/plugin.h: Adding license information. plugin/fulltext/plugin_example.c: License sql/ha_ndbcluster.cc: License sql/ha_partition.cc: License sql/handler.h: License sql/log.cc: License sql/sql_show.cc: Additional PLUIN display information storage/archive/ha_archive.cc: License information added storage/blackhole/ha_blackhole.cc: License information added storage/csv/ha_tina.cc: License Information storage/example/ha_example.cc: License information storage/federated/ha_federated.cc: License Information storage/heap/ha_heap.cc: License Information storage/innobase/handler/ha_innodb.cc: License Information storage/myisam/ha_myisam.cc: License Information storage/myisammrg/ha_myisammrg.cc: License Information
-rw-r--r--include/mysql/plugin.h10
-rw-r--r--plugin/fulltext/plugin_example.c1
-rw-r--r--sql/ha_ndbcluster.cc1
-rw-r--r--sql/ha_partition.cc1
-rw-r--r--sql/handler.h1
-rw-r--r--sql/log.cc1
-rw-r--r--sql/sql_show.cc17
-rw-r--r--storage/archive/ha_archive.cc1
-rw-r--r--storage/blackhole/ha_blackhole.cc1
-rw-r--r--storage/csv/ha_tina.cc1
-rw-r--r--storage/example/ha_example.cc1
-rw-r--r--storage/federated/ha_federated.cc1
-rw-r--r--storage/heap/ha_heap.cc1
-rw-r--r--storage/innobase/handler/ha_innodb.cc1
-rw-r--r--storage/myisam/ha_myisam.cc1
-rw-r--r--storage/myisammrg/ha_myisammrg.cc1
16 files changed, 41 insertions, 0 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 174c2b85739..22cd64a52c4 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -31,6 +31,15 @@
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
#define MYSQL_MAX_PLUGIN_TYPE_NUM 3 /* The number of plugin types */
+/* We use the following strings to define licenses for plugins */
+#define PLUGIN_LICENSE_PROPRIETARY 0
+#define PLUGIN_LICENSE_GPL 1
+#define PLUGIN_LICENSE_BSD 2
+
+#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
+#define PLUGIN_LICENSE_GPL_STRING "GPL"
+#define PLUGIN_LICENSE_BSD_STRING "BSD"
+
/*
Macros for beginning and ending plugin declarations. Between
mysql_declare_plugin and mysql_declare_plugin_end there should
@@ -88,6 +97,7 @@ struct st_mysql_plugin
const char *name; /* plugin name */
const char *author; /* plugin author (for SHOW PLUGINS) */
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
+ int license; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
int (*init)(void *); /* the function to invoke when plugin is loaded */
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
unsigned int version; /* plugin version (for SHOW PLUGINS) */
diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c
index 7da6672190c..f09462f2d1a 100644
--- a/plugin/fulltext/plugin_example.c
+++ b/plugin/fulltext/plugin_example.c
@@ -226,6 +226,7 @@ mysql_declare_plugin(ftexample)
"simple_parser", /* name */
"MySQL AB", /* author */
"Simple Full-Text Parser", /* description */
+ PLUGIN_LICENSE_GPL,
simple_parser_plugin_init, /* init function (when loaded) */
simple_parser_plugin_deinit,/* deinit function (when unloaded) */
0x0001, /* version */
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 0d57f3decec..d04220b8f92 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -10773,6 +10773,7 @@ mysql_declare_plugin(ndbcluster)
ndbcluster_hton_name,
"MySQL AB",
"Clustered, fault-tolerant tables",
+ PLUGIN_LICENSE_GPL,
ndbcluster_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 0da0094d92e..deb3bedb203 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -5643,6 +5643,7 @@ mysql_declare_plugin(partition)
"partition",
"Mikael Ronstrom, MySQL AB",
"Partition Storage Engine Helper",
+ PLUGIN_LICENSE_GPL,
partition_initialize, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100, /* 1.0 */
diff --git a/sql/handler.h b/sql/handler.h
index e0827fec5c8..5e26d9c7b63 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -683,6 +683,7 @@ struct handlerton
const char *wild, bool dir, List<char> *files);
int (*table_exists_in_engine)(handlerton *hton, THD* thd, const char *db,
const char *name);
+ uint32 license; /* Flag for Engine License */
};
diff --git a/sql/log.cc b/sql/log.cc
index b718dc014b2..b63ec563baf 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -4689,6 +4689,7 @@ mysql_declare_plugin(binlog)
"binlog",
"MySQL AB",
"This is a pseudo storage engine to represent the binlog in a transaction",
+ PLUGIN_LICENSE_GPL,
binlog_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 45865adddcd..599bca6cbe1 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -211,6 +211,22 @@ static my_bool show_plugins(THD *thd, st_plugin_int *plugin,
else
table->field[8]->set_null();
+ switch (plug->license) {
+ case PLUGIN_LICENSE_GPL:
+ table->field[9]->store(PLUGIN_LICENSE_GPL_STRING,
+ strlen(PLUGIN_LICENSE_GPL_STRING), cs);
+ break;
+ case PLUGIN_LICENSE_BSD:
+ table->field[9]->store(PLUGIN_LICENSE_BSD_STRING,
+ strlen(PLUGIN_LICENSE_BSD_STRING), cs);
+ break;
+ default:
+ table->field[9]->store(PLUGIN_LICENSE_PROPRIETARY_STRING,
+ strlen(PLUGIN_LICENSE_PROPRIETARY_STRING), cs);
+ break;
+ }
+ table->field[9]->set_notnull();
+
return schema_table_store_record(thd, table);
}
@@ -5579,6 +5595,7 @@ ST_FIELD_INFO plugin_fields_info[]=
{"PLUGIN_LIBRARY_VERSION", 20, MYSQL_TYPE_STRING, 0, 1, 0},
{"PLUGIN_AUTHOR", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"PLUGIN_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
+ {"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 1, "License"},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 0fd5f0ed099..b7673fc96ea 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1585,6 +1585,7 @@ mysql_declare_plugin(archive)
"ARCHIVE",
"Brian Aker, MySQL AB",
"Archive storage engine",
+ PLUGIN_LICENSE_GPL,
archive_db_init, /* Plugin Init */
archive_db_done, /* Plugin Deinit */
0x0100 /* 1.0 */,
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 7ab32cccf84..2515f059e02 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -223,6 +223,7 @@ mysql_declare_plugin(blackhole)
"BLACKHOLE",
"MySQL AB",
"/dev/null storage engine (anything you write to it disappears)",
+ PLUGIN_LICENSE_GPL,
blackhole_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 8f090470f49..d7710ad3c9b 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1533,6 +1533,7 @@ mysql_declare_plugin(csv)
"CSV",
"Brian Aker, MySQL AB",
"CSV storage engine",
+ PLUGIN_LICENSE_GPL,
tina_init_func, /* Plugin Init */
tina_done_func, /* Plugin Deinit */
0x0100 /* 1.0 */,
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 68840a41879..212def8c18e 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -717,6 +717,7 @@ mysql_declare_plugin(example)
"EXAMPLE",
"Brian Aker, MySQL AB",
"Example storage engine",
+ PLUGIN_LICENSE_GPL,
example_init_func, /* Plugin Init */
example_done_func, /* Plugin Deinit */
0x0001 /* 0.1 */,
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 3c1cc722f02..00b2ac87cd4 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2895,6 +2895,7 @@ mysql_declare_plugin(federated)
"FEDERATED",
"Patrick Galbraith and Brian Aker, MySQL AB",
"Federated MySQL storage engine",
+ PLUGIN_LICENSE_GPL,
federated_db_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 4a83b2e12d8..8e8744c2d34 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -720,6 +720,7 @@ mysql_declare_plugin(heap)
"MEMORY",
"MySQL AB",
"Hash based, stored in memory, useful for temporary tables",
+ PLUGIN_LICENSE_GPL,
heap_init,
NULL,
0x0100, /* 1.0 */
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 4a4cb1c0d96..066c0ce48d4 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -7640,6 +7640,7 @@ mysql_declare_plugin(innobase)
innobase_hton_name,
"Innobase OY",
"Supports transactions, row-level locking, and foreign keys",
+ PLUGIN_LICENSE_GPL,
innobase_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100 /* 1.0 */,
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 373e098a2b1..03065b43dd5 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1818,6 +1818,7 @@ mysql_declare_plugin(myisam)
"MyISAM",
"MySQL AB",
"Default engine as of MySQL 3.23 with great performance",
+ PLUGIN_LICENSE_GPL,
myisam_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100, /* 1.0 */
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 7f656c2e67c..db66c9d6442 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -582,6 +582,7 @@ mysql_declare_plugin(myisammrg)
"MRG_MYISAM",
"MySQL AB",
"Collection of identical MyISAM tables",
+ PLUGIN_LICENSE_GPL,
myisammrg_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100, /* 1.0 */