1 diff -r c3e57b0c22c4 patch_info/show_patches.info
2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3 +++ b/patch_info/show_patches.info Mon Dec 22 00:25:06 2008 -0800
5 +File=show_patches.patch
11 diff -r c3e57b0c22c4 sql/Makefile.am
12 --- a/sql/Makefile.am Mon Dec 22 00:20:06 2008 -0800
13 +++ b/sql/Makefile.am Mon Dec 22 00:25:06 2008 -0800
15 -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
18 -BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
19 +BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h patch_info.h
20 EXTRA_DIST = $(BUILT_SOURCES) nt_servc.cc nt_servc.h \
21 message.mc message.h message.rc MSG00001.bin \
22 examples/CMakeLists.txt CMakeLists.txt \
24 udf_example_la_SOURCES= udf_example.c
25 udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
27 +patch_info.h: patch_info.h.pl
30 # Don't update the files from bitkeeper
32 diff -r c3e57b0c22c4 sql/Makefile.in
33 --- a/sql/Makefile.in Mon Dec 22 00:20:06 2008 -0800
34 +++ b/sql/Makefile.in Mon Dec 22 00:25:06 2008 -0800
36 gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS)
37 mysql_tzinfo_to_sql_SOURCES = mysql_tzinfo_to_sql.cc
38 mysql_tzinfo_to_sql_LDADD = @MYSQLD_EXTRA_LDFLAGS@ $(LDADD) $(CXXLDFLAGS)
39 -BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h
40 +BUILT_SOURCES = sql_yacc.cc sql_yacc.h lex_hash.h patch_info.h
41 EXTRA_DIST = $(BUILT_SOURCES) nt_servc.cc nt_servc.h \
42 message.mc message.h message.rc MSG00001.bin \
43 examples/CMakeLists.txt CMakeLists.txt \
45 ./gen_lex_hash$(EXEEXT) > $@-t
48 +patch_info.h: patch_info.h.pl
51 # Don't update the files from bitkeeper
53 # Tell versions [3.59,3.63) of GNU make to not export all variables.
54 diff -r c3e57b0c22c4 sql/lex.h
55 --- a/sql/lex.h Mon Dec 22 00:20:06 2008 -0800
56 +++ b/sql/lex.h Mon Dec 22 00:25:06 2008 -0800
58 { "PACK_KEYS", SYM(PACK_KEYS_SYM)},
59 { "PARTIAL", SYM(PARTIAL)},
60 { "PASSWORD", SYM(PASSWORD)},
61 + { "PATCHES", SYM(PATCHES)},
62 { "PHASE", SYM(PHASE_SYM)},
63 { "POINT", SYM(POINT_SYM)},
64 { "POLYGON", SYM(POLYGON)},
65 diff -r c3e57b0c22c4 sql/mysql_priv.h
66 --- a/sql/mysql_priv.h Mon Dec 22 00:20:06 2008 -0800
67 +++ b/sql/mysql_priv.h Mon Dec 22 00:25:06 2008 -0800
69 int mysqld_show_status(THD *thd);
70 int mysqld_show_variables(THD *thd,const char *wild);
71 bool mysqld_show_storage_engines(THD *thd);
72 +bool mysqld_show_patches(THD *thd);
73 bool mysqld_show_privileges(THD *thd);
74 bool mysqld_show_column_types(THD *thd);
75 bool mysqld_help (THD *thd, const char *text);
76 diff -r c3e57b0c22c4 sql/patch_info.h.pl
77 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
78 +++ b/sql/patch_info.h.pl Mon Dec 22 00:25:06 2008 -0800
82 +my $patch_info_path = '../patch_info';
87 +if (opendir(PATCH_DIR, $patch_info_path))
89 + while ((my $file = readdir(PATCH_DIR)))
91 + open(PATCH_FILE, "<$patch_info_path/$file") || die("Unable to open $patch_info_path/$file ($!)");
99 + while (<PATCH_FILE>)
103 + my ($key, $value) = split(/\s*=\s*/);
104 + $fields{lc($key)} = $value;
107 + $output .= "{\"$fields{'file'}\", \"$fields{'name'}\", \"$fields{'version'}\", \"$fields{'author'}\", \"$fields{'license'}\",\"$fields{'comment'}\"},\n"
113 +/* Copyright (C) 2002-2006 MySQL AB
115 + This program is free software; you can redistribute it and/or modify
116 + it under the terms of the GNU General Public License as published by
117 + the Free Software Foundation; version 2 of the License.
119 + This program is distributed in the hope that it will be useful,
120 + but WITHOUT ANY WARRANTY; without even the implied warranty of
121 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
122 + GNU General Public License for more details.
124 + You should have received a copy of the GNU General Public License
125 + along with this program; if not, write to the Free Software
126 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
128 +#ifdef USE_PRAGMA_INTERFACE
129 +#pragma interface /* gcc class implementation */
135 + const char *version;
136 + const char *author;
137 + const char *license;
138 + const char *comment;
141 +{NULL, NULL, NULL, NULL}
145 diff -r c3e57b0c22c4 sql/sp_head.cc
146 --- a/sql/sp_head.cc Mon Dec 22 00:20:06 2008 -0800
147 +++ b/sql/sp_head.cc Mon Dec 22 00:25:06 2008 -0800
149 case SQLCOM_SHOW_MUTEX_STATUS:
150 case SQLCOM_SHOW_NEW_MASTER:
151 case SQLCOM_SHOW_OPEN_TABLES:
152 + case SQLCOM_SHOW_PATCHES:
153 case SQLCOM_SHOW_PRIVILEGES:
154 case SQLCOM_SHOW_PROCESSLIST:
155 case SQLCOM_SHOW_SLAVE_HOSTS:
156 diff -r c3e57b0c22c4 sql/sql_lex.h
157 --- a/sql/sql_lex.h Mon Dec 22 00:20:06 2008 -0800
158 +++ b/sql/sql_lex.h Mon Dec 22 00:25:06 2008 -0800
160 SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER,
161 SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE,
162 SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
163 + SQLCOM_SHOW_PATCHES,
166 When a command is added here, be sure it's also added in mysqld.cc
167 diff -r c3e57b0c22c4 sql/sql_parse.cc
168 --- a/sql/sql_parse.cc Mon Dec 22 00:20:06 2008 -0800
169 +++ b/sql/sql_parse.cc Mon Dec 22 00:25:06 2008 -0800
170 @@ -3947,6 +3947,9 @@
172 case SQLCOM_SHOW_STORAGE_ENGINES:
173 res= mysqld_show_storage_engines(thd);
175 + case SQLCOM_SHOW_PATCHES:
176 + res= mysqld_show_patches(thd);
178 case SQLCOM_SHOW_PRIVILEGES:
179 res= mysqld_show_privileges(thd);
180 diff -r c3e57b0c22c4 sql/sql_prepare.cc
181 --- a/sql/sql_prepare.cc Mon Dec 22 00:20:06 2008 -0800
182 +++ b/sql/sql_prepare.cc Mon Dec 22 00:25:06 2008 -0800
183 @@ -1790,6 +1790,7 @@
184 case SQLCOM_SHOW_DATABASES:
185 case SQLCOM_SHOW_PROCESSLIST:
186 case SQLCOM_SHOW_STORAGE_ENGINES:
187 + case SQLCOM_SHOW_PATCHES:
188 case SQLCOM_SHOW_PRIVILEGES:
189 case SQLCOM_SHOW_COLUMN_TYPES:
190 case SQLCOM_SHOW_STATUS:
191 diff -r c3e57b0c22c4 sql/sql_show.cc
192 --- a/sql/sql_show.cc Mon Dec 22 00:20:06 2008 -0800
193 +++ b/sql/sql_show.cc Mon Dec 22 00:25:06 2008 -0800
197 #include "sql_trigger.h"
198 +#include "patch_info.h"
201 #ifdef HAVE_BERKELEY_DB
204 view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
205 bool schema_table_store_record(THD *thd, TABLE *table);
207 +/***************************************************************************
208 +** List patches built into this release
209 +***************************************************************************/
211 +bool mysqld_show_patches(THD *thd)
213 + List<Item> field_list;
215 + Protocol *protocol= thd->protocol;
216 + DBUG_ENTER("mysqld_show_patches");
218 + field_list.push_back(new Item_empty_string("File", 255));
219 + field_list.push_back(new Item_empty_string("Name", 50));
220 + field_list.push_back(new Item_empty_string("Version", 10));
221 + field_list.push_back(new Item_empty_string("Author", 50));
222 + field_list.push_back(new Item_empty_string("License", 50));
223 + field_list.push_back(new Item_empty_string("Comment", 32));
225 + if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
228 + for (i = 0; patches[i].file; i++)
230 + protocol->prepare_for_resend();
231 + protocol->store(patches[i].file, system_charset_info);
232 + protocol->store(patches[i].name, system_charset_info);
233 + protocol->store(patches[i].version, system_charset_info);
234 + protocol->store(patches[i].author, system_charset_info);
235 + protocol->store(patches[i].license, system_charset_info);
236 + protocol->store(patches[i].comment, system_charset_info);
238 + if (protocol->write())
244 + DBUG_RETURN(FALSE);
249 /***************************************************************************
250 diff -r c3e57b0c22c4 sql/sql_yacc.yy
251 --- a/sql/sql_yacc.yy Mon Dec 22 00:20:06 2008 -0800
252 +++ b/sql/sql_yacc.yy Mon Dec 22 00:25:06 2008 -0800
261 @@ -8019,7 +8020,7 @@
265 - DATABASES wild_and_where
266 + DATABASES wild_and_where
269 lex->sql_command= SQLCOM_SELECT;
270 @@ -8119,6 +8120,10 @@
272 lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
273 WARN_DEPRECATED("SHOW TABLE TYPES", "SHOW [STORAGE] ENGINES");
277 + Lex->sql_command= SQLCOM_SHOW_PATCHES;
279 | opt_storage ENGINES_SYM
281 @@ -9554,6 +9559,7 @@