~percona-dev/percona-server/release-5.1.52-12-build

« back to all changes in this revision

Viewing changes to show_patches.patch

  • Committer: kinoyasu
  • Date: 2010-04-30 10:17:55 UTC
  • Revision ID: kinoyasu@gauntlet3-20100430101755-h27x25t4uax76lv4
merge, reorder and port patches based on mysql 5.1.46 innodb 1.0.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -ruN a/patch_info/show_patches.info b/patch_info/show_patches.info
 
2
--- /dev/null   1970-01-01 09:00:00.000000000 +0900
 
3
+++ b/patch_info/show_patches.info      2010-04-28 15:29:36.000000000 +0900
 
4
@@ -0,0 +1,9 @@
 
5
+File=show_patches.patch
 
6
+Name=SHOW PATCHES
 
7
+Version=1.0
 
8
+Author=Jeremy Cole
 
9
+License=N/A
 
10
+Comment=
 
11
+Changelog
 
12
+2010-01
 
13
+Ported to 5.1.42
 
14
diff -ruN a/sql/Makefile.am b/sql/Makefile.am
 
15
--- a/sql/Makefile.am   2010-04-06 23:06:05.000000000 +0900
 
16
+++ b/sql/Makefile.am   2010-04-28 15:29:36.000000000 +0900
 
17
@@ -146,7 +146,7 @@
 
18
                        @DEFS@
 
19
 
 
20
 BUILT_MAINT_SRC =      sql_yacc.cc sql_yacc.h
 
21
-BUILT_SOURCES =                $(BUILT_MAINT_SRC) lex_hash.h link_sources
 
22
+BUILT_SOURCES =                $(BUILT_MAINT_SRC) lex_hash.h patch_info.h link_sources
 
23
 EXTRA_DIST =           udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
 
24
                        nt_servc.cc nt_servc.h \
 
25
                        message.mc  message.h message.rc MSG00001.bin \
 
26
@@ -183,6 +183,9 @@
 
27
 udf_example_la_SOURCES= udf_example.c
 
28
 udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
 
29
 
 
30
+patch_info.h:  patch_info.h.pl
 
31
+       $(PERL) $< > $@
 
32
+
 
33
 # We might have some stuff not built in this build, but that we want to install
 
34
 install-exec-hook:
 
35
        $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir)
 
36
diff -ruN a/sql/Makefile.in b/sql/Makefile.in
 
37
--- a/sql/Makefile.in   2010-04-06 23:12:51.000000000 +0900
 
38
+++ b/sql/Makefile.in   2010-04-28 15:29:36.000000000 +0900
 
39
@@ -631,7 +631,7 @@
 
40
 mysql_tzinfo_to_sql_SOURCES = tztime.cc
 
41
 mysql_tzinfo_to_sql_CXXFLAGS = -DTZINFO2SQL
 
42
 BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h
 
43
-BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h link_sources
 
44
+BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h patch_info.h link_sources
 
45
 EXTRA_DIST = udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
 
46
                        nt_servc.cc nt_servc.h \
 
47
                        message.mc  message.h message.rc MSG00001.bin \
 
48
@@ -1316,6 +1316,9 @@
 
49
        test ! -f mysqld-debug.sym.gz   || $(INSTALL_DATA)    mysqld-debug.sym.gz   $(DESTDIR)$(pkglibdir)
 
50
        test ! -f mysqld.sym.gz         || $(INSTALL_DATA)    mysqld.sym.gz         $(DESTDIR)$(pkglibdir)
 
51
 
 
52
+patch_info.h:  patch_info.h.pl
 
53
+       $(PERL) $< > $@
 
54
+
 
55
 # Don't update the files from bitkeeper
 
56
 %::SCCS/s.%
 
57
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 
58
diff -ruN a/sql/lex.h b/sql/lex.h
 
59
--- a/sql/lex.h 2010-04-06 23:07:01.000000000 +0900
 
60
+++ b/sql/lex.h 2010-04-28 15:29:36.000000000 +0900
 
61
@@ -392,6 +392,7 @@
 
