~ubuntu-branches/ubuntu/gutsy/mysql-dfsg-5.0/gutsy

« back to all changes in this revision

Viewing changes to scripts/mysql_create_system_tables.sh

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-04-03 09:43:01 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20070403094301-fnjhfr59hu72pvtg
Tags: 5.0.38-0ubuntu1
* Package the Enterprise version again (.37 was a community version), since
  Debian and we have always done so. This brings in a few more bug fixes and
  makes functional derivations less likely.
* debian/README.Maintainer: Add pointer to upstream download URL, since it
  is very hard to find the Enterprise versions.
* Disable 33_scripts__mysql_create_system_tables__no_test.dpatch, since that
  script was removed upstream.
* debian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch: Adapted to
  changed formatting in new upstream version.
* Remove debian/patches/86_PATH_MAX.dpatch, fixed upstream.
* Add debian/patches/90_org_tables_definition.dpatch: Fix local variable
  declaration in libmysqld/sql_parse.cc to fix compilation with
  EMBEDDED_LIBRARY.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Copyright (C) 1997-2003 MySQL AB
3
 
4
 
# This program is free software; you can redistribute it and/or modify
5
 
# it under the terms of the GNU General Public License as published by
6
 
# the Free Software Foundation; version 2 of the License.
7
 
8
 
# This program is distributed in the hope that it will be useful,
9
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
# GNU General Public License for more details.
12
 
13
 
# You should have received a copy of the GNU General Public License
14
 
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16
 
 
17
 
# This script writes on stdout SQL commands to generate all not
18
 
# existing MySQL system tables. It also replaces the help tables with
19
 
# new context from the manual (from fill_help_tables.sql).
20
 
 
21
 
# $1 - "test" or "real" or "verbose" variant of database
22
 
# $2 - path to mysql-database directory
23
 
# $3 - hostname  
24
 
# $4 - windows option
25
 
 
26
 
if test "$1" = ""
27
 
then
28
 
  echo "
29
 
This script writes on stdout SQL commands to generate all not
30
 
existing MySQL system tables. It also replaces the help tables with
31
 
new context from the manual (from fill_help_tables.sql).
32
 
 
33
 
Usage:
34
 
  mysql_create_system_tables [test|verbose|real] <path to mysql-database directory> <hostname> <windows option>
35
 
"
36
 
  exit
37
 
fi
38
 
 
39
 
mdata=$2
40
 
hostname=$3
41
 
windows=$4
42
 
 
43
 
# Initialize variables
44
 
c_d="" i_d=""
45
 
c_h="" i_h=""
46
 
c_u="" i_u=""
47
 
c_f="" i_f=""
48
 
c_t="" c_c=""
49
 
c_ht=""
50
 
c_hc=""
51
 
c_hr="" 
52
 
c_hk="" 
53
 
i_ht=""
54
 
c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls=""
55
 
i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls=""
56
 
c_p="" c_pp=""
57
 
 
58
 
# Check for old tables
59
 
if test ! -f $mdata/db.frm
60
 
then
61
 
  if test "$1" = "verbose" ; then
62
 
    echo "Preparing db table" 1>&2; 
63
 
  fi
64
 
 
65
 
  # mysqld --bootstrap wants one command/line
66
 
  c_d="$c_d CREATE TABLE db ("
67
 
  c_d="$c_d   Host char(60) binary DEFAULT '' NOT NULL,"
68
 
  c_d="$c_d   Db char(64) binary DEFAULT '' NOT NULL,"
69
 
  c_d="$c_d   User char(16) binary DEFAULT '' NOT NULL,"
70
 
  c_d="$c_d   Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
71
 
  c_d="$c_d   Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
72
 
  c_d="$c_d   Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
73
 
  c_d="$c_d   Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
74
 
  c_d="$c_d   Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
75
 
  c_d="$c_d   Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
76
 
  c_d="$c_d   Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
77
 
  c_d="$c_d   References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
78
 
  c_d="$c_d   Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
79
 
  c_d="$c_d   Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
80
 
  c_d="$c_d   Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
81
 
  c_d="$c_d   Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
82
 
  c_d="$c_d   Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
83
 
  c_d="$c_d   Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
84
 
  c_d="$c_d   Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
85
 
  c_d="$c_d   Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
86
 
  c_d="$c_d   Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
87
 
  c_d="$c_d PRIMARY KEY Host (Host,Db,User),"
88
 
  c_d="$c_d KEY User (User)"
89
 
  c_d="$c_d ) engine=MyISAM"
90
 
  c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin"
91
 
  c_d="$c_d comment='Database privileges';"
92
 
  
93
 
  i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
94
 
  INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');"
95
 
fi
96
 
 
97
 
if test ! -f $mdata/host.frm
98
 
then
99
 
  if test "$1" = "verbose" ; then
100
 
    echo "Preparing host table" 1>&2;
101
 
  fi
102
 
 
103
 
  c_h="$c_h CREATE TABLE host ("
104
 
  c_h="$c_h  Host char(60) binary DEFAULT '' NOT NULL,"
105
 
  c_h="$c_h  Db char(64) binary DEFAULT '' NOT NULL,"
106
 
  c_h="$c_h  Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
107
 
  c_h="$c_h  Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
108
 
  c_h="$c_h  Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
109
 
  c_h="$c_h  Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
110
 
  c_h="$c_h  Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
111
 
  c_h="$c_h  Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
112
 
  c_h="$c_h  Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
113
 
  c_h="$c_h  References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
114
 
  c_h="$c_h  Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
115
 
  c_h="$c_h  Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
116
 
  c_h="$c_h  Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
117
 
  c_h="$c_h  Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
118
 
  c_h="$c_h  Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
119
 
  c_h="$c_h  Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
120
 
  c_h="$c_h  Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
121
 
  c_h="$c_h  Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
122
 
  c_h="$c_h  Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
123
 
  c_h="$c_h  PRIMARY KEY Host (Host,Db)"
124
 
  c_h="$c_h ) engine=MyISAM"
125
 
  c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin"
126
 
  c_h="$c_h comment='Host privileges;  Merged with database privileges';"
127
 
fi
128
 
 
129
 
if test ! -f $mdata/user.frm
130
 
then
131
 
  if test "$1" = "verbose" ; then
132
 
    echo "Preparing user table" 1>&2;
133
 
  fi
134
 
 
135
 
  c_u="$c_u CREATE TABLE user ("
136
 
  c_u="$c_u   Host char(60) binary DEFAULT '' NOT NULL,"
137
 
  c_u="$c_u   User char(16) binary DEFAULT '' NOT NULL,"
138
 
  c_u="$c_u   Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL,"
139
 
  c_u="$c_u   Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
140
 
  c_u="$c_u   Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
141
 
  c_u="$c_u   Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
142
 
  c_u="$c_u   Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
143
 
  c_u="$c_u   Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
144
 
  c_u="$c_u   Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
