]> git.pld-linux.org Git - packages/mysql.git/blob - mysql-show_patches.patch
- update from ourdelta patches: sphinxsearch/sphinx_engine/sphinx.5.0.86.patch
[packages/mysql.git] / mysql-show_patches.patch
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
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 -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
14 @@ -118,7 +118,7 @@
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 @@ -175,6 +175,8 @@
24  udf_example_la_SOURCES= udf_example.c
25  udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
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 -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
35 @@ -561,7 +561,7 @@
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 @@ -1237,6 +1237,9 @@
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 -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
57 @@ -367,6 +367,7 @@
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
68 @@ -968,6 +968,7 @@
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
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 -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
148 @@ -191,6 +191,7 @@
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
159 @@ -95,6 +95,7 @@
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 -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 @@
171      break;
172    case SQLCOM_SHOW_STORAGE_ENGINES:
173      res= mysqld_show_storage_engines(thd);
174 +    break;
175 +  case SQLCOM_SHOW_PATCHES:
176 +    res= mysqld_show_patches(thd);
177      break;
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
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 @@ -45,6 +46,47 @@
203  static int
204  view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
205  bool schema_table_store_record(THD *thd, TABLE *table);
206 +
207 +/***************************************************************************
208 +** List patches built into this release
209 +***************************************************************************/
210 +
211 +bool mysqld_show_patches(THD *thd)
212 +{
213 +  List<Item> field_list;
214 +       int i = 0;
215 +  Protocol *protocol= thd->protocol;
216 +  DBUG_ENTER("mysqld_show_patches");
217 +
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));
224 +
225 +  if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
226 +    DBUG_RETURN(TRUE);
227 +
228 +       for (i = 0; patches[i].file; i++)
229 +       {
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);
237 +
238 +       if (protocol->write())
239 +       DBUG_RETURN(TRUE);
240 +       }       
241 +
242 +   
243 +  send_eof(thd);
244 +  DBUG_RETURN(FALSE);
245 +
246 +}
247  
248  
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
253 @@ -824,6 +824,7 @@
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 @@ -8019,7 +8020,7 @@
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 @@ -8119,6 +8120,10 @@
271             LEX *lex=Lex;
272             lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
273             WARN_DEPRECATED("SHOW TABLE TYPES", "SHOW [STORAGE] ENGINES");
274 +         }
275 +       | PATCHES
276 +         {
277 +           Lex->sql_command= SQLCOM_SHOW_PATCHES;
278           }
279         | opt_storage ENGINES_SYM
280           {
281 @@ -9554,6 +9559,7 @@
282         | PAGE_SYM              {}
283         | PARTIAL               {}
284         | PASSWORD              {}
285 +       | PATCHES {}
286          | PHASE_SYM             {}
287         | POINT_SYM             {}
288         | POLYGON               {}
This page took 0.055164 seconds and 3 git commands to generate.