62
   { "PARTITIONING",     SYM(PARTITIONING_SYM)},
 
63
   { "PARTITIONS",       SYM(PARTITIONS_SYM)},
 
64
   { "PASSWORD",                SYM(PASSWORD)},
 
65
+  { "PATCHES",         SYM(PATCHES)},
 
66
   { "PHASE",            SYM(PHASE_SYM)},
 
67
   { "PLUGIN",           SYM(PLUGIN_SYM)},
 
68
   { "PLUGINS",          SYM(PLUGINS_SYM)},
 
69
diff -ruN a/sql/mysql_priv.h b/sql/mysql_priv.h
 
70
--- a/sql/mysql_priv.h  2010-04-06 23:07:02.000000000 +0900
 
71
+++ b/sql/mysql_priv.h  2010-04-28 15:29:36.000000000 +0900
 
72
@@ -1368,6 +1368,7 @@
 
73
 int mysqld_show_status(THD *thd);
 
74
 int mysqld_show_variables(THD *thd,const char *wild);
 
75
 bool mysqld_show_storage_engines(THD *thd);
 
76
+bool mysqld_show_patches(THD *thd);
 
77
 bool mysqld_show_authors(THD *thd);
 
78
 bool mysqld_show_contributors(THD *thd);
 
79
 bool mysqld_show_privileges(THD *thd);
 
80
diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
 
81
--- a/sql/mysqld.cc     2010-04-06 23:07:02.000000000 +0900
 
82
+++ b/sql/mysqld.cc     2010-04-28 15:29:36.000000000 +0900
 
83
@@ -3148,6 +3148,7 @@
 
84
   {"show_master_status",   (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_MASTER_STAT]), SHOW_LONG_STATUS},
 
85
   {"show_new_master",      (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_NEW_MASTER]), SHOW_LONG_STATUS},
 
86
   {"show_open_tables",     (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS},
 
87
+  {"show_patches",         (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PATCHES]), SHOW_LONG_STATUS},
 
88
   {"show_plugins",         (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PLUGINS]), SHOW_LONG_STATUS},
 
89
   {"show_privileges",      (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PRIVILEGES]), SHOW_LONG_STATUS},
 
90
 #ifndef DBUG_OFF
 
91
diff -ruN a/sql/patch_info.h.pl b/sql/patch_info.h.pl
 
92
--- /dev/null   1970-01-01 09:00:00.000000000 +0900
 
93
+++ b/sql/patch_info.h.pl       2010-04-28 15:29:36.000000000 +0900
 
94
@@ -0,0 +1,65 @@
 
95
+use strict;
 
96
+
 
97
+my $patch_info_path = '../patch_info';
 
98
+my $file = '';
 
99
+my $output = '';
 
100
+
 
101
+
 
102
+if (opendir(PATCH_DIR, $patch_info_path))
 
103
+{
 
104
+       while ((my $file = readdir(PATCH_DIR)))
 
105
+       {
 
106
+               open(PATCH_FILE, "<$patch_info_path/$file") || die("Unable to open $patch_info_path/$file ($!)");
 
107
+               my %fields;
 
108
+       
 
109
+               if ($file =~ /^\./)
 
110
+               {
 
111
+                       next;
 
112
+               }       
 
113
+       
 
114
+               while (<PATCH_FILE>)
 
115
+               {
 
116
+                       chomp;
 
117
+       
 
118
+                       my ($key, $value) = split(/\s*=\s*/);
 
119
+                       $fields{lc($key)} = $value;
 
120
+               }
 
121
+       
 
122
+               $output .= "{\"$fields{'file'}\", \"$fields{'name'}\", \"$fields{'version'}\", \"$fields{'author'}\", \"$fields{'license'}\",\"$fields{'comment'}\"},\n"
 
123
+       }
 
124
+}      
 
125
+
 
126
+print <<HEADER;
 
127
+
 
128
+/* Copyright (C) 2002-2006 MySQL AB
 
129
+
 
130
+   This program is free software; you can redistribute it and/or modify
 
131
+   it under the terms of the GNU General Public License as published by
 
132
+   the Free Software Foundation; version 2 of the License.
 
133
+
 
134
+   This program is distributed in the hope that it will be useful,
 
135
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
136
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
137
+   GNU General Public License for more details.
 
138
+
 
139
+   You should have received a copy of the GNU General Public License
 
140
+   along with this program; if not, write to the Free Software
 
141
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
142
+
 
143
+#ifdef USE_PRAGMA_INTERFACE
 
144
+#pragma interface                      /* gcc class implementation */
 
145
+#endif
 
146
+
 
147
+struct patch {
 
148
+       const char *file;
 
149
+       const char *name;
 
150
+       const char *version;
 
151
+       const char *author;
 
152
+       const char *license;
 
153
+       const char *comment;
 
154
+}patches[] = {
 
155
+$output
 
156
+{NULL, NULL, NULL, NULL}
 
157
+};     
 
158
+
 
159
+HEADER
 
160
diff -ruN a/sql/sp_head.cc b/sql/sp_head.cc
 
161
--- a/sql/sp_head.cc    2010-04-06 23:07:04.000000000 +0900
 
162
+++ b/sql/sp_head.cc    2010-04-28 15:29:36.000000000 +0900
 
163
@@ -197,6 +197,7 @@
 
164
   case SQLCOM_SHOW_MASTER_STAT:
 
165
   case SQLCOM_SHOW_NEW_MASTER:
 
166
   case SQLCOM_SHOW_OPEN_TABLES:
 
167
+  case SQLCOM_SHOW_PATCHES:
 
168
   case SQLCOM_SHOW_PRIVILEGES:
 
169
   case SQLCOM_SHOW_PROCESSLIST:
 
170
   case SQLCOM_SHOW_PROC_CODE:
 
171
diff -ruN a/sql/sql_lex.h b/sql/sql_lex.h
 
172
--- a/sql/sql_lex.h     2010-04-06 23:07:04.000000000 +0900
 
173
+++ b/sql/sql_lex.h     2010-04-28 15:29:36.000000000 +0900
 
174
@@ -118,6 +118,7 @@
 
175
   SQLCOM_SHOW_CREATE_TRIGGER,
 
176
   SQLCOM_ALTER_DB_UPGRADE,
 
177
   SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
 
178
+  SQLCOM_SHOW_PATCHES,
 
179
 
 
180
   /*
 
181
     When a command is added here, be sure it's also added in mysqld.cc
 
182
diff -ruN a/sql/sql_parse.cc b/sql/sql_parse.cc
 
183
--- a/sql/sql_parse.cc  2010-04-06 23:07:05.000000000 +0900
 
184
+++ b/sql/sql_parse.cc  2010-04-28 15:29:36.000000000 +0900
 
185
@@ -3401,6 +3401,9 @@
 
186
   case SQLCOM_SHOW_CONTRIBUTORS:
 
187
     res= mysqld_show_contributors(thd);
 
188
     break;
 
189
+  case SQLCOM_SHOW_PATCHES:
 
190
+    res= mysqld_show_patches(thd);
 
191
+    break;
 
192
   case SQLCOM_SHOW_PRIVILEGES:
 
193
     res= mysqld_show_privileges(thd);
 
194
     break;
 
195
diff -ruN a/sql/sql_prepare.cc b/sql/sql_prepare.cc
 
196
--- a/sql/sql_prepare.cc        2010-04-06 23:07:05.000000000 +0900
 
197
+++ b/sql/sql_prepare.cc        2010-04-28 15:29:36.000000000 +0900
 
198
@@ -1919,6 +1919,7 @@
 
199
     */
 
200
   case SQLCOM_SHOW_PROCESSLIST:
 
201
   case SQLCOM_SHOW_STORAGE_ENGINES:
 
202
+  case SQLCOM_SHOW_PATCHES:
 
203
   case SQLCOM_SHOW_PRIVILEGES:
 
204
   case SQLCOM_SHOW_COLUMN_TYPES:
 
205
   case SQLCOM_SHOW_ENGINE_LOGS:
 
206
diff -ruN a/sql/sql_show.cc b/sql/sql_show.cc
 
207
--- a/sql/sql_show.cc   2010-04-06 23:07:05.000000000 +0900
 
208
+++ b/sql/sql_show.cc   2010-04-28 15:29:36.000000000 +0900
 
209
@@ -23,6 +23,7 @@
 
210
 #include "sp.h"
 
211
 #include "sp_head.h"
 
212
 #include "sql_trigger.h"
 
213
+#include "patch_info.h"
 
214
 #include "authors.h"
 
215
 #include "contributors.h"
 
216
 #ifdef HAVE_EVENT_SCHEDULER
 
217
@@ -7209,3 +7210,42 @@
 
218
     status and client connection will be closed.
 
219
   */
 
220
 }
 
221
+
 
222
+/***************************************************************************
 
223
+** List patches built into this release
 
224
+***************************************************************************/
 
225
+
 
226
+bool mysqld_show_patches(THD *thd)
 
227
+{
 
228
+  List<Item> field_list;
 
229
+  int i = 0;
 
230
+  Protocol *protocol= thd->protocol;
 
231
+  DBUG_ENTER("mysqld_show_patches");
 
232
+
 
233
+  field_list.push_back(new Item_empty_string("File", 255));
 
234
+  field_list.push_back(new Item_empty_string("Name", 50));
 
235
+  field_list.push_back(new Item_empty_string("Version", 10));
 
236
+  field_list.push_back(new Item_empty_string("Author", 50));
 
237
+  field_list.push_back(new Item_empty_string("License", 50));
 
238
+  field_list.push_back(new Item_empty_string("Comment", 32));
 
239
+
 
240
+  if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
 
241
+    DBUG_RETURN(TRUE);
 
242
+
 
243
+  for (i = 0; patches[i].file; i++)
 
244
+  {
 
245
+    protocol->prepare_for_resend();
 
246
+    protocol->store(patches[i].file, system_charset_info);
 
247
+    protocol->store(patches[i].name, system_charset_info);
 
248
+    protocol->store(patches[i].version, system_charset_info);
 
249
+    protocol->store(patches[i].author, system_charset_info);
 
250
+    protocol->store(patches[i].license, system_charset_info);
 
251
+    protocol->store(patches[i].comment, system_charset_info);
 
252
+
 
253
+    if (protocol->write())
 
254
+      DBUG_RETURN(TRUE);
 
255
+  }
 
256
+
 
257
+  my_eof(thd);
 
258
+  DBUG_RETURN(FALSE);
 
259
+}
 
260
diff -ruN a/sql/sql_yacc.yy b/sql/sql_yacc.yy
 
261
--- a/sql/sql_yacc.yy   2010-04-06 23:07:06.000000000 +0900
 
262
+++ b/sql/sql_yacc.yy   2010-04-28 15:29:36.000000000 +0900
 
263
@@ -1056,6 +1056,7 @@
 
264
 %token  PARTITIONS_SYM
 
265
 %token  PARTITION_SYM                 /* SQL-2003-R */
 
266
 %token  PASSWORD
 
267
+%token  PATCHES
 
268
 %token  PHASE_SYM
 
269
 %token  PLUGINS_SYM
 
270
 %token  PLUGIN_SYM
 
271
@@ -10179,6 +10180,11 @@
 
272
             if (prepare_schema_table(YYTHD, lex, 0, SCH_ENGINES))
 
273
               MYSQL_YYABORT;
 
274
           }
 
275
+        | PATCHES
 
276
+          {
 
277
+            LEX *lex=Lex;
 
278
+            lex->sql_command= SQLCOM_SHOW_PATCHES;
 
279
+          }
 
280
         | opt_storage ENGINES_SYM
 
281
           {
 
282
             LEX *lex=Lex;
 
283
@@ -11771,6 +11777,7 @@
 
284
         | PARTITIONING_SYM         {}
 
285
         | PARTITIONS_SYM           {}
 
286
         | PASSWORD                 {}
 
287
+        | PATCHES                  {}
 
288
         | PHASE_SYM                {}
 
289
         | PLUGIN_SYM               {}
 
290
         | PLUGINS_SYM              {}