145
 
  c_u="$c_u   Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
146
 
  c_u="$c_u   Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
147
 
  c_u="$c_u   Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
148
 
  c_u="$c_u   File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
149
 
  c_u="$c_u   Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
150
 
  c_u="$c_u   References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
151
 
  c_u="$c_u   Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
152
 
  c_u="$c_u   Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
153
 
  c_u="$c_u   Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
154
 
  c_u="$c_u   Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
155
 
  c_u="$c_u   Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
156
 
  c_u="$c_u   Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
157
 
  c_u="$c_u   Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
158
 
  c_u="$c_u   Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
159
 
  c_u="$c_u   Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
160
 
  c_u="$c_u   Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
161
 
  c_u="$c_u   Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
162
 
  c_u="$c_u   Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
163
 
  c_u="$c_u   Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
164
 
  c_u="$c_u   Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
165
 
  c_u="$c_u   ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
166
 
  c_u="$c_u   ssl_cipher BLOB NOT NULL,"
167
 
  c_u="$c_u   x509_issuer BLOB NOT NULL,"
168
 
  c_u="$c_u   x509_subject BLOB NOT NULL,"
169
 
  c_u="$c_u   max_questions int(11) unsigned DEFAULT 0  NOT NULL,"
170
 
  c_u="$c_u   max_updates int(11) unsigned DEFAULT 0  NOT NULL,"
171
 
  c_u="$c_u   max_connections int(11) unsigned DEFAULT 0  NOT NULL,"
172
 
  c_u="$c_u   max_user_connections int(11) unsigned DEFAULT 0  NOT NULL,"
173
 
  c_u="$c_u   PRIMARY KEY Host (Host,User)"
174
 
  c_u="$c_u ) engine=MyISAM"
175
 
  c_u="$c_u CHARACTER SET utf8 COLLATE utf8_bin"
176
 
  c_u="$c_u comment='Users and global privileges';"
177
 
 
178
 
  if test "$1" = "test" 
179
 
  then
180
 
    i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
181
 
    INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
182
 
    REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
183
 
    INSERT INTO user (host,user) values ('localhost','');
184
 
    INSERT INTO user (host,user) values ('$hostname','');"
185
 
  else
186
 
    i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);"
187
 
    if test "$windows" = "0"
188
 
    then
189
 
      i_u="$i_u
190
 
           INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
191
 
           INSERT INTO user (host,user) values ('$hostname','');
192
 
           INSERT INTO user (host,user) values ('localhost','');"
193
 
    else
194
 
      i_u="$i_u
195
 
           INSERT INTO user (host,user) VALUES ('localhost','');"
196
 
    fi
197
 
  fi 
198
 
fi
199
 
 
200
 
if test ! -f $mdata/func.frm
201
 
then
202
 
  if test "$1" = "verbose" ; then
203
 
    echo "Preparing func table" 1>&2;
204
 
  fi
205
 
 
206
 
  c_f="$c_f CREATE TABLE func ("
207
 
  c_f="$c_f   name char(64) binary DEFAULT '' NOT NULL,"
208
 
  c_f="$c_f   ret tinyint(1) DEFAULT '0' NOT NULL,"
209
 
  c_f="$c_f   dl char(128) DEFAULT '' NOT NULL,"
210
 
  c_f="$c_f   type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL,"
211
 
  c_f="$c_f   PRIMARY KEY (name)"
212
 
  c_f="$c_f ) engine=MyISAM"
213
 
  c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin"
214
 
  c_f="$c_f   comment='User defined functions';"
215
 
fi
216
 
 
217
 
if test ! -f $mdata/tables_priv.frm
218
 
then
219
 
  if test "$1" = "verbose" ; then
220
 
    echo "Preparing tables_priv table" 1>&2;
221
 
  fi
222
 
 
223
 
  c_t="$c_t CREATE TABLE tables_priv ("
224
 
  c_t="$c_t   Host char(60) binary DEFAULT '' NOT NULL,"
225
 
  c_t="$c_t   Db char(64) binary DEFAULT '' NOT NULL,"
226
 
  c_t="$c_t   User char(16) binary DEFAULT '' NOT NULL,"
227
 
  c_t="$c_t   Table_name char(64) binary DEFAULT '' NOT NULL,"
228
 
  c_t="$c_t   Grantor char(77) DEFAULT '' NOT NULL,"
229
 
  c_t="$c_t   Timestamp timestamp(14),"
230
 
  c_t="$c_t   Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
231
 
  c_t="$c_t   Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
232
 
  c_t="$c_t   PRIMARY KEY (Host,Db,User,Table_name),"
233
 
  c_t="$c_t   KEY Grantor (Grantor)"
234
 
  c_t="$c_t ) engine=MyISAM"
235
 
  c_t="$c_t CHARACTER SET utf8 COLLATE utf8_bin"
236
 
  c_t="$c_t   comment='Table privileges';"
237
 
fi
238
 
 
239
 
if test ! -f $mdata/columns_priv.frm
240
 
then
241
 
  if test "$1" = "verbose" ; then
242
 
    echo "Preparing columns_priv table" 1>&2;
243
 
  fi
244
 
 
245
 
  c_c="$c_c CREATE TABLE columns_priv ("
246
 
  c_c="$c_c   Host char(60) binary DEFAULT '' NOT NULL,"
247
 
  c_c="$c_c   Db char(64) binary DEFAULT '' NOT NULL,"
248
 
  c_c="$c_c   User char(16) binary DEFAULT '' NOT NULL,"
249
 
  c_c="$c_c   Table_name char(64) binary DEFAULT '' NOT NULL,"
250
 
  c_c="$c_c   Column_name char(64) binary DEFAULT '' NOT NULL,"
251
 
  c_c="$c_c   Timestamp timestamp(14),"
252
 
  c_c="$c_c   Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
253
 
  c_c="$c_c   PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
254
 
  c_c="$c_c ) engine=MyISAM"
255
 
  c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin"
256
 
  c_c="$c_c   comment='Column privileges';"
257
 
fi
258
 
 
259
 
if test ! -f $mdata/procs_priv.frm
260
 
then
261
 
  if test "$1" = "verbose" ; then
262
 
    echo "Preparing procs_priv table" 1>&2;
263
 
  fi
264
 
 
265
 
  c_pp="$c_pp CREATE TABLE procs_priv ("
266
 
  c_pp="$c_pp   Host char(60) binary DEFAULT '' NOT NULL,"
267
 
  c_pp="$c_pp   Db char(64) binary DEFAULT '' NOT NULL,"
268
 
  c_pp="$c_pp   User char(16) binary DEFAULT '' NOT NULL,"
269
 
  c_pp="$c_pp   Routine_name char(64) binary DEFAULT '' NOT NULL,"
270
 
  c_pp="$c_pp   Routine_type enum('FUNCTION','PROCEDURE') NOT NULL,"
271
 
  c_pp="$c_pp   Grantor char(77) DEFAULT '' NOT NULL,"
272
 
  c_pp="$c_pp   Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
273
 
  c_pp="$c_pp   Timestamp timestamp(14),"
274
 
  c_pp="$c_pp   PRIMARY KEY (Host,Db,User,Routine_name,Routine_type),"
275
 
  c_pp="$c_pp   KEY Grantor (Grantor)"
276
 
  c_pp="$c_pp ) engine=MyISAM"
277
 
  c_pp="$c_pp CHARACTER SET utf8 COLLATE utf8_bin"
278
 
  c_pp="$c_pp   comment='Procedure privileges';"
279
 
fi
280
 
 
281
 
if test ! -f $mdata/help_topic.frm
282
 
then
283
 
  if test "$1" = "verbose" ; then
284
 
    echo "Preparing help_topic table" 1>&2;
285
 
  fi
286
 
 
287
 
  c_ht="$c_ht CREATE TABLE help_topic ("
288
 
  c_ht="$c_ht   help_topic_id    int unsigned not null,"
289
 
  c_ht="$c_ht   name             char(64) not null,"
290
 
  c_ht="$c_ht   help_category_id smallint unsigned not null,"
291
 
  c_ht="$c_ht   description      text not null,"
292
 
  c_ht="$c_ht   example          text not null,"
293
 
  c_ht="$c_ht   url              char(128) not null,"
294
 
  c_ht="$c_ht   primary key      (help_topic_id),"
295
 
  c_ht="$c_ht   unique index     (name)"
296
 
  c_ht="$c_ht ) engine=MyISAM"
297
 
  c_ht="$c_ht CHARACTER SET utf8"
298
 
  c_ht="$c_ht   comment='help topics';"
299
 
fi
300
 
 
301
 
old_categories="yes"
302
 
                    
303
 
if test ! -f $mdata/help_category.frm
304
 
then
305
 
  if test "$1" = "verbose" ; then
306
 
    echo "Preparing help_category table" 1>&2;
307
 
  fi
308
 
  
309
 
  c_hc="$c_hc CREATE TABLE help_category ("
310
 
  c_hc="$c_hc   help_category_id   smallint unsigned not null,"
311
 
  c_hc="$c_hc   name               char(64) not null,"
312
 
  c_hc="$c_hc   parent_category_id smallint unsigned null,"
313
 
  c_hc="$c_hc   url                char(128) not null,"
314
 
  c_hc="$c_hc   primary key        (help_category_id),"
315
 
  c_hc="$c_hc   unique index       (name)"
316
 
  c_hc="$c_hc ) engine=MyISAM"
317
 
  c_hc="$c_hc CHARACTER SET utf8"
318
 
  c_hc="$c_hc   comment='help categories';"
319
 
fi
320
 
 
321
 
if test ! -f $mdata/help_keyword.frm
322
 
then
323
 
  if test "$1" = "verbose" ; then
324
 
    echo "Preparing help_keyword table" 1>&2;
325
 
  fi
326
 
 
327
 
  c_hk="$c_hk CREATE TABLE help_keyword ("
328
 
  c_hk="$c_hk   help_keyword_id  int unsigned not null,"
329
 
  c_hk="$c_hk   name             char(64) not null,"
330
 
  c_hk="$c_hk   primary key      (help_keyword_id),"
331
 
  c_hk="$c_hk   unique index     (name)"
332
 
  c_hk="$c_hk ) engine=MyISAM"
333
 
  c_hk="$c_hk CHARACTER SET utf8"
334
 
  c_hk="$c_hk   comment='help keywords';"
335
 
fi
336
 
                                    
337
 
if test ! -f $mdata/help_relation.frm
338
 
then
339
 
  if test "$1" = "verbose" ; then
340
 
   echo "Preparing help_relation table" 1>&2;
341
 
  fi
342
 
 
343
 
  c_hr="$c_hr CREATE TABLE help_relation ("
344
 
  c_hr="$c_hr   help_topic_id    int unsigned not null references help_topic,"
345
 
  c_hr="$c_hr   help_keyword_id  int unsigned not null references help_keyword,"
346
 
  c_hr="$c_hr   primary key      (help_keyword_id, help_topic_id)"
347
 
  c_hr="$c_hr ) engine=MyISAM"
348
 
  c_hr="$c_hr CHARACTER SET utf8"
349
 
  c_hr="$c_hr   comment='keyword-topic relation';"
350
 
fi
351
 
 
352
 
if test ! -f $mdata/time_zone_name.frm
353
 
then
354
 
  if test "$1" = "verbose" ; then
355
 
   echo "Preparing time_zone_name table" 1>&2;
356
 
  fi
357
 
 
358
 
  c_tzn="$c_tzn CREATE TABLE time_zone_name ("
359
 
  c_tzn="$c_tzn   Name char(64) NOT NULL,"
360
 
  c_tzn="$c_tzn   Time_zone_id int unsigned NOT NULL,"
361
 
  c_tzn="$c_tzn   PRIMARY KEY Name (Name)"
362
 
  c_tzn="$c_tzn ) engine=MyISAM CHARACTER SET utf8"
363
 
  c_tzn="$c_tzn   comment='Time zone names';"
364
 
  
365
 
  if test "$1" = "test" 
366
 
  then
367
 
    i_tzn="$i_tzn INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
368
 
    i_tzn="$i_tzn   ('MET', 1), ('UTC', 2), ('Universal', 2), "
369
 
    i_tzn="$i_tzn   ('Europe/Moscow',3), ('leap/Europe/Moscow',4), "
370
 
    i_tzn="$i_tzn   ('Japan', 5);"
371
 
  fi
372
 
fi
373
 
 
374
 
if test ! -f $mdata/time_zone.frm
375
 
then
376
 
  if test "$1" = "verbose" ; then
377
 
   echo "Preparing time_zone table" 1>&2;
378
 
  fi
379
 
 
380
 
  c_tz="$c_tz CREATE TABLE time_zone ("
381
 
  c_tz="$c_tz   Time_zone_id int unsigned NOT NULL auto_increment,"
382
 
  c_tz="$c_tz   Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
383
 
  c_tz="$c_tz   PRIMARY KEY TzId (Time_zone_id)"
384
 
  c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8"
385
 
  c_tz="$c_tz   comment='Time zones';"
386
 
  
387
 
  if test "$1" = "test" 
388
 
  then
389
 
    i_tz="$i_tz INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" 
390
 
    i_tz="$i_tz   VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');"
391
 
  fi
392
 
fi
393
 
 
394
 
if test ! -f $mdata/time_zone_transition.frm
395
 
then
396
 
  if test "$1" = "verbose" ; then
397
 
   echo "Preparing time_zone_transition table" 1>&2;
398
 
  fi
