1 diff -urNp -x '*.orig' mysql-5.0.96.org/patch_info/show_patches.info mysql-5.0.96/patch_info/show_patches.info
2 --- mysql-5.0.96.org/patch_info/show_patches.info 1970-01-01 01:00:00.000000000 +0100
3 +++ mysql-5.0.96/patch_info/show_patches.info 2022-10-18 08:28:16.729398106 +0200
5 +File=show_patches.patch
11 diff -urNp -x '*.orig' mysql-5.0.96.org/sql/Makefile.am mysql-5.0.96/sql/Makefile.am
12 --- mysql-5.0.96.org/sql/Makefile.am 2022-10-18 08:28:15.669398106 +0200
13 +++ mysql-5.0.96/sql/Makefile.am 2022-10-18 08:28:16.729398106 +0200
14 @@ -121,7 +121,7 @@ DEFS = -DMYSQL_SERVER \
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 \
23 @@ -182,6 +182,8 @@ pkglib_LTLIBRARIES = sphinx/sphinx.la
24 sphinx_sphinx_la_SOURCES = sphinx/snippets_udf.cc
25 sphinx_sphinx_la_LDFLAGS = -module
27 +patch_info.h: patch_info.h.pl
30 # Don't update the files from bitkeeper
32 diff -urNp -x '*.orig' mysql-5.0.96.org/sql/Makefile.in mysql-5.0.96/sql/Makefile.in
33 --- mysql-5.0.96.org/sql/Makefile.in 2012-03-02 15:05:22.000000000 +0100
34 +++ mysql-5.0.96/sql/Makefile.in 2022-10-18 08:28:16.732731440 +0200
35 @@ -568,7 +568,7 @@ gen_lex_hash_SOURCES = gen_lex_hash.cc
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 \
44 @@ -1229,6 +1229,9 @@ lex_hash.h: gen_lex_hash.cc lex.h
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 -urNp -x '*.orig' mysql-5.0.96.org/sql/lex.h mysql-5.0.96/sql/lex.h
55 --- mysql-5.0.96.org/sql/lex.h 2012-03-02 15:04:12.000000000 +0100
56 +++ mysql-5.0.96/sql/lex.h 2022-10-18 08:28:16.732731440 +0200
57 @@ -367,6 +367,7 @@ static SYMBOL symbols[] = {
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 -urNp -x '*.orig' mysql-5.0.96.org/sql/mysql_priv.h mysql-5.0.96/sql/mysql_priv.h
66 --- mysql-5.0.96.org/sql/mysql_priv.h 2022-10-18 08:28:15.672731440 +0200
67 +++ mysql-5.0.96/sql/mysql_priv.h 2022-10-18 08:28:16.732731440 +0200
68 @@ -987,6 +987,7 @@ void mysqld_list_processes(THD *thd,cons
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 -urNp -x '*.orig' mysql-5.0.96.org/sql/patch_info.h.pl mysql-5.0.96/sql/patch_info.h.pl
77 --- mysql-5.0.96.org/sql/patch_info.h.pl 1970-01-01 01:00:00.000000000 +0100
78 +++ mysql-5.0.96/sql/patch_info.h.pl 2022-10-18 08:28:16.732731440 +0200
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 -urNp -x '*.orig' mysql-5.0.96.org/sql/sp_head.cc mysql-5.0.96/sql/sp_head.cc
146 --- mysql-5.0.96.org/sql/sp_head.cc 2012-03-02 15:04:07.000000000 +0100
147 +++ mysql-5.0.96/sql/sp_head.cc 2022-10-18 08:28:16.732731440 +0200
148 @@ -191,6 +191,7 @@ sp_get_flags_for_command(LEX *lex)
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 -urNp -x '*.orig' mysql-5.0.96.org/sql/sql_lex.h mysql-5.0.96/sql/sql_lex.h
157 --- mysql-5.0.96.org/sql/sql_lex.h 2022-10-18 08:28:15.672731440 +0200
158 +++ mysql-5.0.96/sql/sql_lex.h 2022-10-18 08:28:16.732731440 +0200
159 @@ -96,6 +96,7 @@ enum enum_sql_command {
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 -urNp -x '*.orig' mysql-5.0.96.org/sql/sql_parse.cc mysql-5.0.96/sql/sql_parse.cc
168 --- mysql-5.0.96.org/sql/sql_parse.cc 2022-10-18 08:28:15.676064773 +0200
169 +++ mysql-5.0.96/sql/sql_parse.cc 2022-10-18 08:28:16.732731440 +0200
170 @@ -4120,6 +4120,9 @@ end_with_restore_list:
171 case SQLCOM_SHOW_STORAGE_ENGINES:
172 res= mysqld_show_storage_engines(thd);
174 + case SQLCOM_SHOW_PATCHES:
175 + res= mysqld_show_patches(thd);
177 case SQLCOM_SHOW_PRIVILEGES:
178 res= mysqld_show_privileges(thd);
180 diff -urNp -x '*.orig' mysql-5.0.96.org/sql/sql_prepare.cc mysql-5.0.96/sql/sql_prepare.cc
181 --- mysql-5.0.96.org/sql/sql_prepare.cc 2012-03-02 15:04:08.000000000 +0100
182 +++ mysql-5.0.96/sql/sql_prepare.cc 2022-10-18 08:28:16.736064773 +0200
183 @@ -1818,6 +1818,7 @@ static bool check_prepared_statement(Pre
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 -urNp -x '*.orig' mysql-5.0.96.org/sql/sql_show.cc mysql-5.0.96/sql/sql_show.cc
192 --- mysql-5.0.96.org/sql/sql_show.cc 2022-10-18 08:28:15.676064773 +0200
193 +++ mysql-5.0.96/sql/sql_show.cc 2022-10-18 08:28:16.736064773 +0200
197 #include "sql_trigger.h"
198 +#include "patch_info.h"
201 #ifdef HAVE_BERKELEY_DB
202 @@ -46,6 +47,47 @@ static int
203 view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
204 bool schema_table_store_record(THD *thd, TABLE *table);
206 +/***************************************************************************
207 +** List patches built into this release
208 +***************************************************************************/
210 +bool mysqld_show_patches(THD *thd)
212 + List<Item> field_list;
214 + Protocol *protocol= thd->protocol;
215 + DBUG_ENTER("mysqld_show_patches");
217 + field_list.push_back(new Item_empty_string("File", 255));
218 + field_list.push_back(new Item_empty_string("Name", 50));
219 + field_list.push_back(new Item_empty_string("Version", 10));
220 + field_list.push_back(new Item_empty_string("Author", 50));
221 + field_list.push_back(new Item_empty_string("License", 50));
222 + field_list.push_back(new Item_empty_string("Comment", 32));
224 + if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
227 + for (i = 0; patches[i].file; i++)
229 + protocol->prepare_for_resend();
230 + protocol->store(patches[i].file, system_charset_info);
231 + protocol->store(patches[i].name, system_charset_info);
232 + protocol->store(patches[i].version, system_charset_info);
233 + protocol->store(patches[i].author, system_charset_info);
234 + protocol->store(patches[i].license, system_charset_info);
235 + protocol->store(patches[i].comment, system_charset_info);
237 + if (protocol->write())
243 + DBUG_RETURN(FALSE);
248 /***************************************************************************
249 ** List all table types supported
250 diff -urNp -x '*.orig' mysql-5.0.96.org/sql/sql_yacc.yy mysql-5.0.96/sql/sql_yacc.yy
251 --- mysql-5.0.96.org/sql/sql_yacc.yy 2022-10-18 08:28:15.679398106 +0200
252 +++ mysql-5.0.96/sql/sql_yacc.yy 2022-10-18 08:28:16.736064773 +0200
253 @@ -859,6 +859,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
261 @@ -8061,7 +8062,7 @@ show: SHOW
265 - DATABASES wild_and_where
266 + DATABASES wild_and_where
269 lex->sql_command= SQLCOM_SELECT;
270 @@ -8162,6 +8163,10 @@ show_param:
271 lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
272 WARN_DEPRECATED("SHOW TABLE TYPES", "SHOW [STORAGE] ENGINES");
276 + Lex->sql_command= SQLCOM_SHOW_PATCHES;
278 | opt_storage ENGINES_SYM
281 @@ -9596,6 +9601,7 @@ keyword_sp: