]> git.pld-linux.org Git - packages/mysql.git/blob - mysql-show_patches.patch
Rediff patches / changes for newer rpms
[packages/mysql.git] / mysql-show_patches.patch
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
4 @@ -0,0 +1,6 @@
5 +File=show_patches.patch
6 +Name=SHOW PATCHES
7 +Version=1.0
8 +Author=Jeremy Cole
9 +License=N/A
10 +Comment
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)\"" \
16                         @DEFS@
17  
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
26  
27 +patch_info.h: patch_info.h.pl
28 +       $(PERL) $< > $@
29  
30  # Don't update the files from bitkeeper
31  %::SCCS/s.%
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
46                 $(MV) $@-t $@
47  
48 +patch_info.h: patch_info.h.pl
49 +       $(PERL) $< > $@
50 +
51  # Don't update the files from bitkeeper
52  %::SCCS/s.%
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
79 @@ -0,0 +1,65 @@
80 +use strict;
81 +
82 +my $patch_info_path = '../patch_info';
83 +my $file = '';
84 +my $output = '';
85 +
86 +
87 +if (opendir(PATCH_DIR, $patch_info_path))
88 +{
89 +       while ((my $file = readdir(PATCH_DIR)))
90 +       {
91 +               open(PATCH_FILE, "<$patch_info_path/$file") || die("Unable to open $patch_info_path/$file ($!)");
92 +               my %fields;
93 +       
94 +               if ($file =~ /^\./)
95 +               {
96 +                       next;
97 +               }       
98 +       
99 +               while (<PATCH_FILE>)
100 +               {
101 +                       chomp;
102 +       
103 +                       my ($key, $value) = split(/\s*=\s*/);
104 +                       $fields{lc($key)} = $value;
105 +               }
106 +       
107 +               $output .= "{\"$fields{'file'}\", \"$fields{'name'}\", \"$fields{'version'}\", \"$fields{'author'}\", \"$fields{'license'}\",\"$fields{'comment'}\"},\n"
108 +       }
109 +}      
110 +
111 +print <<HEADER;
112 +
113 +/* Copyright (C) 2002-2006 MySQL AB
114 +
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.
118 +
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.
123 +
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 */
127 +
128 +#ifdef USE_PRAGMA_INTERFACE
129 +#pragma interface                      /* gcc class implementation */
130 +#endif
131 +
132 +struct patch {
133 +       const char *file;
134 +       const char *name;
135 +       const char *version;
136 +       const char *author;
137 +       const char *license;
138 +       const char *comment;
139 +}patches[] = {
140 +$output
141 +{NULL, NULL, NULL, NULL}
142 +};     
143 +
144 +HEADER
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,
164  
165    /*
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);
173      break;
174 +  case SQLCOM_SHOW_PATCHES:
175 +    res= mysqld_show_patches(thd);
176 +    break;
177    case SQLCOM_SHOW_PRIVILEGES:
178      res= mysqld_show_privileges(thd);
179      break;
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
194 @@ -22,6 +22,7 @@
195  #include "sp.h"
196  #include "sp_head.h"
197  #include "sql_trigger.h"
198 +#include "patch_info.h"
199  #include <my_dir.h>
200  
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);
205  
206 +/***************************************************************************
207 +** List patches built into this release
208 +***************************************************************************/
209 +
210 +bool mysqld_show_patches(THD *thd)
211 +{
212 +  List<Item> field_list;
213 +       int i = 0;
214 +  Protocol *protocol= thd->protocol;
215 +  DBUG_ENTER("mysqld_show_patches");
216 +
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));
223 +
224 +  if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
225 +    DBUG_RETURN(TRUE);
226 +
227 +       for (i = 0; patches[i].file; i++)
228 +       {
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);
236 +
237 +       if (protocol->write())
238 +       DBUG_RETURN(TRUE);
239 +       }       
240 +
241 +   
242 +  send_eof(thd);
243 +  DBUG_RETURN(FALSE);
244 +
245 +}
246 +
247  
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 **
254  %token  PAGE_SYM
255  %token  PARTIAL
256  %token  PASSWORD
257 +%token  PATCHES
258  %token  PARAM_MARKER
259  %token  PHASE_SYM
260  %token  POINTFROMTEXT
261 @@ -8061,7 +8062,7 @@ show:     SHOW
262         ;
263  
264  show_param:
265 -         DATABASES wild_and_where
266 +        DATABASES wild_and_where
267           {
268             LEX *lex= Lex;
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");
273           }
274 +       | PATCHES
275 +         {
276 +           Lex->sql_command= SQLCOM_SHOW_PATCHES;
277 +         }
278         | opt_storage ENGINES_SYM
279           {
280             LEX *lex=Lex;
281 @@ -9596,6 +9601,7 @@ keyword_sp:
282         | PAGE_SYM              {}
283         | PARTIAL               {}
284         | PASSWORD              {}
285 +       | PATCHES {}
286          | PHASE_SYM             {}
287         | POINT_SYM             {}
288         | POLYGON               {}
This page took 0.076714 seconds and 3 git commands to generate.