399
 
 
400
 
  c_tzt="$c_tzt CREATE TABLE time_zone_transition ("
401
 
  c_tzt="$c_tzt   Time_zone_id int unsigned NOT NULL,"
402
 
  c_tzt="$c_tzt   Transition_time bigint signed NOT NULL,"
403
 
  c_tzt="$c_tzt   Transition_type_id int unsigned NOT NULL,"
404
 
  c_tzt="$c_tzt   PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
405
 
  c_tzt="$c_tzt ) engine=MyISAM CHARACTER SET utf8"
406
 
  c_tzt="$c_tzt   comment='Time zone transitions';"
407
 
  
408
 
  if test "$1" = "test" 
409
 
  then
410
 
    i_tzt="$i_tzt INSERT INTO time_zone_transition"
411
 
    i_tzt="$i_tzt   (Time_zone_id, Transition_time, Transition_type_id)"
412
 
    i_tzt="$i_tzt VALUES"
413
 
    i_tzt="$i_tzt   (1, -1693706400, 0) ,(1, -1680483600, 1)"
414
 
    i_tzt="$i_tzt  ,(1, -1663455600, 2) ,(1, -1650150000, 3)"
415
 
    i_tzt="$i_tzt  ,(1, -1632006000, 2) ,(1, -1618700400, 3)"
416
 
    i_tzt="$i_tzt  ,(1, -938905200, 2) ,(1, -857257200, 3)"
417
 
    i_tzt="$i_tzt  ,(1, -844556400, 2) ,(1, -828226800, 3)"
418
 
    i_tzt="$i_tzt  ,(1, -812502000, 2) ,(1, -796777200, 3)"
419
 
    i_tzt="$i_tzt  ,(1, 228877200, 2) ,(1, 243997200, 3)"
420
 
    i_tzt="$i_tzt  ,(1, 260326800, 2) ,(1, 276051600, 3)"
421
 
    i_tzt="$i_tzt  ,(1, 291776400, 2) ,(1, 307501200, 3)"
422
 
    i_tzt="$i_tzt  ,(1, 323830800, 2) ,(1, 338950800, 3)"
423
 
    i_tzt="$i_tzt  ,(1, 354675600, 2) ,(1, 370400400, 3)"
424
 
    i_tzt="$i_tzt  ,(1, 386125200, 2) ,(1, 401850000, 3)"
425
 
    i_tzt="$i_tzt  ,(1, 417574800, 2) ,(1, 433299600, 3)"
426
 
    i_tzt="$i_tzt  ,(1, 449024400, 2) ,(1, 465354000, 3)"
427
 
    i_tzt="$i_tzt  ,(1, 481078800, 2) ,(1, 496803600, 3)"
428
 
    i_tzt="$i_tzt  ,(1, 512528400, 2) ,(1, 528253200, 3)"
429
 
    i_tzt="$i_tzt  ,(1, 543978000, 2) ,(1, 559702800, 3)"
430
 
    i_tzt="$i_tzt  ,(1, 575427600, 2) ,(1, 591152400, 3)"
431
 
    i_tzt="$i_tzt  ,(1, 606877200, 2) ,(1, 622602000, 3)"
432
 
    i_tzt="$i_tzt  ,(1, 638326800, 2) ,(1, 654656400, 3)"
433
 
    i_tzt="$i_tzt  ,(1, 670381200, 2) ,(1, 686106000, 3)"
434
 
    i_tzt="$i_tzt  ,(1, 701830800, 2) ,(1, 717555600, 3)"
435
 
    i_tzt="$i_tzt  ,(1, 733280400, 2) ,(1, 749005200, 3)"
436
 
    i_tzt="$i_tzt  ,(1, 764730000, 2) ,(1, 780454800, 3)"
437
 
    i_tzt="$i_tzt  ,(1, 796179600, 2) ,(1, 811904400, 3)"
438
 
    i_tzt="$i_tzt  ,(1, 828234000, 2) ,(1, 846378000, 3)"
439
 
    i_tzt="$i_tzt  ,(1, 859683600, 2) ,(1, 877827600, 3)"
440
 
    i_tzt="$i_tzt  ,(1, 891133200, 2) ,(1, 909277200, 3)"
441
 
    i_tzt="$i_tzt  ,(1, 922582800, 2) ,(1, 941331600, 3)"
442
 
    i_tzt="$i_tzt  ,(1, 954032400, 2) ,(1, 972781200, 3)"
443
 
    i_tzt="$i_tzt  ,(1, 985482000, 2) ,(1, 1004230800, 3)"
444
 
    i_tzt="$i_tzt  ,(1, 1017536400, 2) ,(1, 1035680400, 3)"
445
 
    i_tzt="$i_tzt  ,(1, 1048986000, 2) ,(1, 1067130000, 3)"
446
 
    i_tzt="$i_tzt  ,(1, 1080435600, 2) ,(1, 1099184400, 3)"
447
 
    i_tzt="$i_tzt  ,(1, 1111885200, 2) ,(1, 1130634000, 3)"
448
 
    i_tzt="$i_tzt  ,(1, 1143334800, 2) ,(1, 1162083600, 3)"
449
 
    i_tzt="$i_tzt  ,(1, 1174784400, 2) ,(1, 1193533200, 3)"
450
 
    i_tzt="$i_tzt  ,(1, 1206838800, 2) ,(1, 1224982800, 3)"
451
 
    i_tzt="$i_tzt  ,(1, 1238288400, 2) ,(1, 1256432400, 3)"
452
 
    i_tzt="$i_tzt  ,(1, 1269738000, 2) ,(1, 1288486800, 3)"
453
 
    i_tzt="$i_tzt  ,(1, 1301187600, 2) ,(1, 1319936400, 3)"
454
 
    i_tzt="$i_tzt  ,(1, 1332637200, 2) ,(1, 1351386000, 3)"
455
 
    i_tzt="$i_tzt  ,(1, 1364691600, 2) ,(1, 1382835600, 3)"
456
 
    i_tzt="$i_tzt  ,(1, 1396141200, 2) ,(1, 1414285200, 3)"
457
 
    i_tzt="$i_tzt  ,(1, 1427590800, 2) ,(1, 1445734800, 3)"
458
 
    i_tzt="$i_tzt  ,(1, 1459040400, 2) ,(1, 1477789200, 3)"
459
 
    i_tzt="$i_tzt  ,(1, 1490490000, 2) ,(1, 1509238800, 3)"
460
 
    i_tzt="$i_tzt  ,(1, 1521939600, 2) ,(1, 1540688400, 3)"
461
 
    i_tzt="$i_tzt  ,(1, 1553994000, 2) ,(1, 1572138000, 3)"
462
 
    i_tzt="$i_tzt  ,(1, 1585443600, 2) ,(1, 1603587600, 3)"
463
 
    i_tzt="$i_tzt  ,(1, 1616893200, 2) ,(1, 1635642000, 3)"
464
 
    i_tzt="$i_tzt  ,(1, 1648342800, 2) ,(1, 1667091600, 3)"
465
 
    i_tzt="$i_tzt  ,(1, 1679792400, 2) ,(1, 1698541200, 3)"
466
 
    i_tzt="$i_tzt  ,(1, 1711846800, 2) ,(1, 1729990800, 3)"
467
 
    i_tzt="$i_tzt  ,(1, 1743296400, 2) ,(1, 1761440400, 3)"
468
 
    i_tzt="$i_tzt  ,(1, 1774746000, 2) ,(1, 1792890000, 3)"
469
 
    i_tzt="$i_tzt  ,(1, 1806195600, 2) ,(1, 1824944400, 3)"
470
 
    i_tzt="$i_tzt  ,(1, 1837645200, 2) ,(1, 1856394000, 3)"
471
 
    i_tzt="$i_tzt  ,(1, 1869094800, 2) ,(1, 1887843600, 3)"
472
 
    i_tzt="$i_tzt  ,(1, 1901149200, 2) ,(1, 1919293200, 3)"
473
 
    i_tzt="$i_tzt  ,(1, 1932598800, 2) ,(1, 1950742800, 3)"
474
 
    i_tzt="$i_tzt  ,(1, 1964048400, 2) ,(1, 1982797200, 3)"
475
 
    i_tzt="$i_tzt  ,(1, 1995498000, 2) ,(1, 2014246800, 3)"
476
 
    i_tzt="$i_tzt  ,(1, 2026947600, 2) ,(1, 2045696400, 3)"
477
 
    i_tzt="$i_tzt  ,(1, 2058397200, 2) ,(1, 2077146000, 3)"
478
 
    i_tzt="$i_tzt  ,(1, 2090451600, 2) ,(1, 2108595600, 3)"
479
 
    i_tzt="$i_tzt  ,(1, 2121901200, 2) ,(1, 2140045200, 3)"
480
 
    i_tzt="$i_tzt  ,(3, -1688265000, 2) ,(3, -1656819048, 1)"
481
 
    i_tzt="$i_tzt  ,(3, -1641353448, 2) ,(3, -1627965048, 3)"
482
 
    i_tzt="$i_tzt  ,(3, -1618716648, 1) ,(3, -1596429048, 3)"
483
 
    i_tzt="$i_tzt  ,(3, -1593829848, 5) ,(3, -1589860800, 4)"
484
 
    i_tzt="$i_tzt  ,(3, -1542427200, 5) ,(3, -1539493200, 6)"
485
 
    i_tzt="$i_tzt  ,(3, -1525323600, 5) ,(3, -1522728000, 4)"
486
 
    i_tzt="$i_tzt  ,(3, -1491188400, 7) ,(3, -1247536800, 4)"
487
 
    i_tzt="$i_tzt  ,(3, 354920400, 5) ,(3, 370728000, 4)"
488
 
    i_tzt="$i_tzt  ,(3, 386456400, 5) ,(3, 402264000, 4)"
489
 
    i_tzt="$i_tzt  ,(3, 417992400, 5) ,(3, 433800000, 4)"
490
 
    i_tzt="$i_tzt  ,(3, 449614800, 5) ,(3, 465346800, 8)"
491
 
    i_tzt="$i_tzt  ,(3, 481071600, 9) ,(3, 496796400, 8)"
492
 
    i_tzt="$i_tzt  ,(3, 512521200, 9) ,(3, 528246000, 8)"
493
 
    i_tzt="$i_tzt  ,(3, 543970800, 9) ,(3, 559695600, 8)"
494
 
    i_tzt="$i_tzt  ,(3, 575420400, 9) ,(3, 591145200, 8)"
495
 
    i_tzt="$i_tzt  ,(3, 606870000, 9) ,(3, 622594800, 8)"
496
 
    i_tzt="$i_tzt  ,(3, 638319600, 9) ,(3, 654649200, 8)"
497
 
    i_tzt="$i_tzt  ,(3, 670374000, 10) ,(3, 686102400, 11)"
498
 
    i_tzt="$i_tzt  ,(3, 695779200, 8) ,(3, 701812800, 5)"
499
 
    i_tzt="$i_tzt  ,(3, 717534000, 4) ,(3, 733273200, 9)"
500
 
    i_tzt="$i_tzt  ,(3, 748998000, 8) ,(3, 764722800, 9)"
501
 
    i_tzt="$i_tzt  ,(3, 780447600, 8) ,(3, 796172400, 9)"
502
 
    i_tzt="$i_tzt  ,(3, 811897200, 8) ,(3, 828226800, 9)"
503
 
    i_tzt="$i_tzt  ,(3, 846370800, 8) ,(3, 859676400, 9)"
504
 
    i_tzt="$i_tzt  ,(3, 877820400, 8) ,(3, 891126000, 9)"
505
 
    i_tzt="$i_tzt  ,(3, 909270000, 8) ,(3, 922575600, 9)"
506
 
    i_tzt="$i_tzt  ,(3, 941324400, 8) ,(3, 954025200, 9)"
507
 
    i_tzt="$i_tzt  ,(3, 972774000, 8) ,(3, 985474800, 9)"
508
 
    i_tzt="$i_tzt  ,(3, 1004223600, 8) ,(3, 1017529200, 9)"
509
 
    i_tzt="$i_tzt  ,(3, 1035673200, 8) ,(3, 1048978800, 9)"
510
 
    i_tzt="$i_tzt  ,(3, 1067122800, 8) ,(3, 1080428400, 9)"
511
 
    i_tzt="$i_tzt  ,(3, 1099177200, 8) ,(3, 1111878000, 9)"
512
 
    i_tzt="$i_tzt  ,(3, 1130626800, 8) ,(3, 1143327600, 9)"
513
 
    i_tzt="$i_tzt  ,(3, 1162076400, 8) ,(3, 1174777200, 9)"
514
 
    i_tzt="$i_tzt  ,(3, 1193526000, 8) ,(3, 1206831600, 9)"
515
 
    i_tzt="$i_tzt  ,(3, 1224975600, 8) ,(3, 1238281200, 9)"
516
 
    i_tzt="$i_tzt  ,(3, 1256425200, 8) ,(3, 1269730800, 9)"
517
 
    i_tzt="$i_tzt  ,(3, 1288479600, 8) ,(3, 1301180400, 9)"
518
 
    i_tzt="$i_tzt  ,(3, 1319929200, 8) ,(3, 1332630000, 9)"
519
 
    i_tzt="$i_tzt  ,(3, 1351378800, 8) ,(3, 1364684400, 9)"
520
 
    i_tzt="$i_tzt  ,(3, 1382828400, 8) ,(3, 1396134000, 9)"
521
 
    i_tzt="$i_tzt  ,(3, 1414278000, 8) ,(3, 1427583600, 9)"
522
 
    i_tzt="$i_tzt  ,(3, 1445727600, 8) ,(3, 1459033200, 9)"
523
 
    i_tzt="$i_tzt  ,(3, 1477782000, 8) ,(3, 1490482800, 9)"
524
 
    i_tzt="$i_tzt  ,(3, 1509231600, 8) ,(3, 1521932400, 9)"
525
 
    i_tzt="$i_tzt  ,(3, 1540681200, 8) ,(3, 1553986800, 9)"
526
 
    i_tzt="$i_tzt  ,(3, 1572130800, 8) ,(3, 1585436400, 9)"
527
 
    i_tzt="$i_tzt  ,(3, 1603580400, 8) ,(3, 1616886000, 9)"
528
 
    i_tzt="$i_tzt  ,(3, 1635634800, 8) ,(3, 1648335600, 9)"
529
 
    i_tzt="$i_tzt  ,(3, 1667084400, 8) ,(3, 1679785200, 9)"
530
 
    i_tzt="$i_tzt  ,(3, 1698534000, 8) ,(3, 1711839600, 9)"
531
 
    i_tzt="$i_tzt  ,(3, 1729983600, 8) ,(3, 1743289200, 9)"
532
 
    i_tzt="$i_tzt  ,(3, 1761433200, 8) ,(3, 1774738800, 9)"
533
 
    i_tzt="$i_tzt  ,(3, 1792882800, 8) ,(3, 1806188400, 9)"
534
 
    i_tzt="$i_tzt  ,(3, 1824937200, 8) ,(3, 1837638000, 9)"
535
 
    i_tzt="$i_tzt  ,(3, 1856386800, 8) ,(3, 1869087600, 9)"
536
 
    i_tzt="$i_tzt  ,(3, 1887836400, 8) ,(3, 1901142000, 9)"
537
 
    i_tzt="$i_tzt  ,(3, 1919286000, 8) ,(3, 1932591600, 9)"
538
 
    i_tzt="$i_tzt  ,(3, 1950735600, 8) ,(3, 1964041200, 9)"
539
 
    i_tzt="$i_tzt  ,(3, 1982790000, 8) ,(3, 1995490800, 9)"
540
 
    i_tzt="$i_tzt  ,(3, 2014239600, 8) ,(3, 2026940400, 9)"
541
 
    i_tzt="$i_tzt  ,(3, 2045689200, 8) ,(3, 2058390000, 9)"
542
 
    i_tzt="$i_tzt  ,(3, 2077138800, 8) ,(3, 2090444400, 9)"
543
 
    i_tzt="$i_tzt  ,(3, 2108588400, 8) ,(3, 2121894000, 9)"
544
 
    i_tzt="$i_tzt  ,(3, 2140038000, 8)"
545
 
    i_tzt="$i_tzt  ,(4, -1688265000, 2) ,(4, -1656819048, 1)"
546
 
    i_tzt="$i_tzt  ,(4, -1641353448, 2) ,(4, -1627965048, 3)"
547
 
    i_tzt="$i_tzt  ,(4, -1618716648, 1) ,(4, -1596429048, 3)"
548
 
    i_tzt="$i_tzt  ,(4, -1593829848, 5) ,(4, -1589860800, 4)"
549
 
    i_tzt="$i_tzt  ,(4, -1542427200, 5) ,(4, -1539493200, 6)"
550
 
    i_tzt="$i_tzt  ,(4, -1525323600, 5) ,(4, -1522728000, 4)"
551
 
    i_tzt="$i_tzt  ,(4, -1491188400, 7) ,(4, -1247536800, 4)"
552
 
    i_tzt="$i_tzt  ,(4, 354920409, 5) ,(4, 370728010, 4)"
553
 
    i_tzt="$i_tzt  ,(4, 386456410, 5) ,(4, 402264011, 4)"
554
 
    i_tzt="$i_tzt  ,(4, 417992411, 5) ,(4, 433800012, 4)"
555
 
    i_tzt="$i_tzt  ,(4, 449614812, 5) ,(4, 465346812, 8)"
556
 
    i_tzt="$i_tzt  ,(4, 481071612, 9) ,(4, 496796413, 8)"
557
 
    i_tzt="$i_tzt  ,(4, 512521213, 9) ,(4, 528246013, 8)"
558
 
    i_tzt="$i_tzt  ,(4, 543970813, 9) ,(4, 559695613, 8)"
559
 
    i_tzt="$i_tzt  ,(4, 575420414, 9) ,(4, 591145214, 8)"
560
 
    i_tzt="$i_tzt  ,(4, 606870014, 9) ,(4, 622594814, 8)"
561
 
    i_tzt="$i_tzt  ,(4, 638319615, 9) ,(4, 654649215, 8)"
562
 
    i_tzt="$i_tzt  ,(4, 670374016, 10) ,(4, 686102416, 11)"
563
 
    i_tzt="$i_tzt  ,(4, 695779216, 8) ,(4, 701812816, 5)"
564
 
    i_tzt="$i_tzt  ,(4, 717534017, 4) ,(4, 733273217, 9)"
565
 
    i_tzt="$i_tzt  ,(4, 748998018, 8) ,(4, 764722818, 9)"
566
 
    i_tzt="$i_tzt  ,(4, 780447619, 8) ,(4, 796172419, 9)"
567
 
    i_tzt="$i_tzt  ,(4, 811897219, 8) ,(4, 828226820, 9)"
568
 
    i_tzt="$i_tzt  ,(4, 846370820, 8) ,(4, 859676420, 9)"
569
 
    i_tzt="$i_tzt  ,(4, 877820421, 8) ,(4, 891126021, 9)"
570
 
    i_tzt="$i_tzt  ,(4, 909270021, 8) ,(4, 922575622, 9)"
571
 
    i_tzt="$i_tzt  ,(4, 941324422, 8) ,(4, 954025222, 9)"
572
 
    i_tzt="$i_tzt  ,(4, 972774022, 8) ,(4, 985474822, 9)"
573
 
    i_tzt="$i_tzt  ,(4, 1004223622, 8) ,(4, 1017529222, 9)"
574
 
    i_tzt="$i_tzt  ,(4, 1035673222, 8) ,(4, 1048978822, 9)"
575
 
    i_tzt="$i_tzt  ,(4, 1067122822, 8) ,(4, 1080428422, 9)"
576
 
    i_tzt="$i_tzt  ,(4, 1099177222, 8) ,(4, 1111878022, 9)"
577
 
    i_tzt="$i_tzt  ,(4, 1130626822, 8) ,(4, 1143327622, 9)"
578
 
    i_tzt="$i_tzt  ,(4, 1162076422, 8) ,(4, 1174777222, 9)"
579
 
    i_tzt="$i_tzt  ,(4, 1193526022, 8) ,(4, 1206831622, 9)"
580
 
    i_tzt="$i_tzt  ,(4, 1224975622, 8) ,(4, 1238281222, 9)"
581
 
    i_tzt="$i_tzt  ,(4, 1256425222, 8) ,(4, 1269730822, 9)"
582
 
    i_tzt="$i_tzt  ,(4, 1288479622, 8) ,(4, 1301180422, 9)"
583
 
    i_tzt="$i_tzt  ,(4, 1319929222, 8) ,(4, 1332630022, 9)"
584
 
    i_tzt="$i_tzt  ,(4, 1351378822, 8) ,(4, 1364684422, 9)"
585
 
    i_tzt="$i_tzt  ,(4, 1382828422, 8) ,(4, 1396134022, 9)"
586
 
    i_tzt="$i_tzt  ,(4, 1414278022, 8) ,(4, 1427583622, 9)"
587
 
    i_tzt="$i_tzt  ,(4, 1445727622, 8) ,(4, 1459033222, 9)"
588
 
    i_tzt="$i_tzt  ,(4, 1477782022, 8) ,(4, 1490482822, 9)"
589
 
    i_tzt="$i_tzt  ,(4, 1509231622, 8) ,(4, 1521932422, 9)"
590
 
    i_tzt="$i_tzt  ,(4, 1540681222, 8) ,(4, 1553986822, 9)"
591
 
    i_tzt="$i_tzt  ,(4, 1572130822, 8) ,(4, 1585436422, 9)"
592
 
    i_tzt="$i_tzt  ,(4, 1603580422, 8) ,(4, 1616886022, 9)"
593
 
    i_tzt="$i_tzt  ,(4, 1635634822, 8) ,(4, 1648335622, 9)"
594
 
    i_tzt="$i_tzt  ,(4, 1667084422, 8) ,(4, 1679785222, 9)"
595
 
    i_tzt="$i_tzt  ,(4, 1698534022, 8) ,(4, 1711839622, 9)"
596
 
    i_tzt="$i_tzt  ,(4, 1729983622, 8) ,(4, 1743289222, 9)"
597
 
    i_tzt="$i_tzt  ,(4, 1761433222, 8) ,(4, 1774738822, 9)"
598
 
    i_tzt="$i_tzt  ,(4, 1792882822, 8) ,(4, 1806188422, 9)"
599
 
    i_tzt="$i_tzt  ,(4, 1824937222, 8) ,(4, 1837638022, 9)"
600
 
    i_tzt="$i_tzt  ,(4, 1856386822, 8) ,(4, 1869087622, 9)"
601
 
    i_tzt="$i_tzt  ,(4, 1887836422, 8) ,(4, 1901142022, 9)"
602
 
    i_tzt="$i_tzt  ,(4, 1919286022, 8) ,(4, 1932591622, 9)"
603
 
    i_tzt="$i_tzt  ,(4, 1950735622, 8) ,(4, 1964041222, 9)"
604
 
    i_tzt="$i_tzt  ,(4, 1982790022, 8) ,(4, 1995490822, 9)"
605
 
    i_tzt="$i_tzt  ,(4, 2014239622, 8) ,(4, 2026940422, 9)"
606
 
    i_tzt="$i_tzt  ,(4, 2045689222, 8) ,(4, 2058390022, 9)"
607
 
    i_tzt="$i_tzt  ,(4, 2077138822, 8) ,(4, 2090444422, 9)"
608
 
    i_tzt="$i_tzt  ,(4, 2108588422, 8) ,(4, 2121894022, 9)"
609
 
    i_tzt="$i_tzt  ,(4, 2140038022, 8)"
610
 
    i_tzt="$i_tzt  ,(5, -1009875600, 1);"
611
 
  fi
612
 
fi
613
 
 
614
 
if test ! -f $mdata/time_zone_transition_type.frm
615
 
then
616
 
  if test "$1" = "verbose" ; then
617
 
   echo "Preparing time_zone_transition_type table" 1>&2;
618
 
  fi
619
 
 
620
 
  c_tztt="$c_tztt CREATE TABLE time_zone_transition_type ("
621
 
  c_tztt="$c_tztt   Time_zone_id int unsigned NOT NULL,"
622
 
  c_tztt="$c_tztt   Transition_type_id int unsigned NOT NULL,"
623
 
  c_tztt="$c_tztt   Offset int signed DEFAULT 0 NOT NULL,"
624
 
  c_tztt="$c_tztt   Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
625
 
  c_tztt="$c_tztt   Abbreviation char(8) DEFAULT '' NOT NULL,"
626
 
  c_tztt="$c_tztt   PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
627
 
  c_tztt="$c_tztt ) engine=MyISAM CHARACTER SET utf8"
628
 
  c_tztt="$c_tztt   comment='Time zone transition types';"
629
 
  
630
 
  if test "$1" = "test" 
631
 
  then
632
 
    i_tztt="$i_tztt INSERT INTO time_zone_transition_type (Time_zone_id,"
633
 
    i_tztt="$i_tztt  Transition_type_id, Offset, Is_DST, Abbreviation) VALUES"
634
 
    i_tztt="$i_tztt   (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')"
635
 
    i_tztt="$i_tztt  ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')"
636
 
    i_tztt="$i_tztt  ,(2, 0, 0, 0, 'UTC')"
637
 
    i_tztt="$i_tztt  ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')"
638
 
    i_tztt="$i_tztt  ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')"
639
 
    i_tztt="$i_tztt  ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')"
640
 
    i_tztt="$i_tztt  ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')"
641
 
    i_tztt="$i_tztt  ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')"
642
 
    i_tztt="$i_tztt  ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')"
643
 
    i_tztt="$i_tztt  ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')"
644
 
    i_tztt="$i_tztt  ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')"
645
 
    i_tztt="$i_tztt  ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
646
 
    i_tztt="$i_tztt  ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
647
 
    i_tztt="$i_tztt  ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
648
 
    i_tztt="$i_tztt  ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')"
649
 
    i_tztt="$i_tztt  ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');"
650
 
  fi
651
 
fi
652
 
 
653
 
if test ! -f $mdata/time_zone_leap_second.frm
654
 
then
655
 
  if test "$1" = "verbose" ; then
656
 
   echo "Preparing time_zone_leap_second table" 1>&2;
657
 
  fi
658
 
 
659
 
  c_tzls="$c_tzls CREATE TABLE time_zone_leap_second ("
660
 
  c_tzls="$c_tzls   Transition_time bigint signed NOT NULL,"
661
 
  c_tzls="$c_tzls   Correction int signed NOT NULL,"
662
 
  c_tzls="$c_tzls   PRIMARY KEY TranTime (Transition_time)"
663
 
  c_tzls="$c_tzls ) engine=MyISAM CHARACTER SET utf8"
664
 
  c_tzls="$c_tzls   comment='Leap seconds information for time zones';"
665
 
  
666
 
  if test "$1" = "test" 
667
 
  then
668
 
    i_tzls="$i_tzls INSERT INTO time_zone_leap_second "
669
 
    i_tzls="$i_tzls  (Transition_time, Correction) VALUES "
670
 
    i_tzls="$i_tzls  (78796800, 1) ,(94694401, 2) ,(126230402, 3)"
671
 
    i_tzls="$i_tzls ,(157766403, 4) ,(189302404, 5) ,(220924805, 6)"
672
 
    i_tzls="$i_tzls ,(252460806, 7) ,(283996807, 8) ,(315532808, 9)"
673
 
    i_tzls="$i_tzls ,(362793609, 10) ,(394329610, 11) ,(425865611, 12)"
674
 
    i_tzls="$i_tzls ,(489024012, 13) ,(567993613, 14) ,(631152014, 15)"
675
 
    i_tzls="$i_tzls ,(662688015, 16) ,(709948816, 17) ,(741484817, 18)"
676
 
    i_tzls="$i_tzls ,(773020818, 19) ,(820454419, 20) ,(867715220, 21)"
677
 
    i_tzls="$i_tzls ,(915148821, 22);"
678
 
  fi
679
 
fi
680
 
 
681
 
if test ! -f $mdata/proc.frm
682
 
then
683
 
  c_p="$c_p CREATE TABLE proc ("
684
 
  c_p="$c_p   db                char(64) collate utf8_bin DEFAULT '' NOT NULL,"
685
 
  c_p="$c_p   name              char(64) DEFAULT '' NOT NULL,"
686
 
  c_p="$c_p   type              enum('FUNCTION','PROCEDURE') NOT NULL,"
687
 
  c_p="$c_p   specific_name     char(64) DEFAULT '' NOT NULL,"
688
 
  c_p="$c_p   language          enum('SQL') DEFAULT 'SQL' NOT NULL,"
689
 
  c_p="$c_p   sql_data_access   enum('CONTAINS_SQL',"
690
 
  c_p="$c_p                          'NO_SQL',"
691
 
  c_p="$c_p                          'READS_SQL_DATA',"
692
 
  c_p="$c_p                          'MODIFIES_SQL_DATA'"
693
 
  c_p="$c_p                     ) DEFAULT 'CONTAINS_SQL' NOT NULL,"
694
 
  c_p="$c_p   is_deterministic  enum('YES','NO') DEFAULT 'NO' NOT NULL,"
695
 
  c_p="$c_p   security_type     enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL,"
696
 
  c_p="$c_p   param_list        blob DEFAULT '' NOT NULL,"
697
 
  c_p="$c_p   returns           char(64) DEFAULT '' NOT NULL,"
698
 
  c_p="$c_p   body              longblob DEFAULT '' NOT NULL,"
699
 
  c_p="$c_p   definer           char(77) collate utf8_bin DEFAULT '' NOT NULL,"
700
 
  c_p="$c_p   created           timestamp,"
701
 
  c_p="$c_p   modified          timestamp,"
702
 
  c_p="$c_p   sql_mode          set("
703
 
  c_p="$c_p                         'REAL_AS_FLOAT',"
704
 
  c_p="$c_p                         'PIPES_AS_CONCAT',"
705
 
  c_p="$c_p                         'ANSI_QUOTES',"
706
 
  c_p="$c_p                         'IGNORE_SPACE',"
707
 
  c_p="$c_p                         'NOT_USED',"
708
 
  c_p="$c_p                         'ONLY_FULL_GROUP_BY',"
709
 
  c_p="$c_p                         'NO_UNSIGNED_SUBTRACTION',"
710
 
  c_p="$c_p                         'NO_DIR_IN_CREATE',"
711
 
  c_p="$c_p                         'POSTGRESQL',"
712
 
  c_p="$c_p                         'ORACLE',"
713
 
  c_p="$c_p                         'MSSQL',"
714
 
  c_p="$c_p                         'DB2',"
715
 
  c_p="$c_p                         'MAXDB',"
716
 
  c_p="$c_p                         'NO_KEY_OPTIONS',"
717
 
  c_p="$c_p                         'NO_TABLE_OPTIONS',"
718
 
  c_p="$c_p                         'NO_FIELD_OPTIONS',"
719
 
  c_p="$c_p                         'MYSQL323',"
720
 
  c_p="$c_p                         'MYSQL40',"
721
 
  c_p="$c_p                         'ANSI',"
722
 
  c_p="$c_p                         'NO_AUTO_VALUE_ON_ZERO',"
723
 
  c_p="$c_p                         'NO_BACKSLASH_ESCAPES',"
724
 
  c_p="$c_p                         'STRICT_TRANS_TABLES',"
725
 
  c_p="$c_p                         'STRICT_ALL_TABLES',"
726
 
  c_p="$c_p                         'NO_ZERO_IN_DATE',"
727
 
  c_p="$c_p                         'NO_ZERO_DATE',"
728
 
  c_p="$c_p                         'INVALID_DATES',"
729
 
  c_p="$c_p                         'ERROR_FOR_DIVISION_BY_ZERO',"
730
 
  c_p="$c_p                         'TRADITIONAL',"
731
 
  c_p="$c_p                         'NO_AUTO_CREATE_USER',"
732
 
  c_p="$c_p                         'HIGH_NOT_PRECEDENCE'"
733
 
  c_p="$c_p                     ) DEFAULT '' NOT NULL,"
734
 
  c_p="$c_p   comment           char(64) collate utf8_bin DEFAULT '' NOT NULL,"
735
 
  c_p="$c_p   PRIMARY KEY (db,name,type)"
736
 
  c_p="$c_p ) engine=MyISAM"
737
 
  c_p="$c_p character set utf8"
738
 
  c_p="$c_p comment='Stored Procedures';"
739
 
fi
740
 
 
741
 
cat << END_OF_DATA
742
 
use mysql;
743
 
set table_type=myisam;
744
 
$c_d
745
 
$i_d
746
 
 
747
 
$c_h
748
 
$i_h
749
 
 
750
 
$c_u
751
 
$i_u
752
 
 
753
 
$c_f
754
 
$i_f
755
 
 
756
 
$c_t
757
 
$c_c
758
 
 
759
 
$c_ht
760
 
$c_hc
761
 
$c_hr
762
 
$c_hk
763
 
 
764
 
$c_tzn
765
 
$i_tzn
766
 
$c_tz
767
 
$i_tz
768
 
$c_tzt
769
 
$i_tzt
770
 
$c_tztt
771
 
$i_tztt
772
 
$c_tzls
773
 
$i_tzls
774
 
 
775
 
$c_p
776
 
$c_pp
777
 
 
778
 
END_OF_DATA
779