diff options
297 files changed, 15474 insertions, 6939 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 754cca32249..b00af7095d7 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -74,6 +74,7 @@ paul@teton.kitebird.com pem@mysql.com peter@linux.local peter@mysql.com +pgulutzan@linux.local ram@gw.udmsearch.izhnet.ru ram@mysql.r18.ru ram@ram.(none) diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index 67c0e612828..e95d86c0f6e 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -3,6 +3,15 @@ # Do-pkg - convert a binary distribution into a Mac OS X PKG and put it # inside a Disk Image (.dmg) # +# The script currently assumes the following environment (which should exist +# like that, if the Do-compile script was used to build the binary +# distribution) +# +# - there must be a binary distribution (*.tar.gz) in the directory +# `hostname` of the current directory +# - the extracted and compiled source tree should be located in the +# `hostname` directory, too +# # Use the "--help" option for more info! # # written by Lenz Grimmer <lenz@mysql.com> @@ -15,6 +24,7 @@ $opt_dry_run= undef; $opt_help= undef; $opt_log= undef; $opt_mail= ""; +$opt_skip_dmg= undef; $opt_suffix= undef; $opt_verbose= undef; $opt_version= undef; @@ -24,6 +34,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", + "skip-dmg|skip-disk-image|s", "suffix=s", "verbose|v", "version=s", @@ -32,7 +43,7 @@ GetOptions( # Include helper functions chomp($PWD= `pwd`); $LOGGER= "$PWD/logger.pm"; -if (-f $LOGGER) +if (-f "$LOGGER") { do "$LOGGER"; } @@ -42,7 +53,8 @@ else } $PM= "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; -$TMP= "/tmp/PKGBUILD"; +$TMP= $ENV{TMPDIR}; +$TMP eq "" ? $TMP= $TMP . "/PKGBUILD": $TMP= "/tmp/PKGBUILD"; $PKGROOT= "$TMP/PMROOT"; $PKGDEST= "$TMP/PKG"; $RESOURCE_DIR= "$TMP/Resources"; @@ -56,11 +68,13 @@ $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; $BUILDDIR= "$PWD/$HOST"; -$SUPFILEDIR= <$BUILDDIR/mysql*-$VERSION/support-files/MacOSX>; +$SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>; +$SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; $TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; $INFO= <$SUPFILEDIR/Info.plist>; $DESC= <$SUPFILEDIR/Description.plist>; @RESOURCES= qw/ ReadMe.txt postinstall preinstall /; +@LICENSES= ("$SRCBASEDIR/COPYING","$SRCBASEDIR/MySQLEULA.txt"); &print_help("") if ($opt_help || !$opt_suffix || !$opt_version); @@ -87,7 +101,7 @@ die("You must be root to run this script!") if ($ID ne "root" && !$opt_dry_run); foreach $file ($TAR, $INFO, $DESC) { - &abort("Unable to find $file!") if (!-f $file); + &abort("Unable to find $file!") unless (-f "$file"); } # Remove old temporary build directories first @@ -108,6 +122,18 @@ foreach $resfile (@RESOURCES) &run_command($command, "Error while copying $SUPFILEDIR/$resfile to $RESOURCE_DIR"); } +# Search for license file +foreach $license (@LICENSES) +{ + if (-f "$license") + { + $command= "cp $license $RESOURCE_DIR/License.txt"; + &run_command($command, "Error while copying $license to $RESOURCE_DIR"); + } +} + +&abort("Could not find a license file!") unless (-f "$RESOURCE_DIR/License.txt"); + # Extract the binary tarball and create the "mysql" symlink &logger("Extracting $TAR to $PKGROOT"); &run_command("gnutar zxf $TAR -C $PKGROOT", "Unable to extract $TAR!"); @@ -124,6 +150,12 @@ $command= "$PM -build -p $PKGDEST/$NAME.pkg -f $PKGROOT -r $RESOURCE_DIR -i $INF &logger("Removing $PKGROOT"); &run_command("rm -rf $PKGROOT", "Unable to remove $PKGROOT!"); +if ($opt_skip_dmg) +{ + &logger("SUCCESS: Package $PKGDEST/$NAME.pkg created"); + exit 0; +} + # Determine the size of the Disk image to be created and add a 5% safety # margin for filesystem overhead &logger("Determining required disk image size for $PKGDEST"); @@ -198,6 +230,8 @@ Options: is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com +-s, --skip-disk-image Just build the PKG, don't put it into a + disk image afterwards --suffix=<suffix> The package suffix (e.g. "-standard" or "-pro) --version=<version> The MySQL version number (e.g. 4.0.11-gamma) -v, --verbose Verbose execution diff --git a/Docs/internals.texi b/Docs/internals.texi index 8fc7a041f78..803eae007df 100644 --- a/Docs/internals.texi +++ b/Docs/internals.texi @@ -51,6 +51,7 @@ This is a manual about @strong{MySQL} internals. @menu * caching:: How MySQL Handles Caching +* join_buffer_size:: * flush tables:: How MySQL Handles @code{FLUSH TABLES} * filesort:: How MySQL Does Sorting (@code{filesort}) * selects:: How MySQL performs different selects @@ -60,10 +61,15 @@ This is a manual about @strong{MySQL} internals. * DBUG:: DBUG Tags To Use * protocol:: MySQL Client/Server Protocol * Fulltext Search:: Fulltext Search in MySQL +* MyISAM Record Structure:: MyISAM Record Structure +* InnoDB Record Structure:: InnoDB Record Structure +* InnoDB Page Structure:: InnoDB Page Structure +* Files in MySQL Sources:: Annotated List Of Files in the MySQL Source Code Distribution +* Files in InnoDB Sources:: Annotated List Of Files in the InnoDB Source Code Distribution @end menu -@node caching, flush tables, Top, Top +@node caching, join_buffer_size, Top, Top @chapter How MySQL Handles Caching @strong{MySQL} has the following caches: @@ -106,7 +112,7 @@ use many join caches in the worst case. @end table @node join_buffer_size, flush tables, caching, Top -@subchapter How MySQL uses the join_buffer cache +@chapter How MySQL uses the join_buffer cache Basic information about @code{join_buffer_size}: @@ -177,7 +183,7 @@ same algorithm described above to handle it. (In other words, we store the same row combination several times into different buffers) @end itemize -@node flush tables, filesort, caching, Top +@node flush tables, filesort, join_buffer_size, Top @chapter How MySQL Handles @code{FLUSH TABLES} @itemize @bullet @@ -2228,8 +2234,8 @@ fe 00 . . @c @printindex fn -@node 4.1 protocol,,, -@subchapter MySQL 4.1 protocol +@c @node 4.1 protocol,,, +@c @chapter MySQL 4.1 protocol @node 4.1 protocol changes,,, @section Changes to 4.0 protocol in 4.1 @@ -2272,7 +2278,7 @@ results will sent as binary (low-byte-first). The field description packet is sent as a response to a query that contains a result set. It can be distinguished from a ok packet by the fact that the first byte can't be 0 for a field packet. -@xref {4.1 ok packet}. +@xref{4.1 ok packet}. The header packet has the following structure: @@ -2405,7 +2411,7 @@ parameter in the query: @item 2 @tab 2 byte column flags (NOT_NULL_FLAG etc) @item 1 @tab Number of decimals @item 4 @tab Max column length. -@end itemize +@end multitable Note that the above is not yet in 4.1 but will be added this month. @@ -2438,7 +2444,7 @@ This packet is sent from client -> server: @item 2 @tab Parameter number @item 2 @tab Type of parameter (not used at this point) @item # @tab data (Rest of packet) -@end itemize +@end multitable The server will NOT send an @code{ok} or @code{error} packet in responce for this. If there is any errors (like to big string), one @@ -2460,7 +2466,7 @@ execute or if one has rebound the parameters. @item 2*param_count @tab Type of parameters (only given if new_parameter_bound flag is 1) @item # @tab Parameter data, repeated for each parameter that are NOT NULL and not used with mysql_send_long_data(). -@end itemize +@end multitable The null-bit-map is for all parameters (including parameters sent with 'mysql_send_long_data). If parameter 0 is NULL, then bit 0 in the @@ -2518,7 +2524,7 @@ DATETIME, DATE and TIME are sent to the server in a binary format as follows: The first byte is a length byte and then comes all parameters that are not 0. (Always counted from the beginning). -@node Fulltext Search, , protocol, Top +@node Fulltext Search, MyISAM Record Structure, protocol, Top @chapter Fulltext Search in MySQL Hopefully, sometime there will be complete description of @@ -2560,6 +2566,3850 @@ weight as number of matched B's increases, because it assigns higher weights to individual B's. Also the first expression in much simplier. So it is the first one, that is implemented in MySQL. + +@node MyISAM Record Structure, InnoDB Record Structure, Fulltext Search, Top +@chapter MyISAM Record Structure + +@section Introduction + +When you say: +@* + +@strong{CREATE TABLE Table1 ...} +@* + +MySQL creates files named Table1.MYD ("MySQL Data"), Table1.MYI +("MySQL Index"), and Table1.FRM ("Format"). These files will be in the +directory: @* +/<datadir>/<database>/ +@* + +For example, if you use Linux, you might find the files here (assume +your database name is "test"): @* +/usr/local/var/test +@* + +And if you use Windows, you might find the files in this directory: @* +\mysql\data\test\ +@*@* + +Let's look at the .MYD Data file (MyISAM SQL Data file) more closely. + +@table @strong +@item Page Size +Unlike most DBMSs, MySQL doesn't store on disk using pages. Therefore +you will not see filler space between rows. (Reminder: This does not +refer to BDB and INNODB tables, which do use pages). +@* + +@item Record Header +The minimal record header is a set of flags: +@itemize @bullet +@item +"X bit" = 0 if row is deleted, = 1 if row is not deleted +@item +"Null Bits" = 0 if column is not NULL, = 1 if column is NULL +@item +"Filler Bits" = 1 +@end itemize +@end table +@* + +Here's an example. Suppose you say: +@* + +@strong{CREATE TABLE Table1 (column1 CHAR(1), column2 CHAR(1), column3 CHAR(1))} +@* + +@strong{INSERT INTO Table1 VALUES ('a', 'b', 'c')} +@* + +@strong{INSERT INTO Table1 VALUES ('d', NULL, 'e')} +@* + +A CHAR(1) column takes precisely one byte (plus one bit of overhead +that is assigned to every column -- I'll describe the details of +column storage later). So the file Table1.MYD looks like this: +@* + +@strong{Hexadecimal Display of Table1.MYD file}@* +@code{ +F1 61 62 63 00 F5 64 00 66 00 ... .abc..d e. +} +@* + +Here's how to read this hexadecimal-dump display:@* +@itemize @bullet +@item +The hexadecimal numbers @code{F1 61 62 63 00 F5 64 20 66 00} are byte +values and the column on the right is an attempt to show the +same bytes in ASCII. +@item +The @code{F1} byte means that there are no null fields in the first row. +@item +The @code{F5} byte means that the second column of the second row is NULL. +@end itemize + +(It's probably easier to understand the flag setting if you restate +@code{F5} as @code{11110101 binary}, and (a) notice that the third flag bit from the +right is @code{on}, and (b) remember that the first flag bit is the X bit.) +@* + +There are complications -- the record header is more complex if there +are variable-length fields -- but the simple display shown in the +example is exactly what you'd see if you took a debugger and looked +at the MySQL Data file. +@* + +@section Physical Attributes of Columns + +Next I'll describe the physical attributes of each column in a row. +The format depends entirely on the data type and the size of the +column, so, for every data type, I'll give a description and an example. +@* + +@table @strong +@item The character data types + +@strong{CHAR} +@itemize @bullet +@item +Storage: fixed-length string with space padding on the right. +@item +Example: a CHAR(5) column containing the value 'A' looks like:@* +@code{hexadecimal 41 20 20 20 20} -- (length = 5, value = @code{'A '}) +@end itemize + +@strong{VARCHAR} +@itemize @bullet +@item +Storage: variable-length string with a preceding length. +@item +Example: a VARCHAR(7) column containing 'A' looks like:@* +@code{hexadecimal 01 41} -- (length = 1, value = @code{'A'}) +@end itemize + +@item The numeric data types + +Important: MySQL stores all multi-byte binary numbers with the +high byte first. This is called "little-endian" numeric storage; +it's normal on Intel x86 machines; MySQL uses it even for non-Intel +machines so that databases will be portable. +@* + +@strong{TINYINT} +@itemize @bullet +@item +Storage: fixed-length binary, always one byte. +@item +Example: a TINYINT column containing 65 looks like:@* +@code{hexadecimal 41} -- (length = 1, value = 65) +@end itemize + +@strong{SMALLINT} +@itemize @bullet +@item +Storage: fixed-length binary, always two bytes. +@item +Example: a SMALLINT column containing 65 looks like:@* +@code{hexadecimal 41 00} -- (length = 2, value = 65) +@end itemize + +@strong{MEDIUMINT} +@itemize @bullet +@item +Storage: fixed-length binary, always three bytes. +@item +Example: a MEDIUMINT column containing 65 looks like:@* +@code{hexadecimal 41 00 00} -- (length = 3, value = 65) +@end itemize + +@strong{INT} +@itemize @bullet +@item +Storage: fixed-length binary, always four bytes. +@item +Example: an INT column containing 65 looks like:@* +@code{hexadecimal 41 00 00 00} -- (length = 4, value = 65) +@end itemize + +@strong{BIGINT} +@itemize @bullet +@item +Storage: fixed-length binary, always eight bytes. +@item +Example: a BIGINT column containing 65 looks like:@* +@code{hexadecimal 41 00 00 00 00 00 00 00} -- (length = 8, value = 65) +@end itemize + +@strong{FLOAT} +@itemize @bullet +@item +Storage: fixed-length binary, always four bytes. +@item +Example: a FLOAT column containing approximately 65 looks like:@* +@code{hexadecimal 00 00 82 42} -- (length = 4, value = 65) +@end itemize + +@strong{DOUBLE PRECISION} +@itemize @bullet +@item +Storage: fixed-length binary, always eight bytes. +@item +Example: a DOUBLE PRECISION column containing approximately 65 looks like:@* +@code{hexadecimal 00 00 00 00 00 40 50 40} -- (length = 8, value = 65) +@end itemize + +@strong{REAL} +@itemize @bullet +@item +Storage: same as FLOAT, or same as DOUBLE PRECISION, depending on setting of the --ansi switch. +@end itemize + +@strong{DECIMAL} +@itemize @bullet +@item +Storage: fixed-length string, with a leading byte for the sign, if any. +@item +Example: a DECIMAL(2) column containing 65 looks like:@* +@code{hexadecimal 20 36 35} -- (length = 3, value = @code{' 65'}) +@item +Example: a DECIMAL(2) UNSIGNED column containing 65 looks like:@* +@code{hexadecimal 36 35} -- (length = 2, value = @code{'65'}) +@item +Example: a DECIMAL(4,2) UNSIGNED column containing 65 looks like:@* +@code{hexadecimal 36 35 2E 30 30} -- (length = 5, value = @code{'65.00'}) +@end itemize + +@strong{NUMERIC} +@itemize @bullet +@item +Storage: same as DECIMAL. +@end itemize + +@strong{BOOL} +@itemize @bullet +@item +Storage: same as TINYINT. +@end itemize + +@item The temporal data types + +@strong{DATE} +@itemize @bullet +@item +Storage: 3 byte integer, low byte first. +Packed as: 'day + month*32 + year*16*32' +@item +Example: a DATE column containing '1962-01-02' looks like:@* +@code{hexadecimal 22 54 0F} +@end itemize + +@strong{DATETIME} +@itemize @bullet +@item +Storage: eight bytes. +@item +Part 1 is a 32-bit integer containing year*10000 + month*100 + day. +@item +Part 2 is a 32-bit integer containing hour*10000 + minute*100 + second. +@item +Example: a DATETIME column for '0001-01-01 01:01:01' looks like:@* +@code{hexadecimal B5 2E 11 5A 02 00 00 00} +@end itemize + +@strong{TIME} +@itemize @bullet +@item +Storage: 3 bytes, low byte first. +This is stored as seconds: days*24*3600+hours*3600+minutes*60+seconds +@item +Example: a TIME column containing '1 02:03:04' (1 day 2 hour 3 minutes and 4 seconds) looks like:@* +@code{hexadecimal 58 6E 01} +@end itemize + +@strong{TIMESTAMP} +@itemize @bullet +@item +Storage: 4 bytes, low byte first. +Stored as unix @code{time()}, which is seconds since the Epoch +(00:00:00 UTC, January 1, 1970). +@item +Example: a TIMESTAMP column containing '2003-01-01 01:01:01' looks like:@* +@code{hexadecimal 4D AE 12 23} +@end itemize + +@strong{YEAR} +@itemize @bullet +@item +Storage: same as unsigned TINYINT with a base value of 0 = 1901. +@end itemize + +@item Others + +@strong{SET} +@itemize @bullet +@item +Storage: one byte for each eight members in the set. +@item +Maximum length: eight bytes (for maximum 64 members). +@item +This is a bit list. The least significant bit corresponds to the +first listed member of the set. +@item +Example: a SET('A','B','C') column containing 'A' looks like:@* +@code{01} -- (length = 1, value = 'A') +@end itemize + +@strong{ENUM} +@itemize @bullet +@item +Storage: one byte if less than 256 alternatives, else two bytes. +@item +This is an index. The value 1 corresponds to the first listed +alternative. (Note: ENUM always reserves 0 for a blank '' value. This +explains why 'A' is 1 instead of 0.) +@item +Example: an ENUM('A','B','C') column containing 'A' looks like:@* +@code{01} -- (length = 1, value = 'A') +@end itemize + +@item The Large-Object data types + +Warning: Because TINYBLOB's preceding length is one byte long (the +size of a TINYINT) and MEDIUMBLOB's preceding length is three bytes +long (the size of a MEDIUMINT), it's easy to think there's some sort +of correspondence between the BLOB and the INT types. There isn't -- a +BLOB's preceding length is not four bytes long (the size of an INT). +@* + +(NOTE TO SELF: BLOB storage has not been fully addressed here.) +@* + +@strong{TINYBLOB} +@itemize @bullet +@item +Storage: variable-length string with a preceding one-byte length. +@item +Example: a TINYBLOB column containing 'A' looks like:@* +@code{hexadecimal 01 41} -- (length = 2, value = 'A') +@end itemize + +@strong{TINYTEXT} +@itemize @bullet +@item +Storage: same as TINYBLOB. +@end itemize + +@strong{BLOB} +@itemize @bullet +@item +Storage: variable-length string with a preceding two-byte length. +@item +Example: a BLOB column containing 'A' looks like:@* +@code{hexadecimal 01 00 41} -- (length = 2, value = 'A') +@end itemize + +@strong{TEXT} +@itemize @bullet +@item +Storage: same as BLOB. +@end itemize + +@strong{MEDIUMBLOB} +@itemize @bullet +@item +Storage: variable-length string with a preceding length. +@item +Example: a MEDIUMBLOB column containing 'A' looks like:@* +@code{hexadecimal 01 00 00 41} -- (length = 4, value = 'A') +@end itemize + +@strong{MEDIUMTEXT} +@itemize @bullet +@item +Storage: same as MEDIUMBLOB. +@end itemize + +@strong{LONGBLOB} +@itemize @bullet +@item +Storage: variable-length string with a preceding four-byte length. +@item +Example: a LONGBLOB column containing 'A' looks like:@* +@code{hexadecimal 01 00 00 00 41} -- (length = 5, value = 'A') +@end itemize + +@strong{LONGTEXT} +@itemize @bullet +@item +Storage: same as LONGBLOB. +@end itemize + +@end table + +@section Where to Look For More Information + +@strong{References:} @* +Most of the formatting work for MyISAM columns is visible +in the program /sql/field.cc in the source code directory. +@* + +@node InnoDB Record Structure,InnoDB Page Structure,MyISAM Record Structure,Top +@chapter InnoDB Record Structure + +This page contains: +@itemize @bullet +@item +A high-altitude "summary" picture of the parts of a MySQL/InnoDB +record structure. +@item +A description of each part. +@item +An example. +@end itemize + +After reading this page, you will know how MySQL/InnoDB stores a +physical record. +@* + +@section High-Altitude Picture + +The chart below shows the three parts of a physical record. + +@multitable @columnfractions .10 .35 + +@item @strong{Name} @tab @strong{Size} +@item Field Start Offsets +@tab (F*1) or (F*2) bytes +@item Extra Bytes +@tab 6 bytes +@item Field Contents +@tab depends on content + +@end multitable + +Legend: The letter 'F' stands for 'Number Of Fields'. + +The meaning of the parts is as follows: +@itemize @bullet +@item +The FIELD START OFFSETS is a list of numbers containing the +information "where a field starts". +@item +The EXTRA BYTES is a fixed-size header. +@item +The FIELD CONTENTS contains the actual data. +@end itemize + +@strong{An Important Note About The Word "Origin"}@* +The "Origin" or "Zero Point" of a record is the first byte of the +Field Contents -- not the first byte of the Field Start Offsets. If +there is a pointer to a record, that pointer is pointing to the +Origin. Therefore the first two parts of the record are addressed by +subtracting from the pointer, and only the third part is addressed by +adding to the pointer. + +@subsection FIELD START OFFSETS + +The Field Start Offsets is a list in which each entry is the +position, relative to the Origin, of the start of the next field. The +entries are in reverse order, that is, the first field's offset is at +the end of the list. +@* + +An example: suppose there are three columns. The first column's length +is 1, the second column's length is 2, and the third column's length is 4. +In this case, the offset values are, respectively, 1, 3 (1+2), and 7 (1+2+4). +Because values are reversed, a core dump of the Field Start Offsets +would look like this: @code{07,03,01}. +@* + +There are two complications for special cases: +@itemize @bullet +@item +Complication #1: The size of each offset can be either one byte or +two bytes. One-byte offsets are only usable if the total record size +is less than 127. There is a flag in the "Extra Bytes" part which will +tell you whether the size is one byte or two bytes. +@item +Complication #2: The most significant bits of an offset may contain +flag values. The next two paragraphs explain what the contents are. +@end itemize + +@strong{When The Size Of Each Offset Is One Byte} +@itemize @bullet +@item +1 bit = 0 if field is non-NULL, = 1 if field is NULL +@item +7 bits = the actual offset, a number between 0 and 127 +@end itemize + +@strong{When The Size Of Each Offset Is Two Bytes} +@itemize @bullet +@item +1 bit = 0 if field is non-NULL, = 1 if field is NULL +@item +1 bit = 0 if field is on same page as offset, = 1 if field and offset are on different pages +@item +14 bits = the actual offset, a number between 0 and 16383 +@end itemize + +It is unlikely that the "field and offset are on different pages" +unless the record contains a large BLOB. + +@subsection EXTRA BYTES + +The Extra Bytes are a fixed six-byte header. + +@multitable @columnfractions .10 .25 .35 + +@item @strong{Name} @tab @strong{Size} @tab @strong{Description} +@item @strong{info_bits:} +@item () +@tab 1 bit +@tab unused or unknown +@item () +@tab 1 bit +@tab unused or unknown +@item deleted_flag +@tab 1 bit +@tab 1 if record is deleted +@item min_rec_flag +@tab 1 bit +@tab 1 if record is predefined minimum record +@item n_owned +@tab 4 bits +@tab number of records owned by this record +@item heap_no +@tab 13 bits +@tab record's order number in heap of index page +@item n_fields +@tab 10 bits +@tab number of fields in this record, 1 to 1023 +@item 1byte_offs_flag +@tab 1 bit +@tab 1 if each Field Start Offsets is 1 byte long (this item is also called the "short" flag) +@item @strong{next 16 bits} +@tab 16 bits +@tab pointer to next record in page +@item @strong{TOTAL} +@tab 48 bits + +@end multitable + +Total size is 48 bits, which is six bytes. +@* + +If you're just trying to read the record, the key bit in the Extra +Bytes is 1byte_offs_flag -- you need to know if 1byte_offs_flag is 1 +(i.e.: "short 1-byteoffsets") or 0 (i.e.: "2-byte offsets"). +@* + +Given a pointer to the Origin, InnoDB finds the start of the record as follows: +@itemize @bullet +@item +Let X = n_fields (the number of fields is by definition equal to the +number of entries in the Field Start Offsets Table). +@item +If 1byte_offs_flag equals 0, then let X = X * 2 because there are +two bytes for each entry instead of just one. +@item +Let X = X + 6, because the fixed size of Extra Bytes is 6. +@item +The start of the record is at (pointer value minus X). +@end itemize + +@subsection FIELD CONTENTS + +The Field Contents part of the record has all the data. Fields are +stored in the order they were defined in. +@* + +There are no markers between fields, and there is no marker or filler +at the end of a record. +@* + +Here's an example. +@itemize @bullet +@item +I made a table with this definition: +@*@* + +@strong{CREATE TABLE T + (FIELD1 VARCHAR(3), FIELD2 VARCHAR(3), FIELD3 VARCHAR(3)) + Type=InnoDB;} +@*@* + +To understand what follows, you must know that table T has six columns +-- not three -- because InnoDB automatically added three "system +columns" at the start for its own housekeeping. It happens that these +system columns are the row ID, the transaction ID, and the rollback +pointer, but their values don't matter now. Regard them as three black +boxes. +@*@* + +@item +I put some rows in the table. My last three INSERTs were: +@*@* + +@strong{INSERT INTO T VALUES ('PP', 'PP', 'PP')} +@*@* + +@strong{INSERT INTO T VALUES ('Q', 'Q', 'Q')} +@*@* + +@strong{INSERT INTO T VALUES ('R', NULL, NULL)} +@*@* + +@item +I ran Borland's TDUMP to get a hexadecimal dump of +the contents of \mysql\data\ibdata1, which (in my case) is the +MySQL/InnoDB data file (on Windows). +@end itemize + +Here is an extract of the dump: + +@multitable @columnfractions .05 .95 + +@item @strong{Address Values In Hexadecimal} @tab @strong{Values In ASCII} +@item @code{0D4280: 00 00 2D 00 84 4F 4F 4F 4F 4F 4F 4F 4F 4F 19 17} +@tab @code{..-..OOOOOOOOO..} +@item @code{0D4290: 15 13 0C 06 00 00 78 0D 02 BF 00 00 00 00 04 21} +@tab @code{......x........!} +@item @code{0D42A0: 00 00 00 00 09 2A 80 00 00 00 2D 00 84 50 50 50} +@tab @code{.....*....-..PPP} +@item @code{0D42B0: 50 50 50 16 15 14 13 0C 06 00 00 80 0D 02 E1 00} +@tab @code{PPP.............} +@item @code{0D42C0: 00 00 00 04 22 00 00 00 00 09 2B 80 00 00 00 2D} +@tab @code{....".....+....-} +@item @code{0D42D0: 00 84 51 51 51 94 94 14 13 0C 06 00 00 88 0D 00} +@tab @code{..QQQ...........} +@item @code{0D42E0: 74 00 00 00 00 04 23 00 00 00 00 09 2C 80 00 00} +@tab @code{t.....#.....,...} +@item @code{0D42F0: 00 2D 00 84 52 00 00 00 00 00 00 00 00 00 00 00} +@tab @code{.-..R...........} + +@end multitable + +A reformatted version of the dump, showing only the relevant bytes, +looks like this (I've put a line break after each field and added labels): + +@strong{Reformatted Hexadecimal Dump}@* +@code{ + 19 17 15 13 0C 06 Field Start Offsets /* First Row */@* + 00 00 78 0D 02 BF Extra Bytes@* + 00 00 00 00 04 21 System Column #1@* + 00 00 00 00 09 2A System Column #2@* + 80 00 00 00 2D 00 84 System Column #3@* + 50 50 Field1 'PP'@* + 50 50 Field2 'PP'@* + 50 50 Field3 'PP'}@* + +@code{ + 16 15 14 13 0C 06 Field Start Offsets /* Second Row */@* + 00 00 80 0D 02 E1 Extra Bytes@* + 00 00 00 00 04 22 System Column #1@* + 00 00 00 00 09 2B 80 System Column #2@* + 00 00 00 2D 00 84 System Column #3@* + 51 Field1 'Q'@* + 51 Field2 'Q'@* + 51 Field3 'Q'}@* + +@code{ + 94 94 14 13 0C 06 Field Start Offsets /* Third Row */@* + 00 00 88 0D 00 74 Extra Bytes@* + 00 00 00 00 04 23 System Column #1@* + 00 00 00 00 09 2C System Column #2@* + 80 00 00 00 2D 00 84 System Column #3@* + 52 Field1 'R'}@* +@* + +You won't need explanation if you followed everything I've said, but +I'll add helpful notes for the three trickiest details. +@itemize @bullet +@item +Helpful Notes About "Field Start Offsets": @* +Notice that the sizes of the record's fields, in forward order, are: +6, 6, 7, 2, 2, 2. Since each offset is for the start of the "next" +field, the hexadecimal offsets are 06, 0c (6+6), 13 (6+6+7), 15 +(6+6+7+2), 17 (6+6+7+2+2), 19 (6+6+7+2+2+2). Reversing the order, the +Field Start Offsets of the first record are: @code{19,17,15,13,0c,06}. +@item +Helpful Notes About "Extra Bytes": @* +Look at the Extra Bytes of the first record: @code{00 00 78 0D 02 BF}. The +fourth byte is @code{0D hexadecimal}, which is @code{1101 binary} ... the 110 is the +last bits of n_fields (@code{110 binary} is 6 which is indeed the number of +fields in the record) and the final 1 bit is 1byte_offs_flag. The +fifth and sixth bytes, which contain @code{02 BF}, constitute the "next" +field. Looking at the original hexadecimal dump, at address +@code{0D42BF} (which is position @code{02BF} within the page), you'll see the beginning bytes of +System Column #1 of the second row. In other words, the "next" field +points to the "Origin" of the following row. +@item +Helpful Notes About NULLs:@* +For the third row, I inserted NULLs in FIELD2 and FIELD3. Therefore in +the Field Start Offsets the top bit is @code{on} for these fields (the +values are @code{94 hexadecimal}, @code{94 hexadecimal}, instead of +@code{14 hexadecimal}, @code{14 hexadecimal}). And the row is +shorter because the NULLs take no space. +@end itemize + +@section Where to Look For More Information + +@strong{References:} @* +The most relevant InnoDB source-code files are rem0rec.c, rem0rec.ic, +and rem0rec.h in the rem ("Record Manager") directory. + +@node InnoDB Page Structure,Files in MySQL Sources,InnoDB Record Structure,Top +@chapter InnoDB Page Structure + +InnoDB stores all records inside a fixed-size unit which is commonly called a +"page" (though InnoDB sometimes calls it a "block" instead). +Currently all pages are the same size, 16KB. +@* + +A page contains records, but it also contains headers and trailers. +I'll start this description with a high-altitude view of a page's parts, +then I'll describe each part of a page. Finally, I'll show an example. This +discussion deals only with the most common format, for the leaf page of a data file. +@* + +@section High-Altitude View + +An InnoDB page has seven parts: +@itemize @bullet +@item +Fil Header +@item +Page Header +@item +Infimum + Supremum Records +@item +User Records +@item +Free Space +@item +Page Directory +@item +Fil Trailer +@end itemize + +As you can see, a page has two header/trailer pairs. The inner pair, "Page Header" and +"Page Directory", are mostly the concern of the \page program group, +while the outer pair, "Fil Header" and "Fil Trailer", are mostly the +concern of the \fil program group. The "Fil" header also goes goes by +the name of "File Page Header". +@* + +Sandwiched between the headers and trailers, are the records and +the free (unused) space. A page always begins with two unchanging +records called the Infimum and the Supremum. Then come the user +records. Between the user records (which grow downwards) and the page +directory (which grows upwards) there is space for new records. +@* + +@subsection Fil Header + +The Fil Header has eight parts, as follows: + +@multitable @columnfractions .10 .30 .35 + +@item @strong{Name} @tab @strong{Size} @tab @strong{Remarks} +@item FIL_PAGE_SPACE +@tab 4 +@tab 4 ID of the space the page is in +@item FIL_PAGE_OFFSET +@tab 4 +@tab ordinal page number from start of space +@item FIL_PAGE_PREV +@tab 4 +@tab offset of previous page in key order +@item FIL_PAGE_NEXT +@tab 4 +@tab offset of next page in key order +@item FIL_PAGE_LSN +@tab 8 +@tab log serial number of page's latest log record +@item FIL_PAGE_TYPE +@tab 2 +@tab current defined types are: FIL_PAGE_INDEX, FIL_PAGE_UNDO_LOG, FIL_PAGE_INODE, FIL_PAGE_IBUF_FREE_LIST +@item FIL_PAGE_FILE_FLUSH_LSN +@tab 8 +@tab "the file has been flushed to disk at least up to this lsn" (log serial number), + valid only on the first page of the file +@item FIL_PAGE_ARCH_LOG_NO +@tab 4 +@tab the latest archived log file number at the time that FIL_PAGE_FILE_FLUSH_LSN was written (in the log) +@end multitable + +@itemize +@item +FIL_PAGE_SPACE is a necessary identifier because different pages might belong to +different (table) spaces within the same file. The word +"space" is generic jargon for either "log" or "tablespace". +@*@* + +@item +FIL_PAGE_PREV and FIL_PAGE_NEXT are the page's "backward" and +"forward" pointers. To show what they're about, I'll draw a two-level +B-tree. +@*@* + +@example + -------- + - root - + -------- + | + ---------------------- + | | + | | + -------- -------- + - leaf - <--> - leaf - + -------- -------- +@end example +@* + +Everyone has seen a B-tree and knows that the entries in the root page +point to the leaf pages. (I indicate those pointers with vertical '|' +bars in the drawing.) But sometimes people miss the detail that leaf +pages can also point to each other (I indicate those pointers with a horizontal +two-way pointer '<-->' in the drawing). This feature allows InnoDB to navigate from +leaf to leaf without having to back up to the root level. This is a +sophistication which you won't find in the classic B-tree, which is +why InnoDB should perhaps be called a B+-tree instead. +@*@* + +@item +The fields FIL_PAGE_FILE_FLUSH_LSN, FIL_PAGE_PREV, and FIL_PAGE_NEXT +all have to do with logs, so I'll refer you to my article "How Logs +Work With MySQL And InnoDB" on devarticles.com. +@*@* + +@item +FIL_PAGE_FILE_FLUSH_LSN and FIL_PAGE_ARCH_LOG_NO are only valid for +the first page of a data file. +@end itemize + +@subsection Page Header + +The Page Header has 14 parts, as follows: +@*@* + +@multitable @columnfractions .10 .20 .30 + +@item @strong{Name} @tab @strong{Size} @tab @strong{Remarks} +@item PAGE_N_DIR_SLOTS +@tab 2 +@tab number of directory slots in the Page Directory part; initial value = 2 +@item PAGE_HEAP_TOP +@tab 2 +@tab record pointer to first record in heap +@item PAGE_N_HEAP +@tab 2 +@tab number of heap records; initial value = 2 +@item PAGE_FREE +@tab 2 +@tab record pointer to first free record +@item PAGE_GARBAGE +@tab 2 +@tab "number of bytes in deleted records" +@item PAGE_LAST_INSERT +@tab 2 +@tab record pointer to the last inserted record +@item PAGE_DIRECTION +@tab 2 +@tab either PAGE_LEFT, PAGE_RIGHT, or PAGE_NO_DIRECTION +@item PAGE_N_DIRECTION +@tab 2 +@tab number of consecutive inserts in the same direction, e.g. "last 5 were all to the left" +@item PAGE_N_RECS +@tab 2 +@tab number of user records +@item PAGE_MAX_TRX_ID +@tab 8 +@tab the highest ID of a transaction which might have changed a record on the page (only set for secondary indexes) +@item PAGE_LEVEL +@tab 2 +@tab level within the index (0 for a leaf page) +@item PAGE_INDEX_ID +@tab 8 +@tab identifier of the index the page belongs to +@item PAGE_BTR_SEG_LEAF +@tab 10 +@tab "file segment header for the leaf pages in a B-tree" (this is irrelevant here) +@item PAGE_BTR_SEG_TOP +@tab 10 +@tab "file segment header for the non-leaf pages in a B-tree" (this is irrelevant here) + +@end multitable +@* + +(Note: I'll clarify what a "heap" is when I discuss the User Records part of the page.) +@*@* + +Some of the Page Header parts require further explanation: +@itemize @bullet +@item +PAGE_FREE: @* +Records which have been freed (due to deletion or migration) are in a +one-way linked list. The PAGE_FREE pointer in the page header points +to the first record in the list. The "next" pointer in the record +header (specifically, in the record's Extra Bytes) points to the next +record in the list. +@item +PAGE_DIRECTION and PAGE_N_DIRECTION: @* +It's useful to know whether inserts are coming in a constantly +ascending sequence. That can affect InnoDB's efficiency. +@item +PAGE_HEAP_TOP and PAGE_FREE and PAGE_LAST_INSERT: @* +Warning: Like all record pointers, these point not to the beginning of the +record but to its Origin (see the earlier discussion of Record +Structure). +@item +PAGE_BTR_SEG_LEAF and PAGE_BTR_SEG_TOP: @* +These variables contain information (space ID, page number, and byte offset) about +index node file segments. InnoDB uses the information for allocating new pages. +There are two different variables because InnoDB allocates separately for leaf +pages and upper-level pages. +@end itemize + +@subsection The Infimum And Supremum Records + +"Infimum" and "supremum" are real English words but they are found +only in arcane mathematical treatises, and in InnoDB comments. To +InnoDB, an infimum is lower than the the lowest possible real value +(negative infinity) and a supremum is greater than the greatest +possible real value (positive infinity). InnoDB sets up an infimum +record and a supremum record automatically at page-create time, and +never deletes them. They make a useful barrier to navigation so that +"get-prev" won't pass the beginning and "get-next" won't pass the end. +Also, the infimum record can be a dummy target for temporary record +locks. +@*@* + +The InnoDB code comments distinguish between "the infimum and supremum +records" and the "user records" (all other kinds). +@*@* + +It's sometimes unclear whether InnoDB considers the infimum and +supremum to be part of the header or not. Their size is fixed and +their position is fixed, so I guess so. + +@subsection User Records + +In the User Records part of a page, you'll find all the records that the user +inserted. +@*@* + +There are two ways to navigate through the user records, depending +whether you want to think of their organization as an unordered or an +ordered list. +@*@* + +An unordered list is often called a "heap". If you make a pile of +stones by saying "whichever one I happen to pick up next will go on +top" -- rather than organizing them according to size and colour -- +then you end up with a heap. Similarly, InnoDB does not want to insert +new rows according to the B-tree's key order (that would involve +expensive shifting of large amounts of data), so it inserts new rows +right after the end of the existing rows (at the +top of the Free Space part) or wherever there's space left by a +deleted row. +@*@* + +But by definition the records of a B-tree must be accessible in order +by key value, so there is a record pointer in each record (the "next" +field in the Extra Bytes) which points to the next record in key +order. In other words, the records are a one-way linked list. So +InnoDB can access rows in key order when searching. + +@subsection Free Space + +I think it's clear what the Free Space part of a page is, from the discussion of +other parts. + +@subsection Page Directory + +The Page Directory part of a page has a variable number of record pointers. +Sometimes the record pointers are called "slots" or "directory slots". +Unlike other DBMSs, InnoDB does not have a slot for every record in +the page. Instead it keeps a sparse directory. In a fullish page, +there will be one slot for every six records. +@*@* + +The slots track the records' logical order (the order by key rather +than the order by placement on the heap). Therefore, if the records +are @code{'A' 'B' 'F' 'D'} the slots will be @code{(pointer to 'A') (pointer to +'B') (pointer to 'D') (pointer to 'F')}. Because the slots are in key +order, and each slot has a fixed size, it's easy to do a binary +search of the records on the page via the slots. +@*@* + +(Since the Page Directory does not have a slot for every record, +binary search can only give a rough position and then InnoDB must +follow the "next" record pointers. InnoDB's "sparse slots" policy also +accounts for the n_owned field in the Extra Bytes part of a record: +n_owned indicates how many more records must be gone through because +they don't have their own slots.) + +@subsection Fil Trailer + +The Fil Trailer has one part, as follows: +@*@* + +@multitable @columnfractions .10 .35 .40 + +@item @strong{Name} @tab @strong{Size} @tab @strong{Remarks} +@item FIL_PAGE_END_LSN +@tab 8 +@tab low 4 bytes = checksum of page, last 4 bytes = same as FIL_PAGE_LSN +@end multitable +@* + +The final part of a page, the fil trailer (or File Page Trailer), +exists because InnoDB's architect worried about integrity. It's +impossible for a page to be only half-written, or corrupted by +crashes, because the log-recovery mechanism restores to a consistent +state. But if something goes really wrong, then it's nice to have a +checksum, and to have a value at the very end of the page which must +be the same as a value at the very beginning of the page. + +@section Example + +For this example, I used Borland's TDUMP again, as I did for the earlier chapter on +Record Format. This is what a page looked like: +@*@* + +@multitable @columnfractions .05 .95 + +@item @strong{Address Values In Hexadecimal} @tab @strong{Values In ASCII} +@item @code{0D4000: 00 00 00 00 00 00 00 35 FF FF FF FF FF FF FF FF} +@tab @code{.......5........} +@item @code{0D4010: 00 00 00 00 00 00 E2 64 45 BF 00 00 00 00 00 00} +@tab @code{.......dE.......} +@item @code{0D4020: 00 00 00 00 00 00 00 05 02 F5 00 12 00 00 00 00} +@tab @code{................} +@item @code{0D4030: 02 E1 00 02 00 0F 00 10 00 00 00 00 00 00 00 00} +@tab @code{................} +@item @code{0D4040: 00 00 00 00 00 00 00 00 00 14 00 00 00 00 00 00} +@tab @code{................} +@item @code{0D4050: 00 02 16 B2 00 00 00 00 00 00 00 02 15 F2 08 01} +@tab @code{................} +@item @code{0D4060: 00 00 03 00 89 69 6E 66 69 6D 75 6D 00 09 05 00} +@tab @code{.....infimum....} +@item @code{0D4070: 08 03 00 00 73 75 70 72 65 6D 75 6D 00 22 1D 18} +@tab @code{....supremum."..} +@item @code{0D4080: 13 0C 06 00 00 10 0D 00 B7 00 00 00 00 04 14 00} +@tab @code{................} +@item @code{0D4090: 00 00 00 09 1D 80 00 00 00 2D 00 84 41 41 41 41} +@tab @code{.........-..AAAA} +@item @code{0D40A0: 41 41 41 41 41 41 41 41 41 41 41 1F 1B 17 13 0C} +@tab @code{AAAAAAAAAAA.....} +@item @code{ ... } +@item @code{ ... } +@item @code{0D7FE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 74} +@tab @code{...............t} +@item @code{0D7FF0: 02 47 01 AA 01 0A 00 65 3A E0 AA 71 00 00 E2 64} +@tab @code{.G.....e:..q...d} +@end multitable +@*@* + +Let's skip past the first 38 bytes, which are Fil Header. The bytes +of the Page Header start at location @code{0d4026 hexadecimal}: +@*@* + +@multitable @columnfractions .10 .45 .60 + +@item @strong{Location} @tab @strong{Name} @tab @strong{Description} +@item @code{00 05} +@tab PAGE_N_DIR_SLOTS +@tab There are 5 directory slots. +@item @code{02 F5} +@tab PAGE_HEAP_TOP +@tab At location @code{0402F5}, not shown, is the beginning of free space. +Maybe a better name would have been PAGE_HEAP_END +@item @code{00 12} +@tab PAGE_N_HEAP +@tab There are 18 (hexadecimal 12) records in the page. +@item @code{00 00} +@tab PAGE_FREE +@tab There are zero free (deleted) records. +@item @code{00 00} +@tab PAGE_GARBAGE +@tab There are zero bytes in deleted records. +@item @code{02 E1} +@tab PAGE_LAST_INSERT +@tab The last record was inserted at location @code{02E1}, not shown, within the page. +@item @code{00 02} +@tab PAGE_DIRECTION +@tab A glance at page0page.h will tell you that 2 is the #defined value for PAGE_RIGHT. +@item @code{00 0F} +@tab PAGE_N_DIRECTION +@tab The last 15 (hexadecimal 0F) inserts were all done "to the right" +because I was inserting in ascending order. +@item @code{00 10} +@tab PAGE_N_RECS +@tab There are 16 (hexadecimal 10) user records. Notice that PAGE_N_RECS is +smaller than the earlier field, PAGE_N_HEAP. +@item @code{00 00 00 00 00 00 00} +@tab PAGE_MAX_TRX_ID +@item @code{00 00} +@tab PAGE_LEVEL +@tab Zero because this is a leaf page. +@item @code{00 00 00 00 00 00 00 14} +@tab PAGE_INDEX_ID +@tab This is index number 20. +@item @code{00 00 00 00 00 00 00 02 16 B2} +@tab PAGE_BTR_SEG_LEAF +@item @code{00 00 00 00 00 00 00 02 15 F2} +@tab PAGE_BTR_SEG_TOP +@end multitable +@* + +Immediately after the page header are the infimum and supremum +records. Looking at the "Values In ASCII" column in the hexadecimal +dump, you will see that the contents are in fact the words "infimum" +and "supremum" respectively. +@*@* + +Skipping past the User Records and the Free Space, many bytes later, +is the end of the 16KB page. The values shown there are the two trailers. +@itemize @bullet +@item +The first trailer (@code{00 74, 02 47, 01 AA, 01 0A, 00 65}) is the page +directory. It has 5 entries, because the header field PAGE_N_DIR_SLOTS +says there are 5. +@item +The next trailer (@code{3A E0 AA 71, 00 00 E2 64}) is the fil trailer. Notice +that the last four bytes, @code{00 00 E2 64}, appeared before in the fil +header. +@end itemize + +@section Where to Look For More Information + +@strong{References:} @* +The most relevant InnoDB source-code files are page0page.c, +page0page.ic, and page0page.h in \page directory. + +@node Files in MySQL Sources,Files in InnoDB Sources,InnoDB Page Structure,Top +@chapter Annotated List Of Files in the MySQL Source Code Distribution + +This is a description of the files that you get when you download the +source code of MySQL. This description begins with a list +of the 43 directories and a short comment about each one. Then, for +each directory, in alphabetical order, a longer description is +supplied. When a directory contains significant program files, a list of each C +program is given along with an explanation of its intended function. + +@section Directory Listing + +@strong{Directory -- Short Comment} +@itemize @bullet +@item +bdb -- The Berkeley Database table handler +@item +BitKeeper -- BitKeeper administration +@item +BUILD -- Build switches +@item +Build-tools -- Build tools +@item +client -- Client library +@item +cmd-line-utils -- Command-line utilities +@item +dbug -- Fred Fish's dbug library +@item +div -- Deadlock test +@item +Docs -- Preliminary documents about internals and new modules +@item +extra -- Eight minor standalone utility programs +@item +fs -- File System +@item +heap -- The HEAP table handler +@item +Images -- Empty directory +@item +include -- Include (*.h) files +@item +innobase -- The Innobase (InnoDB) table handler +@item +isam -- The ISAM (MySQL) table handler +@item +libmysql -- For producing MySQL as a library (e.g. a Windows DLL) +@item +libmysql_r -- Only one file, a makefile +@item +libmysqld -- The MySQL Library +@item +man -- Manual pages +@item +merge -- The MERGE table handler (see Reference Manual section 7.2) +@item +myisam -- The MyISAM table handler +@item +myisammrg -- The MyISAM Merge table handler +@item +mysql-test -- A test suite for mysqld +@item +mysys -- MySQL system library (Low level routines for file access +etc.) +@item +netware -- Files related to the Novell NetWare version of MySQL +@item +NEW-RPMS -- New "RPM Package Manager" files +@item +os2 -- Routines for working with the OS/2 operating system +@item +pstack -- Process stack display +@item +regex -- Regular Expression library for support of REGEXP function +@item +repl-tests -- Test cases for replication +@item +SCCS -- Source Code Control System +@item +scripts -- SQL batches, e.g. for converting msql to MySQL +@item +sql -- Programs for handling SQL commands. The "core" of MySQL +@item +sql-bench -- The MySQL benchmarks +@item +SSL -- Secure Sockets Layer +@item +strings -- Library for C string routines, e.g. atof, strchr +@item +support-files -- 15 files used for building, containing switches? +@item +tests -- Tests in Perl +@item +tools -- mysqlmanager.c +@item +VC++Files -- Includes this entire directory, repeated for VC++ +(Windows) use +@item +vio -- Virtual I/O Library +@item +zlib -- data compression library +@end itemize + +@subsection bdb + +The Berkeley Database table handler. +@*@* + +The Berkeley Database (BDB) is maintained by Sleepycat Software. +@*@* + +The documentation for BDB is available at +http://www.sleepycat.com/docs/. Since it's reasonably thorough +documentation, a description of the BDB program files is not included +in this document. +@*@* + +@subsection BitKeeper + +BitKeeper administration. +@*@* + +This directory may be present if you downloaded the MySQL source using +BitKeeper rather than via the mysql.com site. The files in the +BitKeeper directory are for maintenance purposes only -- they are not +part of the MySQL package. +@*@* + +@subsection BUILD + +Build switches. +@*@* + +This directory contains the build switches for compilation on various +platforms. There is a subdirectory for each set of options. The main +ones are: +@itemize @bullet +@item +alpha +@item +ia64 +@item +pentium (with and without debug or bdb, etc.) +@item +solaris +@end itemize +@*@* + +@subsection Build-tools + +Build tools. +@*@* + +This directory contains batch files for extracting, making +directories, and making programs from source files. There are several +subdirectories -- for building Linux executables, for compiling, for +performing all build steps, etc. +@*@* + +@subsection client + +Client library. +@*@* + +The client library includes mysql.cc (the source of the 'mysql' +executable) and other utilities. Most of the utilities are mentioned +in the MySQL Reference Manual. Generally these are standalone C +programs which one runs in "client mode", that is, they call the +server. +@*@* + +The C program files in the directory are: +@itemize @bullet +@item +connect_test.c -- test that a connect is possible +@item +get_password.c -- ask for a password from the console +@item +insert_test.c -- test that an insert is possible +@item +list_test.c -- test that a select is possible +@item +mysql.cc -- "The MySQL command tool" +@item +mysqladmin.c -- maintenance of MYSQL databases +@item +mysqlcheck.c -- check all databases, check connect, etc. +@item +mysqldump.c -- dump table's contents in ascii +@item +mysqlimport.c -- import file into a table +@item +mysqlmanager-pwgen.c -- pwgen seems to stand for "password +generation" +@item +mysqlmanagerc.c -- entry point for mysql manager +@item +mysqlshow.c -- show databases, tables or columns +@item +mysqltest.c -- test program +@item +password.c -- password checking routines +@item +select_test.c -- test that a select is possible +@item +showdb_test.c -- test that a show-databases is possible +@item +ssl_test.c -- test that SSL is possible +@item +thread_test.c -- test that threading is possible +@end itemize +@*@* + +@subsection cmd-line-utils + +Command-line utilities. +@*@* + +There are two subdirectories: \readline and \libedit. All the files +here are "non-MYSQL" files, in the sense that MySQL AB didn't produce +them, it just uses them. It should be unnecessary to study the +programs in these files unless +you are writing or debugging a tty-like client for MySQL, such as +mysql.exe. +@*@* + +The \readline subdirectory contains the files of the GNU Readline +Library, "a library for reading lines of text with interactive input +and history editing". The programs are copyrighted by the Free +Software Foundation. +@*@* + +The \libedit (library of edit functions) subdirectory has files +written by Christos Zoulas. They are for editing the line contents. +These are the program files in the \libedit subdirectory: +@itemize @bullet +@item +chared.c -- character editor +@item +common.c -- common editor functions +@item +el.c -- editline interface functions +@item +emacs.c -- emacs functions +@item +fgetln.c -- get line +@item +hist.c -- history access functions +@item +history.c -- more history access functions +@item +key.c -- procedures for maintaining the extended-key map +@item +map.c -- editor function definitions +@item +parse.c -- parse an editline extended command +@item +prompt.c -- prompt printing functions +@item +read.c -- terminal read functions +@item +readline.c -- read line +@item +refresh.c -- "lower level screen refreshing functions" +@item +search.c -- "history and character search functions" +@item +sig.c -- for signal handling +@item +strlcpy.c -- string copy +@item +term.c -- "editor/termcap-curses interface" +@item +tokenizer.c -- Bourne shell line tokenizer +@item +tty.c -- for a tty interface +@item +vi.c -- commands used when in the vi (editor) mode +@end itemize +@*@* + +@subsection dbug + +Fred Fish's dbug library. +@*@* + +This is not really part of the MySQL package. Rather, it's a set of +public-domain routines which are useful for debugging MySQL programs. +@*@* + +How it works: One inserts a function call that begins with DBUG_* in +one of the regular MYSQL programs. For example, in get_password.c, you +will find this line: @* +DBUG_ENTER("get_tty_password"); @* +at the start of a routine, and this line: @* +DBUG_RETURN(my_strdup(to,MYF(MY_FAE))); @* +at the end of the routine. These lines don't affect production code. +Features of the dbug library include profiling and state pushing. +@*@* + +The C programs in this directory are: +@itemize @bullet +@item +dbug.c -- The main module +@item +dbug_analyze.c -- Reads a file produced by trace functions +@item +example1.c -- A tiny example +@item +example2.c -- A tiny example +@item +example3.c -- A tiny example +@item +factorial.c -- A tiny example +@item +main.c -- A tiny example +@item +sanity.c -- Declaration of a variable +@end itemize +@*@* + +@subsection div + +Deadlock test. +@*@* + +This file contains only one program, deadlock_test.c. +@*@* + +@subsection Docs + +Preliminary documents about internals and new modules. +@*@* + +This directory doesn't have much at present that's very useful to the +student, but the plan is that some documentation related to the source +files and the internal workings of MySQL, including perhaps some +documentation from developers themselves, will be placed here. +@*@* + +These sub-directories are part of this directory: +@itemize @bullet +@item +books -- .gif images and empty .txt files; no real information +@item +flags -- images of flags of countries +@item +images -- flag backgrounds and the MySQL dolphin logo +@item +mysql-logos -- more MySQL-related logos, some of them moving +@item +raw-flags -- more country flags, all .gif files +@item +support -- various files for generating texinfo/docbook +documentation +@item +to-be-included... -- an empty subdirectory +@item +translations -- some Portuguese myodbc documentation +@end itemize +@*@* + +In the main directory, you'll find some .txt files related to the +methods that MySQL uses to produce its printed and html documents, odd +bits in various languages, and the single file in the directory which +has any importance -- internals.texi -- The "MySQL Internals" +document. +@*@* + +Despite the name, internals.texi is not really much of a description +of MySQL internals. However, there is some useful description of the +functions in the mysys directory (see below), and of the structure of +client/server messages (doubtless very useful for people who want to +make their own JDBC drivers, or just sniff). +@*@* + +@subsection extra + +Eight minor standalone utility programs. +@*@* + +These eight programs are all standalone utilities, that is, they have +a main() function and their main role is to show information that the +MySQL server needs or produces. Most are unimportant. They are as +follows: +@itemize @bullet +@item +my_print_defaults.c -- print all parameters in a default file +@item +mysql_install.c -- startup: install MySQL server +@item +mysql_waitpid.c -- wait for a program to terminate +@item +perror.c -- "print error" -- given error number, display message +@item +replace.c -- replace strings in text files +@item +resolve_stack_dump.c -- show symbolic info from a stack dump +@item +resolveip.c -- convert an IP address to a hostname, or vice versa +@end itemize +@*@* + +@subsection fs + +File System. +@*@* + +Here the word "File System" does not refer to the mere idea of a +directory of files on a disk drive, but to object-based access. The +concept has been compared with Oracle's Internet File System (iFS). +@*@* + +The original developer of the files on this directory is Tonu Samuel, +a former MySQL AB employee. Here is a quote (somewhat edited) from +Tonu Samuel's web page (http://no.spam.ee/~tonu/index.php): +"Question: What is it? +Answer: Actually this is not filesystem in common terms. MySQL FS +makes it possible to make SQL tables and some functions available over +a filesystem. MySQL does not require disk space, it uses an ordinary +MySQL daemon to store data." +The descriptions imply that this is a development project. +@*@* + +There are four program files in the directory: +@itemize @bullet +@item +database.c -- "emulate filesystem behaviour on top of SQL database" +@item +libmysqlfs.c -- Search/replace, show-functions, and parse routines +@item +mysqlcorbafs.c -- Connection with the CORBA "Object Request Broker" +@item +mysqlcorbafs_test.c -- Utility to test the working of mysqlcorbafs.c + +@*@* + +@subsection heap + +The HEAP table handler. +@*@* + +All the MySQL table handlers (i.e. the handlers that MySQL itself +produces) have files with similar names and functions. Thus, this +(heap) directory contains a lot of duplication of the myisam directory +(for the MyISAM table handler). Such duplicates have been marked with +an "*" in the following list. For example, you will find that +\heap\hp_extra.c has a close equivalent in the myisam directory +(\myisam\mi_extra.c) with the same descriptive comment. +@*@* + +@item +hp_block.c -- Read/write a block (i.e. a page) +@item +hp_clear.c -- Remove all records in the database +@item +hp_close.c -- * close database +@item +hp_create.c -- * create a table +@item +hp_delete.c -- * delete a row +@item +hp_extra.c -- * for setting options and buffer sizes when optimizing +@item +hp_hash.c -- Hash functions used for saving keys +@item +hp_info.c -- * Information about database status +@item +hp_open.c -- * open database +@item +hp_panic.c -- * the hp_panic routine, probably for sudden shutdowns +@item +hp_rename.c -- * rename a table +@item +hp_rfirst.c -- * read first row through a specific key (very short) +@item +hp_rkey.c -- * read record using a key +@item +hp_rlast.c -- * read last row with same key as previously-read row +@item +hp_rnext.c -- * read next row with same key as previously-read row +@item +hp_rprev.c -- * read previous row with same key as previously-read +row +@item +hp_rrnd.c -- * read a row based on position +@item +hp_rsame.c -- * find current row using positional read or key-based +read +@item +hp_scan.c -- * read all rows sequentially +@item +hp_static.c -- * static variables (very short) +@item +hp_test1.c -- * testing basic functions +@item +hp_test2.c -- * testing database and storing results +@item +hp_update.c -- * update an existing row +@item +hp_write.c -- * insert a new row +@end itemize +@*@* + +There are fewer files in the heap directory than in the myisam +directory, because fewer are necessary. For example, there is no need +for a \myisam\mi_cache.c equivalent (to cache reads) or a +\myisam\log.c equivalent (to log statements). +@*@* + +@subsection Images + +Empty directory. +@*@* + +There are no files in this directory. +@*@* + +@subsection include + +Include (*.h) files. +@*@* + +These files may be included in C program files. Note that each +individual directory will also have its own *.h files, for including +in its own *.c programs. The *.h files in the include directory are +ones that might be included from more than one place. +@*@* + +For example, the mysys directory contains a C file named rijndael.c, +but does not include rijndael.h. The include directory contains +rijndael.h. Looking further, you'll find that rijndael.h is also +included in other places: by my_aes.c and my_aes.h. +@*@* + +The include directory contains 51 *.h (include) files. +@*@* + +@subsection innobase + +The Innobase (InnoDB) table handler. +@*@* + +A full description of these files can be found elsewhere in this +document. +@*@* + +@subsection isam + +The ISAM table handler. +@*@* + +The C files in this directory are: +@itemize @bullet +@item +_cache.c -- for reading records from a cache +@item +changed.c -- a single routine for setting a "changed" flag (very +short) +@item +close.c -- close database +@item +create.c -- create a table +@item +_dbug.c -- support routines for use with "dbug" (see the \dbug +description) +@item +delete.c -- delete a row +@item +_dynrec.c -- functions to handle space-packed records and blobs +@item +extra.c -- setting options and buffer sizes when optimizing table +handling +@item +info.c -- Information about database status +@item +_key.c -- for handling keys +@item +_locking.c -- lock database +@item +log.c -- save commands in log file which myisamlog program can read +@item +_packrec.c -- compress records +@item +_page.c -- read and write pages containing keys +@item +panic.c -- the mi_panic routine, probably for sudden shutdowns +@item +range.c -- approximate count of how many records lie between two +keys +@item +rfirst.c -- read first row through a specific key (very short) +@item +rkey.c -- read a record using a key +@item +rlast.c -- read last row with same key as previously-read row +@item +rnext.c -- read next row with same key as previously-read row +@item +rprev.c -- read previous row with same key as previously-read row +@item +rrnd.c -- read a row based on position +@item +rsame.c -- find current row using positional read or key-based read +@item +rsamepos.c -- positional read +@item +_search.c -- key-handling functions +@item +static.c -- static variables (very short) +@item +_statrec.c -- functions to handle fixed-length records +@item +test1.c -- testing basic functions +@item +test2.c -- testing database and storing results +@item +test3.c -- testing locking +@item +update.c -- update an existing row +@item +write.c -- insert a new row +@item +pack_isam.c -- pack isam file (NOTE TO SELF ?? equivalent to +\myisam\myisampack.c) +@end itemize +@*@* + +Except for one minor C file (pack_isam.c) every program in the ISAM +directory has a counterpart in the MyISAM directory. For example +\isam\update.c corresponds to \myisam\mi_update.c. However, the +reverse is not true -- there are many files in the MyISAM directory +which have no counterpart in the ISAM directory. +@*@* + +The reason is simple -- it's because the ISAM files are becoming +obsolete. When MySQL programmers add new features, they add them for +MyISAM only. The student can therefore ignore all files in this +directory and study the MyISAM programs instead. +@*@* + +@subsection libmysql + +The MySQL Library, Part 1. +@*@* + +The files here are for producing MySQL as a library (e.g. a Windows +DLL). The idea is that, instead of producing separate mysql (client) +and mysqld (server) programs, one produces a library. Instead of +sending messages, the client part merely calls the server part. +@*@* + +The libmysql files are split into three directories: libmysql (this +one), libmysql_r (the next one), and libmysqld (the next one after +that). It may be that the original intention was that the libmysql +directory would hold the "client part" files, and the libmysqld +directory would hold the "server part" files. +@*@* + +The program files on this directory are: +@itemize @bullet +@item +conf_to_src.c -- has to do with charsets +@item +dll.c -- initialization of the dll library +@item +errmsg.c -- English error messages, compare \mysys\errors.c +@item +get_password.c -- get password +@item +libmysql.c -- the main "packet-sending emulation" program +@item +manager.c -- initialize/connect/fetch with MySQL manager +@end itemize +@*@* + +@subsection libmysql_r + +The MySQL Library, Part 2. +@*@* + +This is a continuation of the libmysql directory. There is only one +file here: +@itemize @bullet +@item +makefile.am +@end itemize +@*@* + +@subsection libmysqld + +The MySQL library, Part 3. +@*@* + +This is a continuation of the libmysql directory. The program files on +this directory are: +@itemize @bullet +@item +libmysqld.c -- The called side, compare the mysqld.exe source +@item +lib_vio.c -- Emulate the vio directory's communication buffer +@end itemize +@*@* + +@subsection man + +Manual pages. +@*@* + +These are not the actual "man" (manual) pages, they are switches for +the production. +@*@* + +@subsection merge + +The MERGE table handler. +@*@* + +For a description of the MERGE table handler, see the MySQL Reference +Manual, section 7.2. +@*@* + +You'll notice that there seem to be several directories with +similar-sounding names of C files in them. That's because the MySQL +table handlers are all quite similar. +@*@* + +The related directories are: +@itemize @bullet +@item +\isam -- for ISAM +@item +\myisam -- for MyISAM +@item +\merge -- for ISAM MERGE (mostly call functions in \isam programs) +@item +\myisammrg -- for MyISAM MERGE (mostly call functions in \myisam +programs) +@end itemize +@*@* + +To avoid duplication, only the \myisam program versions are discussed. +@*@* + +The C programs in this (merge) directory are: +@itemize @bullet +@item +mrg_close.c -- compare \isam's close.c +@item +mrg_create.c -- "" create.c +@item +mrg_delete.c -- "" delete.c +@item +mrg_extra.c -- "" extra.c +@item +mrg_info.c -- "" info.c +@item +mrg_locking.c -- "" locking.c +@item +mrg_open.c -- "" open.c +@item +mrg_panic.c -- "" panic.c +@item +mrg_rrnd.c -- "" rrnd.c +@item +mrg_rsame.c -- "" rsame.c +@item +mrg_static.c -- "" static.c +@item +mrg_update.c -- "" update.c +@end itemize +@*@* + +@subsection myisam + +The MyISAM table handler. +@*@* + +The C files in this subdirectory come in six main groups: +@itemize @bullet +@item +ft*.c files -- ft stands for "Full Text", code contributed by Sergei +Golubchik +@item +mi*.c files -- mi stands for "My Isam", these are the main programs +for Myisam +@item +myisam*.c files -- for example, "myisamchk" utility routine +functions source +@item +rt*.c files -- rt stands for "rtree", some code was written by +Alexander Barkov +@item +sp*.c files -- sp stands for "spatial", some code was written by +Ramil Kalimullin +@item +sort.c -- this is a single file that sorts keys for index-create +purposes +@end itemize +@*@* + +The "full text" and "rtree" and "spatial" program sets are for special +purposes, so this document focuses only on the mi*.c "myisam" C +programs. They are: +@itemize @bullet +@item +mi_cache.c -- for reading records from a cache +@item +mi_changed.c -- a single routine for setting a "changed" flag (very +short) +@item +mi_check.c -- doesn't just do checks, ?? for myisamchk program? +@item +mi_checksum.c -- calculates a checksum for a row +@item +mi_close.c -- close database +@item +mi_create.c -- create a table +@item +mi_dbug.c -- support routines for use with "dbug" (see \dbug +description) +@item +mi_delete.c -- delete a row +@item +mi_delete_all.c -- delete all rows +@item +mi_delete_table.c -- delete a table (very short) +@item +mi_dynrec.c -- functions to handle space-packed records and blobs +@item +mi_extra.c -- setting options and buffer sizes when optimizing +@item +mi_info.c -- "Ger tillbaka en struct med information om isam-filen" +@item +mi_key.c -- for handling keys +@item +mi_locking.c -- lock database +@item +mi_log.c -- save commands in log file which myisamlog program can +read +@item +mi_open.c -- open database +@item +mi_packrec.c -- compress records +@item +mi_page.c -- read and write pages containing keys +@item +mi_panic.c -- the mi_panic routine, probably for sudden shutdowns +@item +mi_range.c -- approximate count of how many records lie between two +keys +@item +mi_rename.c -- rename a table +@item +mi_rfirst.c -- read first row through a specific key (very short) +@item +mi_rkey.c -- read a record using a key +@item +mi_rlast.c -- read last row with same key as previously-read row +@item +mi_rnext.c -- read next row with same key as previously-read row +@item +mi_rnext_same.c -- same as mi_rnext.c, but abort if the key changes +@item +mi_rprev.c -- read previous row with same key as previously-read row +@item +mi_rrnd.c -- read a row based on position +@item +mi_rsame.c -- find current row using positional read or key-based +read +@item +mi_rsamepos.c -- positional read +@item +mi_scan.c -- read all rows sequentially +@item +mi_search.c -- key-handling functions +@item +mi_static.c -- static variables (very short) +@item +mi_statrec.c -- functions to handle fixed-length records +@item +mi_test1.c -- testing basic functions +@item +mi_test2.c -- testing database and storing results +@item +mi_test3.c -- testing locking +@item +mi_unique.c -- functions to check if a row is unique +@item +mi_update.c -- update an existing row +@item +mi_write.c -- insert a new row +@end itemize +@*@* + +@subsection myisammrg + +MyISAM Merge table handler. +@*@* + +As with other table handlers, you'll find that the *.c files in the +myissammrg directory have counterparts in the myisam directory. In +fact, this general description of a myisammrg program is almost always +true: The myisammrg +function checks an argument, the myisammrg function formulates an +expression for passing to a myisam function, the myisammrg calls a +myisam function, the myisammrg function returns. +@*@* + +These are the 21 files in the myisammrg directory, with notes about +the myisam functions or programs they're connected with: +@itemize @bullet +@item +myrg_close.c -- mi_close.c +@item +myrg_create.c -- mi_create.c +@item +myrg_delete.c -- mi_delete.c / delete last-read record +@item +myrg_extra.c -- mi_extra.c / "extra functions we want to do ..." +@item +myrg_info.c -- mi_info.c / display information about a mymerge file +@item +myrg_locking.c -- mi_locking.c / lock databases +@item +myrg_open.c -- mi_open.c / open a MyISAM MERGE table +@item +myrg_panic.c -- mi_panic.c / close in a hurry +@item +myrg_queue.c -- read record based on a key +@item +myrg_range.c -- mi_range.c / find records in a range +@item +myrg_rfirst.c -- mi_rfirst.c / read first record according to +specific key +@item +myrg_rkey.c -- mi_rkey.c / read record based on a key +@item +myrg_rlast.c -- mi_rlast.c / read last row with same key as previous +read +@item +myrg_rnext.c -- mi_rnext.c / read next row with same key as previous +read +@item +myrg_rnext_same.c -- mi_rnext_same.c / read next row with same key +@item +myrg_rprev.c -- mi_rprev.c / read previous row with same key +@item +myrg_rrnd.c -- mi_rrnd.c / read record with random access +@item +myrg_rsame.c -- mi_rsame.c / call mi_rsame function, see +\myisam\mi_rsame.c +@item +myrg_static.c -- mi_static.c / static variable declaration +@item +myrg_update.c -- mi_update.c / call mi_update function, see +\myisam\mi_update.c +@item +myrg_write.c -- mi_write.c / call mi_write function, see +\myisam\mi_write.c +@end itemize +@*@* + +@subsection mysql-test + +A test suite for mysqld. +@*@* + +The directory has a README file which explains how to run the tests, +how to make new tests (in files with the filename extension "*.test"), +and how to report errors. +@*@* + +There are four subdirectories: +@itemize @bullet +@item +\misc -- contains one minor Perl program +@item +\r -- contains *.result, i.e. "what happened" files and +*.required, i.e. "what should happen" file +@item +\std_data -- contains standard data for input to tests +@item +\t -- contains tests +@end itemize +@*@* + +There are 186 *.test files in the \t subdirectory. Primarily these are +SQL scripts which try out a feature, output a result, and compare the +result with what's required. Some samples of what the test files check +are: latin1_de comparisons, date additions, the HAVING clause, outer +joins, openSSL, load data, logging, truncate, and UNION. +@*@* + +There are other tests in these directories: +@itemize @bullet +@item +sql-bench +@item +repl-tests +@item +tests +@end itemize + +@subsection mysys + +MySQL system library (Low level routines for file access etc.). +@*@* + +There are 115 *.c programs in this directory: +@itemize @bullet +@item +array.c -- Dynamic array handling +@item +charset.c -- Using dynamic character sets, set default character +set, ... +@item +charset2html.c -- Checking what character set a browser is using +@item +checksum.c -- Calculate checksum for a memory block, used for +pack_isam +@item +default.c -- Find defaults from *.cnf or *.ini files +@item +errors.c -- English text of global errors +@item +hash.c -- Hash search/compare/free functions "for saving keys" +@item +list.c -- Double-linked lists +@item +make-conf.c -- "Make a charset .conf file out of a ctype-charset.c +file" +@item +md5.c -- MD5 ("Message Digest 5") algorithm from RSA Data Security +@item +mf_brkhant.c -- Prevent user from doing a Break during critical +execution +@item +mf_cache.c -- "Open a temporary file and cache it with io_cache" +@item +mf_dirname.c -- Parse/convert directory names +@item +mf_fn_ext.c -- Get filename extension +@item +mf_format.c -- Format a filename +@item +mf_getdate.c -- Get date, return in yyyy-mm-dd hh:mm:ss format +@item +mf_iocache.c -- Cached read/write of files in fixed-size units +@item +mf_iocache2.c -- Continuation of mf_iocache.c +@item +mf_keycache.c -- Key block caching for certain file types +@item +mf_loadpath.c -- Return full path name (no ..\ stuff) +@item +mf_pack.c -- Packing/unpacking directory names for create purposes +@item +mf_path.c -- Determine where a program can find its files +@item +mf_qsort.c -- Quicksort +@item +mf_qsort2.c -- Quicksort, part 2 +@item +mf_radix.c -- Radix sort +@item +mf_same.c -- Determine whether filenames are the same +@item +mf_sort.c -- Sort with choice of Quicksort or Radix sort +@item +mf_soundex.c -- Soundex algorithm derived from EDN Nov. 14, 1985 +(pg. 36) +@item +mf_strip.c -- Strip trail spaces from a string +@item +mf_tempdir.c -- Initialize/find/free temporary directory +@item +mf_tempfile.c -- Create a temporary file +@item +mf_unixpath.c -- Convert filename to UNIX-style filename +@item +mf_util.c -- Routines, #ifdef'd, which may be missing on some +machines +@item +mf_wcomp.c -- Comparisons with wildcards +@item +mf_wfile.c -- Finding files with wildcards +@item +mulalloc.c -- Malloc many pointers at the same time +@item +my_aes.c -- AES encryption +@item +my_alarm.c -- Set a variable value when an alarm is received +@item +my_alloc.c -- malloc of results which will be freed simultaneously +@item +my_append.c -- one file to another +@item +my_bit.c -- smallest X where 2^X >= value, maybe useful for +divisions +@item +my_bitmap.c -- Handle uchar arrays as large bitmaps +@item +my_chsize.c -- Truncate file if shorter, else fill with a filler +character +@item +my_clock.c -- Time-of-day ("clock()") function, with OS-dependent +#ifdef's +@item +my_compress.c -- Compress packet (see also description of \zlib +directory) +@item +my_copy.c -- Copy files +@item +my_create.c -- Create file +@item +my_delete.c -- Delete file +@item +my_div.c -- Get file's name +@item +my_dup.c -- Open a duplicated file +@item +my_error.c -- Return formatted error to user +@item +my_fopen.c -- File open +@item +my_fstream.c -- Streaming file read/write +@item +my_getwd.c -- Get working directory +@item +my_gethostbyname.c -- Thread-safe version of standard net +gethostbyname() func +@item +my_getopt.c -- Find out what options are in effect +@item +my_handler.c -- Compare two keys in various possible formats +@item +my_init.c -- Initialize variables and functions in the mysys library +@item +my_lib.c -- Compare/convert directory names and file names +@item +my_lock.c -- Lock part of a file +@item +my_lockmem.c -- "Allocate a block of locked memory" +@item +my_lread.c -- Read a specified number of bytes from a file into +memory +@item +my_lwrite.c -- Write a specified number of bytes from memory into a +file +@item +my_malloc.c -- Malloc (memory allocate) and dup functions +@item +my_messnc.c -- Put out a message on stderr with "no curses" +@item +my_mkdir.c -- Make directory +@item +my_net.c -- Thread-safe version of net inet_ntoa function +@item +my_netware.c -- Functions used only with the Novell Netware version +of MySQL +@item +my_once.c -- Allocation / duplication for "things we don't need to +free" +@item +my_open.c -- Open a file +@item +my_os2cond.c -- OS2-specific: "A simple implementation of posix +conditions" +@item +my_os2dirsrch.c -- OS2-specific: Emulate a Win32 directory search +@item +my_os2dlfcn.c -- OS2-specific: Emulate UNIX dynamic loading +@item +my_os2file64.c -- OS2-specific: For File64bit setting +@item +my_os2mutex.c -- OS2-specific: For mutex handling +@item +my_os2thread.c -- OS2-specific: For thread handling +@item +my_os2tls.c -- OS2-specific: For thread-local storage +@item +my_port.c -- AIX-specific: my_ulonglong2double() +@item +my_pread.c -- Read a specified number of bytes from a file +@item +my_pthread.c -- A wrapper for thread-handling functions in different +OSs +@item +my_quick.c -- Read/write (labelled a "quicker" interface, perhaps +obsolete) +@item +my_read.c -- Read a specified number of bytes from a file, possibly +retry +@item +my_realloc.c -- Reallocate memory allocated with my_alloc.c +(probably) +@item +my_redel.c -- Rename and delete file +@item +my_rename.c -- Rename without delete +@item +my_seek.c -- Seek, i.e. point to a spot within a file +@item +my_semaphore.c -- Semaphore routines, for use on OS that doesn't +support them +@item +my_sleep.c -- Wait n microseconds +@item +my_static.c -- Static-variable definitions +@item +my_symlink.c -- Read a symbolic link (symlinks are a UNIX thing, I +guess) +@item +my_symlink2.c -- Part 2 of my_symlink.c +@item +my_tempnam.c -- Obsolete temporary-filename routine used by ISAM +table handler +@item +my_thr_init.c -- initialize/allocate "all mysys & debug thread +variables" +@item +my_wincond.c -- Windows-specific: emulate Posix conditions +@item +my_winsem.c -- Windows-specific: emulate Posix threads +@item +my_winthread.c -- Windows-specific: emulate Posix threads +@item +my_write.c -- Write a specified number of bytes to a file +@item +ptr_cmp.c -- Point to an optimal byte-comparison function +@item +queues.c -- Handle priority queues as in Robert Sedgewick's book +@item +raid2.c -- RAID support (the true implementation is in raid.cc) +@item +rijndael.c -- "Optimised ANSI C code for the Rijndael cipher (now +AES") +@item +safemalloc.c -- A version of the standard malloc() with safety +checking +@item +sha1.c -- Implementation of Secure Hashing Algorithm 1 +@item +string.c -- Initialize/append/free dynamically-sized strings +@item +testhash.c -- Standalone program: test the hash library routines +@item +test_charset.c -- Standalone program: display character set +information +@item +test_dir.c -- Standalone program: placeholder for "test all +functions" idea +@item +test_fn.c -- Standalone program: apparently tests a function +@item +test_xml.c -- Standalone program: test XML routines +@item +thr_alarm.c -- Thread alarms and signal handling +@item +thr_lock.c -- "Read and write locks for Posix threads" +@item +thr_mutex.c -- A wrapper for mutex functions +@item +thr_rwlock.c -- Synchronizes the readers' thread locks with the +writer's lock +@item +tree.c -- Initialize/search/free binary trees +@item +typelib.c -- Determine what type a field has +@end itemize +@*@* + +You can find documentation for the main functions in these files +elsewhere in this document. +For example, the main functions in my_getwd.c are described thus: +@*@* + +@example +"int my_getwd _A((string buf, uint size, myf MyFlags)); @* + int my_setwd _A((const char *dir, myf MyFlags)); @* + Get and set working directory." @* +@end example + +@subsection netware + +Files related to the Novell NetWare version of MySQL. +@*@* + +There are 39 files on this directory. Most have filename extensions of +*.def, *.sql, or *.c. +@*@* + +The twenty-five *.def files are all from Novell Inc. They contain import or +export symbols. (".def" is a common filename extension for +"definition".) +@*@* + +The two *.sql files are short scripts of SQL statements used in +testing. +@*@* + +These are the five *.c files, all from Novell Inc.: +@itemize @bullet +@item +libmysqlmain.c -- Only one function: init_available_charsets() +@item +my_manage.c -- Standalone management utility +@item +mysql_install_db.c -- Compare \scripts\mysql_install_db.sh +@item +mysql_test_run.c -- Short test program +@item +mysqld_safe.c -- Compare \scripts\mysqld_safe.sh +@end itemize + +Perhaps the most important file is: +@itemize @bullet +@item +netware.patch -- NetWare-specific build instructions and switches +(compare \mysql-4.1\ltmain.sh) +@end itemize +@*@* + +For instructions about basic installation, see "Deployment Guide For +NetWare AMP" at: +@url{http://developer.novell.com/ndk/whitepapers/namp.htm} +@* + +@subsection NEW-RPMS + +New "RPM Package Manager" files. +@*@* + +This directory is not part of the Windows distribution. Perhaps in +MYSQL's Linux distribution it has files for use with Red Hat +installations -- a point that needs checking someday. +@*@* + +@subsection os2 + +Routines for working with the OS2 operating system. +@*@* + +The files in this directory are the product of the efforts of three +people from outside MySQL: Yuri Dario, Timo Maier, and John M +Alfredsson. There are no .C program files in this directory. +@*@* + +The contents of \os2 are: +@itemize @bullet +@item +A Readme.Txt file +@item +An \include subdirectory containing .h files which are for OS/2 only +@item +Files used in the build process (configuration, switches, and one +.obj) +@end itemize +@*@* + +The README file refers to MySQL version 3.23, which suggests that +there have been no updates for MySQL 4.0 for this section. +@*@* + +@subsection pstack + +Process stack display. +@*@* + +This is a set of publicly-available debugging aids which all do pretty +well the same thing: display the contents of the stack, along with +symbolic information, for a running process. There are versions for +various object file formats (such as ELF and IEEE-695). Most of the +programs are copyrighted by the Free Software Foundation and are +marked as "part of GNU Binutils". +@*@* + +In other words, the pstack files are not really part of the MySQL +library. They are merely useful when you re-program some MYSQL code +and it crashes. +@*@* + +@subsection regex + +Regular Expression library for support of REGEXP function. +@*@* + +This is the copyrighted product of Henry Spencer from the University +of Toronto. It's a fairly-well-known implementation of the +requirements of POSIX 1003.2 Section 2.8. The library is bundled with +Apache and is the default implementation for regular-expression +handling in BSD Unix. MySQL's Monty Widenius has made minor changes in +three programs (debug.c, engine.c, regexec.c) but this is not a MySQL +package. MySQL calls it only in order to support two MySQL functions: +REGEXP and RLIKE. +@*@* + +Some of Mr Spencer's documentation for the regex library can be found +in the README and WHATSNEW files. +@*@* + +One MySQL program which uses regex is \cmd-line-utils\libedit\search.c +@*@* + +This program calls the 'regcomp' function, which is the entry point in +\regex\regexp.c. +@*@* + +@subsection repl-tests + +Test cases for replication. +@*@* + +There are six short and trivial-looking tests in these subdirectories: +@itemize @bullet +@item +\test-auto-inc -- Do auto-Increment columns work? +@item +\test-bad-query -- Does insert in PK column work? +@item +\test-dump -- Do LOAD statements work? +@item +\test-repl -- Does replication work? +@item +\test-repl-alter -- Does ALTER TABLE work? +@item +\test-repl-ts -- Does TIMESTAMP column work? +@end itemize +@*@* + +@subsection SCCS + +Source Code Control System. +@*@* + +You will see this directory if and only if you used BitKeeper for +downloading the source. The files here are for BitKeeper +administration and are not of interest to application programmers. +@*@* + +@subsection scripts + +SQL batches, e.g. for converting msql to MySQL. +@*@* + +The *.sh filename extension apparently stands for "shell script". +Linux programmers use it where Windows programmers would use a *.bat +(batch filename extension). +@*@* + +The *.sh files on this directory are: +@itemize @bullet +@item +fill_help_tables.sh -- Create help-information tables and insert +@item +make_binary_distribution.sh -- Get configure information, make, +produce tar +@item +msql2mysql.sh -- Convert mSQL to MySQL +@item +mysqlbug.sh -- Create a bug report and mail it +@item +mysqld_multi.sh -- Start/stop any number of mysqld instances +@item +mysqld_safe-watch.sh -- Start/restart in safe mode +@item +mysqld_safe.sh -- Start/restart in safe mode +@item +mysqldumpslow.sh -- Parse and summarize the slow query log +@item +mysqlhotcopy.sh -- Hot backup +@item +mysql_config.sh -- Get configure information that client might need +@item +mysql_convert_table_format.sh -- Conversion, e.g. from ISAM to +MyISAM +@item +mysql_explain_log.sh -- Put a log (made with --log) into a MySQL +table +@item +mysql_find_rows.sh -- Search for queries containing <regexp> +@item +mysql_fix_extensions.sh -- Renames some file extensions, not +recommended +@item +mysql_fix_privilege_tables.sh -- Fix mysql.user etc. if upgrading to +MySQL 3.23.14+ +@item +mysql_install_db.sh -- Create privilege tables and func table +@item +mysql_secure_installation.sh -- Disallow remote root login, +eliminate test, etc. +@item +mysql_setpermission.sh -- Aid to add users or databases, sets +privileges +@item +mysql_tableinfo.sh -- Puts info re MySQL tables into a MySQL table +@item +mysql_zap.sh -- Kill processes which match pattern +@end itemize +@*@* + +@subsection sql + +Programs for handling SQL commands. The "core" of MySQL. +@*@* + +These are the .c and .cc files in the sql directory: +@itemize @bullet +@item +cache_manager.cc -- manages a number of blocks +@item +convert.cc -- convert tables between different character sets +@item +derror.cc -- read language-dependent message file +@item +des_key_file.cc -- load DES keys from plaintext file +@item +field.cc -- "implement classes defined in field.h" (long) +@item +field_conv.cc -- functions to copy data to or from fields +@item +filesort.cc -- sort file +@item +frm_crypt.cc -- contains only one short function: get_crypt_for_frm +@item +gen_lex_hash.cc -- Knuth's algorithm from Vol 3 Sorting and +Searching, Chapter 6.3 +@item +gstream.cc -- GTextReadStream +@item +handler.cc -- handler-calling functions +@item +hash_filo.cc -- static-sized hash tables +@item +ha_berkeley.cc -- Handler: BDB +@item +ha_heap.cc -- Handler: Heap +@item +ha_innodb.cc -- Handler: InnoDB +@item +ha_isam.cc -- Handler: ISAM +@item +ha_isammrg.cc -- Handler: (ISAM MERGE) +@item +ha_myisam.cc -- Handler: MyISAM +@item +ha_myisammrg.cc -- Handler: (MyISAM MERGE) +@item +hostname.cc -- Given IP, return hostname +@item +init.cc -- Init and dummy functions for interface with unireg +@item +item.cc -- Item functions +@item +item_buff.cc -- Buffers to save and compare item values +@item +item_cmpfunc.cc -- Definition of all compare functions +@item +item_create.cc -- Create an item. Used by lex.h. +@item +item_func.cc -- Numerical functions +@item +item_row.cc -- Row items for comparing rows and for IN on rows +@item +item_sum.cc -- Set functions (sum, avg, etc.) +@item +item_strfunc.cc -- String functions +@item +item_subselect.cc -- Item subselect +@item +item_timefunc.cc -- Date/time functions, e.g. week of year +@item +item_uniq.cc -- Empty file, here for compatibility reasons +@item +key.cc -- Functions to handle keys and fields in forms +@item +lock.cc -- Locks +@item +log.cc -- Logs +@item +log_event.cc -- Log event +@item +matherr.c -- Handling overflow, underflow, etc. +@item +mf_iocache.cc -- Caching of (sequential) reads +@item +mini_client.cc -- Client included in server for server-server +messaging +@item +mysqld.cc -- Source of mysqld.exe +@item +my_lock.c -- Lock part of a file +@item +net_serv.cc -- Read/write of packets on a network socket +@item +nt_servc.cc -- Initialize/register/remove an NT service +@item +opt_ft.cc -- Create a FT or QUICK RANGE based on a key (very short) +* opt_range.cc -- Range of keys +@item +opt_sum.cc -- Optimize functions in presence of (implied) GROUP BY +@item +password.c -- Password checking +@item +procedure.cc -- Procedure +@item +protocol.cc -- Low level functions for storing data to be sent to +client +@item +records.cc -- Functions to read, write, and lock records +@item +repl_failsafe.cc -- Replication fail-save +@item +set_var.cc -- MySQL variables +@item +slave.cc -- Procedures for a slave in a master/slave (replication?) +relation +@item +spatial.cc -- Geometry stuff (lines, points, etc.) +@item +sql_acl.cc -- Functions related to ACL security +@item +sql_analyse.cc -- Analyse an input string (?) +@item +sql_base.cc -- Basic functions needed by many modules +@item +sql_cache.cc -- SQL cache, with long comments about how caching +works +@item +sql_class.cc -- SQL class +@item +sql_crypt.cc -- Encode / decode, very short +@item +sql_db.cc -- Create / drop database +@item +sql_delete.cc -- The DELETE statement +@item +sql_derived.cc -- Derived tables, with long comments +@item +sql_do.cc -- The DO statement +@item +sql_error.cc -- Errors and warnings +@item +sql_handler.cc -- Direct access to ISAM +@item +sql_help.cc -- The HELP statement (if there is one?) +@item +sql_insert.cc -- The INSERT statement +@item +sql_lex.cc -- Related to lex or yacc +@item +sql_list.cc -- Only list_node_end_of_list, short +@item +sql_load.cc -- The LOAD DATA statement? +@item +sql_map.cc -- Memory-mapped files? +@item +sql_manager.cc -- Maintenance tasks, e.g. flushing the buffers +periodically +@item +sql_olap.cc -- ROLLUP +@item +sql_parse.cc -- Parse an SQL statement +@item +sql_prepare.cc -- Prepare an SQL statement +@item +sql_repl.cc -- Replication +@item +sql_rename.cc -- Rename table +@item +sql_select.cc -- Select and join optimisation +@item +sql_show.cc -- The SHOW statement +@item +sql_string.cc -- String functions: alloc, realloc, copy, convert, +etc. +@item +sql_table.cc -- The DROP TABLE and ALTER TABLE statements +@item +sql_test.cc -- Some debugging information +@item +sql_udf.cc -- User-defined functions +@item +sql_union.cc -- The UNION operator +@item +sql_update.cc -- The UPDATE statement +@item +stacktrace.c -- Display stack trace (Linux/Intel only?) +@item +table.cc -- Table metadata retrieval, mostly +@item +thr_malloc.cc -- Mallocs used in threads +@item +time.cc -- Date and time functions +@item +udf_example.cc -- Example file of user-defined functions +@item +uniques.cc -- Function to handle quick removal of duplicates +@item +unireg.cc -- Create a unireg form file from a FIELD and field-info struct +@end itemize +@*@* + +@subsection sql-bench + +The MySQL Benchmarks. +@*@* + +This directory has the programs and input files which MySQL uses for +its comparisons of MySQL, PostgreSQL, mSQL, Solid, etc. Since MySQL +publishes the comparative results, it's only right that it should make +available all the material necessary to reproduce all the tests. +@*@* + +There are five subdirectories and sub-subdirectories: +@itemize @bullet +@item +\Comments -- Comments about results from tests of Access, Adabas, +etc. +@item +\Data\ATIS -- .txt files containing input data for the "ATIS" tests +@item +\Data\Wisconsin -- .txt files containing input data for the +"Wisconsin" tests +@item +\Results -- old test results +@item +\Results-win32 -- old test results from Windows 32-bit tests +@end itemize +@*@* + +There are twenty-four *.sh (shell script) files, which involve Perl +programs. +@*@* + +There are three *.bat (batch) files. +@*@* + +There is one README file and one TODO file. +@*@* + +@subsection SSL + +Secure Sockets Layer. +@*@* + +This isn't a code directory. It contains a short note from Tonu Samuel +(the NOTES file) and seven *.pem files. PEM stands for "Privacy +Enhanced Mail" and is an Internet standard for adding security to +electronic mail. Finally, there are two short scripts for running +clients and servers over SSL connections. +@*@* + +@subsection strings + +The string library. +@*@* + +Many of the files in this subdirectory are equivalent to well-known +functions that appear in most C string libraries. For those, there is +documentation available in most compiler handbooks. +@*@* + +On the other hand, some of the files are MySQL additions or +improvements. Often the MySQL changes are attempts to optimize the +standard libraries. It doesn't seem that anyone tried to optimize for +recent Pentium class processors, though. +@*@* + +The .C files are: +@itemize @bullet +@item +atof.c -- ascii-to-float, MySQL version +@item +bchange.c -- short replacement routine written by Monty Widenius in +1987 +@item +bcmp.c -- binary compare, rarely used +@item +bcopy-duff.c -- block copy: attempt to copy memory blocks faster +than cmemcpy +@item +bfill.c -- byte fill, to fill a buffer with (length) copies of a +byte +@item +bmove.c -- block move +@item +bmove512.c -- "should be the fastest way to move a multiple of 512 +bytes" +@item +bmove_upp.c -- bmove.c variant, starting with last byte +@item +bzero.c -- something like bfill with an argument of 0 +@item +conf_to_src.c -- reading a configuration file (NOTE TO SELF ? what's +this doing here?) +@item +ctype*.c -- string handling programs for each char type MySQL +handles +@item +do_ctype.c -- display case-conversion and sort-conversion tables +@item +int2str.c -- integer-to-string +@item +is_prefix.c -- checks whether string1 starts with string2 +@item +llstr.c -- convert long long to temporary-buffer string, return +pointer +@item +longlong2str.c -- ditto, but to argument-buffer +@item +memcmp.c -- memory compare +@item +memset.c -- memory set +@item +my_vsnprintf.c -- variant of printf +@item +r_strinstr.c -- see if one string is within another +@item +str2int.c -- convert string to integer +@item +strappend.c -- append one string to another +@item +strcat.c -- concatenate strings +@item +strcend.c -- point to where a character C occurs within str, or NULL +@item +strchr.c -- point to first place in string where character occurs +@item +strcmp.c -- compare two strings +@item +strcont.c -- point to where any one of a set of characters appears +@item +strend.c -- point to the '\0' byte which terminates str +@item +strfill.c -- fill a string with n copies of a byte +@item +strinstr.c -- find string within string +@item +strlen.c -- return length of string in bytes +@item +strmake.c -- move n characters, or move till end +@item +strmov.c -- move source to dest and return pointer to end +@item +strnlen.c -- return length of string, or return n +@item +strnmov.c -- move source to dest for source size, or for n bytes +@item +strrchr.c -- find a character within string, searching from end +@item +strstr.c -- find an instance of pattern within source +@item +strto.c -- string to long, to long long, to unsigned long, etc. +@item +strtol.c -- string to long +@item +strtoll.c -- string to long long +@item +strtoul.c -- string to unsigned long +@item +strtoull.c -- string to unsigned long long +@item +strxmov.c -- move a series of concatenated source strings to dest +@item +strxnmov.c -- like strxmov.c but with a maximum length n +@item +str_test.c -- test of all the string functions encoded in assembler +@item +udiv.c -- unsigned long divide +@item +xml.c -- read and parse XML strings +@end itemize +@*@* + +There are also four .ASM files -- macros.asm, ptr_cmp.asm, +strings.asm, and strxmov.asm -- which can replace some of the +C-program functions. But again, they look like optimizations for old +members of the Intel processor family. +@*@* + +@subsection support-files + +Support files. +@*@* + +The files here are for building ("making") MySQL given a package +manager, compiler, linker, and other build tools. The support files +provide instructions and switches for the build processes. +@*@* + +@subsection tests + +Tests in Perl. +@*@* + +These are tests that were run once to check for bugs in various +scenarios: forks, locks, big records, exporting, truncating, etc. +@*@* + +@subsection tools + +Tools -- well, actually, one tool. +@*@* + +The only file is: +@itemize @bullet +@item +mysqlmanager.c -- A "server management daemon" by Sasha Pachev +@end itemize +@*@* + +@subsection VC++Files + +Visual C++ Files. +@*@* + +Includes this entire directory, repeated for VC++ (Windows) use. +@*@* + +VC++Files has subdirectories which are copies of the main directories. +For example there is a subdirectory \VC++Files\heap, which has the +same files as \heap. So for a description of the files in +\VC++Files\heap, see the description of the files in \heap. The same +applies for almost all of VC++Files's subdirectories (bdb, client, +isam, libmysql, etc.). The difference is that the \VC++Files variants +are specifically for compilation with Microsoft Visual C++ in 32-bit +Windows environments. +@*@* + +In addition to the "subdirectories which are duplicates of +directories", VC++Files contains these subdirectories, which are not +duplicates: +@itemize @bullet +@item +comp_err -- (nearly empty) +@item +contrib -- (nearly empty) +@item +InstallShield script files +@item +isamchk -- (nearly empty) +@item +libmysqltest -- one small non-MySQL test program: mytest.c +@item +myisamchk -- (nearly empty) +@item +myisamlog -- (nearly empty) +@item +myisammrg -- (nearly empty) +@item +mysqlbinlog -- (nearly empty) +@item +mysqlmanager -- MFC foundation class files created by AppWizard +@item +mysqlserver -- (nearly empty) +@item +mysqlshutdown -- one short program, mysqlshutdown.c +@item +mysqlwatch.c -- Windows service initialization and monitoring +@item +my_print_defaults -- (nearly empty) +@item +pack_isam -- (nearly empty) +@item +perror -- (nearly empty) +@item +prepare -- (nearly empty) +@item +replace -- (nearly empty) +@item +SCCS -- source code control system +@item +test1 -- tests connecting via X threads +@item +thr_insert_test -- (nearly empty) +@item +thr_test -- one short program used to test for memory-allocation bug +@item +winmysqladmin -- the winmysqladmin.exe source. machine-generated? +@end itemize +@*@* + +@subsection vio + +Virtual I/O Library. +@*@* + +The VIO routines are wrappers for the various network I/O calls that +happen with different protocols. The idea is that in the main modules +one won't have to write separate bits of code for each protocol. Thus +vio's purpose is somewhat like the purpose of Microsoft's winsock +library. +@*@* + +The underlying protocols at this moment are: TCP/IP, Named Pipes (for +WindowsNT), Shared Memory, and Secure Sockets (SSL). +@*@* + +The C programs are: +@itemize @bullet +@item +test-ssl.c -- Short standalone test program: SSL +@item +test-sslclient.c -- Short standalone test program: clients +@item +test-sslserver.c -- Short standalone test program: server +@item +vio.c -- Declarations + open/close functions +@item +viosocket.c -- Send/retrieve functions +@item +viossl.c -- SSL variations for the above +@item +viosslfactories.c -- Certification / Verification +@item +viotest.cc -- Short standalone test program: general +@item +viotest-ssl.c -- Short standalone test program: SSL +@item +viotest-sslconnect.cc -- Short standalone test program: SSL connect +@end itemize +@*@* + +The older functions -- raw_net_read, raw_net_write -- are now +obsolete. +@*@* + +@subsection zlib + +Data compression library. +@*@* + +Zlib -- which presumably stands for "Zip Library" -- is not a MySQL +package. It was produced by the GNU Zip (gzip.org) people. Zlib is a +variation of the famous "Lempel-Ziv" method, which is also used by +"Zip". The method for reducing the size of any arbitrary string of +bytes is as follows: +@itemize @bullet +@item +Find a substring which occurs twice in the string. +@item +Replace the second occurrence of the substring with (a) a pointer to +the first occurrence, plus (b) an indication of the length of the +first occurrence. +@end itemize + +There is a full description of the library's functions in the gzip +manual at: @* +@url{http://www.gzip.org/zlib/manual.html} @* +There is therefore no need to list the modules in this document. +@*@* + +The MySQL program that uses zlib is \mysys\my_compress.c. The use is +for packet compression. The client sends messages to the server which +are compressed by zlib. See also: \sql\net_serv.cc. + +@node Files in InnoDB Sources,,Files in MySQL Sources,Top +@chapter Annotated List Of Files in the InnoDB Source Code Distribution + +ERRATUM BY HEIKKI TUURI (START) +@*@* + +Errata about InnoDB row locks:@*@* + +@example + #define LOCK_S 4 /* shared */ + #define LOCK_X 5 /* exclusive */ +... +@strong{/* Waiting lock flag */} + #define LOCK_WAIT 256 +/* this wait bit should be so high that it can be ORed to the lock +mode and type; when this bit is set, it means that the lock has not +yet been granted, it is just waiting for its turn in the wait queue */ +... +@strong{/* Precise modes */} + #define LOCK_ORDINARY 0 +/* this flag denotes an ordinary next-key lock in contrast to LOCK_GAP +or LOCK_REC_NOT_GAP */ + #define LOCK_GAP 512 +/* this gap bit should be so high that it can be ORed to the other +flags; when this bit is set, it means that the lock holds only on the +gap before the record; for instance, an x-lock on the gap does not +give permission to modify the record on which the bit is set; locks of +this type are created when records are removed from the index chain of +records */ + #define LOCK_REC_NOT_GAP 1024 +/* this bit means that the lock is only on the index record and does +NOT block inserts to the gap before the index record; this is used in +the case when we retrieve a record with a unique key, and is also used +in locking plain SELECTs (not part of UPDATE or DELETE) when the user +has set the READ COMMITTED isolation level */ + #define LOCK_INSERT_INTENTION 2048 +/* this bit is set when we place a waiting gap type record lock +request in order to let an insert of an index record to wait until +there are no conflicting locks by other transactions on the gap; note +that this flag remains set when the waiting lock is granted, or if the +lock is inherited to a neighboring record */ +@end example +@* + +ERRATUM BY HEIKKI TUURI (END) +@*@* + +The InnoDB source files are the best place to look for information +about internals of the file structure that MySQLites can optionally +use for transaction support. But when you first look at all the +subdirectories and file names you'll wonder: Where Do I Start? It can +be daunting. +@*@* + +Well, I've been through that phase, so I'll pass on what I had to +learn on the first day that I looked at InnoDB source files. I am very +sure that this will help you grasp, in overview, the organization of +InnoDB modules. I'm also going to add comments about what is going on +-- which you should mistrust! These comments are reasonable working +hypotheses; nevertheless, they have not been subjected to expert peer +review. +@*@* + +Here's how I'm going to organize the discussion. I'll take each of the +32 InnoDB subdirectories that come with the MySQL 4.0 source code in +\mysql\innobase (on my Windows directory). The format of each section +will be like this every time: +@*@* + +@strong{\subdirectory-name (LONGER EXPLANATORY NAME)}@* +@multitable @columnfractions .10 .20 .40 .50 +@item @strong{File Name} @tab @strong{What Name Stands For} @tab @strong{Size} @tab @strong{Comment Inside File} +@item file-name +@tab my-own-guess +@tab in-bytes +@tab from-the-file-itself +@end multitable +...@* +My-Comments@* +@* + +For example: @* +@example +" +@strong{\ha (HASHING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + ha0ha.c Hashing/Hashing 7,452 Hash table with external chains + + Comments about hashing will be here. +" +@end example +@* + +The "Comment Inside File" column is a direct copy from the first /* +comment */ line inside the file. All other comments are mine. After +I've discussed each directory, I'll finish with some notes about +naming conventions and a short list of URLs that you can use for +further reference. +@*@* + +Now let's begin. +@*@* + +@example + +@strong{\ha (HASHING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + ha0ha.c Hashing / Hashing 7,452 Hash table with external chains + +I'll hold my comments until the next section, \hash (HASHING). + +@strong{\hash (HASHING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + hash0hash.c Hashing / Hashing 3,257 Simple hash table utility + +The two C programs in the \ha and \hashing directories -- ha0ha.c and +hash0hash.c -- both refer to a "hash table" but hash0hash.c is +specialized, it is mostly about accessing points in the table under +mutex control. + +When a "database" is so small that InnoDB can load it all into memory +at once, it's more efficient to access it via a hash table. After all, +no disk i/o can be saved by using an index lookup, if there's no disk. + +@strong{\os (OPERATING SYSTEM)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + os0shm.c OS / Shared Memory 3,150 To shared memory primitives + os0file.c OS / File 64,412 To i/o primitives + os0thread.c OS / Thread 6,827 To thread control primitives + os0proc.c OS / Process 3,700 To process control primitives + os0sync.c OS / Synchronization 10,208 To synchronization primitives + +This is a group of utilities that other modules may call whenever they +want to use an operating-system resource. For example, in os0file.c +there is a public InnoDB function named os_file_create_simple(), which +simply calls the Windows-API function CreateFile. Naturally the +contents of this group are somewhat different for other operating systems. + +The "Shared Memory" functions in os0shm.c are only called from the +communications program com0shm.c (see \com COMMUNICATIONS). The i/o +and thread-control primitives are called extensively. The word +"synchronization" in this context refers to the mutex-create and +mutex-wait functionality. + +@strong{\ut (UTILITIES)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + ut0ut.c Utilities / Utilities 7,041 Various utilities + ut0byte.c Utilities / Debug 1,856 Byte utilities + ut0rnd.c Utilities / Random 1,475 Random numbers and hashing + ut0mem.c Utilities / Memory 5,530 Memory primitives + ut0dbg.c Utilities / Debug 642 Debug utilities + +The two functions in ut0byte.c are just for lower/upper case +conversion and comparison. The single function in ut0rnd.c is for +finding a prime slightly greater than the given argument, which is +useful for hash functions, but unrelated to randomness. The functions +in ut0mem.c are wrappers for "malloc" and "free" calls -- for the +real "memory" module see section \mem (MEMORY). Finally, the +functions in ut0ut.c are a miscellany that didn't fit better elsewhere: +get_high_bytes, clock, time, difftime, get_year_month_day, and "sprintf" +for various diagnostic purposes. + +In short: the \ut group is trivial. + +@strong{\buf (BUFFERING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + buf0buf.c Buffering / Buffering 53,246 The database buffer buf_pool + buf0flu.c Buffering / Flush 23,711 ... flush algorithm + buf0lru.c / least-recently-used 20,245 ... replacement algorithm + buf0rea.c Buffering / read 17,399 ... read + +There is a separate file group (\mem MEMORY) which handles memory +requests in general.A "buffer" usually has a more specific +definition, as a memory area which contains copies of pages that +ordinarily are in the main data file. The "buffer pool" is the set +of all buffers (there are lots of them because InnoDB doesn't +depend on the OS's caching to make things faster). + +The pool size is fixed (at the time of this writing) but the rest of +the buffering architecture is sophisticated, involving a host of +control structures. In general: when InnoDB needs to access a new page +it looks first in the buffer pool; InnoDB reads from disk to a new +buffer when the page isn't there; InnoDB chucks old buffers (basing +its decision on a conventional Least-Recently-Used algorithm) when it +has to make space for a new buffer. + +There are routines for checking a page's validity, and for read-ahead. +An example of "read-ahead" use: if a sequential scan is going on, then +a DBMS can read more than one page at a time, which is efficient +because reading 32,768 bytes (two pages) takes less than twice as long +as reading 16,384 bytes (one page). + +@strong{\btr (B-TREE)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + btr0btr.c B-tree / B-tree 74,255 B-tree + btr0cur.c B-tree / Cursor 94,950 index tree cursor + btr0sea.c B-tree / Search 36,580 index tree adaptive search + btr0pcur.c B-tree / persistent cursor 14,548 index tree persistent cursor + +If you total up the sizes of the C files, you'll see that \btr is the +second-largest file group in InnoDB. This is understandable because +maintaining a B-tree is a relatively complex task. Luckily, there has +been a lot of work done to describe efficient management of B-tree and +B+-tree structures, much of it open-source or public-domain, since +their original invention over thirty years ago. + +InnoDB likes to put everything in B-trees. This is what I'd call a +"distinguishing characteristic" because in all the major DBMSs (like +IBM DB2, Microsoft SQL Server, and Oracle), the main or default or +classic structure is the heap-and-index. In InnoDB the main structure +is just the index. To put it another way: InnoDB keeps the rows in the +leaf node of the index, rather than in a separate file. Compare +Oracle's Index Organized Tables, and Microsoft SQL Server's Clustered +Indexes. + +This, by the way, has some consequences. For example, you may as well +have a primary key since otherwise InnoDB will make one anyway. And +that primary key should be the shortest of the candidate keys, since +InnoDB +will use it as a pointer if there are secondary indexes. + +Most importantly, it means that rows have no fixed address. Therefore +the routines for managing file pages should be good. We'll see about +that when we look at the \row (ROW) program group later. + +@strong{\com (COMMUNCATION)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + com0com.c Communication 6,913 Communication primitives + com0shm.c Communication / 24,633 ... through shared memory + Shared Memory + +The communication primitives in com0com.c are said to be modelled +after the ones in Microsoft's winsock library (the Windows Sockets +interface). The communication primitives in com0shm.c are at a +slightly lower level, and are called from the routines in com0com.c. + +I was interested in seeing how InnoDB would handle inter-process +communication, since there are many options -- named pipes, TCP/IP, +Windows messaging, and Shared Memory being the main ones that come to +mind. It appears that InnoDB prefers Shared Memory. The main idea is: +there is an area of memory which two different processes (or threads, +of course) can both access. To communicate, a thread gets an +appropriate mutex, puts in a request, and waits for a response. Thread +interaction is also a subject for the os0thread.c program in another +program group, \os (OPERATING SYSTEM). + +@strong{\dyn (DYNAMICALLY ALLOCATED ARRAY)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + dyn0dyn.c Dynamic / Dynamic 994 dynamically allocated array + +There is a single function in the dyn0dyn.c program, for adding a +block to the dynamically allocated array. InnoDB might use the array +for managing concurrency between threads. + +At the moment, the \dyn program group is trivial. + +@strong{\fil (FILE)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + fil0fil.c File / File 39,725 The low-level file system + +The reads and writes to the database files happen here, in +co-ordination with the low-level file i/o routines (see os0file.h in +the \os program group). + +Briefly: a table's contents are in pages, which are in files, which +are in tablespaces. Files do not grow; instead one can add new files +to the tablespace. As we saw earlier (discussing the \btr program group) +the pages are nodes of B-trees. Since that's the case, new additions can +happen at various places in the logical file structure, not +necessarily at the end. Reads and writes are asynchronous, and go into +buffers, which are set up by routines in the \buf program group. + +@strong{\fsp (FILE SPACE)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + fsp0fsp.c File Space Management 100,271 File space management + +I would have thought that the \fil (FILE) and \fsp (FILE SPACE) +MANAGEMENT programs would fit together in the same program group; +however, I guess the InnoDB folk are splitters rather than lumpers. + +It's in fsp0fsp.c that one finds some of the descriptions and comments +of extents, segments, and headers. For example, the "descriptor bitmap +of the pages in the extent" is in here, and you can find as well how +the free-page list is maintained, what's in the bitmaps, and what +various header fields' contents are. + +@strong{\fut (FILE UTILITY)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + fut0fut.c File Utility / Utility 293 File-based utilities + fut0lst.c File Utility / List 14,129 File-based list utilities + +Mainly these small programs affect only file-based lists, so maybe +saying "File Utility" is too generic. The real work with data files +goes on in the \fsp program group. + +@strong{\log (LOGGING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + log0log.c Logging / Logging 77,834 Database log + log0recv.c Logging / Recovery 80,701 Recovery + +I've already written about the \log program group, so here's a link to +my previous article: "How Logs work with MySQL and InnoDB": +@url{http://www.devarticles.com/art/1/181/2} + +@strong{\mem (MEMORY)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + mem0mem.c Memory / Memory 9,971 The memory management + mem0dbg.c Memory / Debug 21,297 ... the debug code + mem0pool.c Memory / Pool 16,293 ... the lowest level + +There is a long comment at the start of the mem0pool.c program, which +explains what the memory-consumers are, and how InnoDB tries to +satisfy them. The main thing to know is that there are really three +pools: the buffer pool (see the \buf program group), the log pool (see the \log +program group), and the common pool, which is where everything that's +not in the buffer or log pools goes (for example the parsed SQL +statements and the data dictionary cache). + +@strong{\mtr (MINI-TRANSACTION)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + mtr0mtr.c Mini-transaction / 12,433 Mini-transaction buffer + mtr0log.c Mini-transaction / Log 8,180 ... log routines + +The mini-transaction routines are called from most of the other +program groups. I'd describe this as a low-level utility set. + +@strong{\que (QUERY GRAPH)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + que0que.c Query Graph / Query 35,964 Query graph + +The program que0que.c ostensibly is about the execution of stored +procedures which contain commit/rollback statements. I took it that +this has little importance for the average MySQL user. + +@strong{\rem (RECORD MANAGER)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + rem0rec.c Record Manager 14,961 Record Manager + rem0cmp.c Record Manager / 25,263 Comparison services for records + Comparison + +There's an extensive comment near the start of rem0rec.c title +"Physical Record" and it's recommended reading. At some point you'll +ask what are all those bits that surround the data in the rows on a page, +and this is where you'll find the answer. + +@strong{\row (ROW)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + row0row.c Row / Row 16,764 General row routines + row0uins.c Row / Undo Insert 7,199 Fresh insert undo + row0umod.c Row / Undo Modify 17,147 Undo modify of a row + row0undo.c Row / Undo 10,254 Row undo + row0vers.c Row / Version 12,288 Row versions + row0mysql.c Row / MySQL 63,556 Interface [to MySQL] + row0ins.c Row / Insert 42,829 Insert into a table + row0sel.c Row / Select 85,923 Select + row0upd.c Row / Update 44,456 Update of a row + row0purge.c Row / Purge 14,961 Purge obsolete records + +Rows can be selected, inserted, updated/deleted, or purged (a +maintenance activity). These actions have ancillary actions, for +example after insert there can be an index-update test, but it seems +to me that sometimes the ancillary action has no MySQL equivalent (yet) +and so is inoperative. + +Speaking of MySQL, notice that one of the larger programs in the \row +program group is the "interface between Innobase row operations and +MySQL" (row0mysql.c) -- information interchange happens at this level +because rows in InnoDB and in MySQL are analogous, something which +can't be said for pages and other levels. + +@strong{\srv (Server)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + srv0srv.c Server / Server 79,058 Server main program + srv0que.c Server / Query 2,361 Server query execution + srv0start.c Server / Start 34,586 Starts the server + +This is where the server reads the initial configuration files, splits +up the threads, and gets going. There is a long comment deep in the +program (you might miss it at first glance) titled "IMPLEMENTATION OF +THE SERVER MAIN PROGRAM" in which you'll find explanations about +thread priority, and about what the responsibiities are for various +thread types. + +InnoDB has many threads, for example "user threads" (which wait for +client requests and reply to them), "parallel communication threads" +(which take part of a user thread's job if a query process can be +split), "utility threads" (background priority), and a "master thread" +(high priority, usually asleep). + +@strong{\thr (Thread Local Storage)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + thr0loc.c Thread / Local 5,261 The thread local storage + +InnoDB doesn't use the Windows-API thread-local-storage functions, +perhaps because they're not portable enough. + +@strong{\trx (Transaction)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + trx0trx.c Transaction / 37,447 The transaction + trx0purge.c Transaction / Purge 26,782 ... Purge old versions + trx0rec.c Transaction / Record 36,525 ... Undo log record + trx0sys.c Transaction / System 20,671 ... System + trx0rseg.c / Rollback segment 6,214 ... Rollback segment + trx0undo.c Transaction / Undo 46,595 ... Undo log + +InnoDB's transaction management is supposedly "in the style of Oracle" +and that's close to true but can mislead you. +@itemize +@item +First: InnoDB uses rollback segments like Oracle8i does -- but +Oracle9i uses a different name +@item +Second: InnoDB uses multi-versioning like Oracle does -- but I see +nothing that looks like an Oracle ITL being stored in the InnoDB data +pages. +@item +Third: InnoDB and Oracle both have short (back-to-statement-start) +versioning for the READ COMMITTED isolation level and long +(back-to-transaction-start) versioning for higher levels -- but InnoDB +and Oracle have different "default" isolation levels. +@item +Finally: InnoDB's documentation says it has to lock "the gaps before +index keys" to prevent phantoms -- but any Oracle user will tell you that +phantoms are impossible anyway at the SERIALIZABLE isolation level, so +key-locks are unnecessary. +@end itemize + +The main idea, though, is that InnoDB has multi-versioning. So does +Oracle. This is very different from the way that DB2 and SQL Server do +things. + +@strong{\usr (USER)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + usr0sess.c User / Session 27,415 Sessions + +One user can have multiple sessions (the session being all the things +that happen betweeen a connect and disconnect). This is where InnoDB +tracks session IDs, and server/client messaging. It's another of those +items which is usually MySQL's job, though. + +@strong{\data (DATA)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + data0data.c Data / Data 26,002 SQL data field and tuple + data0type.c Data / Type 2,122 Data types + +This is a collection of minor utility routines affecting rows. + +@strong{\dict (DICTIONARY)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + dict0dict.c Dictionary / Dictionary 84,667 Data dictionary system + dict0boot.c Dictionary / boot 12,134 ... creation and booting + dict0load.c Dictionary / load 26,546 ... load to memory cache + dict0mem.c Dictionary / memory 8,221 ... memory object creation + +The data dictionary (known in some circles as the catalog) has the +metadata information about objects in the database -- column sizes, +table names, and the like. + +@strong{\eval (EVALUATING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + eval0eval.c Evaluating/Evaluating 15,682 SQL evaluator + eval0proc.c Evaluating/Procedures 5,000 Executes SQL procedures + +The evaluating step is a late part of the process of interpreting an +SQL statement -- parsing has already occurred during \pars (PARSING). + +The ability to execute SQL stored procedures is an InnoDB feature, but +not a MySQL feature, so the eval0proc.c program is unimportant. + +@strong{\ibuf (INSERT BUFFER)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + ibuf0ibuf.c Insert Buffer / 69,884 Insert buffer + +The words "Insert Buffer" mean not "buffer used for INSERT" but +"insertion of a buffer into the buffer pool" (see the \buf BUFFER +program group description). The matter is complex due to possibilities +for deadlocks, a problem to which the comments in the ibuf0ibuf.c +program devote considerable attention. + +@strong{\mach (MACHINE FORMAT)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + mach0data.c Machine/Data 2,319 Utilities for converting + +The mach0data.c program has two small routines for reading compressed +ulints (unsigned long integers). + +@strong{\lock (LOCKING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + lock0lock.c Lock / Lock 127,646 The transaction lock system + +If you've used DB2 or SQL Server, you might think that locks have their +own in-memory table, that row locks might need occasional escalation to +table locks, and that there are three lock types: Shared, Update, Exclusive. + +All those things are untrue with InnoDB! Locks are kept in the database +pages. A bunch of row locks can't be rolled together into a single table +lock. And most importantly there's only one lock type. I call this type +"Update" because it has the characteristics of DB2 / SQL Server Update +locks, that is, it blocks other updates but doesn't block reads. +Unfortunately, InnoDB comments refer to them as "x-locks" etc. + +To sum it up: if your background is Oracle you won't find too much +surprising, but if your background is DB2 or SQL Server the locking +concepts and terminology will probably confuse you at first. + +You can find an online article about the differences between +Oracle-style and DB2/SQL-Server-style locks at: +@url{http://dbazine.com/gulutzan6.html} + +@strong{\odbc (ODBC)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + odbc0odbc.c ODBC / ODBC 16,865 ODBC client library + +The odbc0odbc.c program has a small selection of old ODBC-API +functions: SQLAllocEnv, SQLAllocConnect, SQLAllocStmt, SQLConnect, +SQLError, SQLPrepare, SQLBindParameter, SQLExecute. + +@strong{\page (PAGE)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + page0page.c Page / Page 44,309 Index page routines + page0cur.c Page / Cursor 30,305 The page cursor + +It's in the page0page.c program that you'll learn as follows: index +pages start with a header, entries in the page are in order, at the +end of the page is a sparse "page directory" (what I would have called +a slot table) which makes binary searches easier. + +Incidentally, the program comments refer to "a page size of 8 kB" +which seems obsolete. In univ.i (a file containing universal +constants) the page size is now #defined as 16KB. + +@strong{\pars (PARSING)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + pars0pars.c Parsing/Parsing 49,947 SQL parser + pars0grm.c Parsing/Grammar 62,685 A Bison parser + pars0opt.c Parsing/Optimizer 30,809 Simple SQL Optimizer + pars0sym.c Parsing/Symbol Table 5,541 SQL parser symbol table + lexyy.c ?/Lexer 59,948 Lexical scanner + +The job is to input a string containing an SQL statement and output an +in-memory parse tree. The EVALUATING (subdirectory \eval) programs +will use the tree. + +As is common practice, the Bison and Flex tools were used -- pars0grm.c +is what the Bison parser produced from an original file named pars0grm.y +(not supplied), and lexyy.c is what Flex produced. + +Since InnoDB is a DBMS by itself, it's natural to find SQL parsing in +it. But in the MySQL/InnoDB combination, MySQL handles most of the +parsing. These files are unimportant. + +@strong{\read (READ)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + read0read.c Read / Read 6,244 Cursor read + +The read0read.c program opens a "read view" of a query result, using +some functions in the \trx program group. + +@strong{\sync (SYNCHRONIZATION)} + File Name What Name Stands For Size Comment Inside File + --------- -------------------- ------ ------------------- + sync0sync.c Synchronization / 35,918 Mutex, the basic sync primitive + sync0arr.c ... / array 26,461 Wait array used in primitives + sync0ipm.c ... / interprocess 4,027 for interprocess sync + sync0rw.c ... / read-write 22,220 read-write lock for thread sync + +A mutex (Mutual Exclusion) is an object which only one thread/process +can hold at a time. Any modern operating system API has some functions +for mutexes; however, as the comments in the sync0sync.c code indicate, it +can be faster to write one's own low-level mechanism. In fact the old +assembly-language XCHG trick is in here -- this is the only program +that contains any assembly code. +@end example +@* +@* + +This is the end of the section-by-section account of InnoDB +subdirectories. +@*@* + +@strong{A Note About File Naming} @*@* + +There appears to be a naming convention. The first letters of the file +name are the same as the subdirectory name, then there is a '0' +separator, then there is an individual name. For the main program in a +subdirectory, the individual name may be a repeat of the subdirectory +name. For example, there is a file named ha0ha.c (the first two +letters ha mean "it's in in subdirectory ..\ha", the next letter 0 +means "0 separator", the next two letters mean "this is the main ha +program"). This naming convention is not strict, though: for example +the file lexyy.c is in the \pars subdirectory. +@*@* + +@strong{A Note About Copyrights} @*@* + +Most of the files begin with a copyright notice or a creation date, +for example "Created 10/25/1995 Heikki Tuuri". I don't know a great +deal about the history of InnoDB, but found it interesting that most +creation dates were between 1994 and 1998. +@*@* + +@strong{References} @*@* + +Ryan Bannon, Alvin Chin, Faryaaz Kassam and Andrew Roszko @* +"InnoDB Concrete Architecture" @* +@url{http://www.swen.uwaterloo.ca/~mrbannon/cs798/assignment_02/innodb.pdf} + +A student paper. It's an interesting attempt to figure out InnoDB's +architecture using tools, but I didn't end up using it for the specific +purposes of this article. +@*@* + +Peter Gulutzan @* +"How Logs Work With MySQL And InnoDB" @* +@url{http://www.devarticles.com/art/1/181/2} +@*@* + +Heikki Tuuri @* +"InnoDB Engine in MySQL-Max-3.23.54 / MySQL-4.0.9: The Up-to-Date +Reference Manual of InnoDB" @* +@url{http://www.innodb.com/ibman.html} + +This is the natural starting point for all InnoDB information. Mr +Tuuri also appears frequently on MySQL forums. +@*@* + @summarycontents @contents diff --git a/Makefile.am b/Makefile.am index 9da59074caa..f8b559c4238 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = INSTALL-SOURCE README \ COPYING COPYING.LIB SUBDIRS = . include @docs_dirs@ \ - @readline_topdir@ @readline_dir@ \ + @readline_topdir@ \ @thread_dirs@ pstack @sql_client_dirs@ \ @sql_server_dirs@ scripts man tests \ BUILD @netware_dir@ os2 @libmysqld_dirs@ \ diff --git a/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr b/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr new file mode 100755 index 00000000000..ef8404545fb --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr @@ -0,0 +1,51 @@ +[Language] +LanguageSupport0=0009 + +[OperatingSystem] +OSSupport=0000000000010010 + +[Data] +CurrentMedia= +CurrentComponentDef=Default.cdf +ProductName=MySQL Servers and Clients +set_mifserial= +DevEnvironment=Microsoft Visual C++ 6 +AppExe= +set_dlldebug=No +EmailAddresss= +Instructions=Instructions.txt +set_testmode=No +set_mif=No +SummaryText= +Department= +HomeURL= +Author= +Type=Database Application +InstallRoot=D:\MySQL-Install\4.0.xcom-clas +Version=1.00.000 +InstallationGUID=40744a4d-efed-4cff-84a9-9e6389550f5c +set_level=Level 3 +CurrentFileGroupDef=Default.fdf +Notes=Notes.txt +set_maxerr=50 +set_args= +set_miffile=Status.mif +set_dllcmdline= +Copyright= +set_warnaserr=No +CurrentPlatform= +Category= +set_preproc= +CurrentLanguage=English +CompanyName=MySQL +Description=Description.txt +set_maxwarn=50 +set_crc=Yes +set_compileb4build=No + +[MediaInfo] + +[General] +Type=INSTALLMAIN +Version=1.10.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf new file mode 100755 index 00000000000..48d37800cd1 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf @@ -0,0 +1,192 @@ +[Development] +required0=Servers +SELECTED=Yes +FILENEED=STANDARD +required1=Grant Tables +HTTPLOCATION= +STATUS=Examples, Libraries, Includes and Script files +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=Examples, Libraries, Includes and Script files +DISPLAYTEXT=Examples, Libraries, Includes and Script files +IMAGE= +DEFSELECTION=Yes +filegroup0=Development +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=ALWAYSOVERWRITE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Grant Tables] +required0=Servers +SELECTED=Yes +FILENEED=CRITICAL +HTTPLOCATION= +STATUS=The Grant Tables and Core Files +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The Grant Tables and Core Files +DISPLAYTEXT=The Grant Tables and Core Files +IMAGE= +DEFSELECTION=Yes +filegroup0=Grant Tables +requiredby0=Development +COMMENT= +INCLUDEINBUILD=Yes +requiredby1=Clients and Tools +INSTALLATION=NEVEROVERWRITE +requiredby2=Documentation +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Components] +component0=Development +component1=Grant Tables +component2=Servers +component3=Clients and Tools +component4=Documentation + +[TopComponents] +component0=Servers +component1=Clients and Tools +component2=Documentation +component3=Development +component4=Grant Tables + +[SetupType] +setuptype0=Compact +setuptype1=Typical +setuptype2=Custom + +[Clients and Tools] +required0=Servers +SELECTED=Yes +FILENEED=HIGHLYRECOMMENDED +required1=Grant Tables +HTTPLOCATION= +STATUS=The MySQL clients and Maintenance Tools +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL clients and Maintenance Tools +DISPLAYTEXT=The MySQL clients and Maintenance Tools +IMAGE= +DEFSELECTION=Yes +filegroup0=Clients and Tools +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=NEWERDATE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Servers] +SELECTED=Yes +FILENEED=CRITICAL +HTTPLOCATION= +STATUS=The MySQL Servers +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL Servers +DISPLAYTEXT=The MySQL Servers +IMAGE= +DEFSELECTION=Yes +filegroup0=Servers +requiredby0=Development +COMMENT= +INCLUDEINBUILD=Yes +requiredby1=Grant Tables +INSTALLATION=ALWAYSOVERWRITE +requiredby2=Clients and Tools +requiredby3=Documentation +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[SetupTypeItem-Compact] +Comment= +item0=Grant Tables +item1=Servers +item2=Clients and Tools +item3=Documentation +Descrip= +DisplayText= + +[SetupTypeItem-Custom] +Comment= +item0=Development +item1=Grant Tables +item2=Servers +item3=Clients and Tools +Descrip= +item4=Documentation +DisplayText= + +[Info] +Type=CompDef +Version=1.00.000 +Name= + +[SetupTypeItem-Typical] +Comment= +item0=Development +item1=Grant Tables +item2=Servers +item3=Clients and Tools +Descrip= +item4=Documentation +DisplayText= + +[Documentation] +required0=Servers +SELECTED=Yes +FILENEED=HIGHLYRECOMMENDED +required1=Grant Tables +HTTPLOCATION= +STATUS=The MySQL Documentation with different formats +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL Documentation with different formats +DISPLAYTEXT=The MySQL Documentation with different formats +IMAGE= +DEFSELECTION=Yes +filegroup0=Documentation +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=ALWAYSOVERWRITE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.fgl b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.fgl new file mode 100755 index 00000000000..4e20dcea4ab --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.fgl @@ -0,0 +1,42 @@ +[<PROGRAMFILES>\<COMMONFILES>] +DISPLAYTEXT=Common Files Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[<WINDIR>\<WINSYSDIR>] +DISPLAYTEXT=Windows System Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[USERDEFINED] +DISPLAYTEXT=Script-defined Folders +TYPE=USERSTART +fulldirectory= + +[<PROGRAMFILES>] +DISPLAYTEXT=Program Files Folder +SubDir0=<PROGRAMFILES>\<COMMONFILES> +TYPE=TEXTSUBFIXED +fulldirectory= + +[<TARGETDIR>] +DISPLAYTEXT=General Application Destination +TYPE=TEXTSUBFIXED +fulldirectory= + +[<WINDIR>] +DISPLAYTEXT=Windows Operating System +SubDir0=<WINDIR>\<WINSYSDIR> +TYPE=TEXTSUBFIXED +fulldirectory= + +[TopDir] +SubDir0=<WINDIR> +SubDir1=<PROGRAMFILES> +SubDir2=<TARGETDIR> +SubDir3=USERDEFINED + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl new file mode 100755 index 00000000000..7bba3d7474a --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl @@ -0,0 +1,31 @@ +[bin] +file15=C:\mysql\bin\replace.exe +file16=C:\mysql\bin\winmysqladmin.cnt +file0=C:\mysql\bin\isamchk.exe +file17=C:\mysql\bin\WINMYSQLADMIN.HLP +file1=C:\mysql\bin\myisamchk.exe +file18=C:\mysql\bin\comp-err.exe +file2=C:\mysql\bin\myisamlog.exe +file19=C:\mysql\bin\my_print_defaults.exe +file3=C:\mysql\bin\myisampack.exe +file4=C:\mysql\bin\mysql.exe +file5=C:\mysql\bin\mysqladmin.exe +file6=C:\mysql\bin\mysqlbinlog.exe +file7=C:\mysql\bin\mysqlc.exe +file8=C:\mysql\bin\mysqlcheck.exe +file9=C:\mysql\bin\mysqldump.exe +file20=C:\mysql\bin\winmysqladmin.exe +file10=C:\mysql\bin\mysqlimport.exe +fulldirectory= +file11=C:\mysql\bin\mysqlshow.exe +file12=C:\mysql\bin\mysqlwatch.exe +file13=C:\mysql\bin\pack_isam.exe +file14=C:\mysql\bin\perror.exe + +[TopDir] +SubDir0=bin + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Default.fdf b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Default.fdf new file mode 100755 index 00000000000..8096a4b74bf --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Default.fdf @@ -0,0 +1,82 @@ +[FileGroups] +group0=Development +group1=Grant Tables +group2=Servers +group3=Clients and Tools +group4=Documentation + +[Development] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Grant Tables] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Clients and Tools] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM=0000000000000000 +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Servers] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Info] +Type=FileGrp +Version=1.00.000 +Name= + +[Documentation] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl new file mode 100755 index 00000000000..6f9df51965b --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl @@ -0,0 +1,239 @@ +[bench\Data\Wisconsin] +file0=C:\mysql\bench\Data\Wisconsin\onek.data +file1=C:\mysql\bench\Data\Wisconsin\tenk.data +fulldirectory= + +[lib\debug] +file0=C:\mysql\lib\debug\libmySQL.dll +file1=C:\mysql\lib\debug\libmySQL.lib +file2=C:\mysql\lib\debug\mysqlclient.lib +file3=C:\mysql\lib\debug\zlib.lib +file4=C:\mysql\lib\debug\mysys.lib +file5=C:\mysql\lib\debug\regex.lib +file6=C:\mysql\lib\debug\strings.lib +fulldirectory= + +[bench\output] +fulldirectory= + +[examples\libmysqltest] +file0=C:\mysql\examples\libmysqltest\myTest.c +file1=C:\mysql\examples\libmysqltest\myTest.dsp +file2=C:\mysql\examples\libmysqltest\myTest.dsw +file3=C:\mysql\examples\libmysqltest\myTest.exe +file4=C:\mysql\examples\libmysqltest\myTest.mak +file5=C:\mysql\examples\libmysqltest\myTest.ncb +file6=C:\mysql\examples\libmysqltest\myTest.opt +file7=C:\mysql\examples\libmysqltest\readme +fulldirectory= + +[include] +file15=C:\mysql\include\libmysqld.def +file16=C:\mysql\include\my_alloc.h +file0=C:\mysql\include\raid.h +file17=C:\mysql\include\my_getopt.h +file1=C:\mysql\include\errmsg.h +file2=C:\mysql\include\Libmysql.def +file3=C:\mysql\include\m_ctype.h +file4=C:\mysql\include\m_string.h +file5=C:\mysql\include\my_list.h +file6=C:\mysql\include\my_pthread.h +file7=C:\mysql\include\my_sys.h +file8=C:\mysql\include\mysql.h +file9=C:\mysql\include\mysql_com.h +file10=C:\mysql\include\mysql_version.h +fulldirectory= +file11=C:\mysql\include\mysqld_error.h +file12=C:\mysql\include\dbug.h +file13=C:\mysql\include\config-win.h +file14=C:\mysql\include\my_global.h + +[examples] +SubDir0=examples\libmysqltest +SubDir1=examples\tests +fulldirectory= + +[lib\opt] +file0=C:\mysql\lib\opt\libmySQL.dll +file1=C:\mysql\lib\opt\libmySQL.lib +file2=C:\mysql\lib\opt\mysqlclient.lib +file3=C:\mysql\lib\opt\zlib.lib +file4=C:\mysql\lib\opt\mysys.lib +file5=C:\mysql\lib\opt\regex.lib +file6=C:\mysql\lib\opt\strings.lib +fulldirectory= + +[bench\Data] +SubDir0=bench\Data\ATIS +SubDir1=bench\Data\Wisconsin +fulldirectory= + +[bench\limits] +file15=C:\mysql\bench\limits\pg.comment +file16=C:\mysql\bench\limits\solid.cfg +file0=C:\mysql\bench\limits\access.cfg +file17=C:\mysql\bench\limits\solid-nt4.cfg +file1=C:\mysql\bench\limits\access.comment +file18=C:\mysql\bench\limits\sybase.cfg +file2=C:\mysql\bench\limits\Adabas.cfg +file3=C:\mysql\bench\limits\Adabas.comment +file4=C:\mysql\bench\limits\Db2.cfg +file5=C:\mysql\bench\limits\empress.cfg +file6=C:\mysql\bench\limits\empress.comment +file7=C:\mysql\bench\limits\Informix.cfg +file8=C:\mysql\bench\limits\Informix.comment +file9=C:\mysql\bench\limits\msql.cfg +file10=C:\mysql\bench\limits\ms-sql.cfg +fulldirectory= +file11=C:\mysql\bench\limits\Ms-sql65.cfg +file12=C:\mysql\bench\limits\mysql.cfg +file13=C:\mysql\bench\limits\oracle.cfg +file14=C:\mysql\bench\limits\pg.cfg + +[TopDir] +SubDir0=bench +SubDir1=examples +SubDir2=include +SubDir3=lib +SubDir4=scripts + +[bench] +file15=C:\mysql\bench\test-create +file16=C:\mysql\bench\test-insert +file0=C:\mysql\bench\uname.bat +file17=C:\mysql\bench\test-select +file1=C:\mysql\bench\compare-results +file18=C:\mysql\bench\test-wisconsin +file2=C:\mysql\bench\copy-db +file19=C:\mysql\bench\bench-init.pl +file3=C:\mysql\bench\crash-me +file4=C:\mysql\bench\example.bat +file5=C:\mysql\bench\print-limit-table +file6=C:\mysql\bench\pwd.bat +file7=C:\mysql\bench\Readme +SubDir0=bench\Data +file8=C:\mysql\bench\run.bat +SubDir1=bench\limits +file9=C:\mysql\bench\run-all-tests +SubDir2=bench\output +file10=C:\mysql\bench\server-cfg +fulldirectory= +file11=C:\mysql\bench\test-alter-table +file12=C:\mysql\bench\test-ATIS +file13=C:\mysql\bench\test-big-tables +file14=C:\mysql\bench\test-connect + +[examples\tests] +file15=C:\mysql\examples\tests\lock_test.res +file16=C:\mysql\examples\tests\mail_to_db.pl +file0=C:\mysql\examples\tests\unique_users.tst +file17=C:\mysql\examples\tests\table_types.pl +file1=C:\mysql\examples\tests\auto_increment.tst +file18=C:\mysql\examples\tests\test_delayed_insert.pl +file2=C:\mysql\examples\tests\big_record.pl +file19=C:\mysql\examples\tests\udf_test +file3=C:\mysql\examples\tests\big_record.res +file4=C:\mysql\examples\tests\czech-sorting +file5=C:\mysql\examples\tests\deadlock-script.pl +file6=C:\mysql\examples\tests\export.pl +file7=C:\mysql\examples\tests\fork_test.pl +file8=C:\mysql\examples\tests\fork2_test.pl +file9=C:\mysql\examples\tests\fork3_test.pl +file20=C:\mysql\examples\tests\udf_test.res +file21=C:\mysql\examples\tests\auto_increment.res +file10=C:\mysql\examples\tests\function.res +fulldirectory= +file11=C:\mysql\examples\tests\function.tst +file12=C:\mysql\examples\tests\grant.pl +file13=C:\mysql\examples\tests\grant.res +file14=C:\mysql\examples\tests\lock_test.pl + +[bench\Data\ATIS] +file26=C:\mysql\bench\Data\ATIS\stop1.txt +file15=C:\mysql\bench\Data\ATIS\flight_class.txt +file27=C:\mysql\bench\Data\ATIS\time_interval.txt +file16=C:\mysql\bench\Data\ATIS\flight_day.txt +file0=C:\mysql\bench\Data\ATIS\transport.txt +file28=C:\mysql\bench\Data\ATIS\time_zone.txt +file17=C:\mysql\bench\Data\ATIS\flight_fare.txt +file1=C:\mysql\bench\Data\ATIS\airline.txt +file29=C:\mysql\bench\Data\ATIS\aircraft.txt +file18=C:\mysql\bench\Data\ATIS\food_service.txt +file2=C:\mysql\bench\Data\ATIS\airport.txt +file19=C:\mysql\bench\Data\ATIS\ground_service.txt +file3=C:\mysql\bench\Data\ATIS\airport_service.txt +file4=C:\mysql\bench\Data\ATIS\city.txt +file5=C:\mysql\bench\Data\ATIS\class_of_service.txt +file6=C:\mysql\bench\Data\ATIS\code_description.txt +file7=C:\mysql\bench\Data\ATIS\compound_class.txt +file8=C:\mysql\bench\Data\ATIS\connect_leg.txt +file9=C:\mysql\bench\Data\ATIS\date_day.txt +file20=C:\mysql\bench\Data\ATIS\month_name.txt +file21=C:\mysql\bench\Data\ATIS\restrict_carrier.txt +file10=C:\mysql\bench\Data\ATIS\day_name.txt +fulldirectory= +file22=C:\mysql\bench\Data\ATIS\restrict_class.txt +file11=C:\mysql\bench\Data\ATIS\dual_carrier.txt +file23=C:\mysql\bench\Data\ATIS\restriction.txt +file12=C:\mysql\bench\Data\ATIS\fare.txt +file24=C:\mysql\bench\Data\ATIS\state.txt +file13=C:\mysql\bench\Data\ATIS\fconnection.txt +file25=C:\mysql\bench\Data\ATIS\stop.txt +file14=C:\mysql\bench\Data\ATIS\flight.txt + +[General] +Type=FILELIST +Version=1.00.000 + +[scripts] +file37=C:\mysql\scripts\mysqld_safe-watch.sh +file26=C:\mysql\scripts\mysql_zap +file15=C:\mysql\scripts\mysql_fix_privilege_tables +file38=C:\mysql\scripts\mysqldumpslow +file27=C:\mysql\scripts\mysql_zap.sh +file16=C:\mysql\scripts\mysql_fix_privilege_tables.sh +file0=C:\mysql\scripts\Readme +file39=C:\mysql\scripts\mysqldumpslow.sh +file28=C:\mysql\scripts\mysqlaccess +file17=C:\mysql\scripts\mysql_install_db +file1=C:\mysql\scripts\make_binary_distribution.sh +file29=C:\mysql\scripts\mysqlaccess.conf +file18=C:\mysql\scripts\mysql_install_db.sh +file2=C:\mysql\scripts\msql2mysql +file19=C:\mysql\scripts\mysql_secure_installation +file3=C:\mysql\scripts\msql2mysql.sh +file4=C:\mysql\scripts\mysql_config +file5=C:\mysql\scripts\mysql_config.sh +file6=C:\mysql\scripts\mysql_convert_table_format +file7=C:\mysql\scripts\mysql_convert_table_format.sh +file40=C:\mysql\scripts\mysqlhotcopy +file8=C:\mysql\scripts\mysql_explain_log +file41=C:\mysql\scripts\mysqlhotcopy.pl +file30=C:\mysql\scripts\mysqlaccess.sh +file9=C:\mysql\scripts\mysql_explain_log.sh +file42=C:\mysql\scripts\mysqlhotcopy.sh +file31=C:\mysql\scripts\mysqlbug +file20=C:\mysql\scripts\mysql_secure_installation.sh +file43=C:\mysql\scripts\make_binary_distribution +file32=C:\mysql\scripts\mysqlbug.sh +file21=C:\mysql\scripts\mysql_setpermission +file10=C:\mysql\scripts\mysql_find_rows +fulldirectory= +file33=C:\mysql\scripts\mysqld_multi +file22=C:\mysql\scripts\mysql_setpermission.pl +file11=C:\mysql\scripts\mysql_find_rows.pl +file34=C:\mysql\scripts\mysqld_multi.sh +file23=C:\mysql\scripts\mysql_setpermission.sh +file12=C:\mysql\scripts\mysql_find_rows.sh +file35=C:\mysql\scripts\mysqld_safe +file24=C:\mysql\scripts\mysql_tableinfo +file13=C:\mysql\scripts\mysql_fix_extensions +file36=C:\mysql\scripts\mysqld_safe.sh +file25=C:\mysql\scripts\mysql_tableinfo.sh +file14=C:\mysql\scripts\mysql_fix_extensions.sh + +[lib] +SubDir0=lib\debug +SubDir1=lib\opt +fulldirectory= + diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Documentation.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Documentation.fgl new file mode 100755 index 00000000000..80fe777cf0f --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Documentation.fgl @@ -0,0 +1,99 @@ +[Docs\Flags] +file59=C:\mysql\Docs\Flags\romania.gif +file48=C:\mysql\Docs\Flags\kroatia.eps +file37=C:\mysql\Docs\Flags\iceland.gif +file26=C:\mysql\Docs\Flags\france.eps +file15=C:\mysql\Docs\Flags\china.gif +file49=C:\mysql\Docs\Flags\kroatia.gif +file38=C:\mysql\Docs\Flags\ireland.eps +file27=C:\mysql\Docs\Flags\france.gif +file16=C:\mysql\Docs\Flags\croatia.eps +file0=C:\mysql\Docs\Flags\usa.gif +file39=C:\mysql\Docs\Flags\ireland.gif +file28=C:\mysql\Docs\Flags\germany.eps +file17=C:\mysql\Docs\Flags\croatia.gif +file1=C:\mysql\Docs\Flags\argentina.gif +file29=C:\mysql\Docs\Flags\germany.gif +file18=C:\mysql\Docs\Flags\czech-republic.eps +file2=C:\mysql\Docs\Flags\australia.eps +file19=C:\mysql\Docs\Flags\czech-republic.gif +file3=C:\mysql\Docs\Flags\australia.gif +file80=C:\mysql\Docs\Flags\usa.eps +file4=C:\mysql\Docs\Flags\austria.eps +file81=C:\mysql\Docs\Flags\argentina.eps +file70=C:\mysql\Docs\Flags\spain.eps +file5=C:\mysql\Docs\Flags\austria.gif +file71=C:\mysql\Docs\Flags\spain.gif +file60=C:\mysql\Docs\Flags\russia.eps +file6=C:\mysql\Docs\Flags\brazil.eps +file72=C:\mysql\Docs\Flags\sweden.eps +file61=C:\mysql\Docs\Flags\russia.gif +file50=C:\mysql\Docs\Flags\latvia.eps +file7=C:\mysql\Docs\Flags\brazil.gif +file73=C:\mysql\Docs\Flags\sweden.gif +file62=C:\mysql\Docs\Flags\singapore.eps +file51=C:\mysql\Docs\Flags\latvia.gif +file40=C:\mysql\Docs\Flags\island.eps +file8=C:\mysql\Docs\Flags\bulgaria.eps +file74=C:\mysql\Docs\Flags\switzerland.eps +file63=C:\mysql\Docs\Flags\singapore.gif +file52=C:\mysql\Docs\Flags\netherlands.eps +file41=C:\mysql\Docs\Flags\island.gif +file30=C:\mysql\Docs\Flags\great-britain.eps +file9=C:\mysql\Docs\Flags\bulgaria.gif +file75=C:\mysql\Docs\Flags\switzerland.gif +file64=C:\mysql\Docs\Flags\south-africa.eps +file53=C:\mysql\Docs\Flags\netherlands.gif +file42=C:\mysql\Docs\Flags\israel.eps +file31=C:\mysql\Docs\Flags\great-britain.gif +file20=C:\mysql\Docs\Flags\denmark.eps +file76=C:\mysql\Docs\Flags\taiwan.eps +file65=C:\mysql\Docs\Flags\south-africa.gif +file54=C:\mysql\Docs\Flags\poland.eps +file43=C:\mysql\Docs\Flags\israel.gif +file32=C:\mysql\Docs\Flags\greece.eps +file21=C:\mysql\Docs\Flags\denmark.gif +file10=C:\mysql\Docs\Flags\canada.eps +fulldirectory= +file77=C:\mysql\Docs\Flags\taiwan.gif +file66=C:\mysql\Docs\Flags\south-africa1.eps +file55=C:\mysql\Docs\Flags\poland.gif +file44=C:\mysql\Docs\Flags\italy.eps +file33=C:\mysql\Docs\Flags\greece.gif +file22=C:\mysql\Docs\Flags\estonia.eps +file11=C:\mysql\Docs\Flags\canada.gif +file78=C:\mysql\Docs\Flags\ukraine.eps +file67=C:\mysql\Docs\Flags\south-africa1.gif +file56=C:\mysql\Docs\Flags\portugal.eps +file45=C:\mysql\Docs\Flags\italy.gif +file34=C:\mysql\Docs\Flags\hungary.eps +file23=C:\mysql\Docs\Flags\estonia.gif +file12=C:\mysql\Docs\Flags\chile.eps +file79=C:\mysql\Docs\Flags\ukraine.gif +file68=C:\mysql\Docs\Flags\south-korea.eps +file57=C:\mysql\Docs\Flags\portugal.gif +file46=C:\mysql\Docs\Flags\japan.eps +file35=C:\mysql\Docs\Flags\hungary.gif +file24=C:\mysql\Docs\Flags\finland.eps +file13=C:\mysql\Docs\Flags\chile.gif +file69=C:\mysql\Docs\Flags\south-korea.gif +file58=C:\mysql\Docs\Flags\romania.eps +file47=C:\mysql\Docs\Flags\japan.gif +file36=C:\mysql\Docs\Flags\iceland.eps +file25=C:\mysql\Docs\Flags\finland.gif +file14=C:\mysql\Docs\Flags\china.eps + +[Docs] +file0=C:\mysql\Docs\manual_toc.html +file1=C:\mysql\Docs\manual.html +file2=C:\mysql\Docs\manual.txt +SubDir0=Docs\Flags +fulldirectory= + +[TopDir] +SubDir0=Docs + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Grant Tables.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Grant Tables.fgl new file mode 100755 index 00000000000..178065a7003 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Grant Tables.fgl @@ -0,0 +1,36 @@ +[data\test] +fulldirectory= + +[data\mysql] +file15=C:\mysql\data\mysql\func.frm +file16=C:\mysql\data\mysql\func.MYD +file0=C:\mysql\data\mysql\columns_priv.frm +file17=C:\mysql\data\mysql\func.MYI +file1=C:\mysql\data\mysql\columns_priv.MYD +file2=C:\mysql\data\mysql\columns_priv.MYI +file3=C:\mysql\data\mysql\db.frm +file4=C:\mysql\data\mysql\db.MYD +file5=C:\mysql\data\mysql\db.MYI +file6=C:\mysql\data\mysql\host.frm +file7=C:\mysql\data\mysql\host.MYD +file8=C:\mysql\data\mysql\host.MYI +file9=C:\mysql\data\mysql\tables_priv.frm +file10=C:\mysql\data\mysql\tables_priv.MYD +fulldirectory= +file11=C:\mysql\data\mysql\tables_priv.MYI +file12=C:\mysql\data\mysql\user.frm +file13=C:\mysql\data\mysql\user.MYD +file14=C:\mysql\data\mysql\user.MYI + +[TopDir] +SubDir0=data + +[data] +SubDir0=data\mysql +SubDir1=data\test +fulldirectory= + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl new file mode 100755 index 00000000000..3f875b574f6 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl @@ -0,0 +1,226 @@ +[Embedded\Static\release] +file0=C:\mysql\embedded\Static\release\test_stc.dsp +file1=C:\mysql\embedded\Static\release\ReadMe.txt +file2=C:\mysql\embedded\Static\release\StdAfx.cpp +file3=C:\mysql\embedded\Static\release\StdAfx.h +file4=C:\mysql\embedded\Static\release\test_stc.cpp +file5=C:\mysql\embedded\Static\release\mysqlserver.lib +fulldirectory= + +[share\polish] +file0=C:\mysql\share\polish\errmsg.sys +file1=C:\mysql\share\polish\errmsg.txt +fulldirectory= + +[share\dutch] +file0=C:\mysql\share\dutch\errmsg.sys +file1=C:\mysql\share\dutch\errmsg.txt +fulldirectory= + +[share\spanish] +file0=C:\mysql\share\spanish\errmsg.sys +file1=C:\mysql\share\spanish\errmsg.txt +fulldirectory= + +[share\english] +file0=C:\mysql\share\english\errmsg.sys +file1=C:\mysql\share\english\errmsg.txt +fulldirectory= + +[bin] +file0=C:\mysql\bin\mysqld-opt.exe +file1=C:\mysql\bin\mysqld-nt.exe +file2=C:\mysql\bin\mysqld.exe +file3=C:\mysql\bin\cygwinb19.dll +file4=C:\mysql\bin\libmySQL.dll +fulldirectory= + +[share\korean] +file0=C:\mysql\share\korean\errmsg.sys +file1=C:\mysql\share\korean\errmsg.txt +fulldirectory= + +[share\charsets] +file15=C:\mysql\share\charsets\latin1.conf +file16=C:\mysql\share\charsets\latin2.conf +file0=C:\mysql\share\charsets\win1251ukr.conf +file17=C:\mysql\share\charsets\latin5.conf +file1=C:\mysql\share\charsets\cp1257.conf +file18=C:\mysql\share\charsets\Readme +file2=C:\mysql\share\charsets\croat.conf +file19=C:\mysql\share\charsets\swe7.conf +file3=C:\mysql\share\charsets\danish.conf +file4=C:\mysql\share\charsets\dec8.conf +file5=C:\mysql\share\charsets\dos.conf +file6=C:\mysql\share\charsets\estonia.conf +file7=C:\mysql\share\charsets\german1.conf +file8=C:\mysql\share\charsets\greek.conf +file9=C:\mysql\share\charsets\hebrew.conf +file20=C:\mysql\share\charsets\usa7.conf +file21=C:\mysql\share\charsets\win1250.conf +file10=C:\mysql\share\charsets\hp8.conf +fulldirectory= +file22=C:\mysql\share\charsets\win1251.conf +file11=C:\mysql\share\charsets\hungarian.conf +file23=C:\mysql\share\charsets\cp1251.conf +file12=C:\mysql\share\charsets\Index +file13=C:\mysql\share\charsets\koi8_ru.conf +file14=C:\mysql\share\charsets\koi8_ukr.conf + +[Embedded\DLL\debug] +file0=C:\mysql\embedded\DLL\debug\libmysqld.dll +file1=C:\mysql\embedded\DLL\debug\libmysqld.exp +file2=C:\mysql\embedded\DLL\debug\libmysqld.lib +fulldirectory= + +[Embedded] +file0=C:\mysql\embedded\embedded.dsw +SubDir0=Embedded\DLL +SubDir1=Embedded\Static +fulldirectory= + +[share\ukrainian] +file0=C:\mysql\share\ukrainian\errmsg.sys +file1=C:\mysql\share\ukrainian\errmsg.txt +fulldirectory= + +[share\hungarian] +file0=C:\mysql\share\hungarian\errmsg.sys +file1=C:\mysql\share\hungarian\errmsg.txt +fulldirectory= + +[share\german] +file0=C:\mysql\share\german\errmsg.sys +file1=C:\mysql\share\german\errmsg.txt +fulldirectory= + +[share\portuguese] +file0=C:\mysql\share\portuguese\errmsg.sys +file1=C:\mysql\share\portuguese\errmsg.txt +fulldirectory= + +[share\estonian] +file0=C:\mysql\share\estonian\errmsg.sys +file1=C:\mysql\share\estonian\errmsg.txt +fulldirectory= + +[share\romanian] +file0=C:\mysql\share\romanian\errmsg.sys +file1=C:\mysql\share\romanian\errmsg.txt +fulldirectory= + +[share\french] +file0=C:\mysql\share\french\errmsg.sys +file1=C:\mysql\share\french\errmsg.txt +fulldirectory= + +[share\swedish] +file0=C:\mysql\share\swedish\errmsg.sys +file1=C:\mysql\share\swedish\errmsg.txt +fulldirectory= + +[share\slovak] +file0=C:\mysql\share\slovak\errmsg.sys +file1=C:\mysql\share\slovak\errmsg.txt +fulldirectory= + +[share\greek] +file0=C:\mysql\share\greek\errmsg.sys +file1=C:\mysql\share\greek\errmsg.txt +fulldirectory= + +[TopDir] +file0=C:\mysql\my-huge.cnf +file1=C:\mysql\my-large.cnf +file2=C:\mysql\my-medium.cnf +file3=C:\mysql\my-small.cnf +file4=C:\mysql\MySQLEULA.txt +SubDir0=bin +SubDir1=share +SubDir2=Embedded + +[share] +SubDir8=share\hungarian +SubDir9=share\charsets +SubDir20=share\spanish +SubDir21=share\swedish +SubDir10=share\italian +SubDir22=share\ukrainian +SubDir11=share\japanese +SubDir12=share\korean +SubDir13=share\norwegian +SubDir14=share\norwegian-ny +SubDir15=share\polish +SubDir16=share\portuguese +SubDir0=share\czech +SubDir17=share\romanian +SubDir1=share\danish +SubDir18=share\russian +SubDir2=share\dutch +SubDir19=share\slovak +SubDir3=share\english +fulldirectory= +SubDir4=share\estonian +SubDir5=share\french +SubDir6=share\german +SubDir7=share\greek + +[share\norwegian-ny] +file0=C:\mysql\share\norwegian-ny\errmsg.sys +file1=C:\mysql\share\norwegian-ny\errmsg.txt +fulldirectory= + +[Embedded\DLL] +file0=C:\mysql\embedded\DLL\test_dll.dsp +file1=C:\mysql\embedded\DLL\StdAfx.h +file2=C:\mysql\embedded\DLL\test_dll.cpp +file3=C:\mysql\embedded\DLL\StdAfx.cpp +SubDir0=Embedded\DLL\debug +SubDir1=Embedded\DLL\release +fulldirectory= + +[Embedded\Static] +SubDir0=Embedded\Static\release +fulldirectory= + +[Embedded\DLL\release] +file0=C:\mysql\embedded\DLL\release\libmysqld.dll +file1=C:\mysql\embedded\DLL\release\libmysqld.exp +file2=C:\mysql\embedded\DLL\release\libmysqld.lib +file3=C:\mysql\embedded\DLL\release\mysql-server.exe +fulldirectory= + +[share\danish] +file0=C:\mysql\share\danish\errmsg.sys +file1=C:\mysql\share\danish\errmsg.txt +fulldirectory= + +[share\czech] +file0=C:\mysql\share\czech\errmsg.sys +file1=C:\mysql\share\czech\errmsg.txt +fulldirectory= + +[General] +Type=FILELIST +Version=1.00.000 + +[share\russian] +file0=C:\mysql\share\russian\errmsg.sys +file1=C:\mysql\share\russian\errmsg.txt +fulldirectory= + +[share\norwegian] +file0=C:\mysql\share\norwegian\errmsg.sys +file1=C:\mysql\share\norwegian\errmsg.txt +fulldirectory= + +[share\japanese] +file0=C:\mysql\share\japanese\errmsg.sys +file1=C:\mysql\share\japanese\errmsg.txt +fulldirectory= + +[share\italian] +file0=C:\mysql\share\italian\errmsg.sys +file1=C:\mysql\share\italian\errmsg.txt +fulldirectory= + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Registry Entries/Default.rge b/VC++Files/InstallShield/4.0.XX-classic/Registry Entries/Default.rge new file mode 100755 index 00000000000..537dfd82e48 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Registry Entries/Default.rge @@ -0,0 +1,4 @@ +[General] +Type=REGISTRYDATA +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.dbg b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.dbg Binary files differnew file mode 100755 index 00000000000..0c6d4e6b708 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.dbg diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ino b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ino Binary files differnew file mode 100755 index 00000000000..204d8ea0f36 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ino diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ins b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ins Binary files differnew file mode 100755 index 00000000000..759009b5c84 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ins diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.obs b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.obs Binary files differnew file mode 100755 index 00000000000..5fcfcb62c4e --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.obs diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul new file mode 100755 index 00000000000..df143b493c4 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul @@ -0,0 +1,640 @@ + +//////////////////////////////////////////////////////////////////////////////// +// +// IIIIIII SSSSSS +// II SS InstallShield (R) +// II SSSSSS (c) 1996-1997, InstallShield Software Corporation +// II SS (c) 1990-1996, InstallShield Corporation +// IIIIIII SSSSSS All Rights Reserved. +// +// +// This code is generated as a starting setup template. You should +// modify it to provide all necessary steps for your setup. +// +// +// File Name: Setup.rul +// +// Description: InstallShield script +// +// Comments: This template script performs a basic setup on a +// Windows 95 or Windows NT 4.0 platform. With minor +// modifications, this template can be adapted to create +// new, customized setups. +// +//////////////////////////////////////////////////////////////////////////////// + + + // Include header file +#include "sdlang.h" +#include "sddialog.h" + +////////////////////// string defines //////////////////////////// + +#define UNINST_LOGFILE_NAME "Uninst.isu" + +//////////////////// installation declarations /////////////////// + + // ----- DLL prototypes ----- + + + // your DLL prototypes + + + // ---- script prototypes ----- + + // generated + prototype ShowDialogs(); + prototype MoveFileData(); + prototype HandleMoveDataError( NUMBER ); + prototype ProcessBeforeDataMove(); + prototype ProcessAfterDataMove(); + prototype SetupRegistry(); + prototype SetupFolders(); + prototype CleanUpInstall(); + prototype SetupInstall(); + prototype SetupScreen(); + prototype CheckRequirements(); + prototype DialogShowSdWelcome(); + prototype DialogShowSdShowInfoList(); + prototype DialogShowSdAskDestPath(); + prototype DialogShowSdSetupType(); + prototype DialogShowSdComponentDialog2(); + prototype DialogShowSdFinishReboot(); + + // your prototypes + + + // ----- global variables ------ + + // generated + BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; + STRING svDir; + STRING svName, svCompany, svSerial; + STRING szAppPath; + STRING svSetupType; + + + // your global variables + + +/////////////////////////////////////////////////////////////////////////////// +// +// MAIN PROGRAM +// +// The setup begins here by hiding the visible setup +// window. This is done to allow all the titles, images, etc. to +// be established before showing the main window. The following +// logic then performs the setup in a series of steps. +// +/////////////////////////////////////////////////////////////////////////////// +program + Disable( BACKGROUND ); + + CheckRequirements(); + + SetupInstall(); + + SetupScreen(); + + if (ShowDialogs()<0) goto end_install; + + if (ProcessBeforeDataMove()<0) goto end_install; + + if (MoveFileData()<0) goto end_install; + + if (ProcessAfterDataMove()<0) goto end_install; + + if (SetupRegistry()<0) goto end_install; + + if (SetupFolders()<0) goto end_install; + + + end_install: + + CleanUpInstall(); + + // If an unrecoverable error occurred, clean up the partial installation. + // Otherwise, exit normally. + + if (bInstallAborted) then + abort; + endif; + +endprogram + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ShowDialogs // +// // +// Purpose: This function manages the display and navigation // +// the standard dialogs that exist in a setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ShowDialogs() + NUMBER nResult; + begin + + Dlg_Start: + // beginning of dialogs label + + Dlg_SdWelcome: + nResult = DialogShowSdWelcome(); + if (nResult = BACK) goto Dlg_Start; + + Dlg_SdShowInfoList: + nResult = DialogShowSdShowInfoList(); + if (nResult = BACK) goto Dlg_SdWelcome; + + Dlg_SdAskDestPath: + nResult = DialogShowSdAskDestPath(); + if (nResult = BACK) goto Dlg_SdShowInfoList; + + Dlg_SdSetupType: + nResult = DialogShowSdSetupType(); + if (nResult = BACK) goto Dlg_SdAskDestPath; + + Dlg_SdComponentDialog2: + if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then + goto Dlg_SdSetupType; + endif; + nResult = DialogShowSdComponentDialog2(); + if (nResult = BACK) goto Dlg_SdSetupType; + + return 0; + + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ProcessBeforeDataMove // +// // +// Purpose: This function performs any necessary operations prior to the // +// actual data move operation. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ProcessBeforeDataMove() + STRING svLogFile; + NUMBER nResult; + begin + + InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); + + svLogFile = UNINST_LOGFILE_NAME; + + nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); + if (nResult < 0) then + MessageBox( @ERROR_UNINSTSETUP, WARNING ); + endif; + + szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir + + if ((bIs32BitSetup) && (bIsShellExplorer)) then + RegDBSetItem( REGDB_APPPATH, szAppPath ); + RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); + RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); + endif; + + // TODO : update any items you want to process before moving the data + // + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: MoveFileData // +// // +// Purpose: This function handles the data movement for // +// the setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function MoveFileData() + NUMBER nResult, nDisk; + begin + + nDisk = 1; + SetStatusWindow( 0, "" ); + Disable( DIALOGCACHE ); + Enable( STATUS ); + StatusUpdate( ON, 100 ); + nResult = ComponentMoveData( MEDIA, nDisk, 0 ); + + HandleMoveDataError( nResult ); + + Disable( STATUS ); + + return nResult; + + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: HandleMoveDataError // +// // +// Purpose: This function handles the error (if any) during the move data // +// operation. // +// // +/////////////////////////////////////////////////////////////////////////////// +function HandleMoveDataError( nResult ) + STRING szErrMsg, svComponent , svFileGroup , svFile; + begin + + svComponent = ""; + svFileGroup = ""; + svFile = ""; + + switch (nResult) + case 0: + return 0; + default: + ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); + szErrMsg = @ERROR_MOVEDATA + "\n\n" + + @ERROR_COMPONENT + " " + svComponent + "\n" + + @ERROR_FILEGROUP + " " + svFileGroup + "\n" + + @ERROR_FILE + " " + svFile; + SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); + bInstallAborted = TRUE; + return nResult; + endswitch; + + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ProcessAfterDataMove // +// // +// Purpose: This function performs any necessary operations needed after // +// all data has been moved. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ProcessAfterDataMove() + begin + + // TODO : update self-registered files and other processes that + // should be performed after the data has been moved. + + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupRegistry // +// // +// Purpose: This function makes the registry entries for this setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupRegistry() + NUMBER nResult; + + begin + + // TODO : Add all your registry entry keys here + // + // + // RegDBCreateKeyEx, RegDBSetKeyValueEx.... + // + + nResult = CreateRegistrySet( "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// +// Function: SetupFolders +// +// Purpose: This function creates all the folders and shortcuts for the +// setup. This includes program groups and items for Windows 3.1. +// +/////////////////////////////////////////////////////////////////////////////// +function SetupFolders() + NUMBER nResult; + + begin + + + // TODO : Add all your folder (program group) along with shortcuts (program items) + // + // + // CreateProgramFolder, AddFolderIcon.... + // + + nResult = CreateShellObjects( "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CleanUpInstall // +// // +// Purpose: This cleans up the setup. Anything that should // +// be released or deleted at the end of the setup should // +// be done here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CleanUpInstall() + begin + + + if (bInstallAborted) then + return 0; + endif; + + DialogShowSdFinishReboot(); + + if (BATCH_INSTALL) then // ensure locked files are properly written + CommitSharedFiles(0); + endif; + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupInstall // +// // +// Purpose: This will setup the installation. Any general initialization // +// needed for the installation should be performed here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupInstall() + begin + + Enable( CORECOMPONENTHANDLING ); + + bInstallAborted = FALSE; + + if (bIs32BitSetup) then + svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; + else + svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names + endif; + + TARGETDIR = svDir; + + SdProductName( @PRODUCT_NAME ); + + Enable( DIALOGCACHE ); + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupScreen // +// // +// Purpose: This function establishes the screen look. This includes // +// colors, fonts, and text to be displayed. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupScreen() + begin + + Enable( FULLWINDOWMODE ); + Enable( INDVFILESTATUS ); + SetTitle( @TITLE_MAIN, 24, WHITE ); + + SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. + + Enable( BACKGROUND ); + + Delay( 1 ); + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CheckRequirements // +// // +// Purpose: This function checks all minimum requirements for the // +// application being installed. If any fail, then the user // +// is informed and the setup is terminated. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CheckRequirements() + NUMBER nvDx, nvDy, nvResult; + STRING svResult; + + begin + + bWinNT = FALSE; + bIsShellExplorer = FALSE; + + // Check screen resolution. + GetExtents( nvDx, nvDy ); + + if (nvDy < 480) then + MessageBox( @ERROR_VGARESOLUTION, WARNING ); + abort; + endif; + + // set 'setup' operation mode + bIs32BitSetup = TRUE; + GetSystemInfo( ISTYPE, nvResult, svResult ); + if (nvResult = 16) then + bIs32BitSetup = FALSE; // running 16-bit setup + return 0; // no additional information required + endif; + + // --- 32-bit testing after this point --- + + // Determine the target system's operating system. + GetSystemInfo( OS, nvResult, svResult ); + + if (nvResult = IS_WINDOWSNT) then + // Running Windows NT. + bWinNT = TRUE; + + // Check to see if the shell being used is EXPLORER shell. + if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then + if (nvResult >= 4) then + bIsShellExplorer = TRUE; + endif; + endif; + + elseif (nvResult = IS_WINDOWS95 ) then + bIsShellExplorer = TRUE; + + endif; + +end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdWelcome // +// // +// Purpose: This function handles the standard welcome dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdWelcome() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = ""; + nResult = SdWelcome( szTitle, szMsg ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdShowInfoList // +// // +// Purpose: This function displays the general information list dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdShowInfoList() + NUMBER nResult; + LIST list; + STRING szTitle, szMsg, szFile; + begin + + szFile = SUPPORTDIR ^ "infolist.txt"; + + list = ListCreate( STRINGLIST ); + ListReadFromFile( list, szFile ); + szTitle = ""; + szMsg = " "; + nResult = SdShowInfoList( szTitle, szMsg, list ); + + ListDestroy( list ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdAskDestPath // +// // +// Purpose: This function asks the user for the destination directory. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdAskDestPath() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = ""; + nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); + + TARGETDIR = svDir; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdSetupType // +// // +// Purpose: This function displays the standard setup type dialog. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdSetupType() + NUMBER nResult, nType; + STRING szTitle, szMsg; + begin + + switch (svSetupType) + case "Typical": + nType = TYPICAL; + case "Custom": + nType = CUSTOM; + case "Compact": + nType = COMPACT; + case "": + svSetupType = "Typical"; + nType = TYPICAL; + endswitch; + + szTitle = ""; + szMsg = ""; + nResult = SetupType( szTitle, szMsg, "", nType, 0 ); + + switch (nResult) + case COMPACT: + svSetupType = "Compact"; + case TYPICAL: + svSetupType = "Typical"; + case CUSTOM: + svSetupType = "Custom"; + endswitch; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdComponentDialog2 // +// // +// Purpose: This function displays the custom component dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdComponentDialog2() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + if ((svSetupType != "Custom") && (svSetupType != "")) then + return 0; + endif; + + szTitle = ""; + szMsg = ""; + nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdFinishReboot // +// // +// Purpose: This function will show the last dialog of the product. // +// It will allow the user to reboot and/or show some readme text. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdFinishReboot() + NUMBER nResult, nDefOptions; + STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; + NUMBER bOpt1, bOpt2; + begin + + if (!BATCH_INSTALL) then + bOpt1 = FALSE; + bOpt2 = FALSE; + szMsg1 = ""; + szMsg2 = ""; + szOption1 = ""; + szOption2 = ""; + nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); + return 0; + endif; + + nDefOptions = SYS_BOOTMACHINE; + szTitle = ""; + szMsg1 = ""; + szMsg2 = ""; + nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); + + return nResult; + end; + + // --- include script file section --- + +#include "sddialog.rul" + + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt b/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt new file mode 100755 index 00000000000..acad9353244 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt @@ -0,0 +1,25 @@ +This is a release of MySQL Classic 4.0.11a-gamma for Win32. + +NOTE: If you install MySQL in a folder other than +C:\MYSQL or you intend to start MySQL on NT/Win2000 +as a service, you must create a file named C:\MY.CNF +or \Windows\my.ini or \winnt\my.ini with the following +information:: + +[mysqld] +basedir=E:/installation-path/ +datadir=E:/data-path/ + +After your have installed MySQL, the installation +directory will contain 4 files named 'my-small.cnf, +my-medium.cnf, my-large.cnf, my-huge.cnf'. +You can use this as a starting point for your own +C:\my.cnf file. + +If you have any problems, you can mail them to +win32@lists.mysql.com after you have consulted the +MySQL manual and the MySQL mailing list archive +(http://www.mysql.com/documentation/index.html) + +On behalf of the MySQL AB gang, +Michael Widenius
\ No newline at end of file diff --git a/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp b/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp Binary files differnew file mode 100755 index 00000000000..3229d50c9bf --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp diff --git a/VC++Files/InstallShield/4.0.XX-classic/Shell Objects/Default.shl b/VC++Files/InstallShield/4.0.XX-classic/Shell Objects/Default.shl new file mode 100755 index 00000000000..187cb651307 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Shell Objects/Default.shl @@ -0,0 +1,12 @@ +[Data] +Folder3=<FOLDER_STARTUP> +Group0=Main +Group1=Startup +Folder0=<FOLDER_DESKTOP> +Folder1=<FOLDER_STARTMENU> +Folder2=<FOLDER_PROGRAMS> + +[Info] +Type=ShellObject +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/String Tables/0009-English/value.shl b/VC++Files/InstallShield/4.0.XX-classic/String Tables/0009-English/value.shl new file mode 100755 index 00000000000..9359ce70202 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/String Tables/0009-English/value.shl @@ -0,0 +1,23 @@ +[Data] +TITLE_MAIN=MySQL Classic Servers and Clients 4.0.11a-gamma +COMPANY_NAME=MySQL AB +ERROR_COMPONENT=Component: +COMPANY_NAME16=Company +PRODUCT_VERSION=MySQL Classic Servers and Clients 4.0.11a-gamma +ERROR_MOVEDATA=An error occurred during the move data process: %d +ERROR_FILEGROUP=File Group: +UNINST_KEY=MySQL Classic Servers and Clients 4.0.11a-gamma +TITLE_CAPTIONBAR=MySQL Classic Servers and Clients 4.0.11a-gamma +PRODUCT_NAME16=Product +ERROR_VGARESOLUTION=This program requires VGA or better resolution. +ERROR_FILE=File: +UNINST_DISPLAY_NAME=MySQL Classic Servers and Clients 4.0.11a-gamma +PRODUCT_KEY=yourapp.Exe +PRODUCT_NAME=MySQL Classic Servers and Clients 4.0.11a-gamma +ERROR_UNINSTSETUP=unInstaller setup failed to initialize. You may not be able to uninstall this product. + +[General] +Language=0009 +Type=STRINGTABLESPECIFIC +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/String Tables/Default.shl b/VC++Files/InstallShield/4.0.XX-classic/String Tables/Default.shl new file mode 100755 index 00000000000..d4dc4925ab1 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/String Tables/Default.shl @@ -0,0 +1,74 @@ +[TITLE_MAIN] +Comment= + +[COMPANY_NAME] +Comment= + +[ERROR_COMPONENT] +Comment= + +[COMPANY_NAME16] +Comment= + +[PRODUCT_VERSION] +Comment= + +[ERROR_MOVEDATA] +Comment= + +[ERROR_FILEGROUP] +Comment= + +[Language] +Lang0=0009 +CurrentLang=0 + +[UNINST_KEY] +Comment= + +[TITLE_CAPTIONBAR] +Comment= + +[Data] +Entry0=ERROR_VGARESOLUTION +Entry1=TITLE_MAIN +Entry2=TITLE_CAPTIONBAR +Entry3=UNINST_KEY +Entry4=UNINST_DISPLAY_NAME +Entry5=COMPANY_NAME +Entry6=PRODUCT_NAME +Entry7=PRODUCT_VERSION +Entry8=PRODUCT_KEY +Entry9=ERROR_MOVEDATA +Entry10=ERROR_UNINSTSETUP +Entry11=COMPANY_NAME16 +Entry12=PRODUCT_NAME16 +Entry13=ERROR_COMPONENT +Entry14=ERROR_FILEGROUP +Entry15=ERROR_FILE + +[PRODUCT_NAME16] +Comment= + +[ERROR_VGARESOLUTION] +Comment= + +[ERROR_FILE] +Comment= + +[General] +Type=STRINGTABLE +Version=1.00.000 + +[UNINST_DISPLAY_NAME] +Comment= + +[PRODUCT_KEY] +Comment= + +[PRODUCT_NAME] +Comment= + +[ERROR_UNINSTSETUP] +Comment= + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Build.tsb b/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Build.tsb new file mode 100755 index 00000000000..3949bd4c066 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Build.tsb @@ -0,0 +1,56 @@ +[<HKUS>] +Value= +KeyType=4 + +[<HKCR>] +Value= +KeyType=4 + +[<PROGRAMFILES>] +Value= +KeyType=4 + +[<WINSYSDIR>] +Value= +KeyType=4 + +[<COMMONFILES>] +Value= +KeyType=4 + +[<WINDIR>] +Value= +KeyType=4 + +[Data] +Key0=<PROGRAMFILES> +Key1=<COMMONFILES> +Key2=<WINDIR> +Key3=<WINSYSDIR> +Key4=<HKLM> +Key5=<HKCU> +Key6=<HKCC> +Key7=<HKDD> +Key8=<HKUS> +Key9=<HKCR> + +[General] +Type=TEXTSUB +Version=1.00.000 + +[<HKLM>] +Value= +KeyType=4 + +[<HKCU>] +Value= +KeyType=4 + +[<HKCC>] +Value= +KeyType=4 + +[<HKDD>] +Value= +KeyType=4 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Setup.tsb b/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Setup.tsb new file mode 100755 index 00000000000..b0c5a509f0b --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Setup.tsb @@ -0,0 +1,76 @@ +[<SRCDIR>] +Value= +KeyType=4 + +[<HKUS>] +Value= +KeyType=4 + +[<HKCR>] +Value= +KeyType=4 + +[<PROGRAMFILES>] +Value= +KeyType=4 + +[<TARGETDIR>] +Value= +KeyType=4 + +[<WINSYSDIR>] +Value= +KeyType=4 + +[<COMMONFILES>] +Value= +KeyType=4 + +[<WINDIR>] +Value= +KeyType=4 + +[Data] +Key0=<PROGRAMFILES> +Key1=<COMMONFILES> +Key2=<WINDIR> +Key3=<WINSYSDIR> +Key4=<TARGETDIR> +Key5=<SUPPORTDIR> +Key10=<HKDD> +Key6=<SRCDIR> +Key11=<HKUS> +Key7=<HKLM> +Key12=<HKCR> +Key8=<HKCU> +Key13=<SHELL_OBJECT_FOLDER> +Key9=<HKCC> + +[<SUPPORTDIR>] +Value= +KeyType=4 + +[<SHELL_OBJECT_FOLDER>] +Value= +KeyType=4 + +[General] +Type=TEXTSUB +Version=1.00.000 + +[<HKLM>] +Value= +KeyType=4 + +[<HKCU>] +Value= +KeyType=4 + +[<HKCC>] +Value= +KeyType=4 + +[<HKDD>] +Value= +KeyType=4 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/4.0.XX-gpl.ipr b/VC++Files/InstallShield/4.0.XX-gpl/4.0.XX-gpl.ipr new file mode 100755 index 00000000000..c415a03a315 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/4.0.XX-gpl.ipr @@ -0,0 +1,51 @@ +[Language] +LanguageSupport0=0009 + +[OperatingSystem] +OSSupport=0000000000010010 + +[Data] +CurrentMedia= +CurrentComponentDef=Default.cdf +ProductName=MySQL Servers and Clients +set_mifserial= +DevEnvironment=Microsoft Visual C++ 6 +AppExe= +set_dlldebug=No +EmailAddresss= +Instructions=Instructions.txt +set_testmode=No +set_mif=No +SummaryText= +Department= +HomeURL= +Author= +Type=Database Application +InstallRoot=D:\MySQL-Install\mysql-4\MySQL Servers and Clients +Version=1.00.000 +InstallationGUID=40744a4d-efed-4cff-84a9-9e6389550f5c +set_level=Level 3 +CurrentFileGroupDef=Default.fdf +Notes=Notes.txt +set_maxerr=50 +set_args= +set_miffile=Status.mif +set_dllcmdline= +Copyright= +set_warnaserr=No +CurrentPlatform= +Category= +set_preproc= +CurrentLanguage=English +CompanyName=MySQL +Description=Description.txt +set_maxwarn=50 +set_crc=Yes +set_compileb4build=No + +[MediaInfo] + +[General] +Type=INSTALLMAIN +Version=1.10.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.cdf b/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.cdf new file mode 100755 index 00000000000..48d37800cd1 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.cdf @@ -0,0 +1,192 @@ +[Development] +required0=Servers +SELECTED=Yes +FILENEED=STANDARD +required1=Grant Tables +HTTPLOCATION= +STATUS=Examples, Libraries, Includes and Script files +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=Examples, Libraries, Includes and Script files +DISPLAYTEXT=Examples, Libraries, Includes and Script files +IMAGE= +DEFSELECTION=Yes +filegroup0=Development +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=ALWAYSOVERWRITE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Grant Tables] +required0=Servers +SELECTED=Yes +FILENEED=CRITICAL +HTTPLOCATION= +STATUS=The Grant Tables and Core Files +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The Grant Tables and Core Files +DISPLAYTEXT=The Grant Tables and Core Files +IMAGE= +DEFSELECTION=Yes +filegroup0=Grant Tables +requiredby0=Development +COMMENT= +INCLUDEINBUILD=Yes +requiredby1=Clients and Tools +INSTALLATION=NEVEROVERWRITE +requiredby2=Documentation +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Components] +component0=Development +component1=Grant Tables +component2=Servers +component3=Clients and Tools +component4=Documentation + +[TopComponents] +component0=Servers +component1=Clients and Tools +component2=Documentation +component3=Development +component4=Grant Tables + +[SetupType] +setuptype0=Compact +setuptype1=Typical +setuptype2=Custom + +[Clients and Tools] +required0=Servers +SELECTED=Yes +FILENEED=HIGHLYRECOMMENDED +required1=Grant Tables +HTTPLOCATION= +STATUS=The MySQL clients and Maintenance Tools +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL clients and Maintenance Tools +DISPLAYTEXT=The MySQL clients and Maintenance Tools +IMAGE= +DEFSELECTION=Yes +filegroup0=Clients and Tools +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=NEWERDATE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Servers] +SELECTED=Yes +FILENEED=CRITICAL +HTTPLOCATION= +STATUS=The MySQL Servers +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL Servers +DISPLAYTEXT=The MySQL Servers +IMAGE= +DEFSELECTION=Yes +filegroup0=Servers +requiredby0=Development +COMMENT= +INCLUDEINBUILD=Yes +requiredby1=Grant Tables +INSTALLATION=ALWAYSOVERWRITE +requiredby2=Clients and Tools +requiredby3=Documentation +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[SetupTypeItem-Compact] +Comment= +item0=Grant Tables +item1=Servers +item2=Clients and Tools +item3=Documentation +Descrip= +DisplayText= + +[SetupTypeItem-Custom] +Comment= +item0=Development +item1=Grant Tables +item2=Servers +item3=Clients and Tools +Descrip= +item4=Documentation +DisplayText= + +[Info] +Type=CompDef +Version=1.00.000 +Name= + +[SetupTypeItem-Typical] +Comment= +item0=Development +item1=Grant Tables +item2=Servers +item3=Clients and Tools +Descrip= +item4=Documentation +DisplayText= + +[Documentation] +required0=Servers +SELECTED=Yes +FILENEED=HIGHLYRECOMMENDED +required1=Grant Tables +HTTPLOCATION= +STATUS=The MySQL Documentation with different formats +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL Documentation with different formats +DISPLAYTEXT=The MySQL Documentation with different formats +IMAGE= +DEFSELECTION=Yes +filegroup0=Documentation +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=ALWAYSOVERWRITE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.fgl b/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.fgl new file mode 100755 index 00000000000..4e20dcea4ab --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.fgl @@ -0,0 +1,42 @@ +[<PROGRAMFILES>\<COMMONFILES>] +DISPLAYTEXT=Common Files Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[<WINDIR>\<WINSYSDIR>] +DISPLAYTEXT=Windows System Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[USERDEFINED] +DISPLAYTEXT=Script-defined Folders +TYPE=USERSTART +fulldirectory= + +[<PROGRAMFILES>] +DISPLAYTEXT=Program Files Folder +SubDir0=<PROGRAMFILES>\<COMMONFILES> +TYPE=TEXTSUBFIXED +fulldirectory= + +[<TARGETDIR>] +DISPLAYTEXT=General Application Destination +TYPE=TEXTSUBFIXED +fulldirectory= + +[<WINDIR>] +DISPLAYTEXT=Windows Operating System +SubDir0=<WINDIR>\<WINSYSDIR> +TYPE=TEXTSUBFIXED +fulldirectory= + +[TopDir] +SubDir0=<WINDIR> +SubDir1=<PROGRAMFILES> +SubDir2=<TARGETDIR> +SubDir3=USERDEFINED + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl new file mode 100755 index 00000000000..7bba3d7474a --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl @@ -0,0 +1,31 @@ +[bin] +file15=C:\mysql\bin\replace.exe +file16=C:\mysql\bin\winmysqladmin.cnt +file0=C:\mysql\bin\isamchk.exe +file17=C:\mysql\bin\WINMYSQLADMIN.HLP +file1=C:\mysql\bin\myisamchk.exe +file18=C:\mysql\bin\comp-err.exe +file2=C:\mysql\bin\myisamlog.exe +file19=C:\mysql\bin\my_print_defaults.exe +file3=C:\mysql\bin\myisampack.exe +file4=C:\mysql\bin\mysql.exe +file5=C:\mysql\bin\mysqladmin.exe +file6=C:\mysql\bin\mysqlbinlog.exe +file7=C:\mysql\bin\mysqlc.exe +file8=C:\mysql\bin\mysqlcheck.exe +file9=C:\mysql\bin\mysqldump.exe +file20=C:\mysql\bin\winmysqladmin.exe +file10=C:\mysql\bin\mysqlimport.exe +fulldirectory= +file11=C:\mysql\bin\mysqlshow.exe +file12=C:\mysql\bin\mysqlwatch.exe +file13=C:\mysql\bin\pack_isam.exe +file14=C:\mysql\bin\perror.exe + +[TopDir] +SubDir0=bin + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Default.fdf b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Default.fdf new file mode 100755 index 00000000000..8096a4b74bf --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Default.fdf @@ -0,0 +1,82 @@ +[FileGroups] +group0=Development +group1=Grant Tables +group2=Servers +group3=Clients and Tools +group4=Documentation + +[Development] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Grant Tables] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Clients and Tools] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM=0000000000000000 +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Servers] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Info] +Type=FileGrp +Version=1.00.000 +Name= + +[Documentation] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl new file mode 100755 index 00000000000..401509e9b7a --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl @@ -0,0 +1,241 @@ +[bench\Data\Wisconsin] +file0=C:\mysql\bench\Data\Wisconsin\onek.data +file1=C:\mysql\bench\Data\Wisconsin\tenk.data +fulldirectory= + +[lib\debug] +file0=C:\mysql\lib\debug\libmySQL.dll +file1=C:\mysql\lib\debug\libmySQL.lib +file2=C:\mysql\lib\debug\mysqlclient.lib +file3=C:\mysql\lib\debug\zlib.lib +file4=C:\mysql\lib\debug\regex.lib +file5=C:\mysql\lib\debug\mysys.lib +file6=C:\mysql\lib\debug\strings.lib +fulldirectory= + +[bench\output] +fulldirectory= + +[examples\libmysqltest] +file0=C:\mysql\examples\libmysqltest\myTest.c +file1=C:\mysql\examples\libmysqltest\myTest.dsp +file2=C:\mysql\examples\libmysqltest\myTest.dsw +file3=C:\mysql\examples\libmysqltest\myTest.exe +file4=C:\mysql\examples\libmysqltest\myTest.mak +file5=C:\mysql\examples\libmysqltest\myTest.ncb +file6=C:\mysql\examples\libmysqltest\myTest.opt +file7=C:\mysql\examples\libmysqltest\readme +fulldirectory= + +[include] +file15=C:\mysql\include\libmysqld.def +file16=C:\mysql\include\my_alloc.h +file0=C:\mysql\include\raid.h +file17=C:\mysql\include\my_getopt.h +file1=C:\mysql\include\errmsg.h +file2=C:\mysql\include\Libmysql.def +file3=C:\mysql\include\m_ctype.h +file4=C:\mysql\include\m_string.h +file5=C:\mysql\include\my_list.h +file6=C:\mysql\include\my_pthread.h +file7=C:\mysql\include\my_sys.h +file8=C:\mysql\include\mysql.h +file9=C:\mysql\include\mysql_com.h +file10=C:\mysql\include\mysql_version.h +fulldirectory= +file11=C:\mysql\include\mysqld_error.h +file12=C:\mysql\include\dbug.h +file13=C:\mysql\include\config-win.h +file14=C:\mysql\include\my_global.h + +[examples] +SubDir0=examples\libmysqltest +SubDir1=examples\tests +fulldirectory= + +[lib\opt] +file0=C:\mysql\lib\opt\libmySQL.dll +file1=C:\mysql\lib\opt\libmySQL.lib +file2=C:\mysql\lib\opt\mysqlclient.lib +file3=C:\mysql\lib\opt\zlib.lib +file4=C:\mysql\lib\opt\strings.lib +file5=C:\mysql\lib\opt\mysys-max.lib +file6=C:\mysql\lib\opt\regex.lib +file7=C:\mysql\lib\opt\mysys.lib +fulldirectory= + +[bench\Data] +SubDir0=bench\Data\ATIS +SubDir1=bench\Data\Wisconsin +fulldirectory= + +[bench\limits] +file15=C:\mysql\bench\limits\pg.comment +file16=C:\mysql\bench\limits\solid.cfg +file0=C:\mysql\bench\limits\access.cfg +file17=C:\mysql\bench\limits\solid-nt4.cfg +file1=C:\mysql\bench\limits\access.comment +file18=C:\mysql\bench\limits\sybase.cfg +file2=C:\mysql\bench\limits\Adabas.cfg +file3=C:\mysql\bench\limits\Adabas.comment +file4=C:\mysql\bench\limits\Db2.cfg +file5=C:\mysql\bench\limits\empress.cfg +file6=C:\mysql\bench\limits\empress.comment +file7=C:\mysql\bench\limits\Informix.cfg +file8=C:\mysql\bench\limits\Informix.comment +file9=C:\mysql\bench\limits\msql.cfg +file10=C:\mysql\bench\limits\ms-sql.cfg +fulldirectory= +file11=C:\mysql\bench\limits\Ms-sql65.cfg +file12=C:\mysql\bench\limits\mysql.cfg +file13=C:\mysql\bench\limits\oracle.cfg +file14=C:\mysql\bench\limits\pg.cfg + +[TopDir] +SubDir0=bench +SubDir1=examples +SubDir2=include +SubDir3=lib +SubDir4=scripts + +[bench] +file15=C:\mysql\bench\test-create +file16=C:\mysql\bench\test-insert +file0=C:\mysql\bench\uname.bat +file17=C:\mysql\bench\test-select +file1=C:\mysql\bench\compare-results +file18=C:\mysql\bench\test-wisconsin +file2=C:\mysql\bench\copy-db +file19=C:\mysql\bench\bench-init.pl +file3=C:\mysql\bench\crash-me +file4=C:\mysql\bench\example.bat +file5=C:\mysql\bench\print-limit-table +file6=C:\mysql\bench\pwd.bat +file7=C:\mysql\bench\Readme +SubDir0=bench\Data +file8=C:\mysql\bench\run.bat +SubDir1=bench\limits +file9=C:\mysql\bench\run-all-tests +SubDir2=bench\output +file10=C:\mysql\bench\server-cfg +fulldirectory= +file11=C:\mysql\bench\test-alter-table +file12=C:\mysql\bench\test-ATIS +file13=C:\mysql\bench\test-big-tables +file14=C:\mysql\bench\test-connect + +[examples\tests] +file15=C:\mysql\examples\tests\lock_test.res +file16=C:\mysql\examples\tests\mail_to_db.pl +file0=C:\mysql\examples\tests\unique_users.tst +file17=C:\mysql\examples\tests\table_types.pl +file1=C:\mysql\examples\tests\auto_increment.tst +file18=C:\mysql\examples\tests\test_delayed_insert.pl +file2=C:\mysql\examples\tests\big_record.pl +file19=C:\mysql\examples\tests\udf_test +file3=C:\mysql\examples\tests\big_record.res +file4=C:\mysql\examples\tests\czech-sorting +file5=C:\mysql\examples\tests\deadlock-script.pl +file6=C:\mysql\examples\tests\export.pl +file7=C:\mysql\examples\tests\fork_test.pl +file8=C:\mysql\examples\tests\fork2_test.pl +file9=C:\mysql\examples\tests\fork3_test.pl +file20=C:\mysql\examples\tests\udf_test.res +file21=C:\mysql\examples\tests\auto_increment.res +file10=C:\mysql\examples\tests\function.res +fulldirectory= +file11=C:\mysql\examples\tests\function.tst +file12=C:\mysql\examples\tests\grant.pl +file13=C:\mysql\examples\tests\grant.res +file14=C:\mysql\examples\tests\lock_test.pl + +[bench\Data\ATIS] +file26=C:\mysql\bench\Data\ATIS\stop1.txt +file15=C:\mysql\bench\Data\ATIS\flight_class.txt +file27=C:\mysql\bench\Data\ATIS\time_interval.txt +file16=C:\mysql\bench\Data\ATIS\flight_day.txt +file0=C:\mysql\bench\Data\ATIS\transport.txt +file28=C:\mysql\bench\Data\ATIS\time_zone.txt +file17=C:\mysql\bench\Data\ATIS\flight_fare.txt +file1=C:\mysql\bench\Data\ATIS\airline.txt +file29=C:\mysql\bench\Data\ATIS\aircraft.txt +file18=C:\mysql\bench\Data\ATIS\food_service.txt +file2=C:\mysql\bench\Data\ATIS\airport.txt +file19=C:\mysql\bench\Data\ATIS\ground_service.txt +file3=C:\mysql\bench\Data\ATIS\airport_service.txt +file4=C:\mysql\bench\Data\ATIS\city.txt +file5=C:\mysql\bench\Data\ATIS\class_of_service.txt +file6=C:\mysql\bench\Data\ATIS\code_description.txt +file7=C:\mysql\bench\Data\ATIS\compound_class.txt +file8=C:\mysql\bench\Data\ATIS\connect_leg.txt +file9=C:\mysql\bench\Data\ATIS\date_day.txt +file20=C:\mysql\bench\Data\ATIS\month_name.txt +file21=C:\mysql\bench\Data\ATIS\restrict_carrier.txt +file10=C:\mysql\bench\Data\ATIS\day_name.txt +fulldirectory= +file22=C:\mysql\bench\Data\ATIS\restrict_class.txt +file11=C:\mysql\bench\Data\ATIS\dual_carrier.txt +file23=C:\mysql\bench\Data\ATIS\restriction.txt +file12=C:\mysql\bench\Data\ATIS\fare.txt +file24=C:\mysql\bench\Data\ATIS\state.txt +file13=C:\mysql\bench\Data\ATIS\fconnection.txt +file25=C:\mysql\bench\Data\ATIS\stop.txt +file14=C:\mysql\bench\Data\ATIS\flight.txt + +[General] +Type=FILELIST +Version=1.00.000 + +[scripts] +file37=C:\mysql\scripts\mysqld_safe-watch.sh +file26=C:\mysql\scripts\mysql_zap +file15=C:\mysql\scripts\mysql_fix_privilege_tables +file38=C:\mysql\scripts\mysqldumpslow +file27=C:\mysql\scripts\mysql_zap.sh +file16=C:\mysql\scripts\mysql_fix_privilege_tables.sh +file0=C:\mysql\scripts\Readme +file39=C:\mysql\scripts\mysqldumpslow.sh +file28=C:\mysql\scripts\mysqlaccess +file17=C:\mysql\scripts\mysql_install_db +file1=C:\mysql\scripts\make_binary_distribution.sh +file29=C:\mysql\scripts\mysqlaccess.conf +file18=C:\mysql\scripts\mysql_install_db.sh +file2=C:\mysql\scripts\msql2mysql +file19=C:\mysql\scripts\mysql_secure_installation +file3=C:\mysql\scripts\msql2mysql.sh +file4=C:\mysql\scripts\mysql_config +file5=C:\mysql\scripts\mysql_config.sh +file6=C:\mysql\scripts\mysql_convert_table_format +file7=C:\mysql\scripts\mysql_convert_table_format.sh +file40=C:\mysql\scripts\mysqlhotcopy +file8=C:\mysql\scripts\mysql_explain_log +file41=C:\mysql\scripts\mysqlhotcopy.pl +file30=C:\mysql\scripts\mysqlaccess.sh +file9=C:\mysql\scripts\mysql_explain_log.sh +file42=C:\mysql\scripts\mysqlhotcopy.sh +file31=C:\mysql\scripts\mysqlbug +file20=C:\mysql\scripts\mysql_secure_installation.sh +file43=C:\mysql\scripts\make_binary_distribution +file32=C:\mysql\scripts\mysqlbug.sh +file21=C:\mysql\scripts\mysql_setpermission +file10=C:\mysql\scripts\mysql_find_rows +fulldirectory= +file33=C:\mysql\scripts\mysqld_multi +file22=C:\mysql\scripts\mysql_setpermission.pl +file11=C:\mysql\scripts\mysql_find_rows.pl +file34=C:\mysql\scripts\mysqld_multi.sh +file23=C:\mysql\scripts\mysql_setpermission.sh +file12=C:\mysql\scripts\mysql_find_rows.sh +file35=C:\mysql\scripts\mysqld_safe +file24=C:\mysql\scripts\mysql_tableinfo +file13=C:\mysql\scripts\mysql_fix_extensions +file36=C:\mysql\scripts\mysqld_safe.sh +file25=C:\mysql\scripts\mysql_tableinfo.sh +file14=C:\mysql\scripts\mysql_fix_extensions.sh + +[lib] +file0=C:\mysql\lib\Readme +SubDir0=lib\debug +SubDir1=lib\opt +fulldirectory= + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Documentation.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Documentation.fgl new file mode 100755 index 00000000000..107ebd1afb7 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Documentation.fgl @@ -0,0 +1,101 @@ +[Docs\Flags] +file59=C:\mysql\Docs\Flags\romania.gif +file48=C:\mysql\Docs\Flags\kroatia.eps +file37=C:\mysql\Docs\Flags\iceland.gif +file26=C:\mysql\Docs\Flags\france.eps +file15=C:\mysql\Docs\Flags\china.gif +file49=C:\mysql\Docs\Flags\kroatia.gif +file38=C:\mysql\Docs\Flags\ireland.eps +file27=C:\mysql\Docs\Flags\france.gif +file16=C:\mysql\Docs\Flags\croatia.eps +file0=C:\mysql\Docs\Flags\usa.gif +file39=C:\mysql\Docs\Flags\ireland.gif +file28=C:\mysql\Docs\Flags\germany.eps +file17=C:\mysql\Docs\Flags\croatia.gif +file1=C:\mysql\Docs\Flags\argentina.gif +file29=C:\mysql\Docs\Flags\germany.gif +file18=C:\mysql\Docs\Flags\czech-republic.eps +file2=C:\mysql\Docs\Flags\australia.eps +file19=C:\mysql\Docs\Flags\czech-republic.gif +file3=C:\mysql\Docs\Flags\australia.gif +file80=C:\mysql\Docs\Flags\usa.eps +file4=C:\mysql\Docs\Flags\austria.eps +file81=C:\mysql\Docs\Flags\argentina.eps +file70=C:\mysql\Docs\Flags\spain.eps +file5=C:\mysql\Docs\Flags\austria.gif +file71=C:\mysql\Docs\Flags\spain.gif +file60=C:\mysql\Docs\Flags\russia.eps +file6=C:\mysql\Docs\Flags\brazil.eps +file72=C:\mysql\Docs\Flags\sweden.eps +file61=C:\mysql\Docs\Flags\russia.gif +file50=C:\mysql\Docs\Flags\latvia.eps +file7=C:\mysql\Docs\Flags\brazil.gif +file73=C:\mysql\Docs\Flags\sweden.gif +file62=C:\mysql\Docs\Flags\singapore.eps +file51=C:\mysql\Docs\Flags\latvia.gif +file40=C:\mysql\Docs\Flags\island.eps +file8=C:\mysql\Docs\Flags\bulgaria.eps +file74=C:\mysql\Docs\Flags\switzerland.eps +file63=C:\mysql\Docs\Flags\singapore.gif +file52=C:\mysql\Docs\Flags\netherlands.eps +file41=C:\mysql\Docs\Flags\island.gif +file30=C:\mysql\Docs\Flags\great-britain.eps +file9=C:\mysql\Docs\Flags\bulgaria.gif +file75=C:\mysql\Docs\Flags\switzerland.gif +file64=C:\mysql\Docs\Flags\south-africa.eps +file53=C:\mysql\Docs\Flags\netherlands.gif +file42=C:\mysql\Docs\Flags\israel.eps +file31=C:\mysql\Docs\Flags\great-britain.gif +file20=C:\mysql\Docs\Flags\denmark.eps +file76=C:\mysql\Docs\Flags\taiwan.eps +file65=C:\mysql\Docs\Flags\south-africa.gif +file54=C:\mysql\Docs\Flags\poland.eps +file43=C:\mysql\Docs\Flags\israel.gif +file32=C:\mysql\Docs\Flags\greece.eps +file21=C:\mysql\Docs\Flags\denmark.gif +file10=C:\mysql\Docs\Flags\canada.eps +fulldirectory= +file77=C:\mysql\Docs\Flags\taiwan.gif +file66=C:\mysql\Docs\Flags\south-africa1.eps +file55=C:\mysql\Docs\Flags\poland.gif +file44=C:\mysql\Docs\Flags\italy.eps +file33=C:\mysql\Docs\Flags\greece.gif +file22=C:\mysql\Docs\Flags\estonia.eps +file11=C:\mysql\Docs\Flags\canada.gif +file78=C:\mysql\Docs\Flags\ukraine.eps +file67=C:\mysql\Docs\Flags\south-africa1.gif +file56=C:\mysql\Docs\Flags\portugal.eps +file45=C:\mysql\Docs\Flags\italy.gif +file34=C:\mysql\Docs\Flags\hungary.eps +file23=C:\mysql\Docs\Flags\estonia.gif +file12=C:\mysql\Docs\Flags\chile.eps +file79=C:\mysql\Docs\Flags\ukraine.gif +file68=C:\mysql\Docs\Flags\south-korea.eps +file57=C:\mysql\Docs\Flags\portugal.gif +file46=C:\mysql\Docs\Flags\japan.eps +file35=C:\mysql\Docs\Flags\hungary.gif +file24=C:\mysql\Docs\Flags\finland.eps +file13=C:\mysql\Docs\Flags\chile.gif +file69=C:\mysql\Docs\Flags\south-korea.gif +file58=C:\mysql\Docs\Flags\romania.eps +file47=C:\mysql\Docs\Flags\japan.gif +file36=C:\mysql\Docs\Flags\iceland.eps +file25=C:\mysql\Docs\Flags\finland.gif +file14=C:\mysql\Docs\Flags\china.eps + +[Docs] +file0=C:\mysql\Docs\manual_toc.html +file1=C:\mysql\Docs\Copying +file2=C:\mysql\Docs\Copying.lib +file3=C:\mysql\Docs\manual.html +file4=C:\mysql\Docs\manual.txt +SubDir0=Docs\Flags +fulldirectory= + +[TopDir] +SubDir0=Docs + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Grant Tables.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Grant Tables.fgl new file mode 100755 index 00000000000..178065a7003 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Grant Tables.fgl @@ -0,0 +1,36 @@ +[data\test] +fulldirectory= + +[data\mysql] +file15=C:\mysql\data\mysql\func.frm +file16=C:\mysql\data\mysql\func.MYD +file0=C:\mysql\data\mysql\columns_priv.frm +file17=C:\mysql\data\mysql\func.MYI +file1=C:\mysql\data\mysql\columns_priv.MYD +file2=C:\mysql\data\mysql\columns_priv.MYI +file3=C:\mysql\data\mysql\db.frm +file4=C:\mysql\data\mysql\db.MYD +file5=C:\mysql\data\mysql\db.MYI +file6=C:\mysql\data\mysql\host.frm +file7=C:\mysql\data\mysql\host.MYD +file8=C:\mysql\data\mysql\host.MYI +file9=C:\mysql\data\mysql\tables_priv.frm +file10=C:\mysql\data\mysql\tables_priv.MYD +fulldirectory= +file11=C:\mysql\data\mysql\tables_priv.MYI +file12=C:\mysql\data\mysql\user.frm +file13=C:\mysql\data\mysql\user.MYD +file14=C:\mysql\data\mysql\user.MYI + +[TopDir] +SubDir0=data + +[data] +SubDir0=data\mysql +SubDir1=data\test +fulldirectory= + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl new file mode 100755 index 00000000000..64883f7f369 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl @@ -0,0 +1,229 @@ +[Embedded\Static\release] +file0=C:\mysql\embedded\Static\release\test_stc.dsp +file1=C:\mysql\embedded\Static\release\ReadMe.txt +file2=C:\mysql\embedded\Static\release\StdAfx.cpp +file3=C:\mysql\embedded\Static\release\StdAfx.h +file4=C:\mysql\embedded\Static\release\test_stc.cpp +file5=C:\mysql\embedded\Static\release\mysqlserver.lib +fulldirectory= + +[share\polish] +file0=C:\mysql\share\polish\errmsg.sys +file1=C:\mysql\share\polish\errmsg.txt +fulldirectory= + +[share\dutch] +file0=C:\mysql\share\dutch\errmsg.sys +file1=C:\mysql\share\dutch\errmsg.txt +fulldirectory= + +[share\spanish] +file0=C:\mysql\share\spanish\errmsg.sys +file1=C:\mysql\share\spanish\errmsg.txt +fulldirectory= + +[share\english] +file0=C:\mysql\share\english\errmsg.sys +file1=C:\mysql\share\english\errmsg.txt +fulldirectory= + +[bin] +file0=C:\mysql\bin\mysqld-opt.exe +file1=C:\mysql\bin\mysqld-max.exe +file2=C:\mysql\bin\mysqld-max-nt.exe +file3=C:\mysql\bin\mysqld-nt.exe +file4=C:\mysql\bin\mysqld.exe +file5=C:\mysql\bin\cygwinb19.dll +file6=C:\mysql\bin\libmySQL.dll +fulldirectory= + +[share\korean] +file0=C:\mysql\share\korean\errmsg.sys +file1=C:\mysql\share\korean\errmsg.txt +fulldirectory= + +[share\charsets] +file15=C:\mysql\share\charsets\latin1.conf +file16=C:\mysql\share\charsets\latin2.conf +file0=C:\mysql\share\charsets\win1251ukr.conf +file17=C:\mysql\share\charsets\latin5.conf +file1=C:\mysql\share\charsets\cp1257.conf +file18=C:\mysql\share\charsets\Readme +file2=C:\mysql\share\charsets\croat.conf +file19=C:\mysql\share\charsets\swe7.conf +file3=C:\mysql\share\charsets\danish.conf +file4=C:\mysql\share\charsets\dec8.conf +file5=C:\mysql\share\charsets\dos.conf +file6=C:\mysql\share\charsets\estonia.conf +file7=C:\mysql\share\charsets\german1.conf +file8=C:\mysql\share\charsets\greek.conf +file9=C:\mysql\share\charsets\hebrew.conf +file20=C:\mysql\share\charsets\usa7.conf +file21=C:\mysql\share\charsets\win1250.conf +file10=C:\mysql\share\charsets\hp8.conf +fulldirectory= +file22=C:\mysql\share\charsets\win1251.conf +file11=C:\mysql\share\charsets\hungarian.conf +file23=C:\mysql\share\charsets\cp1251.conf +file12=C:\mysql\share\charsets\Index +file13=C:\mysql\share\charsets\koi8_ru.conf +file14=C:\mysql\share\charsets\koi8_ukr.conf + +[Embedded\DLL\debug] +file0=C:\mysql\embedded\DLL\debug\libmysqld.dll +file1=C:\mysql\embedded\DLL\debug\libmysqld.exp +file2=C:\mysql\embedded\DLL\debug\libmysqld.lib +fulldirectory= + +[Embedded] +file0=C:\mysql\embedded\embedded.dsw +SubDir0=Embedded\DLL +SubDir1=Embedded\Static +fulldirectory= + +[share\ukrainian] +file0=C:\mysql\share\ukrainian\errmsg.sys +file1=C:\mysql\share\ukrainian\errmsg.txt +fulldirectory= + +[share\hungarian] +file0=C:\mysql\share\hungarian\errmsg.sys +file1=C:\mysql\share\hungarian\errmsg.txt +fulldirectory= + +[share\german] +file0=C:\mysql\share\german\errmsg.sys +file1=C:\mysql\share\german\errmsg.txt +fulldirectory= + +[share\portuguese] +file0=C:\mysql\share\portuguese\errmsg.sys +file1=C:\mysql\share\portuguese\errmsg.txt +fulldirectory= + +[share\estonian] +file0=C:\mysql\share\estonian\errmsg.sys +file1=C:\mysql\share\estonian\errmsg.txt +fulldirectory= + +[share\romanian] +file0=C:\mysql\share\romanian\errmsg.sys +file1=C:\mysql\share\romanian\errmsg.txt +fulldirectory= + +[share\french] +file0=C:\mysql\share\french\errmsg.sys +file1=C:\mysql\share\french\errmsg.txt +fulldirectory= + +[share\swedish] +file0=C:\mysql\share\swedish\errmsg.sys +file1=C:\mysql\share\swedish\errmsg.txt +fulldirectory= + +[share\slovak] +file0=C:\mysql\share\slovak\errmsg.sys +file1=C:\mysql\share\slovak\errmsg.txt +fulldirectory= + +[share\greek] +file0=C:\mysql\share\greek\errmsg.sys +file1=C:\mysql\share\greek\errmsg.txt +fulldirectory= + +[TopDir] +file0=C:\mysql\Readme +file1=C:\mysql\mysqlbug.txt +file2=C:\mysql\my-huge.cnf +file3=C:\mysql\my-large.cnf +file4=C:\mysql\my-medium.cnf +file5=C:\mysql\my-small.cnf +SubDir0=bin +SubDir1=share +SubDir2=Embedded + +[share] +SubDir8=share\hungarian +SubDir9=share\charsets +SubDir20=share\spanish +SubDir21=share\swedish +SubDir10=share\italian +SubDir22=share\ukrainian +SubDir11=share\japanese +SubDir12=share\korean +SubDir13=share\norwegian +SubDir14=share\norwegian-ny +SubDir15=share\polish +SubDir16=share\portuguese +SubDir0=share\czech +SubDir17=share\romanian +SubDir1=share\danish +SubDir18=share\russian +SubDir2=share\dutch +SubDir19=share\slovak +SubDir3=share\english +fulldirectory= +SubDir4=share\estonian +SubDir5=share\french +SubDir6=share\german +SubDir7=share\greek + +[share\norwegian-ny] +file0=C:\mysql\share\norwegian-ny\errmsg.sys +file1=C:\mysql\share\norwegian-ny\errmsg.txt +fulldirectory= + +[Embedded\DLL] +file0=C:\mysql\embedded\DLL\test_dll.dsp +file1=C:\mysql\embedded\DLL\StdAfx.h +file2=C:\mysql\embedded\DLL\test_dll.cpp +file3=C:\mysql\embedded\DLL\StdAfx.cpp +SubDir0=Embedded\DLL\debug +SubDir1=Embedded\DLL\release +fulldirectory= + +[Embedded\Static] +SubDir0=Embedded\Static\release +fulldirectory= + +[Embedded\DLL\release] +file0=C:\mysql\embedded\DLL\release\libmysqld.dll +file1=C:\mysql\embedded\DLL\release\libmysqld.exp +file2=C:\mysql\embedded\DLL\release\libmysqld.lib +file3=C:\mysql\embedded\DLL\release\mysql-server.exe +fulldirectory= + +[share\danish] +file0=C:\mysql\share\danish\errmsg.sys +file1=C:\mysql\share\danish\errmsg.txt +fulldirectory= + +[share\czech] +file0=C:\mysql\share\czech\errmsg.sys +file1=C:\mysql\share\czech\errmsg.txt +fulldirectory= + +[General] +Type=FILELIST +Version=1.00.000 + +[share\russian] +file0=C:\mysql\share\russian\errmsg.sys +file1=C:\mysql\share\russian\errmsg.txt +fulldirectory= + +[share\norwegian] +file0=C:\mysql\share\norwegian\errmsg.sys +file1=C:\mysql\share\norwegian\errmsg.txt +fulldirectory= + +[share\japanese] +file0=C:\mysql\share\japanese\errmsg.sys +file1=C:\mysql\share\japanese\errmsg.txt +fulldirectory= + +[share\italian] +file0=C:\mysql\share\italian\errmsg.sys +file1=C:\mysql\share\italian\errmsg.txt +fulldirectory= + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Registry Entries/Default.rge b/VC++Files/InstallShield/4.0.XX-gpl/Registry Entries/Default.rge new file mode 100755 index 00000000000..537dfd82e48 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Registry Entries/Default.rge @@ -0,0 +1,4 @@ +[General] +Type=REGISTRYDATA +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.dbg b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.dbg Binary files differnew file mode 100755 index 00000000000..0c6d4e6b708 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.dbg diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ino b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ino Binary files differnew file mode 100755 index 00000000000..204d8ea0f36 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ino diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ins b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ins Binary files differnew file mode 100755 index 00000000000..759009b5c84 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ins diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.obs b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.obs Binary files differnew file mode 100755 index 00000000000..5fcfcb62c4e --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.obs diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul new file mode 100755 index 00000000000..df143b493c4 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul @@ -0,0 +1,640 @@ + +//////////////////////////////////////////////////////////////////////////////// +// +// IIIIIII SSSSSS +// II SS InstallShield (R) +// II SSSSSS (c) 1996-1997, InstallShield Software Corporation +// II SS (c) 1990-1996, InstallShield Corporation +// IIIIIII SSSSSS All Rights Reserved. +// +// +// This code is generated as a starting setup template. You should +// modify it to provide all necessary steps for your setup. +// +// +// File Name: Setup.rul +// +// Description: InstallShield script +// +// Comments: This template script performs a basic setup on a +// Windows 95 or Windows NT 4.0 platform. With minor +// modifications, this template can be adapted to create +// new, customized setups. +// +//////////////////////////////////////////////////////////////////////////////// + + + // Include header file +#include "sdlang.h" +#include "sddialog.h" + +////////////////////// string defines //////////////////////////// + +#define UNINST_LOGFILE_NAME "Uninst.isu" + +//////////////////// installation declarations /////////////////// + + // ----- DLL prototypes ----- + + + // your DLL prototypes + + + // ---- script prototypes ----- + + // generated + prototype ShowDialogs(); + prototype MoveFileData(); + prototype HandleMoveDataError( NUMBER ); + prototype ProcessBeforeDataMove(); + prototype ProcessAfterDataMove(); + prototype SetupRegistry(); + prototype SetupFolders(); + prototype CleanUpInstall(); + prototype SetupInstall(); + prototype SetupScreen(); + prototype CheckRequirements(); + prototype DialogShowSdWelcome(); + prototype DialogShowSdShowInfoList(); + prototype DialogShowSdAskDestPath(); + prototype DialogShowSdSetupType(); + prototype DialogShowSdComponentDialog2(); + prototype DialogShowSdFinishReboot(); + + // your prototypes + + + // ----- global variables ------ + + // generated + BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; + STRING svDir; + STRING svName, svCompany, svSerial; + STRING szAppPath; + STRING svSetupType; + + + // your global variables + + +/////////////////////////////////////////////////////////////////////////////// +// +// MAIN PROGRAM +// +// The setup begins here by hiding the visible setup +// window. This is done to allow all the titles, images, etc. to +// be established before showing the main window. The following +// logic then performs the setup in a series of steps. +// +/////////////////////////////////////////////////////////////////////////////// +program + Disable( BACKGROUND ); + + CheckRequirements(); + + SetupInstall(); + + SetupScreen(); + + if (ShowDialogs()<0) goto end_install; + + if (ProcessBeforeDataMove()<0) goto end_install; + + if (MoveFileData()<0) goto end_install; + + if (ProcessAfterDataMove()<0) goto end_install; + + if (SetupRegistry()<0) goto end_install; + + if (SetupFolders()<0) goto end_install; + + + end_install: + + CleanUpInstall(); + + // If an unrecoverable error occurred, clean up the partial installation. + // Otherwise, exit normally. + + if (bInstallAborted) then + abort; + endif; + +endprogram + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ShowDialogs // +// // +// Purpose: This function manages the display and navigation // +// the standard dialogs that exist in a setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ShowDialogs() + NUMBER nResult; + begin + + Dlg_Start: + // beginning of dialogs label + + Dlg_SdWelcome: + nResult = DialogShowSdWelcome(); + if (nResult = BACK) goto Dlg_Start; + + Dlg_SdShowInfoList: + nResult = DialogShowSdShowInfoList(); + if (nResult = BACK) goto Dlg_SdWelcome; + + Dlg_SdAskDestPath: + nResult = DialogShowSdAskDestPath(); + if (nResult = BACK) goto Dlg_SdShowInfoList; + + Dlg_SdSetupType: + nResult = DialogShowSdSetupType(); + if (nResult = BACK) goto Dlg_SdAskDestPath; + + Dlg_SdComponentDialog2: + if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then + goto Dlg_SdSetupType; + endif; + nResult = DialogShowSdComponentDialog2(); + if (nResult = BACK) goto Dlg_SdSetupType; + + return 0; + + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ProcessBeforeDataMove // +// // +// Purpose: This function performs any necessary operations prior to the // +// actual data move operation. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ProcessBeforeDataMove() + STRING svLogFile; + NUMBER nResult; + begin + + InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); + + svLogFile = UNINST_LOGFILE_NAME; + + nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); + if (nResult < 0) then + MessageBox( @ERROR_UNINSTSETUP, WARNING ); + endif; + + szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir + + if ((bIs32BitSetup) && (bIsShellExplorer)) then + RegDBSetItem( REGDB_APPPATH, szAppPath ); + RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); + RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); + endif; + + // TODO : update any items you want to process before moving the data + // + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: MoveFileData // +// // +// Purpose: This function handles the data movement for // +// the setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function MoveFileData() + NUMBER nResult, nDisk; + begin + + nDisk = 1; + SetStatusWindow( 0, "" ); + Disable( DIALOGCACHE ); + Enable( STATUS ); + StatusUpdate( ON, 100 ); + nResult = ComponentMoveData( MEDIA, nDisk, 0 ); + + HandleMoveDataError( nResult ); + + Disable( STATUS ); + + return nResult; + + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: HandleMoveDataError // +// // +// Purpose: This function handles the error (if any) during the move data // +// operation. // +// // +/////////////////////////////////////////////////////////////////////////////// +function HandleMoveDataError( nResult ) + STRING szErrMsg, svComponent , svFileGroup , svFile; + begin + + svComponent = ""; + svFileGroup = ""; + svFile = ""; + + switch (nResult) + case 0: + return 0; + default: + ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); + szErrMsg = @ERROR_MOVEDATA + "\n\n" + + @ERROR_COMPONENT + " " + svComponent + "\n" + + @ERROR_FILEGROUP + " " + svFileGroup + "\n" + + @ERROR_FILE + " " + svFile; + SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); + bInstallAborted = TRUE; + return nResult; + endswitch; + + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ProcessAfterDataMove // +// // +// Purpose: This function performs any necessary operations needed after // +// all data has been moved. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ProcessAfterDataMove() + begin + + // TODO : update self-registered files and other processes that + // should be performed after the data has been moved. + + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupRegistry // +// // +// Purpose: This function makes the registry entries for this setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupRegistry() + NUMBER nResult; + + begin + + // TODO : Add all your registry entry keys here + // + // + // RegDBCreateKeyEx, RegDBSetKeyValueEx.... + // + + nResult = CreateRegistrySet( "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// +// Function: SetupFolders +// +// Purpose: This function creates all the folders and shortcuts for the +// setup. This includes program groups and items for Windows 3.1. +// +/////////////////////////////////////////////////////////////////////////////// +function SetupFolders() + NUMBER nResult; + + begin + + + // TODO : Add all your folder (program group) along with shortcuts (program items) + // + // + // CreateProgramFolder, AddFolderIcon.... + // + + nResult = CreateShellObjects( "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CleanUpInstall // +// // +// Purpose: This cleans up the setup. Anything that should // +// be released or deleted at the end of the setup should // +// be done here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CleanUpInstall() + begin + + + if (bInstallAborted) then + return 0; + endif; + + DialogShowSdFinishReboot(); + + if (BATCH_INSTALL) then // ensure locked files are properly written + CommitSharedFiles(0); + endif; + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupInstall // +// // +// Purpose: This will setup the installation. Any general initialization // +// needed for the installation should be performed here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupInstall() + begin + + Enable( CORECOMPONENTHANDLING ); + + bInstallAborted = FALSE; + + if (bIs32BitSetup) then + svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; + else + svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names + endif; + + TARGETDIR = svDir; + + SdProductName( @PRODUCT_NAME ); + + Enable( DIALOGCACHE ); + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupScreen // +// // +// Purpose: This function establishes the screen look. This includes // +// colors, fonts, and text to be displayed. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupScreen() + begin + + Enable( FULLWINDOWMODE ); + Enable( INDVFILESTATUS ); + SetTitle( @TITLE_MAIN, 24, WHITE ); + + SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. + + Enable( BACKGROUND ); + + Delay( 1 ); + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CheckRequirements // +// // +// Purpose: This function checks all minimum requirements for the // +// application being installed. If any fail, then the user // +// is informed and the setup is terminated. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CheckRequirements() + NUMBER nvDx, nvDy, nvResult; + STRING svResult; + + begin + + bWinNT = FALSE; + bIsShellExplorer = FALSE; + + // Check screen resolution. + GetExtents( nvDx, nvDy ); + + if (nvDy < 480) then + MessageBox( @ERROR_VGARESOLUTION, WARNING ); + abort; + endif; + + // set 'setup' operation mode + bIs32BitSetup = TRUE; + GetSystemInfo( ISTYPE, nvResult, svResult ); + if (nvResult = 16) then + bIs32BitSetup = FALSE; // running 16-bit setup + return 0; // no additional information required + endif; + + // --- 32-bit testing after this point --- + + // Determine the target system's operating system. + GetSystemInfo( OS, nvResult, svResult ); + + if (nvResult = IS_WINDOWSNT) then + // Running Windows NT. + bWinNT = TRUE; + + // Check to see if the shell being used is EXPLORER shell. + if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then + if (nvResult >= 4) then + bIsShellExplorer = TRUE; + endif; + endif; + + elseif (nvResult = IS_WINDOWS95 ) then + bIsShellExplorer = TRUE; + + endif; + +end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdWelcome // +// // +// Purpose: This function handles the standard welcome dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdWelcome() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = ""; + nResult = SdWelcome( szTitle, szMsg ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdShowInfoList // +// // +// Purpose: This function displays the general information list dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdShowInfoList() + NUMBER nResult; + LIST list; + STRING szTitle, szMsg, szFile; + begin + + szFile = SUPPORTDIR ^ "infolist.txt"; + + list = ListCreate( STRINGLIST ); + ListReadFromFile( list, szFile ); + szTitle = ""; + szMsg = " "; + nResult = SdShowInfoList( szTitle, szMsg, list ); + + ListDestroy( list ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdAskDestPath // +// // +// Purpose: This function asks the user for the destination directory. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdAskDestPath() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = ""; + nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); + + TARGETDIR = svDir; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdSetupType // +// // +// Purpose: This function displays the standard setup type dialog. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdSetupType() + NUMBER nResult, nType; + STRING szTitle, szMsg; + begin + + switch (svSetupType) + case "Typical": + nType = TYPICAL; + case "Custom": + nType = CUSTOM; + case "Compact": + nType = COMPACT; + case "": + svSetupType = "Typical"; + nType = TYPICAL; + endswitch; + + szTitle = ""; + szMsg = ""; + nResult = SetupType( szTitle, szMsg, "", nType, 0 ); + + switch (nResult) + case COMPACT: + svSetupType = "Compact"; + case TYPICAL: + svSetupType = "Typical"; + case CUSTOM: + svSetupType = "Custom"; + endswitch; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdComponentDialog2 // +// // +// Purpose: This function displays the custom component dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdComponentDialog2() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + if ((svSetupType != "Custom") && (svSetupType != "")) then + return 0; + endif; + + szTitle = ""; + szMsg = ""; + nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdFinishReboot // +// // +// Purpose: This function will show the last dialog of the product. // +// It will allow the user to reboot and/or show some readme text. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdFinishReboot() + NUMBER nResult, nDefOptions; + STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; + NUMBER bOpt1, bOpt2; + begin + + if (!BATCH_INSTALL) then + bOpt1 = FALSE; + bOpt2 = FALSE; + szMsg1 = ""; + szMsg2 = ""; + szOption1 = ""; + szOption2 = ""; + nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); + return 0; + endif; + + nDefOptions = SYS_BOOTMACHINE; + szTitle = ""; + szMsg1 = ""; + szMsg2 = ""; + nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); + + return nResult; + end; + + // --- include script file section --- + +#include "sddialog.rul" + + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt b/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt new file mode 100755 index 00000000000..c91cb20740d --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt @@ -0,0 +1,25 @@ +This is a release of MySQL 4.0.11a-gamma for Win32. + +NOTE: If you install MySQL in a folder other than +C:\MYSQL or you intend to start MySQL on NT/Win2000 +as a service, you must create a file named C:\MY.CNF +or \Windows\my.ini or \winnt\my.ini with the following +information:: + +[mysqld] +basedir=E:/installation-path/ +datadir=E:/data-path/ + +After your have installed MySQL, the installation +directory will contain 4 files named 'my-small.cnf, +my-medium.cnf, my-large.cnf, my-huge.cnf'. +You can use this as a starting point for your own +C:\my.cnf file. + +If you have any problems, you can mail them to +win32@lists.mysql.com after you have consulted the +MySQL manual and the MySQL mailing list archive +(http://www.mysql.com/documentation/index.html) + +On behalf of the MySQL AB gang, +Michael Widenius
\ No newline at end of file diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp b/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp Binary files differnew file mode 100755 index 00000000000..3229d50c9bf --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Shell Objects/Default.shl b/VC++Files/InstallShield/4.0.XX-gpl/Shell Objects/Default.shl new file mode 100755 index 00000000000..187cb651307 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Shell Objects/Default.shl @@ -0,0 +1,12 @@ +[Data] +Folder3=<FOLDER_STARTUP> +Group0=Main +Group1=Startup +Folder0=<FOLDER_DESKTOP> +Folder1=<FOLDER_STARTMENU> +Folder2=<FOLDER_PROGRAMS> + +[Info] +Type=ShellObject +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/String Tables/0009-English/value.shl b/VC++Files/InstallShield/4.0.XX-gpl/String Tables/0009-English/value.shl new file mode 100755 index 00000000000..ccd18e688eb --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/String Tables/0009-English/value.shl @@ -0,0 +1,23 @@ +[Data] +TITLE_MAIN=MySQL Servers and Clients 4.0.11a-gamma +COMPANY_NAME=MySQL AB +ERROR_COMPONENT=Component: +COMPANY_NAME16=Company +PRODUCT_VERSION=MySQL Servers and Clients 4.0.11a-gamma +ERROR_MOVEDATA=An error occurred during the move data process: %d +ERROR_FILEGROUP=File Group: +UNINST_KEY=MySQL Servers and Clients 4.0.11a-gamma +TITLE_CAPTIONBAR=MySQL Servers and Clients 4.0.11a-gamma +PRODUCT_NAME16=Product +ERROR_VGARESOLUTION=This program requires VGA or better resolution. +ERROR_FILE=File: +UNINST_DISPLAY_NAME=MySQL Servers and Clients 4.0.11a-gamma +PRODUCT_KEY=yourapp.Exe +PRODUCT_NAME=MySQL Servers and Clients 4.0.11a-gamma +ERROR_UNINSTSETUP=unInstaller setup failed to initialize. You may not be able to uninstall this product. + +[General] +Language=0009 +Type=STRINGTABLESPECIFIC +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/String Tables/Default.shl b/VC++Files/InstallShield/4.0.XX-gpl/String Tables/Default.shl new file mode 100755 index 00000000000..d4dc4925ab1 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/String Tables/Default.shl @@ -0,0 +1,74 @@ +[TITLE_MAIN] +Comment= + +[COMPANY_NAME] +Comment= + +[ERROR_COMPONENT] +Comment= + +[COMPANY_NAME16] +Comment= + +[PRODUCT_VERSION] +Comment= + +[ERROR_MOVEDATA] +Comment= + +[ERROR_FILEGROUP] +Comment= + +[Language] +Lang0=0009 +CurrentLang=0 + +[UNINST_KEY] +Comment= + +[TITLE_CAPTIONBAR] +Comment= + +[Data] +Entry0=ERROR_VGARESOLUTION +Entry1=TITLE_MAIN +Entry2=TITLE_CAPTIONBAR +Entry3=UNINST_KEY +Entry4=UNINST_DISPLAY_NAME +Entry5=COMPANY_NAME +Entry6=PRODUCT_NAME +Entry7=PRODUCT_VERSION +Entry8=PRODUCT_KEY +Entry9=ERROR_MOVEDATA +Entry10=ERROR_UNINSTSETUP +Entry11=COMPANY_NAME16 +Entry12=PRODUCT_NAME16 +Entry13=ERROR_COMPONENT +Entry14=ERROR_FILEGROUP +Entry15=ERROR_FILE + +[PRODUCT_NAME16] +Comment= + +[ERROR_VGARESOLUTION] +Comment= + +[ERROR_FILE] +Comment= + +[General] +Type=STRINGTABLE +Version=1.00.000 + +[UNINST_DISPLAY_NAME] +Comment= + +[PRODUCT_KEY] +Comment= + +[PRODUCT_NAME] +Comment= + +[ERROR_UNINSTSETUP] +Comment= + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Build.tsb b/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Build.tsb new file mode 100755 index 00000000000..3949bd4c066 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Build.tsb @@ -0,0 +1,56 @@ +[<HKUS>] +Value= +KeyType=4 + +[<HKCR>] +Value= +KeyType=4 + +[<PROGRAMFILES>] +Value= +KeyType=4 + +[<WINSYSDIR>] +Value= +KeyType=4 + +[<COMMONFILES>] +Value= +KeyType=4 + +[<WINDIR>] +Value= +KeyType=4 + +[Data] +Key0=<PROGRAMFILES> +Key1=<COMMONFILES> +Key2=<WINDIR> +Key3=<WINSYSDIR> +Key4=<HKLM> +Key5=<HKCU> +Key6=<HKCC> +Key7=<HKDD> +Key8=<HKUS> +Key9=<HKCR> + +[General] +Type=TEXTSUB +Version=1.00.000 + +[<HKLM>] +Value= +KeyType=4 + +[<HKCU>] +Value= +KeyType=4 + +[<HKCC>] +Value= +KeyType=4 + +[<HKDD>] +Value= +KeyType=4 + diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Setup.tsb b/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Setup.tsb new file mode 100755 index 00000000000..b0c5a509f0b --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Setup.tsb @@ -0,0 +1,76 @@ +[<SRCDIR>] +Value= +KeyType=4 + +[<HKUS>] +Value= +KeyType=4 + +[<HKCR>] +Value= +KeyType=4 + +[<PROGRAMFILES>] +Value= +KeyType=4 + +[<TARGETDIR>] +Value= +KeyType=4 + +[<WINSYSDIR>] +Value= +KeyType=4 + +[<COMMONFILES>] +Value= +KeyType=4 + +[<WINDIR>] +Value= +KeyType=4 + +[Data] +Key0=<PROGRAMFILES> +Key1=<COMMONFILES> +Key2=<WINDIR> +Key3=<WINSYSDIR> +Key4=<TARGETDIR> +Key5=<SUPPORTDIR> +Key10=<HKDD> +Key6=<SRCDIR> +Key11=<HKUS> +Key7=<HKLM> +Key12=<HKCR> +Key8=<HKCU> +Key13=<SHELL_OBJECT_FOLDER> +Key9=<HKCC> + +[<SUPPORTDIR>] +Value= +KeyType=4 + +[<SHELL_OBJECT_FOLDER>] +Value= +KeyType=4 + +[General] +Type=TEXTSUB +Version=1.00.000 + +[<HKLM>] +Value= +KeyType=4 + +[<HKCU>] +Value= +KeyType=4 + +[<HKCC>] +Value= +KeyType=4 + +[<HKDD>] +Value= +KeyType=4 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/4.0.XX-pro.ipr b/VC++Files/InstallShield/4.0.XX-pro/4.0.XX-pro.ipr new file mode 100755 index 00000000000..bfa7a082873 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/4.0.XX-pro.ipr @@ -0,0 +1,52 @@ +[Language] +LanguageSupport0=0009 + +[OperatingSystem] +OSSupport=0000000000010010 + +[Data] +CurrentMedia=New Media +CurrentComponentDef=Default.cdf +ProductName=MySQL Servers and Clients +set_mifserial= +DevEnvironment=Microsoft Visual C++ 6 +AppExe= +set_dlldebug=No +EmailAddresss= +Instructions=Instructions.txt +set_testmode=No +set_mif=No +SummaryText= +Department= +HomeURL= +Author= +Type=Database Application +InstallRoot=D:\MySQL-Install\4.0.xpro +Version=1.00.000 +InstallationGUID=40744a4d-efed-4cff-84a9-9e6389550f5c +set_level=Level 3 +CurrentFileGroupDef=Default.fdf +Notes=Notes.txt +set_maxerr=50 +set_args= +set_miffile=Status.mif +set_dllcmdline= +Copyright= +set_warnaserr=No +CurrentPlatform= +Category= +set_preproc= +CurrentLanguage=English +CompanyName=MySQL +Description=Description.txt +set_maxwarn=50 +set_crc=Yes +set_compileb4build=No + +[MediaInfo] +mediadata0=New Media/ + +[General] +Type=INSTALLMAIN +Version=1.10.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.cdf b/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.cdf new file mode 100755 index 00000000000..48d37800cd1 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.cdf @@ -0,0 +1,192 @@ +[Development] +required0=Servers +SELECTED=Yes +FILENEED=STANDARD +required1=Grant Tables +HTTPLOCATION= +STATUS=Examples, Libraries, Includes and Script files +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=Examples, Libraries, Includes and Script files +DISPLAYTEXT=Examples, Libraries, Includes and Script files +IMAGE= +DEFSELECTION=Yes +filegroup0=Development +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=ALWAYSOVERWRITE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Grant Tables] +required0=Servers +SELECTED=Yes +FILENEED=CRITICAL +HTTPLOCATION= +STATUS=The Grant Tables and Core Files +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The Grant Tables and Core Files +DISPLAYTEXT=The Grant Tables and Core Files +IMAGE= +DEFSELECTION=Yes +filegroup0=Grant Tables +requiredby0=Development +COMMENT= +INCLUDEINBUILD=Yes +requiredby1=Clients and Tools +INSTALLATION=NEVEROVERWRITE +requiredby2=Documentation +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Components] +component0=Development +component1=Grant Tables +component2=Servers +component3=Clients and Tools +component4=Documentation + +[TopComponents] +component0=Servers +component1=Clients and Tools +component2=Documentation +component3=Development +component4=Grant Tables + +[SetupType] +setuptype0=Compact +setuptype1=Typical +setuptype2=Custom + +[Clients and Tools] +required0=Servers +SELECTED=Yes +FILENEED=HIGHLYRECOMMENDED +required1=Grant Tables +HTTPLOCATION= +STATUS=The MySQL clients and Maintenance Tools +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL clients and Maintenance Tools +DISPLAYTEXT=The MySQL clients and Maintenance Tools +IMAGE= +DEFSELECTION=Yes +filegroup0=Clients and Tools +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=NEWERDATE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[Servers] +SELECTED=Yes +FILENEED=CRITICAL +HTTPLOCATION= +STATUS=The MySQL Servers +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL Servers +DISPLAYTEXT=The MySQL Servers +IMAGE= +DEFSELECTION=Yes +filegroup0=Servers +requiredby0=Development +COMMENT= +INCLUDEINBUILD=Yes +requiredby1=Grant Tables +INSTALLATION=ALWAYSOVERWRITE +requiredby2=Clients and Tools +requiredby3=Documentation +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + +[SetupTypeItem-Compact] +Comment= +item0=Grant Tables +item1=Servers +item2=Clients and Tools +item3=Documentation +Descrip= +DisplayText= + +[SetupTypeItem-Custom] +Comment= +item0=Development +item1=Grant Tables +item2=Servers +item3=Clients and Tools +Descrip= +item4=Documentation +DisplayText= + +[Info] +Type=CompDef +Version=1.00.000 +Name= + +[SetupTypeItem-Typical] +Comment= +item0=Development +item1=Grant Tables +item2=Servers +item3=Clients and Tools +Descrip= +item4=Documentation +DisplayText= + +[Documentation] +required0=Servers +SELECTED=Yes +FILENEED=HIGHLYRECOMMENDED +required1=Grant Tables +HTTPLOCATION= +STATUS=The MySQL Documentation with different formats +UNINSTALLABLE=Yes +TARGET=<TARGETDIR> +FTPLOCATION= +VISIBLE=Yes +DESCRIPTION=The MySQL Documentation with different formats +DISPLAYTEXT=The MySQL Documentation with different formats +IMAGE= +DEFSELECTION=Yes +filegroup0=Documentation +COMMENT= +INCLUDEINBUILD=Yes +INSTALLATION=ALWAYSOVERWRITE +COMPRESSIFSEPARATE=No +MISC= +ENCRYPT=No +DISK=ANYDISK +TARGETDIRCDROM= +PASSWORD= +TARGETHIDDEN=General Application Destination + diff --git a/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.fgl b/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.fgl new file mode 100755 index 00000000000..4e20dcea4ab --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.fgl @@ -0,0 +1,42 @@ +[<PROGRAMFILES>\<COMMONFILES>] +DISPLAYTEXT=Common Files Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[<WINDIR>\<WINSYSDIR>] +DISPLAYTEXT=Windows System Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[USERDEFINED] +DISPLAYTEXT=Script-defined Folders +TYPE=USERSTART +fulldirectory= + +[<PROGRAMFILES>] +DISPLAYTEXT=Program Files Folder +SubDir0=<PROGRAMFILES>\<COMMONFILES> +TYPE=TEXTSUBFIXED +fulldirectory= + +[<TARGETDIR>] +DISPLAYTEXT=General Application Destination +TYPE=TEXTSUBFIXED +fulldirectory= + +[<WINDIR>] +DISPLAYTEXT=Windows Operating System +SubDir0=<WINDIR>\<WINSYSDIR> +TYPE=TEXTSUBFIXED +fulldirectory= + +[TopDir] +SubDir0=<WINDIR> +SubDir1=<PROGRAMFILES> +SubDir2=<TARGETDIR> +SubDir3=USERDEFINED + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl new file mode 100755 index 00000000000..7bba3d7474a --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl @@ -0,0 +1,31 @@ +[bin] +file15=C:\mysql\bin\replace.exe +file16=C:\mysql\bin\winmysqladmin.cnt +file0=C:\mysql\bin\isamchk.exe +file17=C:\mysql\bin\WINMYSQLADMIN.HLP +file1=C:\mysql\bin\myisamchk.exe +file18=C:\mysql\bin\comp-err.exe +file2=C:\mysql\bin\myisamlog.exe +file19=C:\mysql\bin\my_print_defaults.exe +file3=C:\mysql\bin\myisampack.exe +file4=C:\mysql\bin\mysql.exe +file5=C:\mysql\bin\mysqladmin.exe +file6=C:\mysql\bin\mysqlbinlog.exe +file7=C:\mysql\bin\mysqlc.exe +file8=C:\mysql\bin\mysqlcheck.exe +file9=C:\mysql\bin\mysqldump.exe +file20=C:\mysql\bin\winmysqladmin.exe +file10=C:\mysql\bin\mysqlimport.exe +fulldirectory= +file11=C:\mysql\bin\mysqlshow.exe +file12=C:\mysql\bin\mysqlwatch.exe +file13=C:\mysql\bin\pack_isam.exe +file14=C:\mysql\bin\perror.exe + +[TopDir] +SubDir0=bin + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Default.fdf b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Default.fdf new file mode 100755 index 00000000000..8096a4b74bf --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Default.fdf @@ -0,0 +1,82 @@ +[FileGroups] +group0=Development +group1=Grant Tables +group2=Servers +group3=Clients and Tools +group4=Documentation + +[Development] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Grant Tables] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Clients and Tools] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM=0000000000000000 +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Servers] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + +[Info] +Type=FileGrp +Version=1.00.000 +Name= + +[Documentation] +SELFREGISTERING=No +HTTPLOCATION= +LANGUAGE= +OPERATINGSYSTEM= +FTPLOCATION= +FILETYPE=No +INFOTYPE=Standard +COMMENT= +COMPRESS=Yes +COMPRESSDLL= +POTENTIALLY=No +MISC= + diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl new file mode 100755 index 00000000000..df4c058f8ce --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl @@ -0,0 +1,239 @@ +[bench\Data\Wisconsin] +file0=C:\mysql\bench\Data\Wisconsin\onek.data +file1=C:\mysql\bench\Data\Wisconsin\tenk.data +fulldirectory= + +[lib\debug] +file0=C:\mysql\lib\debug\libmySQL.dll +file1=C:\mysql\lib\debug\libmySQL.lib +file2=C:\mysql\lib\debug\mysqlclient.lib +file3=C:\mysql\lib\debug\zlib.lib +file4=C:\mysql\lib\debug\mysys.lib +file5=C:\mysql\lib\debug\regex.lib +file6=C:\mysql\lib\debug\strings.lib +fulldirectory= + +[bench\output] +fulldirectory= + +[examples\libmysqltest] +file0=C:\mysql\examples\libmysqltest\myTest.c +file1=C:\mysql\examples\libmysqltest\myTest.dsp +file2=C:\mysql\examples\libmysqltest\myTest.dsw +file3=C:\mysql\examples\libmysqltest\myTest.exe +file4=C:\mysql\examples\libmysqltest\myTest.mak +file5=C:\mysql\examples\libmysqltest\myTest.ncb +file6=C:\mysql\examples\libmysqltest\myTest.opt +file7=C:\mysql\examples\libmysqltest\readme +fulldirectory= + +[include] +file15=C:\mysql\include\libmysqld.def +file16=C:\mysql\include\my_alloc.h +file0=C:\mysql\include\raid.h +file17=C:\mysql\include\my_getopt.h +file1=C:\mysql\include\errmsg.h +file2=C:\mysql\include\Libmysql.def +file3=C:\mysql\include\m_ctype.h +file4=C:\mysql\include\m_string.h +file5=C:\mysql\include\my_list.h +file6=C:\mysql\include\my_pthread.h +file7=C:\mysql\include\my_sys.h +file8=C:\mysql\include\mysql.h +file9=C:\mysql\include\mysql_com.h +file10=C:\mysql\include\mysql_version.h +fulldirectory= +file11=C:\mysql\include\mysqld_error.h +file12=C:\mysql\include\dbug.h +file13=C:\mysql\include\config-win.h +file14=C:\mysql\include\my_global.h + +[examples] +SubDir0=examples\libmysqltest +SubDir1=examples\tests +fulldirectory= + +[lib\opt] +file0=C:\mysql\lib\opt\libmySQL.dll +file1=C:\mysql\lib\opt\libmySQL.lib +file2=C:\mysql\lib\opt\mysqlclient.lib +file3=C:\mysql\lib\opt\zlib.lib +file4=C:\mysql\lib\opt\strings.lib +file5=C:\mysql\lib\opt\regex.lib +file6=C:\mysql\lib\opt\mysys.lib +fulldirectory= + +[bench\Data] +SubDir0=bench\Data\ATIS +SubDir1=bench\Data\Wisconsin +fulldirectory= + +[bench\limits] +file15=C:\mysql\bench\limits\pg.comment +file16=C:\mysql\bench\limits\solid.cfg +file0=C:\mysql\bench\limits\access.cfg +file17=C:\mysql\bench\limits\solid-nt4.cfg +file1=C:\mysql\bench\limits\access.comment +file18=C:\mysql\bench\limits\sybase.cfg +file2=C:\mysql\bench\limits\Adabas.cfg +file3=C:\mysql\bench\limits\Adabas.comment +file4=C:\mysql\bench\limits\Db2.cfg +file5=C:\mysql\bench\limits\empress.cfg +file6=C:\mysql\bench\limits\empress.comment +file7=C:\mysql\bench\limits\Informix.cfg +file8=C:\mysql\bench\limits\Informix.comment +file9=C:\mysql\bench\limits\msql.cfg +file10=C:\mysql\bench\limits\ms-sql.cfg +fulldirectory= +file11=C:\mysql\bench\limits\Ms-sql65.cfg +file12=C:\mysql\bench\limits\mysql.cfg +file13=C:\mysql\bench\limits\oracle.cfg +file14=C:\mysql\bench\limits\pg.cfg + +[TopDir] +SubDir0=bench +SubDir1=examples +SubDir2=include +SubDir3=lib +SubDir4=scripts + +[bench] +file15=C:\mysql\bench\test-create +file16=C:\mysql\bench\test-insert +file0=C:\mysql\bench\uname.bat +file17=C:\mysql\bench\test-select +file1=C:\mysql\bench\compare-results +file18=C:\mysql\bench\test-wisconsin +file2=C:\mysql\bench\copy-db +file19=C:\mysql\bench\bench-init.pl +file3=C:\mysql\bench\crash-me +file4=C:\mysql\bench\example.bat +file5=C:\mysql\bench\print-limit-table +file6=C:\mysql\bench\pwd.bat +file7=C:\mysql\bench\Readme +SubDir0=bench\Data +file8=C:\mysql\bench\run.bat +SubDir1=bench\limits +file9=C:\mysql\bench\run-all-tests +SubDir2=bench\output +file10=C:\mysql\bench\server-cfg +fulldirectory= +file11=C:\mysql\bench\test-alter-table +file12=C:\mysql\bench\test-ATIS +file13=C:\mysql\bench\test-big-tables +file14=C:\mysql\bench\test-connect + +[examples\tests] +file15=C:\mysql\examples\tests\lock_test.res +file16=C:\mysql\examples\tests\mail_to_db.pl +file0=C:\mysql\examples\tests\unique_users.tst +file17=C:\mysql\examples\tests\table_types.pl +file1=C:\mysql\examples\tests\auto_increment.tst +file18=C:\mysql\examples\tests\test_delayed_insert.pl +file2=C:\mysql\examples\tests\big_record.pl +file19=C:\mysql\examples\tests\udf_test +file3=C:\mysql\examples\tests\big_record.res +file4=C:\mysql\examples\tests\czech-sorting +file5=C:\mysql\examples\tests\deadlock-script.pl +file6=C:\mysql\examples\tests\export.pl +file7=C:\mysql\examples\tests\fork_test.pl +file8=C:\mysql\examples\tests\fork2_test.pl +file9=C:\mysql\examples\tests\fork3_test.pl +file20=C:\mysql\examples\tests\udf_test.res +file21=C:\mysql\examples\tests\auto_increment.res +file10=C:\mysql\examples\tests\function.res +fulldirectory= +file11=C:\mysql\examples\tests\function.tst +file12=C:\mysql\examples\tests\grant.pl +file13=C:\mysql\examples\tests\grant.res +file14=C:\mysql\examples\tests\lock_test.pl + +[bench\Data\ATIS] +file26=C:\mysql\bench\Data\ATIS\stop1.txt +file15=C:\mysql\bench\Data\ATIS\flight_class.txt +file27=C:\mysql\bench\Data\ATIS\time_interval.txt +file16=C:\mysql\bench\Data\ATIS\flight_day.txt +file0=C:\mysql\bench\Data\ATIS\transport.txt +file28=C:\mysql\bench\Data\ATIS\time_zone.txt +file17=C:\mysql\bench\Data\ATIS\flight_fare.txt +file1=C:\mysql\bench\Data\ATIS\airline.txt +file29=C:\mysql\bench\Data\ATIS\aircraft.txt +file18=C:\mysql\bench\Data\ATIS\food_service.txt +file2=C:\mysql\bench\Data\ATIS\airport.txt +file19=C:\mysql\bench\Data\ATIS\ground_service.txt +file3=C:\mysql\bench\Data\ATIS\airport_service.txt +file4=C:\mysql\bench\Data\ATIS\city.txt +file5=C:\mysql\bench\Data\ATIS\class_of_service.txt +file6=C:\mysql\bench\Data\ATIS\code_description.txt +file7=C:\mysql\bench\Data\ATIS\compound_class.txt +file8=C:\mysql\bench\Data\ATIS\connect_leg.txt +file9=C:\mysql\bench\Data\ATIS\date_day.txt +file20=C:\mysql\bench\Data\ATIS\month_name.txt +file21=C:\mysql\bench\Data\ATIS\restrict_carrier.txt +file10=C:\mysql\bench\Data\ATIS\day_name.txt +fulldirectory= +file22=C:\mysql\bench\Data\ATIS\restrict_class.txt +file11=C:\mysql\bench\Data\ATIS\dual_carrier.txt +file23=C:\mysql\bench\Data\ATIS\restriction.txt +file12=C:\mysql\bench\Data\ATIS\fare.txt +file24=C:\mysql\bench\Data\ATIS\state.txt +file13=C:\mysql\bench\Data\ATIS\fconnection.txt +file25=C:\mysql\bench\Data\ATIS\stop.txt +file14=C:\mysql\bench\Data\ATIS\flight.txt + +[General] +Type=FILELIST +Version=1.00.000 + +[scripts] +file37=C:\mysql\scripts\mysqld_safe-watch.sh +file26=C:\mysql\scripts\mysql_zap +file15=C:\mysql\scripts\mysql_fix_privilege_tables +file38=C:\mysql\scripts\mysqldumpslow +file27=C:\mysql\scripts\mysql_zap.sh +file16=C:\mysql\scripts\mysql_fix_privilege_tables.sh +file0=C:\mysql\scripts\Readme +file39=C:\mysql\scripts\mysqldumpslow.sh +file28=C:\mysql\scripts\mysqlaccess +file17=C:\mysql\scripts\mysql_install_db +file1=C:\mysql\scripts\make_binary_distribution.sh +file29=C:\mysql\scripts\mysqlaccess.conf +file18=C:\mysql\scripts\mysql_install_db.sh +file2=C:\mysql\scripts\msql2mysql +file19=C:\mysql\scripts\mysql_secure_installation +file3=C:\mysql\scripts\msql2mysql.sh +file4=C:\mysql\scripts\mysql_config +file5=C:\mysql\scripts\mysql_config.sh +file6=C:\mysql\scripts\mysql_convert_table_format +file7=C:\mysql\scripts\mysql_convert_table_format.sh +file40=C:\mysql\scripts\mysqlhotcopy +file8=C:\mysql\scripts\mysql_explain_log +file41=C:\mysql\scripts\mysqlhotcopy.pl +file30=C:\mysql\scripts\mysqlaccess.sh +file9=C:\mysql\scripts\mysql_explain_log.sh +file42=C:\mysql\scripts\mysqlhotcopy.sh +file31=C:\mysql\scripts\mysqlbug +file20=C:\mysql\scripts\mysql_secure_installation.sh +file43=C:\mysql\scripts\make_binary_distribution +file32=C:\mysql\scripts\mysqlbug.sh +file21=C:\mysql\scripts\mysql_setpermission +file10=C:\mysql\scripts\mysql_find_rows +fulldirectory= +file33=C:\mysql\scripts\mysqld_multi +file22=C:\mysql\scripts\mysql_setpermission.pl +file11=C:\mysql\scripts\mysql_find_rows.pl +file34=C:\mysql\scripts\mysqld_multi.sh +file23=C:\mysql\scripts\mysql_setpermission.sh +file12=C:\mysql\scripts\mysql_find_rows.sh +file35=C:\mysql\scripts\mysqld_safe +file24=C:\mysql\scripts\mysql_tableinfo +file13=C:\mysql\scripts\mysql_fix_extensions +file36=C:\mysql\scripts\mysqld_safe.sh +file25=C:\mysql\scripts\mysql_tableinfo.sh +file14=C:\mysql\scripts\mysql_fix_extensions.sh + +[lib] +SubDir0=lib\debug +SubDir1=lib\opt +fulldirectory= + diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Documentation.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Documentation.fgl new file mode 100755 index 00000000000..80fe777cf0f --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Documentation.fgl @@ -0,0 +1,99 @@ +[Docs\Flags] +file59=C:\mysql\Docs\Flags\romania.gif +file48=C:\mysql\Docs\Flags\kroatia.eps +file37=C:\mysql\Docs\Flags\iceland.gif +file26=C:\mysql\Docs\Flags\france.eps +file15=C:\mysql\Docs\Flags\china.gif +file49=C:\mysql\Docs\Flags\kroatia.gif +file38=C:\mysql\Docs\Flags\ireland.eps +file27=C:\mysql\Docs\Flags\france.gif +file16=C:\mysql\Docs\Flags\croatia.eps +file0=C:\mysql\Docs\Flags\usa.gif +file39=C:\mysql\Docs\Flags\ireland.gif +file28=C:\mysql\Docs\Flags\germany.eps +file17=C:\mysql\Docs\Flags\croatia.gif +file1=C:\mysql\Docs\Flags\argentina.gif +file29=C:\mysql\Docs\Flags\germany.gif +file18=C:\mysql\Docs\Flags\czech-republic.eps +file2=C:\mysql\Docs\Flags\australia.eps +file19=C:\mysql\Docs\Flags\czech-republic.gif +file3=C:\mysql\Docs\Flags\australia.gif +file80=C:\mysql\Docs\Flags\usa.eps +file4=C:\mysql\Docs\Flags\austria.eps +file81=C:\mysql\Docs\Flags\argentina.eps +file70=C:\mysql\Docs\Flags\spain.eps +file5=C:\mysql\Docs\Flags\austria.gif +file71=C:\mysql\Docs\Flags\spain.gif +file60=C:\mysql\Docs\Flags\russia.eps +file6=C:\mysql\Docs\Flags\brazil.eps +file72=C:\mysql\Docs\Flags\sweden.eps +file61=C:\mysql\Docs\Flags\russia.gif +file50=C:\mysql\Docs\Flags\latvia.eps +file7=C:\mysql\Docs\Flags\brazil.gif +file73=C:\mysql\Docs\Flags\sweden.gif +file62=C:\mysql\Docs\Flags\singapore.eps +file51=C:\mysql\Docs\Flags\latvia.gif +file40=C:\mysql\Docs\Flags\island.eps +file8=C:\mysql\Docs\Flags\bulgaria.eps +file74=C:\mysql\Docs\Flags\switzerland.eps +file63=C:\mysql\Docs\Flags\singapore.gif +file52=C:\mysql\Docs\Flags\netherlands.eps +file41=C:\mysql\Docs\Flags\island.gif +file30=C:\mysql\Docs\Flags\great-britain.eps +file9=C:\mysql\Docs\Flags\bulgaria.gif +file75=C:\mysql\Docs\Flags\switzerland.gif +file64=C:\mysql\Docs\Flags\south-africa.eps +file53=C:\mysql\Docs\Flags\netherlands.gif +file42=C:\mysql\Docs\Flags\israel.eps +file31=C:\mysql\Docs\Flags\great-britain.gif +file20=C:\mysql\Docs\Flags\denmark.eps +file76=C:\mysql\Docs\Flags\taiwan.eps +file65=C:\mysql\Docs\Flags\south-africa.gif +file54=C:\mysql\Docs\Flags\poland.eps +file43=C:\mysql\Docs\Flags\israel.gif +file32=C:\mysql\Docs\Flags\greece.eps +file21=C:\mysql\Docs\Flags\denmark.gif +file10=C:\mysql\Docs\Flags\canada.eps +fulldirectory= +file77=C:\mysql\Docs\Flags\taiwan.gif +file66=C:\mysql\Docs\Flags\south-africa1.eps +file55=C:\mysql\Docs\Flags\poland.gif +file44=C:\mysql\Docs\Flags\italy.eps +file33=C:\mysql\Docs\Flags\greece.gif +file22=C:\mysql\Docs\Flags\estonia.eps +file11=C:\mysql\Docs\Flags\canada.gif +file78=C:\mysql\Docs\Flags\ukraine.eps +file67=C:\mysql\Docs\Flags\south-africa1.gif +file56=C:\mysql\Docs\Flags\portugal.eps +file45=C:\mysql\Docs\Flags\italy.gif +file34=C:\mysql\Docs\Flags\hungary.eps +file23=C:\mysql\Docs\Flags\estonia.gif +file12=C:\mysql\Docs\Flags\chile.eps +file79=C:\mysql\Docs\Flags\ukraine.gif +file68=C:\mysql\Docs\Flags\south-korea.eps +file57=C:\mysql\Docs\Flags\portugal.gif +file46=C:\mysql\Docs\Flags\japan.eps +file35=C:\mysql\Docs\Flags\hungary.gif +file24=C:\mysql\Docs\Flags\finland.eps +file13=C:\mysql\Docs\Flags\chile.gif +file69=C:\mysql\Docs\Flags\south-korea.gif +file58=C:\mysql\Docs\Flags\romania.eps +file47=C:\mysql\Docs\Flags\japan.gif +file36=C:\mysql\Docs\Flags\iceland.eps +file25=C:\mysql\Docs\Flags\finland.gif +file14=C:\mysql\Docs\Flags\china.eps + +[Docs] +file0=C:\mysql\Docs\manual_toc.html +file1=C:\mysql\Docs\manual.html +file2=C:\mysql\Docs\manual.txt +SubDir0=Docs\Flags +fulldirectory= + +[TopDir] +SubDir0=Docs + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Grant Tables.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Grant Tables.fgl new file mode 100755 index 00000000000..178065a7003 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Grant Tables.fgl @@ -0,0 +1,36 @@ +[data\test] +fulldirectory= + +[data\mysql] +file15=C:\mysql\data\mysql\func.frm +file16=C:\mysql\data\mysql\func.MYD +file0=C:\mysql\data\mysql\columns_priv.frm +file17=C:\mysql\data\mysql\func.MYI +file1=C:\mysql\data\mysql\columns_priv.MYD +file2=C:\mysql\data\mysql\columns_priv.MYI +file3=C:\mysql\data\mysql\db.frm +file4=C:\mysql\data\mysql\db.MYD +file5=C:\mysql\data\mysql\db.MYI +file6=C:\mysql\data\mysql\host.frm +file7=C:\mysql\data\mysql\host.MYD +file8=C:\mysql\data\mysql\host.MYI +file9=C:\mysql\data\mysql\tables_priv.frm +file10=C:\mysql\data\mysql\tables_priv.MYD +fulldirectory= +file11=C:\mysql\data\mysql\tables_priv.MYI +file12=C:\mysql\data\mysql\user.frm +file13=C:\mysql\data\mysql\user.MYD +file14=C:\mysql\data\mysql\user.MYI + +[TopDir] +SubDir0=data + +[data] +SubDir0=data\mysql +SubDir1=data\test +fulldirectory= + +[General] +Type=FILELIST +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl new file mode 100755 index 00000000000..3f875b574f6 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl @@ -0,0 +1,226 @@ +[Embedded\Static\release] +file0=C:\mysql\embedded\Static\release\test_stc.dsp +file1=C:\mysql\embedded\Static\release\ReadMe.txt +file2=C:\mysql\embedded\Static\release\StdAfx.cpp +file3=C:\mysql\embedded\Static\release\StdAfx.h +file4=C:\mysql\embedded\Static\release\test_stc.cpp +file5=C:\mysql\embedded\Static\release\mysqlserver.lib +fulldirectory= + +[share\polish] +file0=C:\mysql\share\polish\errmsg.sys +file1=C:\mysql\share\polish\errmsg.txt +fulldirectory= + +[share\dutch] +file0=C:\mysql\share\dutch\errmsg.sys +file1=C:\mysql\share\dutch\errmsg.txt +fulldirectory= + +[share\spanish] +file0=C:\mysql\share\spanish\errmsg.sys +file1=C:\mysql\share\spanish\errmsg.txt +fulldirectory= + +[share\english] +file0=C:\mysql\share\english\errmsg.sys +file1=C:\mysql\share\english\errmsg.txt +fulldirectory= + +[bin] +file0=C:\mysql\bin\mysqld-opt.exe +file1=C:\mysql\bin\mysqld-nt.exe +file2=C:\mysql\bin\mysqld.exe +file3=C:\mysql\bin\cygwinb19.dll +file4=C:\mysql\bin\libmySQL.dll +fulldirectory= + +[share\korean] +file0=C:\mysql\share\korean\errmsg.sys +file1=C:\mysql\share\korean\errmsg.txt +fulldirectory= + +[share\charsets] +file15=C:\mysql\share\charsets\latin1.conf +file16=C:\mysql\share\charsets\latin2.conf +file0=C:\mysql\share\charsets\win1251ukr.conf +file17=C:\mysql\share\charsets\latin5.conf +file1=C:\mysql\share\charsets\cp1257.conf +file18=C:\mysql\share\charsets\Readme +file2=C:\mysql\share\charsets\croat.conf +file19=C:\mysql\share\charsets\swe7.conf +file3=C:\mysql\share\charsets\danish.conf +file4=C:\mysql\share\charsets\dec8.conf +file5=C:\mysql\share\charsets\dos.conf +file6=C:\mysql\share\charsets\estonia.conf +file7=C:\mysql\share\charsets\german1.conf +file8=C:\mysql\share\charsets\greek.conf +file9=C:\mysql\share\charsets\hebrew.conf +file20=C:\mysql\share\charsets\usa7.conf +file21=C:\mysql\share\charsets\win1250.conf +file10=C:\mysql\share\charsets\hp8.conf +fulldirectory= +file22=C:\mysql\share\charsets\win1251.conf +file11=C:\mysql\share\charsets\hungarian.conf +file23=C:\mysql\share\charsets\cp1251.conf +file12=C:\mysql\share\charsets\Index +file13=C:\mysql\share\charsets\koi8_ru.conf +file14=C:\mysql\share\charsets\koi8_ukr.conf + +[Embedded\DLL\debug] +file0=C:\mysql\embedded\DLL\debug\libmysqld.dll +file1=C:\mysql\embedded\DLL\debug\libmysqld.exp +file2=C:\mysql\embedded\DLL\debug\libmysqld.lib +fulldirectory= + +[Embedded] +file0=C:\mysql\embedded\embedded.dsw +SubDir0=Embedded\DLL +SubDir1=Embedded\Static +fulldirectory= + +[share\ukrainian] +file0=C:\mysql\share\ukrainian\errmsg.sys +file1=C:\mysql\share\ukrainian\errmsg.txt +fulldirectory= + +[share\hungarian] +file0=C:\mysql\share\hungarian\errmsg.sys +file1=C:\mysql\share\hungarian\errmsg.txt +fulldirectory= + +[share\german] +file0=C:\mysql\share\german\errmsg.sys +file1=C:\mysql\share\german\errmsg.txt +fulldirectory= + +[share\portuguese] +file0=C:\mysql\share\portuguese\errmsg.sys +file1=C:\mysql\share\portuguese\errmsg.txt +fulldirectory= + +[share\estonian] +file0=C:\mysql\share\estonian\errmsg.sys +file1=C:\mysql\share\estonian\errmsg.txt +fulldirectory= + +[share\romanian] +file0=C:\mysql\share\romanian\errmsg.sys +file1=C:\mysql\share\romanian\errmsg.txt +fulldirectory= + +[share\french] +file0=C:\mysql\share\french\errmsg.sys +file1=C:\mysql\share\french\errmsg.txt +fulldirectory= + +[share\swedish] +file0=C:\mysql\share\swedish\errmsg.sys +file1=C:\mysql\share\swedish\errmsg.txt +fulldirectory= + +[share\slovak] +file0=C:\mysql\share\slovak\errmsg.sys +file1=C:\mysql\share\slovak\errmsg.txt +fulldirectory= + +[share\greek] +file0=C:\mysql\share\greek\errmsg.sys +file1=C:\mysql\share\greek\errmsg.txt +fulldirectory= + +[TopDir] +file0=C:\mysql\my-huge.cnf +file1=C:\mysql\my-large.cnf +file2=C:\mysql\my-medium.cnf +file3=C:\mysql\my-small.cnf +file4=C:\mysql\MySQLEULA.txt +SubDir0=bin +SubDir1=share +SubDir2=Embedded + +[share] +SubDir8=share\hungarian +SubDir9=share\charsets +SubDir20=share\spanish +SubDir21=share\swedish +SubDir10=share\italian +SubDir22=share\ukrainian +SubDir11=share\japanese +SubDir12=share\korean +SubDir13=share\norwegian +SubDir14=share\norwegian-ny +SubDir15=share\polish +SubDir16=share\portuguese +SubDir0=share\czech +SubDir17=share\romanian +SubDir1=share\danish +SubDir18=share\russian +SubDir2=share\dutch +SubDir19=share\slovak +SubDir3=share\english +fulldirectory= +SubDir4=share\estonian +SubDir5=share\french +SubDir6=share\german +SubDir7=share\greek + +[share\norwegian-ny] +file0=C:\mysql\share\norwegian-ny\errmsg.sys +file1=C:\mysql\share\norwegian-ny\errmsg.txt +fulldirectory= + +[Embedded\DLL] +file0=C:\mysql\embedded\DLL\test_dll.dsp +file1=C:\mysql\embedded\DLL\StdAfx.h +file2=C:\mysql\embedded\DLL\test_dll.cpp +file3=C:\mysql\embedded\DLL\StdAfx.cpp +SubDir0=Embedded\DLL\debug +SubDir1=Embedded\DLL\release +fulldirectory= + +[Embedded\Static] +SubDir0=Embedded\Static\release +fulldirectory= + +[Embedded\DLL\release] +file0=C:\mysql\embedded\DLL\release\libmysqld.dll +file1=C:\mysql\embedded\DLL\release\libmysqld.exp +file2=C:\mysql\embedded\DLL\release\libmysqld.lib +file3=C:\mysql\embedded\DLL\release\mysql-server.exe +fulldirectory= + +[share\danish] +file0=C:\mysql\share\danish\errmsg.sys +file1=C:\mysql\share\danish\errmsg.txt +fulldirectory= + +[share\czech] +file0=C:\mysql\share\czech\errmsg.sys +file1=C:\mysql\share\czech\errmsg.txt +fulldirectory= + +[General] +Type=FILELIST +Version=1.00.000 + +[share\russian] +file0=C:\mysql\share\russian\errmsg.sys +file1=C:\mysql\share\russian\errmsg.txt +fulldirectory= + +[share\norwegian] +file0=C:\mysql\share\norwegian\errmsg.sys +file1=C:\mysql\share\norwegian\errmsg.txt +fulldirectory= + +[share\japanese] +file0=C:\mysql\share\japanese\errmsg.sys +file1=C:\mysql\share\japanese\errmsg.txt +fulldirectory= + +[share\italian] +file0=C:\mysql\share\italian\errmsg.sys +file1=C:\mysql\share\italian\errmsg.txt +fulldirectory= + diff --git a/VC++Files/InstallShield/4.0.XX-pro/Registry Entries/Default.rge b/VC++Files/InstallShield/4.0.XX-pro/Registry Entries/Default.rge new file mode 100755 index 00000000000..537dfd82e48 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Registry Entries/Default.rge @@ -0,0 +1,4 @@ +[General] +Type=REGISTRYDATA +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.dbg b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.dbg Binary files differnew file mode 100755 index 00000000000..0c6d4e6b708 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.dbg diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ino b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ino Binary files differnew file mode 100755 index 00000000000..204d8ea0f36 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ino diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ins b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ins Binary files differnew file mode 100755 index 00000000000..759009b5c84 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ins diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.obs b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.obs Binary files differnew file mode 100755 index 00000000000..5fcfcb62c4e --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.obs diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul new file mode 100755 index 00000000000..df143b493c4 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul @@ -0,0 +1,640 @@ + +//////////////////////////////////////////////////////////////////////////////// +// +// IIIIIII SSSSSS +// II SS InstallShield (R) +// II SSSSSS (c) 1996-1997, InstallShield Software Corporation +// II SS (c) 1990-1996, InstallShield Corporation +// IIIIIII SSSSSS All Rights Reserved. +// +// +// This code is generated as a starting setup template. You should +// modify it to provide all necessary steps for your setup. +// +// +// File Name: Setup.rul +// +// Description: InstallShield script +// +// Comments: This template script performs a basic setup on a +// Windows 95 or Windows NT 4.0 platform. With minor +// modifications, this template can be adapted to create +// new, customized setups. +// +//////////////////////////////////////////////////////////////////////////////// + + + // Include header file +#include "sdlang.h" +#include "sddialog.h" + +////////////////////// string defines //////////////////////////// + +#define UNINST_LOGFILE_NAME "Uninst.isu" + +//////////////////// installation declarations /////////////////// + + // ----- DLL prototypes ----- + + + // your DLL prototypes + + + // ---- script prototypes ----- + + // generated + prototype ShowDialogs(); + prototype MoveFileData(); + prototype HandleMoveDataError( NUMBER ); + prototype ProcessBeforeDataMove(); + prototype ProcessAfterDataMove(); + prototype SetupRegistry(); + prototype SetupFolders(); + prototype CleanUpInstall(); + prototype SetupInstall(); + prototype SetupScreen(); + prototype CheckRequirements(); + prototype DialogShowSdWelcome(); + prototype DialogShowSdShowInfoList(); + prototype DialogShowSdAskDestPath(); + prototype DialogShowSdSetupType(); + prototype DialogShowSdComponentDialog2(); + prototype DialogShowSdFinishReboot(); + + // your prototypes + + + // ----- global variables ------ + + // generated + BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; + STRING svDir; + STRING svName, svCompany, svSerial; + STRING szAppPath; + STRING svSetupType; + + + // your global variables + + +/////////////////////////////////////////////////////////////////////////////// +// +// MAIN PROGRAM +// +// The setup begins here by hiding the visible setup +// window. This is done to allow all the titles, images, etc. to +// be established before showing the main window. The following +// logic then performs the setup in a series of steps. +// +/////////////////////////////////////////////////////////////////////////////// +program + Disable( BACKGROUND ); + + CheckRequirements(); + + SetupInstall(); + + SetupScreen(); + + if (ShowDialogs()<0) goto end_install; + + if (ProcessBeforeDataMove()<0) goto end_install; + + if (MoveFileData()<0) goto end_install; + + if (ProcessAfterDataMove()<0) goto end_install; + + if (SetupRegistry()<0) goto end_install; + + if (SetupFolders()<0) goto end_install; + + + end_install: + + CleanUpInstall(); + + // If an unrecoverable error occurred, clean up the partial installation. + // Otherwise, exit normally. + + if (bInstallAborted) then + abort; + endif; + +endprogram + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ShowDialogs // +// // +// Purpose: This function manages the display and navigation // +// the standard dialogs that exist in a setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ShowDialogs() + NUMBER nResult; + begin + + Dlg_Start: + // beginning of dialogs label + + Dlg_SdWelcome: + nResult = DialogShowSdWelcome(); + if (nResult = BACK) goto Dlg_Start; + + Dlg_SdShowInfoList: + nResult = DialogShowSdShowInfoList(); + if (nResult = BACK) goto Dlg_SdWelcome; + + Dlg_SdAskDestPath: + nResult = DialogShowSdAskDestPath(); + if (nResult = BACK) goto Dlg_SdShowInfoList; + + Dlg_SdSetupType: + nResult = DialogShowSdSetupType(); + if (nResult = BACK) goto Dlg_SdAskDestPath; + + Dlg_SdComponentDialog2: + if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then + goto Dlg_SdSetupType; + endif; + nResult = DialogShowSdComponentDialog2(); + if (nResult = BACK) goto Dlg_SdSetupType; + + return 0; + + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ProcessBeforeDataMove // +// // +// Purpose: This function performs any necessary operations prior to the // +// actual data move operation. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ProcessBeforeDataMove() + STRING svLogFile; + NUMBER nResult; + begin + + InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); + + svLogFile = UNINST_LOGFILE_NAME; + + nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); + if (nResult < 0) then + MessageBox( @ERROR_UNINSTSETUP, WARNING ); + endif; + + szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir + + if ((bIs32BitSetup) && (bIsShellExplorer)) then + RegDBSetItem( REGDB_APPPATH, szAppPath ); + RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); + RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); + endif; + + // TODO : update any items you want to process before moving the data + // + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: MoveFileData // +// // +// Purpose: This function handles the data movement for // +// the setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function MoveFileData() + NUMBER nResult, nDisk; + begin + + nDisk = 1; + SetStatusWindow( 0, "" ); + Disable( DIALOGCACHE ); + Enable( STATUS ); + StatusUpdate( ON, 100 ); + nResult = ComponentMoveData( MEDIA, nDisk, 0 ); + + HandleMoveDataError( nResult ); + + Disable( STATUS ); + + return nResult; + + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: HandleMoveDataError // +// // +// Purpose: This function handles the error (if any) during the move data // +// operation. // +// // +/////////////////////////////////////////////////////////////////////////////// +function HandleMoveDataError( nResult ) + STRING szErrMsg, svComponent , svFileGroup , svFile; + begin + + svComponent = ""; + svFileGroup = ""; + svFile = ""; + + switch (nResult) + case 0: + return 0; + default: + ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); + szErrMsg = @ERROR_MOVEDATA + "\n\n" + + @ERROR_COMPONENT + " " + svComponent + "\n" + + @ERROR_FILEGROUP + " " + svFileGroup + "\n" + + @ERROR_FILE + " " + svFile; + SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); + bInstallAborted = TRUE; + return nResult; + endswitch; + + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: ProcessAfterDataMove // +// // +// Purpose: This function performs any necessary operations needed after // +// all data has been moved. // +// // +/////////////////////////////////////////////////////////////////////////////// +function ProcessAfterDataMove() + begin + + // TODO : update self-registered files and other processes that + // should be performed after the data has been moved. + + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupRegistry // +// // +// Purpose: This function makes the registry entries for this setup. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupRegistry() + NUMBER nResult; + + begin + + // TODO : Add all your registry entry keys here + // + // + // RegDBCreateKeyEx, RegDBSetKeyValueEx.... + // + + nResult = CreateRegistrySet( "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// +// Function: SetupFolders +// +// Purpose: This function creates all the folders and shortcuts for the +// setup. This includes program groups and items for Windows 3.1. +// +/////////////////////////////////////////////////////////////////////////////// +function SetupFolders() + NUMBER nResult; + + begin + + + // TODO : Add all your folder (program group) along with shortcuts (program items) + // + // + // CreateProgramFolder, AddFolderIcon.... + // + + nResult = CreateShellObjects( "" ); + + return nResult; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CleanUpInstall // +// // +// Purpose: This cleans up the setup. Anything that should // +// be released or deleted at the end of the setup should // +// be done here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CleanUpInstall() + begin + + + if (bInstallAborted) then + return 0; + endif; + + DialogShowSdFinishReboot(); + + if (BATCH_INSTALL) then // ensure locked files are properly written + CommitSharedFiles(0); + endif; + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupInstall // +// // +// Purpose: This will setup the installation. Any general initialization // +// needed for the installation should be performed here. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupInstall() + begin + + Enable( CORECOMPONENTHANDLING ); + + bInstallAborted = FALSE; + + if (bIs32BitSetup) then + svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; + else + svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names + endif; + + TARGETDIR = svDir; + + SdProductName( @PRODUCT_NAME ); + + Enable( DIALOGCACHE ); + + return 0; + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: SetupScreen // +// // +// Purpose: This function establishes the screen look. This includes // +// colors, fonts, and text to be displayed. // +// // +/////////////////////////////////////////////////////////////////////////////// +function SetupScreen() + begin + + Enable( FULLWINDOWMODE ); + Enable( INDVFILESTATUS ); + SetTitle( @TITLE_MAIN, 24, WHITE ); + + SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. + + Enable( BACKGROUND ); + + Delay( 1 ); + end; + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: CheckRequirements // +// // +// Purpose: This function checks all minimum requirements for the // +// application being installed. If any fail, then the user // +// is informed and the setup is terminated. // +// // +/////////////////////////////////////////////////////////////////////////////// +function CheckRequirements() + NUMBER nvDx, nvDy, nvResult; + STRING svResult; + + begin + + bWinNT = FALSE; + bIsShellExplorer = FALSE; + + // Check screen resolution. + GetExtents( nvDx, nvDy ); + + if (nvDy < 480) then + MessageBox( @ERROR_VGARESOLUTION, WARNING ); + abort; + endif; + + // set 'setup' operation mode + bIs32BitSetup = TRUE; + GetSystemInfo( ISTYPE, nvResult, svResult ); + if (nvResult = 16) then + bIs32BitSetup = FALSE; // running 16-bit setup + return 0; // no additional information required + endif; + + // --- 32-bit testing after this point --- + + // Determine the target system's operating system. + GetSystemInfo( OS, nvResult, svResult ); + + if (nvResult = IS_WINDOWSNT) then + // Running Windows NT. + bWinNT = TRUE; + + // Check to see if the shell being used is EXPLORER shell. + if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then + if (nvResult >= 4) then + bIsShellExplorer = TRUE; + endif; + endif; + + elseif (nvResult = IS_WINDOWS95 ) then + bIsShellExplorer = TRUE; + + endif; + +end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdWelcome // +// // +// Purpose: This function handles the standard welcome dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdWelcome() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = ""; + nResult = SdWelcome( szTitle, szMsg ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdShowInfoList // +// // +// Purpose: This function displays the general information list dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdShowInfoList() + NUMBER nResult; + LIST list; + STRING szTitle, szMsg, szFile; + begin + + szFile = SUPPORTDIR ^ "infolist.txt"; + + list = ListCreate( STRINGLIST ); + ListReadFromFile( list, szFile ); + szTitle = ""; + szMsg = " "; + nResult = SdShowInfoList( szTitle, szMsg, list ); + + ListDestroy( list ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdAskDestPath // +// // +// Purpose: This function asks the user for the destination directory. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdAskDestPath() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + szTitle = ""; + szMsg = ""; + nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); + + TARGETDIR = svDir; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdSetupType // +// // +// Purpose: This function displays the standard setup type dialog. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdSetupType() + NUMBER nResult, nType; + STRING szTitle, szMsg; + begin + + switch (svSetupType) + case "Typical": + nType = TYPICAL; + case "Custom": + nType = CUSTOM; + case "Compact": + nType = COMPACT; + case "": + svSetupType = "Typical"; + nType = TYPICAL; + endswitch; + + szTitle = ""; + szMsg = ""; + nResult = SetupType( szTitle, szMsg, "", nType, 0 ); + + switch (nResult) + case COMPACT: + svSetupType = "Compact"; + case TYPICAL: + svSetupType = "Typical"; + case CUSTOM: + svSetupType = "Custom"; + endswitch; + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdComponentDialog2 // +// // +// Purpose: This function displays the custom component dialog. // +// // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdComponentDialog2() + NUMBER nResult; + STRING szTitle, szMsg; + begin + + if ((svSetupType != "Custom") && (svSetupType != "")) then + return 0; + endif; + + szTitle = ""; + szMsg = ""; + nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); + + return nResult; + end; + + +/////////////////////////////////////////////////////////////////////////////// +// // +// Function: DialogShowSdFinishReboot // +// // +// Purpose: This function will show the last dialog of the product. // +// It will allow the user to reboot and/or show some readme text. // +// // +/////////////////////////////////////////////////////////////////////////////// +function DialogShowSdFinishReboot() + NUMBER nResult, nDefOptions; + STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; + NUMBER bOpt1, bOpt2; + begin + + if (!BATCH_INSTALL) then + bOpt1 = FALSE; + bOpt2 = FALSE; + szMsg1 = ""; + szMsg2 = ""; + szOption1 = ""; + szOption2 = ""; + nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); + return 0; + endif; + + nDefOptions = SYS_BOOTMACHINE; + szTitle = ""; + szMsg1 = ""; + szMsg2 = ""; + nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); + + return nResult; + end; + + // --- include script file section --- + +#include "sddialog.rul" + + diff --git a/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt b/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt new file mode 100755 index 00000000000..18d7995fd50 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt @@ -0,0 +1,25 @@ +This is a release of MySQL Pro 4.0.11a-gamma for Win32. + +NOTE: If you install MySQL in a folder other than +C:\MYSQL or you intend to start MySQL on NT/Win2000 +as a service, you must create a file named C:\MY.CNF +or \Windows\my.ini or \winnt\my.ini with the following +information:: + +[mysqld] +basedir=E:/installation-path/ +datadir=E:/data-path/ + +After your have installed MySQL, the installation +directory will contain 4 files named 'my-small.cnf, +my-medium.cnf, my-large.cnf, my-huge.cnf'. +You can use this as a starting point for your own +C:\my.cnf file. + +If you have any problems, you can mail them to +win32@lists.mysql.com after you have consulted the +MySQL manual and the MySQL mailing list archive +(http://www.mysql.com/documentation/index.html) + +On behalf of the MySQL AB gang, +Michael Widenius
\ No newline at end of file diff --git a/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp b/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp Binary files differnew file mode 100755 index 00000000000..3229d50c9bf --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp diff --git a/VC++Files/InstallShield/4.0.XX-pro/Shell Objects/Default.shl b/VC++Files/InstallShield/4.0.XX-pro/Shell Objects/Default.shl new file mode 100755 index 00000000000..187cb651307 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Shell Objects/Default.shl @@ -0,0 +1,12 @@ +[Data] +Folder3=<FOLDER_STARTUP> +Group0=Main +Group1=Startup +Folder0=<FOLDER_DESKTOP> +Folder1=<FOLDER_STARTMENU> +Folder2=<FOLDER_PROGRAMS> + +[Info] +Type=ShellObject +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/String Tables/0009-English/value.shl b/VC++Files/InstallShield/4.0.XX-pro/String Tables/0009-English/value.shl new file mode 100755 index 00000000000..c1dd3707afb --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/String Tables/0009-English/value.shl @@ -0,0 +1,23 @@ +[Data] +TITLE_MAIN=MySQL Pro Servers and Clients 4.0.11a-gamma +COMPANY_NAME=MySQL AB +ERROR_COMPONENT=Component: +COMPANY_NAME16=Company +PRODUCT_VERSION=MySQL Pro Servers and Clients 4.0.11a-gamma +ERROR_MOVEDATA=An error occurred during the move data process: %d +ERROR_FILEGROUP=File Group: +UNINST_KEY=MySQL Pro Servers and Clients 4.0.11a-gamma +TITLE_CAPTIONBAR=MySQL Pro Servers and Clients 4.0.11a-gamma +PRODUCT_NAME16=Product +ERROR_VGARESOLUTION=This program requires VGA or better resolution. +ERROR_FILE=File: +UNINST_DISPLAY_NAME=MySQL Pro Servers and Clients 4.0.11a-gamma +PRODUCT_KEY=yourapp.Exe +PRODUCT_NAME=MySQL Pro Servers and Clients 4.0.11a-gamma +ERROR_UNINSTSETUP=unInstaller setup failed to initialize. You may not be able to uninstall this product. + +[General] +Language=0009 +Type=STRINGTABLESPECIFIC +Version=1.00.000 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/String Tables/Default.shl b/VC++Files/InstallShield/4.0.XX-pro/String Tables/Default.shl new file mode 100755 index 00000000000..d4dc4925ab1 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/String Tables/Default.shl @@ -0,0 +1,74 @@ +[TITLE_MAIN] +Comment= + +[COMPANY_NAME] +Comment= + +[ERROR_COMPONENT] +Comment= + +[COMPANY_NAME16] +Comment= + +[PRODUCT_VERSION] +Comment= + +[ERROR_MOVEDATA] +Comment= + +[ERROR_FILEGROUP] +Comment= + +[Language] +Lang0=0009 +CurrentLang=0 + +[UNINST_KEY] +Comment= + +[TITLE_CAPTIONBAR] +Comment= + +[Data] +Entry0=ERROR_VGARESOLUTION +Entry1=TITLE_MAIN +Entry2=TITLE_CAPTIONBAR +Entry3=UNINST_KEY +Entry4=UNINST_DISPLAY_NAME +Entry5=COMPANY_NAME +Entry6=PRODUCT_NAME +Entry7=PRODUCT_VERSION +Entry8=PRODUCT_KEY +Entry9=ERROR_MOVEDATA +Entry10=ERROR_UNINSTSETUP +Entry11=COMPANY_NAME16 +Entry12=PRODUCT_NAME16 +Entry13=ERROR_COMPONENT +Entry14=ERROR_FILEGROUP +Entry15=ERROR_FILE + +[PRODUCT_NAME16] +Comment= + +[ERROR_VGARESOLUTION] +Comment= + +[ERROR_FILE] +Comment= + +[General] +Type=STRINGTABLE +Version=1.00.000 + +[UNINST_DISPLAY_NAME] +Comment= + +[PRODUCT_KEY] +Comment= + +[PRODUCT_NAME] +Comment= + +[ERROR_UNINSTSETUP] +Comment= + diff --git a/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Build.tsb b/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Build.tsb new file mode 100755 index 00000000000..3949bd4c066 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Build.tsb @@ -0,0 +1,56 @@ +[<HKUS>] +Value= +KeyType=4 + +[<HKCR>] +Value= +KeyType=4 + +[<PROGRAMFILES>] +Value= +KeyType=4 + +[<WINSYSDIR>] +Value= +KeyType=4 + +[<COMMONFILES>] +Value= +KeyType=4 + +[<WINDIR>] +Value= +KeyType=4 + +[Data] +Key0=<PROGRAMFILES> +Key1=<COMMONFILES> +Key2=<WINDIR> +Key3=<WINSYSDIR> +Key4=<HKLM> +Key5=<HKCU> +Key6=<HKCC> +Key7=<HKDD> +Key8=<HKUS> +Key9=<HKCR> + +[General] +Type=TEXTSUB +Version=1.00.000 + +[<HKLM>] +Value= +KeyType=4 + +[<HKCU>] +Value= +KeyType=4 + +[<HKCC>] +Value= +KeyType=4 + +[<HKDD>] +Value= +KeyType=4 + diff --git a/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Setup.tsb b/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Setup.tsb new file mode 100755 index 00000000000..b0c5a509f0b --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Setup.tsb @@ -0,0 +1,76 @@ +[<SRCDIR>] +Value= +KeyType=4 + +[<HKUS>] +Value= +KeyType=4 + +[<HKCR>] +Value= +KeyType=4 + +[<PROGRAMFILES>] +Value= +KeyType=4 + +[<TARGETDIR>] +Value= +KeyType=4 + +[<WINSYSDIR>] +Value= +KeyType=4 + +[<COMMONFILES>] +Value= +KeyType=4 + +[<WINDIR>] +Value= +KeyType=4 + +[Data] +Key0=<PROGRAMFILES> +Key1=<COMMONFILES> +Key2=<WINDIR> +Key3=<WINSYSDIR> +Key4=<TARGETDIR> +Key5=<SUPPORTDIR> +Key10=<HKDD> +Key6=<SRCDIR> +Key11=<HKUS> +Key7=<HKLM> +Key12=<HKCR> +Key8=<HKCU> +Key13=<SHELL_OBJECT_FOLDER> +Key9=<HKCC> + +[<SUPPORTDIR>] +Value= +KeyType=4 + +[<SHELL_OBJECT_FOLDER>] +Value= +KeyType=4 + +[General] +Type=TEXTSUB +Version=1.00.000 + +[<HKLM>] +Value= +KeyType=4 + +[<HKCU>] +Value= +KeyType=4 + +[<HKCC>] +Value= +KeyType=4 + +[<HKDD>] +Value= +KeyType=4 + diff --git a/VC++Files/bdb/bdb.dsp b/VC++Files/bdb/bdb.dsp index 2809e65b793..6c4ee47daa2 100644 --- a/VC++Files/bdb/bdb.dsp +++ b/VC++Files/bdb/bdb.dsp @@ -7,19 +7,19 @@ CFG=bdb - Win32 Max !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE !MESSAGE NMAKE /f "bdb.mak".
-!MESSAGE
+!MESSAGE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE !MESSAGE NMAKE /f "bdb.mak" CFG="bdb - Win32 Max" -!MESSAGE
+!MESSAGE !MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE !MESSAGE "bdb - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "bdb - Win32 Max" (based on "Win32 (x86) Static Library")
-!MESSAGE
+!MESSAGE # Begin Project
# PROP AllowPerConfigDependencies 0
@@ -75,7 +75,7 @@ LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo /out:"..\lib_debug\bdb.lib"
# ADD LIB32 /nologo /out:"..\lib_release\bdb.lib"
-!ENDIF
+!ENDIF # Begin Target
diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp index 113a7e0d1f9..bf5cd3bcab0 100644 --- a/VC++Files/client/mysqlclient.dsp +++ b/VC++Files/client/mysqlclient.dsp @@ -7,19 +7,19 @@ CFG=mysqlclient - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqlclient.mak" CFG="mysqlclient - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -76,7 +76,7 @@ LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib" -!ENDIF +!ENDIF # Begin Target @@ -244,7 +244,7 @@ SOURCE=..\mysys\mf_iocache2.c # ADD CPP /Od -!ENDIF +!ENDIF # End Source File # Begin Source File diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp index 1c17168628d..7e6f3037400 100644 --- a/VC++Files/innobase/innobase.dsp +++ b/VC++Files/innobase/innobase.dsp @@ -7,21 +7,21 @@ CFG=INNOBASE - WIN32 RELEASE !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "innobase.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "innobase.mak" CFG="INNOBASE - WIN32 RELEASE" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "innobase - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "innobase - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "innobase - Win32 nt" (based on "Win32 (x86) Static Library") !MESSAGE "innobase - Win32 Max nt" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -126,7 +126,7 @@ LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo /out:"..\lib_release\innodb.lib" # ADD LIB32 /nologo /out:"..\lib_release\innodb.lib" -!ENDIF +!ENDIF # Begin Target diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index 9811d07f474..873c64a7bba 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -1,25 +1,25 @@ -# Microsoft Developer Studio Project File - Name="libmySQL" - Package Owner=<4> +# Microsoft Developer Studio Project File - Name="libmysql" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -CFG=libmySQL - Win32 Debug +CFG=libmysql - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libmySQL.mak". -!MESSAGE +!MESSAGE +!MESSAGE NMAKE /f "libmysql.mak". +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libmySQL.mak" CFG="libmySQL - Win32 Debug" -!MESSAGE +!MESSAGE +!MESSAGE NMAKE /f "libmysql.mak" CFG="libmysql - Win32 Debug" +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libmySQL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libmySQL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE +!MESSAGE +!MESSAGE "libmysql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "libmysql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -29,7 +29,7 @@ CPP=cl.exe MTL=midl.exe RSC=rc.exe -!IF "$(CFG)" == "libmySQL - Win32 Release" +!IF "$(CFG)" == "libmysql - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -54,15 +54,15 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /def:"libmysql.def" /out:"../lib_release/libmySQL.dll" /libpath:"." /libpath:"..\lib_release" +# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /def:"libmysql.def" /out:"..\lib_release\libmysql.dll" /libpath:"." /libpath:"..\lib_release" # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" -PostBuild_Desc=Move DLL export lib -PostBuild_Cmds=xcopy release\libmysql.lib ..\lib_release /y +PostBuild_Desc=Copy .lib file +PostBuild_Cmds=xcopy release\libmysql.lib ..\lib_release\ # End Special Build Tool -!ELSEIF "$(CFG)" == "libmySQL - Win32 Debug" +!ELSEIF "$(CFG)" == "libmysql - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -87,20 +87,20 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 zlib.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /def:"libmysql.def" /out:"../lib_debug/libmySQL.dll" /pdbtype:sept /libpath:"." /libpath:"..\lib_debug" +# ADD LINK32 zlib.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /def:"libmysql.def" /out:"..\lib_debug\libmysql.dll" /pdbtype:sept /libpath:"." /libpath:"..\lib_debug" # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" -PostBuild_Desc=Move DLL export lib -PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll C:\winnt\system32\ /y xcopy debug\libmysql.lib ..\lib_debug\ /y +PostBuild_Desc=Copy .lib file +PostBuild_Cmds=xcopy ..\lib_debug\libmysql.dll C:\winnt\system32\ xcopy debug\libmysql.lib ..\lib_debug\ # End Special Build Tool -!ENDIF +!ENDIF # Begin Target -# Name "libmySQL - Win32 Release" -# Name "libmySQL - Win32 Debug" +# Name "libmysql - Win32 Release" +# Name "libmysql - Win32 Debug" # Begin Source File SOURCE=..\mysys\array.c @@ -303,6 +303,10 @@ SOURCE=..\mysys\my_gethostbyname.c # End Source File # Begin Source File +SOURCE=..\mysys\my_getopt.c +# End Source File +# Begin Source File + SOURCE=..\mysys\my_getwd.c # End Source File # Begin Source File @@ -463,6 +467,10 @@ SOURCE=..\strings\strnmov.c # End Source File # Begin Source File +SOURCE=..\strings\strtoll.c +# End Source File +# Begin Source File + SOURCE=..\strings\strxmov.c # End Source File # Begin Source File diff --git a/VC++Files/libmysql/libmysql.dsw b/VC++Files/libmysql/libmysql.dsw index 331802dc16d..36d5b9b330b 100644 --- a/VC++Files/libmysql/libmysql.dsw +++ b/VC++Files/libmysql/libmysql.dsw @@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 5.00 ############################################################################### -Project: "libmySQL"=".\libmySQL.dsp" - Package Owner=<4> +Project: "libmysql"=".\libmysql.dsp" - Package Owner=<4> Package=<5> {{{ diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index f72cd0f0163..eef82588fa8 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -114,7 +114,7 @@ Package=<4> ############################################################################### -Project: "libmySQL"=".\libmysql\libmySQL.dsp" - Package Owner=<4> +Project: "libmysql"=".\libmysql\libmysql.dsp" - Package Owner=<4> Package=<5> {{{ @@ -192,7 +192,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name libmySQL + Project_Dep_Name libmysql End Project Dependency }}} @@ -708,7 +708,7 @@ Package=<5> Package=<4> {{{ Begin Project Dependency - Project_Dep_Name libmySQL + Project_Dep_Name libmysql End Project Dependency }}} diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp index 21d1eb7eac0..0b6c2bb285d 100644 --- a/VC++Files/mysqldemb/mysqldemb.dsp +++ b/VC++Files/mysqldemb/mysqldemb.dsp @@ -7,19 +7,19 @@ CFG=mysqldemb - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE !MESSAGE NMAKE /f "mysqldemb.mak".
-!MESSAGE
+!MESSAGE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE !MESSAGE NMAKE /f "mysqldemb.mak" CFG="mysqldemb - Win32 Debug"
-!MESSAGE
+!MESSAGE !MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE !MESSAGE "mysqldemb - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqldemb - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
+!MESSAGE # Begin Project
# PROP AllowPerConfigDependencies 0
@@ -76,7 +76,7 @@ LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
-!ENDIF
+!ENDIF # Begin Target
diff --git a/VC++Files/mysqlmanager/MySqlManager.dsp b/VC++Files/mysqlmanager/MySqlManager.dsp index ae8e3ec5f0b..a5338b8f5ce 100644 --- a/VC++Files/mysqlmanager/MySqlManager.dsp +++ b/VC++Files/mysqlmanager/MySqlManager.dsp @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Gm /GR /GX /Zi /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /FD /c # SUBTRACT CPP /Fr /YX /Yc /Yu # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /o "NUL" /win32 diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp index 5f13c80f8ec..8d1928f4c6d 100644 --- a/VC++Files/mysys/mysys.dsp +++ b/VC++Files/mysys/mysys.dsp @@ -7,20 +7,20 @@ CFG=mysys - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysys.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysys.mak" CFG="mysys - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -102,7 +102,7 @@ LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib" # ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib" -!ENDIF +!ENDIF # Begin Target @@ -121,7 +121,7 @@ SOURCE=.\array.c !ELSEIF "$(CFG)" == "mysys - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -500,7 +500,7 @@ SOURCE=.\thr_lock.c !ELSEIF "$(CFG)" == "mysys - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index e068ba8f164..e15d443a3b7 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -7,22 +7,22 @@ CFG=mysqld - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqld.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "mysqld.mak" CFG="mysqld - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "mysqld - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 nt" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Max nt" (based on "Win32 (x86) Console Application") !MESSAGE "mysqld - Win32 Max" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -167,7 +167,7 @@ LINK32=xilink6.exe # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe" # SUBTRACT LINK32 /debug -!ENDIF +!ENDIF # Begin Target @@ -193,7 +193,7 @@ SOURCE=.\convert.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -213,7 +213,7 @@ SOURCE=.\derror.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -237,7 +237,7 @@ SOURCE=.\field.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -257,7 +257,7 @@ SOURCE=.\field_conv.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -277,7 +277,7 @@ SOURCE=.\filesort.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -329,7 +329,7 @@ SOURCE=.\handler.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -348,7 +348,7 @@ SOURCE=.\hash_filo.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -371,7 +371,7 @@ SOURCE=.\hostname.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -391,7 +391,7 @@ SOURCE=.\init.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -411,7 +411,7 @@ SOURCE=.\item.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -431,7 +431,7 @@ SOURCE=.\item_buff.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -451,7 +451,7 @@ SOURCE=.\item_cmpfunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -481,7 +481,7 @@ SOURCE=.\item_func.cpp # ADD CPP /I "../zlib" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -505,7 +505,7 @@ SOURCE=.\item_strfunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -529,7 +529,7 @@ SOURCE=.\item_sum.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -548,7 +548,7 @@ SOURCE=.\item_timefunc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -568,7 +568,7 @@ SOURCE=.\item_uniq.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -588,7 +588,7 @@ SOURCE=.\key.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -608,7 +608,7 @@ SOURCE=.\lock.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -628,7 +628,7 @@ SOURCE=.\log.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -651,7 +651,7 @@ SOURCE=.\mf_iocache.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -679,7 +679,7 @@ SOURCE=.\mysqld.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -702,7 +702,7 @@ SOURCE=.\nt_servc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -729,7 +729,7 @@ SOURCE=.\opt_range.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -756,7 +756,7 @@ SOURCE=.\password.c !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -776,7 +776,7 @@ SOURCE=.\procedure.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -800,7 +800,7 @@ SOURCE=.\records.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -836,7 +836,7 @@ SOURCE=.\sql_acl.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -860,7 +860,7 @@ SOURCE=.\sql_base.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -884,7 +884,7 @@ SOURCE=.\sql_class.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -912,7 +912,7 @@ SOURCE=.\sql_db.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -932,7 +932,7 @@ SOURCE=.\sql_delete.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -972,7 +972,7 @@ SOURCE=.\sql_insert.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -992,7 +992,7 @@ SOURCE=.\sql_lex.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1012,7 +1012,7 @@ SOURCE=.\sql_list.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1032,7 +1032,7 @@ SOURCE=.\sql_load.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1056,7 +1056,7 @@ SOURCE=.\sql_map.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1076,7 +1076,7 @@ SOURCE=.\sql_parse.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1108,7 +1108,7 @@ SOURCE=.\sql_select.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1128,7 +1128,7 @@ SOURCE=.\sql_show.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1148,7 +1148,7 @@ SOURCE=.\sql_string.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1168,7 +1168,7 @@ SOURCE=.\sql_table.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1188,7 +1188,7 @@ SOURCE=.\sql_test.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1216,7 +1216,7 @@ SOURCE=.\sql_update.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1236,7 +1236,7 @@ SOURCE=.\sql_yacc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1260,7 +1260,7 @@ SOURCE=.\thr_malloc.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1280,7 +1280,7 @@ SOURCE=.\time.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -1304,7 +1304,7 @@ SOURCE=.\unireg.cpp !ELSEIF "$(CFG)" == "mysqld - Win32 Max" -!ENDIF +!ENDIF # End Source File # End Target diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp index a60034d3ec6..f18f27f2086 100644 --- a/VC++Files/strings/strings.dsp +++ b/VC++Files/strings/strings.dsp @@ -7,19 +7,19 @@ CFG=strings - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "strings.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "strings.mak" CFG="strings - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "strings - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "strings - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -76,7 +76,7 @@ LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\strings.lib" -!ENDIF +!ENDIF # Begin Target diff --git a/client/mysql.cc b/client/mysql.cc index c1ce7f23d6e..a8417a01a6f 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -40,7 +40,7 @@ #include <signal.h> #include <violite.h> -const char *VER= "13.4"; +const char *VER= "13.5"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 @@ -802,6 +802,7 @@ static int get_options(int argc, char **argv) } if (argc == 1) { + skip_updates= 0; my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); current_db= my_strdup(*argv, MYF(MY_WME)); } diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 83c93ee3fca..3f85f0be008 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -28,7 +28,7 @@ #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES) char server_version[SERVER_VERSION_LENGTH]; -uint32 server_id = 0; +ulong server_id = 0; // needed by net_serv.c ulong bytes_sent = 0L, bytes_received = 0L; diff --git a/client/mysqltest.c b/client/mysqltest.c index 3dbcaf891ba..b8c81de66ec 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -92,7 +92,9 @@ #define DEFAULT_DELIMITER ';' enum {OPT_MANAGER_USER=256,OPT_MANAGER_HOST,OPT_MANAGER_PASSWD, - OPT_MANAGER_PORT,OPT_MANAGER_WAIT_TIMEOUT, OPT_SKIP_SAFEMALLOC}; + OPT_MANAGER_PORT,OPT_MANAGER_WAIT_TIMEOUT, OPT_SKIP_SAFEMALLOC, + OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH, + OPT_SSL_CIPHER}; static int record = 0, opt_sleep=0; static char *db = 0, *pass=0; @@ -129,6 +131,8 @@ static char delimiter= DEFAULT_DELIMITER; DYNAMIC_ARRAY q_lines; +#include "sslopt-vars.h" + typedef struct { char file[FN_REFLEN]; @@ -1007,13 +1011,6 @@ int do_sync_with_master2(const char* p) if (rpl_parse) mysql_enable_rpl_parse(mysql); -#ifndef TO_BE_REMOVED - /* - We need this because wait_for_pos() only waits for the relay log, - which doesn't guarantee that the slave has executed the statement. - */ - my_sleep(2*1000000L); -#endif return 0; } @@ -1460,6 +1457,11 @@ int do_connect(struct st_query* q) mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); +#ifdef HAVE_OPENSSL + if (opt_use_ssl) + mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, + opt_ssl_capath, opt_ssl_cipher); +#endif if (con_sock && !free_con_sock && *con_sock && *con_sock != FN_LIBCHAR) con_sock=fn_format(buff, con_sock, TMPDIR, "",0); if (!con_db[0]) @@ -1871,6 +1873,7 @@ static struct my_option my_long_options[] = {"socket", 'S', "Socket file to use for connection.", (gptr*) &unix_sock, (gptr*) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#include "sslopt-longopts.h" {"test-file", 'x', "Read test from/in this file (default stdin).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tmpdir", 't', "Temporary directory where sockets are put", @@ -1945,6 +1948,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else tty_password= 1; break; +#include <sslopt-case.h> case 't': strnmov(TMPDIR, argument, sizeof(TMPDIR)); break; @@ -2425,6 +2429,11 @@ int main(int argc, char** argv) if (opt_compress) mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); +#ifdef HAVE_OPENSSL + if (opt_use_ssl) + mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, + opt_ssl_capath, opt_ssl_cipher); +#endif cur_con->name = my_strdup("default", MYF(MY_WME)); if (!cur_con->name) @@ -2555,6 +2564,7 @@ int main(int argc, char** argv) break; case Q_COMMENT: /* Ignore row */ case Q_COMMENT_WITH_COMMAND: + break; case Q_PING: (void) mysql_ping(&cur_con->mysql); break; diff --git a/client/password.c b/client/password.c deleted file mode 100644 index 9b154603b98..00000000000 --- a/client/password.c +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* password checking routines */ -/***************************************************************************** - The main idea is that no password are sent between client & server on - connection and that no password are saved in mysql in a decodable form. - - On connection a random string is generated and sent to the client. - The client generates a new string with a random generator inited with - the hash values from the password and the sent string. - This 'check' string is sent to the server where it is compared with - a string generated from the stored hash_value of the password and the - random string. - - The password is saved (in user.password) by using the PASSWORD() function in - mysql. - - Example: - update user set password=PASSWORD("hello") where user="test" - This saves a hashed number as a string in the password field. -*****************************************************************************/ - -#include <my_global.h> -#include <my_sys.h> -#include <m_string.h> -#include "mysql.h" - - -void randominit(struct rand_struct *rand_st,ulong seed1, ulong seed2) -{ /* For mysql 3.21.# */ -#ifdef HAVE_purify - bzero((char*) rand_st,sizeof(*rand_st)); /* Avoid UMC varnings */ -#endif - rand_st->max_value= 0x3FFFFFFFL; - rand_st->max_value_dbl=(double) rand_st->max_value; - rand_st->seed1=seed1%rand_st->max_value ; - rand_st->seed2=seed2%rand_st->max_value; -} - -static void old_randominit(struct rand_struct *rand_st,ulong seed1) -{ /* For mysql 3.20.# */ - rand_st->max_value= 0x01FFFFFFL; - rand_st->max_value_dbl=(double) rand_st->max_value; - seed1%=rand_st->max_value; - rand_st->seed1=seed1 ; rand_st->seed2=seed1/2; -} - -double rnd(struct rand_struct *rand_st) -{ - rand_st->seed1=(rand_st->seed1*3+rand_st->seed2) % rand_st->max_value; - rand_st->seed2=(rand_st->seed1+rand_st->seed2+33) % rand_st->max_value; - return (((double) rand_st->seed1)/rand_st->max_value_dbl); -} - -void hash_password(ulong *result, const char *password) -{ - register ulong nr=1345345333L, add=7, nr2=0x12345671L; - ulong tmp; - for (; *password ; password++) - { - if (*password == ' ' || *password == '\t') - continue; /* skipp space in password */ - tmp= (ulong) (uchar) *password; - nr^= (((nr & 63)+add)*tmp)+ (nr << 8); - nr2+=(nr2 << 8) ^ nr; - add+=tmp; - } - result[0]=nr & (((ulong) 1L << 31) -1L); /* Don't use sign bit (str2int) */; - result[1]=nr2 & (((ulong) 1L << 31) -1L); - return; -} - -void make_scrambled_password(char *to,const char *password) -{ - ulong hash_res[2]; - hash_password(hash_res,password); - sprintf(to,"%08lx%08lx",hash_res[0],hash_res[1]); -} - -static inline uint char_val(char X) -{ - return (uint) (X >= '0' && X <= '9' ? X-'0' : - X >= 'A' && X <= 'Z' ? X-'A'+10 : - X-'a'+10); -} - -/* -** This code assumes that len(password) is divideable with 8 and that -** res is big enough (2 in mysql) -*/ - -void get_salt_from_password(ulong *res,const char *password) -{ - res[0]=res[1]=0; - if (password) - { - while (*password) - { - ulong val=0; - uint i; - for (i=0 ; i < 8 ; i++) - val=(val << 4)+char_val(*password++); - *res++=val; - } - } - return; -} - -void make_password_from_salt(char *to, ulong *hash_res) -{ - sprintf(to,"%08lx%08lx",hash_res[0],hash_res[1]); -} - - -/* - * Genererate a new message based on message and password - * The same thing is done in client and server and the results are checked. - */ - -char *scramble(char *to,const char *message,const char *password, - my_bool old_ver) -{ - struct rand_struct rand_st; - ulong hash_pass[2],hash_message[2]; - if (password && password[0]) - { - char *to_start=to; - hash_password(hash_pass,password); - hash_password(hash_message,message); - if (old_ver) - old_randominit(&rand_st,hash_pass[0] ^ hash_message[0]); - else - randominit(&rand_st,hash_pass[0] ^ hash_message[0], - hash_pass[1] ^ hash_message[1]); - while (*message++) - *to++= (char) (floor(rnd(&rand_st)*31)+64); - if (!old_ver) - { /* Make it harder to break */ - char extra=(char) (floor(rnd(&rand_st)*31)); - while (to_start != to) - *(to_start++)^=extra; - } - } - *to=0; - return to; -} - - -my_bool check_scramble(const char *scrambled, const char *message, - ulong *hash_pass, my_bool old_ver) -{ - struct rand_struct rand_st; - ulong hash_message[2]; - char buff[16],*to,extra; /* Big enough for check */ - const char *pos; - - hash_password(hash_message,message); - if (old_ver) - old_randominit(&rand_st,hash_pass[0] ^ hash_message[0]); - else - randominit(&rand_st,hash_pass[0] ^ hash_message[0], - hash_pass[1] ^ hash_message[1]); - to=buff; - for (pos=scrambled ; *pos ; pos++) - *to++=(char) (floor(rnd(&rand_st)*31)+64); - if (old_ver) - extra=0; - else - extra=(char) (floor(rnd(&rand_st)*31)); - to=buff; - while (*scrambled) - { - if (*scrambled++ != (char) (*to++ ^ extra)) - return 1; /* Wrong password */ - } - return 0; -} diff --git a/configure.in b/configure.in index 870be7376a3..2bcd58cc5cc 100644 --- a/configure.in +++ b/configure.in @@ -2401,7 +2401,11 @@ done dnl Always compile latin1 AC_DEFINE(HAVE_CHARSET_latin1) - + +dnl Always compile utf8 +AC_DEFINE(HAVE_CHARSET_utf8) +use_mb=yes + if test "$use_mb" = "yes" then AC_DEFINE(USE_MB) @@ -2586,7 +2590,7 @@ EOF echo "" echo "Configuring MIT Pthreads" # We will never install so installation paths are not needed. - (cd mit-pthreads; sh ./configure) + (cd mit-pthreads && sh ./configure) || exit 1 echo "End of MIT Pthreads configuration" echo "" LIBS="$MT_LD_ADD $LIBS" diff --git a/dbug/dbug.c b/dbug/dbug.c index 3f6c9b2f980..a4f9d5ecd4b 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -919,7 +919,6 @@ void _db_doprnt_ (const char *format,...) } (void) fprintf (_db_fp_, "%s: ", state->u_keyword); (void) vfprintf (_db_fp_, format, args); - va_end(args); (void) fputc('\n',_db_fp_); dbug_flush(state); errno=save_errno; diff --git a/include/Makefile.am b/include/Makefile.am index 8220424354d..7372d3ab417 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -16,16 +16,16 @@ # MA 02111-1307, USA BUILT_SOURCES = mysql_version.h m_ctype.h my_config.h -pkginclude_HEADERS = dbug.h m_string.h my_sys.h my_list.h my_xml.h \ +pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \ mysql.h mysql_com.h mysqld_error.h mysql_embed.h \ my_semaphore.h my_pthread.h my_no_pthread.h raid.h \ errmsg.h my_global.h my_net.h my_alloc.h \ - my_getopt.h sslopt-longopts.h typelib.h \ + my_getopt.h sslopt-longopts.h my_dir.h typelib.h \ sslopt-vars.h sslopt-case.h $(BUILT_SOURCES) noinst_HEADERS = config-win.h config-os2.h config-netware.h \ nisam.h heap.h merge.h my_bitmap.h\ myisam.h myisampack.h myisammrg.h ft_global.h\ - my_dir.h mysys_err.h my_base.h \ + mysys_err.h my_base.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_aes.h my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h \ diff --git a/include/m_ctype.h b/include/m_ctype.h index 8833b7df47e..29ea40eaf33 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -85,7 +85,8 @@ enum my_lex_states MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_COLON, MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, - MY_LEX_IDENT_OR_KEYWORD, MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, + MY_LEX_IDENT_OR_KEYWORD, + MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR, MY_LEX_STRING_OR_DELIMITER }; diff --git a/include/dbug.h b/include/my_dbug.h index 5c88e2e42db..5c88e2e42db 100644 --- a/include/dbug.h +++ b/include/my_dbug.h diff --git a/include/my_global.h b/include/my_global.h index dd1e8986ae2..40cd748699b 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -286,6 +286,7 @@ C_MODE_END #define CONFIG_SMP #include <asm/atomic.h> #endif +#include <errno.h> /* Recommended by debian */ /* Go around some bugs in different OS and compilers */ #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) @@ -416,7 +417,7 @@ typedef unsigned short ushort; #define DBUG_OFF #endif -#include <dbug.h> +#include <my_dbug.h> #define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/ #define ASCII_BITS_USED 8 /* Bit char used */ @@ -869,7 +870,13 @@ typedef char bool; /* Ordinary boolean values 0 1 */ ((uint32) (uchar) (A)[0]))) #define sint4korr(A) (*((long *) (A))) #define uint2korr(A) (*((uint16 *) (A))) +#ifdef HAVE_purify +#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\ + (((uint32) ((uchar) (A)[1])) << 8) +\ + (((uint32) ((uchar) (A)[2])) << 16)) +#else #define uint3korr(A) (long) (*((unsigned long *) (A)) & 0xFFFFFF) +#endif #define uint4korr(A) (*((unsigned long *) (A))) #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ diff --git a/include/my_sys.h b/include/my_sys.h index 7d754912823..b3be3588b2f 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -74,6 +74,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */ +#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ @@ -202,7 +203,6 @@ extern int (*fatal_error_handler_hook)(uint my_err, const char *str, /* charsets */ extern CHARSET_INFO *default_charset_info; -extern CHARSET_INFO *system_charset_info; extern CHARSET_INFO *all_charsets[256]; extern CHARSET_INFO compiled_charsets[]; @@ -219,9 +219,9 @@ extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); /* statistics */ -extern ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests, - _my_cache_read; -extern ulong _my_blocks_used,_my_blocks_changed; +extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests, + my_cache_read; +extern ulong my_blocks_used, my_blocks_changed; extern uint key_cache_block_size; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; extern my_bool key_cache_inited, my_init_done; diff --git a/include/myisam.h b/include/myisam.h index e06f9fc37ca..eb260537628 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -101,6 +101,7 @@ typedef struct st_mi_create_info ulong raid_chunksize; uint old_options; uint8 language; + my_bool with_auto_increment; } MI_CREATE_INFO; struct st_myisam_info; /* For referense */ diff --git a/include/mysql_com.h b/include/mysql_com.h index 7eac3b113d2..7a12413bc23 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -298,7 +298,7 @@ extern unsigned long net_buffer_length; void randominit(struct rand_struct *,unsigned long seed1, unsigned long seed2); -double rnd(struct rand_struct *); +double my_rnd(struct rand_struct *); void make_scrambled_password(char *to,const char *password, my_bool force_old_scramble,struct rand_struct *rand_st); int get_password_length(my_bool force_old_scramble); diff --git a/include/thr_lock.h b/include/thr_lock.h index cf59f4aaeb2..947b17bf2b6 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -111,6 +111,7 @@ void thr_unlock(THR_LOCK_DATA *data); int thr_multi_lock(THR_LOCK_DATA **data,uint count); void thr_multi_unlock(THR_LOCK_DATA **data,uint count); void thr_abort_locks(THR_LOCK *lock); +void thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread); void thr_print_locks(void); /* For debugging */ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data); my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data); diff --git a/include/violite.h b/include/violite.h index 4963fbb21e4..a5c063700b4 100644 --- a/include/violite.h +++ b/include/violite.h @@ -101,7 +101,7 @@ my_socket vio_fd(Vio*vio); /* * Remote peer's address and name in text form. */ -my_bool vio_peer_addr(Vio* vio, char *buf); +my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port); /* Remotes in_addr */ @@ -136,7 +136,7 @@ int vio_close_pipe(Vio * vio); #define vio_keepalive(vio, set_keep_alive) (vio)->viokeepalive(vio, set_keep_alive) #define vio_should_retry(vio) (vio)->should_retry(vio) #define vio_close(vio) ((vio)->vioclose)(vio) -#define vio_peer_addr(vio, buf) (vio)->peer_addr(vio, buf) +#define vio_peer_addr(vio, buf, prt) (vio)->peer_addr(vio, buf, prt) #define vio_in_addr(vio, in) (vio)->in_addr(vio, in) #endif /* defined(HAVE_VIO) && !defined(DONT_MAP_VIO) */ @@ -242,7 +242,7 @@ struct st_vio my_bool (*is_blocking)(Vio*); int (*viokeepalive)(Vio*, my_bool); int (*fastsend)(Vio*); - my_bool (*peer_addr)(Vio*, gptr); + my_bool (*peer_addr)(Vio*, gptr, uint16*); void (*in_addr)(Vio*, struct in_addr*); my_bool (*should_retry)(Vio*); int (*vioclose)(Vio*); diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 3c6ec424434..14d538a14bc 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -346,13 +346,21 @@ buf_page_print( ut_dulint_get_high(btr_page_get_index_id(read_buf)), ut_dulint_get_low(btr_page_get_index_id(read_buf))); - index = dict_index_find_on_id_low( + /* If the code is in ibbackup, dict_sys may be uninitialized, + i.e., NULL */ + + if (dict_sys != NULL) { + + index = dict_index_find_on_id_low( btr_page_get_index_id(read_buf)); - if (index) { - fprintf(stderr, "InnoDB: and table %s index %s\n", + if (index) { + fprintf(stderr, + "InnoDB: and table %s index %s\n", index->table_name, index->name); + } } + } else if (fil_page_get_type(read_buf) == FIL_PAGE_INODE) { fprintf(stderr, "InnoDB: Page may be an 'inode' page\n"); } else if (fil_page_get_type(read_buf) == FIL_PAGE_IBUF_FREE_LIST) { diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c index 4489b25ec2b..b847798586d 100644 --- a/innobase/ha/ha0ha.c +++ b/innobase/ha/ha0ha.c @@ -294,10 +294,10 @@ ha_print_info( { hash_cell_t* cell; /* ha_node_t* node; */ - ulint nodes = 0; +/* ulint nodes = 0; */ ulint cells = 0; - ulint len = 0; - ulint max_len = 0; +/* ulint len = 0; */ +/* ulint max_len = 0; */ ulint n_bufs; ulint i; diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h index 24cdecb7341..aec3ebfeea9 100644 --- a/innobase/include/srv0start.h +++ b/innobase/include/srv0start.h @@ -81,6 +81,7 @@ innobase_shutdown_for_mysql(void); extern ulint srv_sizeof_trx_t_in_ha_innodb_cc; +extern ibool srv_is_being_started; extern ibool srv_startup_is_before_trx_rollback_phase; extern ibool srv_is_being_shut_down; diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 82ed957b5fb..5ffcabf6fe6 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -196,7 +196,7 @@ os_file_get_last_error(void) err = (ulint) GetLastError(); - if (err != ERROR_FILE_EXISTS && err != ERROR_DISK_FULL) { + if (err != ERROR_DISK_FULL && err != ERROR_FILE_EXISTS) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Operating system error number %li in a file operation.\n" @@ -220,6 +220,8 @@ os_file_get_last_error(void) } } + fflush(stderr); + if (err == ERROR_FILE_NOT_FOUND) { return(OS_FILE_NOT_FOUND); } else if (err == ERROR_DISK_FULL) { @@ -232,7 +234,7 @@ os_file_get_last_error(void) #else err = (ulint) errno; - if (err != EEXIST && err != ENOSPC ) { + if (err != ENOSPC && err != EEXIST) { ut_print_timestamp(stderr); fprintf(stderr, @@ -256,6 +258,8 @@ os_file_get_last_error(void) } } + fflush(stderr); + if (err == ENOSPC ) { return(OS_FILE_DISK_FULL); #ifdef POSIX_ASYNC_IO @@ -278,7 +282,8 @@ static ibool os_file_handle_error( /*=================*/ - /* out: TRUE if we should retry the operation */ + /* out: TRUE if we should retry the + operation */ os_file_t file, /* in: file pointer */ char* name) /* in: name of a file or NULL */ { @@ -308,12 +313,15 @@ os_file_handle_error( os_has_said_disk_full = TRUE; + fflush(stderr); + return(FALSE); } else if (err == OS_FILE_AIO_RESOURCES_RESERVED) { return(TRUE); } else if (err == OS_FILE_ALREADY_EXISTS) { + return(FALSE); } else { if (name) { @@ -322,6 +330,8 @@ os_file_handle_error( fprintf(stderr, "InnoDB: Cannot continue operation.\n"); + fflush(stderr); + exit(1); } @@ -1063,7 +1073,17 @@ error_handling: if (retry) { goto try_again; } - + + fprintf(stderr, +"InnoDB: Fatal error: cannot read from file. OS error number %lu.\n", +#ifdef __WIN__ + (ulint)GetLastError() +#else + (ulint)errno +#endif + ); + fflush(stderr); + ut_error; return(FALSE); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 7cef63d1337..1bb33551da8 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -6,7 +6,7 @@ Contains also create table and other data dictionary operations. Created 9/17/2000 Heikki Tuuri *******************************************************/ - + #include "row0mysql.h" #ifdef UNIV_NONINL diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 1fc329fe2ca..fb508e7b1da 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2145,19 +2145,14 @@ row_sel_store_mysql_rec( extern_field_heap = NULL; } } else { - /* MySQL sometimes seems to copy the 'data' - pointed to by a BLOB field even if the field - has been marked to contain the SQL NULL value. - This caused seg faults reported by two users. - Set the BLOB length to 0 and the data pointer - to NULL to avoid a seg fault. */ - - if (templ->type == DATA_BLOB) { - row_sel_field_store_in_mysql_format( - mysql_rec + templ->mysql_col_offset, - templ->mysql_col_len, NULL, - 0, templ->type, templ->is_unsigned); - } + /* MySQL seems to assume the field for an SQL NULL + value is set to zero. Not taking this into account + caused seg faults with NULL BLOB fields, and + bug number 154 in the MySQL bug database: GROUP BY + and DISTINCT could treat NULL values inequal. */ + + memset(mysql_rec + templ->mysql_col_offset, '\0', + templ->mysql_col_len); if (!templ->mysql_null_bit_mask) { fprintf(stderr, diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 671ef4e5b22..33d4a30e227 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -577,8 +577,11 @@ open_or_create_log_file( || size_high != srv_calc_high32(srv_log_file_size)) { fprintf(stderr, - "InnoDB: Error: log file %s is of different size\n" - "InnoDB: than specified in the .cnf file!\n", name); +"InnoDB: Error: log file %s is of different size %lu %lu bytes\n" +"InnoDB: than specified in the .cnf file %lu %lu bytes!\n", + name, size_high, size, + srv_calc_high32(srv_log_file_size), + srv_calc_low32(srv_log_file_size)); return(DB_ERROR); } @@ -770,8 +773,13 @@ open_or_create_data_files( rounded_size_pages)) { fprintf(stderr, - "InnoDB: Error: data file %s is of a different size\n" - "InnoDB: than specified in the .cnf file!\n", name); +"InnoDB: Error: auto-extending data file %s is of a different size\n" +"InnoDB: %lu pages (rounded down to MB) than specified in the .cnf file:\n" +"InnoDB: initial %lu pages, max %lu (relevant if non-zero) pages!\n", + name, rounded_size_pages, + srv_data_file_sizes[i], srv_last_file_size_max); + + return(DB_ERROR); } srv_data_file_sizes[i] = @@ -782,8 +790,11 @@ open_or_create_data_files( != srv_data_file_sizes[i]) { fprintf(stderr, - "InnoDB: Error: data file %s is of a different size\n" - "InnoDB: than specified in the .cnf file!\n", name); +"InnoDB: Error: data file %s is of a different size\n" +"InnoDB: %lu pages (rounded down to MB)\n" +"InnoDB: than specified in the .cnf file %lu pages!\n", name, + rounded_size_pages, + srv_data_file_sizes[i]); return(DB_ERROR); } diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c index 1f0e0c58ac7..a9f8c5ad22c 100644 --- a/innobase/trx/trx0roll.c +++ b/innobase/trx/trx0roll.c @@ -21,6 +21,7 @@ Created 3/26/1996 Heikki Tuuri #include "que0que.h" #include "usr0sess.h" #include "srv0que.h" +#include "srv0start.h" #include "row0undo.h" #include "row0mysql.h" #include "lock0lock.h" @@ -29,6 +30,12 @@ Created 3/26/1996 Heikki Tuuri /* This many pages must be undone before a truncate is tried within rollback */ #define TRX_ROLL_TRUNC_THRESHOLD 1 +/* In crash recovery we set this to the undo n:o of the current trx to be +rolled back. Then we can print how many % the rollback has progressed. */ +ib_longlong trx_roll_max_undo_no; +/* Auxiliary variable which tells the previous progress % we printed */ +ulint trx_roll_progress_printed_pct; + /*********************************************************************** Rollback a transaction used in MySQL. */ @@ -174,6 +181,8 @@ trx_rollback_or_clean_all_without_sess(void) roll_node_t* roll_node; trx_t* trx; dict_table_t* table; + ib_longlong rows_to_undo; + char* unit = (char*)""; int err; mutex_enter(&kernel_mutex); @@ -219,8 +228,7 @@ loop: trx->sess = trx_dummy_sess; - if (trx->conc_state == TRX_COMMITTED_IN_MEMORY) { - + if (trx->conc_state == TRX_COMMITTED_IN_MEMORY) { fprintf(stderr, "InnoDB: Cleaning up trx with id %lu %lu\n", ut_dulint_get_high(trx->id), ut_dulint_get_low(trx->id)); @@ -248,9 +256,19 @@ loop: ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0)); - fprintf(stderr, "InnoDB: Rolling back trx with id %lu %lu\n", + trx_roll_max_undo_no = ut_conv_dulint_to_longlong(trx->undo_no); + trx_roll_progress_printed_pct = 0; + rows_to_undo = trx_roll_max_undo_no; + if (rows_to_undo > 1000000000) { + rows_to_undo = rows_to_undo / 1000000; + unit = (char*)"M"; + } + + fprintf(stderr, +"InnoDB: Rolling back trx with id %lu %lu, %lu%s rows to undo", ut_dulint_get_high(trx->id), - ut_dulint_get_low(trx->id)); + ut_dulint_get_low(trx->id), + (ulint)rows_to_undo, unit); mutex_exit(&kernel_mutex); if (trx->dict_operation) { @@ -300,7 +318,7 @@ loop: row_mysql_unlock_data_dictionary(trx); } - fprintf(stderr, "InnoDB: Rolling back of trx id %lu %lu completed\n", + fprintf(stderr, "\nInnoDB: Rolling back of trx id %lu %lu completed\n", ut_dulint_get_high(trx->id), ut_dulint_get_low(trx->id)); mem_heap_free(heap); @@ -614,6 +632,7 @@ trx_roll_pop_top_rec_of_trx( dulint undo_no; ibool is_insert; trx_rseg_t* rseg; + ulint progress_pct; mtr_t mtr; rseg = trx->rseg; @@ -676,6 +695,26 @@ try_again: ut_ad(ut_dulint_cmp(ut_dulint_add(undo_no, 1), trx->undo_no) == 0); + /* We print rollback progress info if we are in a crash recovery + and the transaction has at least 1000 row operations to undo */ + + if (srv_is_being_started && trx_roll_max_undo_no > 1000) { + progress_pct = 100 - (ulint) + ((ut_conv_dulint_to_longlong(undo_no) * 100) + / trx_roll_max_undo_no); + if (progress_pct != trx_roll_progress_printed_pct) { + if (trx_roll_progress_printed_pct == 0) { + fprintf(stderr, + "\nInnoDB: Progress in percents: %lu", progress_pct); + } else { + fprintf(stderr, + " %lu", progress_pct); + } + fflush(stderr); + trx_roll_progress_printed_pct = progress_pct; + } + } + trx->undo_no = undo_no; if (!trx_undo_arr_store_info(trx, undo_no)) { diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index 33c962772e8..1ae9f00ae1f 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -699,6 +699,9 @@ trx_sys_init_at_db_start(void) /*==========================*/ { trx_sysf_t* sys_header; + ib_longlong rows_to_undo = 0; + char* unit = (char*)""; + trx_t* trx; mtr_t mtr; mtr_start(&mtr); @@ -734,9 +737,28 @@ trx_sys_init_at_db_start(void) trx_lists_init_at_db_start(); if (UT_LIST_GET_LEN(trx_sys->trx_list) > 0) { + trx = UT_LIST_GET_FIRST(trx_sys->trx_list); + + for (;;) { + rows_to_undo += + ut_conv_dulint_to_longlong(trx->undo_no); + trx = UT_LIST_GET_NEXT(trx_list, trx); + + if (!trx) { + break; + } + } + + if (rows_to_undo > 1000000000) { + unit = (char*)"M"; + rows_to_undo = rows_to_undo / 1000000; + } + fprintf(stderr, - "InnoDB: %lu transaction(s) which must be rolled back or cleaned up\n", - UT_LIST_GET_LEN(trx_sys->trx_list)); +"InnoDB: %lu transaction(s) which must be rolled back or cleaned up\n" +"InnoDB: in total %lu%s row operations to undo\n", + UT_LIST_GET_LEN(trx_sys->trx_list), + (ulint)rows_to_undo, unit); fprintf(stderr, "InnoDB: Trx id counter is %lu %lu\n", ut_dulint_get_high(trx_sys->max_trx_id), diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index 1d5a5b19180..c366c034154 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -48,10 +48,6 @@ link_sources: rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../strings/$$f $(srcdir)/$$f; \ done; \ - for f in $$qs; do \ - rm -f $(srcdir)/$$f; \ - @LN_CP_F@ $(srcdir)/../sql/$$f $(srcdir)/$$f; \ - done; \ for f in $$ds; do \ rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../dbug/$$f $(srcdir)/$$f; \ @@ -61,7 +57,9 @@ link_sources: @LN_CP_F@ $(srcdir)/../mysys/$$f $(srcdir)/$$f; \ done; \ rm -f $(srcdir)/net.c; \ - @LN_CP_F@ $(srcdir)/../sql/net_serv.cc $(srcdir)/net.c + @LN_CP_F@ $(srcdir)/../sql/net_serv.cc $(srcdir)/net.c ; \ + rm -f $(srcdir)/password.c; \ + @LN_CP_F@ $(srcdir)/../sql/password.c $(srcdir)/password.c # This part requires GNUmake # diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index 9440d920719..60d6b320bb6 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -41,7 +41,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \ ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo \ ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \ - ctype-gb2312.lo ctype-gbk.lo ctype-latin1_de.lo \ + ctype-gb2312.lo ctype-gbk.lo \ ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo xml.lo mystringsextra= strto.c diff --git a/libmysql/get_password.c b/libmysql/get_password.c index 53eeb1080ce..e6221ea556e 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -23,7 +23,6 @@ #include "mysql.h" #include <m_string.h> #include <m_ctype.h> -#include <dbug.h> #if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE) #undef HAVE_GETPASS diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 564db0fe111..cc268101d38 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -192,9 +192,10 @@ my_bool my_connect(my_socket s, const struct sockaddr *name, struct timeval tv; time_t start_time, now_time; - /* If they passed us a timeout of zero, we should behave - * exactly like the normal connect() call does. - */ + /* + If they passed us a timeout of zero, we should behave + exactly like the normal connect() call does. + */ if (timeout == 0) return connect(s, (struct sockaddr*) name, namelen) != 0; @@ -247,12 +248,14 @@ my_bool my_connect(my_socket s, const struct sockaddr *name, tv.tv_sec = (long) timeout; tv.tv_usec = 0; #if defined(HPUX10) && defined(THREAD) - if ((res = select(s+1, NULL, (int*) &sfds, NULL, &tv)) >= 0) + if ((res = select(s+1, NULL, (int*) &sfds, NULL, &tv)) > 0) break; #else - if ((res = select(s+1, NULL, &sfds, NULL, &tv)) >= 0) + if ((res = select(s+1, NULL, &sfds, NULL, &tv)) > 0) break; #endif + if (res == 0) /* timeout */ + return -1; now_time=time(NULL); timeout-= (uint) (now_time - start_time); if (errno != EINTR || (int) timeout <= 0) @@ -274,7 +277,8 @@ my_bool my_connect(my_socket s, const struct sockaddr *name, errno = s_err; return(1); /* but return an error... */ } - return(0); /* It's all good! */ + return (0); /* ok */ + #endif } diff --git a/libmysql/password.c b/libmysql/password.c deleted file mode 100755 index e69de29bb2d..00000000000 --- a/libmysql/password.c +++ /dev/null diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 451ab3378d7..13e389b4dca 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -32,14 +32,14 @@ noinst_LIBRARIES = libmysqld_int.a pkglib_LIBRARIES = libmysqld.a SUBDIRS = . examples libmysqld_sources= libmysqld.c lib_sql.cc -libmysqlsources = errmsg.c get_password.c password.c +libmysqlsources = errmsg.c get_password.c noinst_HEADERS = embedded_priv.h sqlsources = convert.cc derror.cc field.cc field_conv.cc filesort.cc \ ha_innodb.cc ha_berkeley.cc ha_heap.cc ha_isam.cc ha_isammrg.cc \ ha_myisam.cc ha_myisammrg.cc handler.cc sql_handler.cc \ - hostname.cc init.cc \ + hostname.cc init.cc password.c \ item.cc item_buff.cc item_cmpfunc.cc item_create.cc \ item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \ item_uniq.cc item_subselect.cc item_row.cc\ diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 68a7b940220..12647a32713 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -504,6 +504,7 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } +#if 0 /* The same as Protocol::net_store_data but does the converstion */ bool Protocol::convert_str(const char *from, uint length) @@ -519,3 +520,4 @@ bool Protocol::convert_str(const char *from, uint length) return false; } +#endif diff --git a/libmysqld/lib_vio.c b/libmysqld/lib_vio.c index 6d4a09c6844..14c1366e5f9 100644 --- a/libmysqld/lib_vio.c +++ b/libmysqld/lib_vio.c @@ -33,7 +33,6 @@ #include <violite.h> #include <my_net.h> #include <m_string.h> -#include <dbug.h> #include <assert.h> #ifndef __WIN__ @@ -199,7 +198,7 @@ my_socket vio_fd(Vio* vio) } -my_bool vio_peer_addr(Vio * vio, char *buf) +my_bool vio_peer_addr(Vio * vio, char *buf, uint16 *port) { return(0); } diff --git a/man/perror.1 b/man/perror.1 index 38a51593ba1..2c5dd9a295f 100644 --- a/man/perror.1 +++ b/man/perror.1 @@ -1,17 +1,12 @@ .TH perror 1 "19 December 2000" "MySQL 3.23" "MySQL database" .SH NAME -.BR perror -can be used to display a description for a system error code, or an MyISAM/ISAM table handler error code. The error messages are mostly system dependent. -.SH USAGE -perror [OPTIONS] [ERRORCODE [ERRORCODE...]] +perror \- describes a system or MySQL error code. .SH SYNOPSIS -.B perror -.RB [ \-? | \-\-help ] -.RB [ \-I | \-\-info ] -.RB [ \-s | \-\-silent ] -.RB [ \-v | \-\-verbose ] -.RB [ \-V | \-\-version ] +perror [OPTIONS] [ERRORCODE [ERRORCODE...]] .SH DESCRIPTION +Can be used to display a description for a system error code, or an MyISAM/ISAM table handler error code. +The error messages are mostly system dependent. +.SH OPTIONS .TP .BR \-? | \-\-help Displays this help and exits. diff --git a/myisam/mi_check.c b/myisam/mi_check.c index d0e9d17a43b..a55096dd061 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -3824,7 +3824,7 @@ void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows) MI_KEYDEF *key=share->keyinfo; for (i=0 ; i < share->base.keys ; i++,key++) { - if (!(key->flag & (HA_NOSAME | HA_SPATIAL)) && + if (!(key->flag & (HA_NOSAME | HA_SPATIAL | HA_AUTO_KEY)) && ! mi_too_big_key_for_sort(key,rows) && info->s->base.auto_key != i+1) { share->state.key_map&= ~ ((ulonglong) 1 << i); diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 843a92d9d10..964845cc051 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -321,7 +321,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, if (keydef->flag & HA_BINARY_PACK_KEY) options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ - if (keydef->flag & HA_AUTO_KEY) + if (keydef->flag & HA_AUTO_KEY && ci->with_auto_increment) share.base.auto_key=i+1; for (j=0, keyseg=keydef->seg ; j < keydef->keysegs ; j++, keyseg++) { diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 1ed3ee78ffb..a2602abea5d 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -37,6 +37,14 @@ static void setup_key_functions(MI_KEYDEF *keyinfo); pos+=size;} +#define disk_pos_assert(pos, end_pos) \ +if (pos > end_pos) \ +{ \ + my_errno=HA_ERR_CRASHED; \ + goto err; \ +} + + /****************************************************************************** ** Return the shared struct if the table is already open. ** In MySQL the server will handle version issues. @@ -72,7 +80,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) key_parts,unique_key_parts,fulltext_keys,uniques; char name_buff[FN_REFLEN], org_name [FN_REFLEN], index_name[FN_REFLEN], data_name[FN_REFLEN]; - char *disk_cache,*disk_pos; + char *disk_cache, *disk_pos, *end_pos; MI_INFO info,*m_info,*old_info; MYISAM_SHARE share_buff,*share; ulong rec_per_key_part[MI_MAX_POSSIBLE_KEY*MI_MAX_KEY_SEG]; @@ -139,11 +147,12 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) info_length=mi_uint2korr(share->state.header.header_length); base_pos=mi_uint2korr(share->state.header.base_pos); - if (!(disk_cache=(char*) my_alloca(info_length))) + if (!(disk_cache=(char*) my_alloca(info_length+128))) { my_errno=ENOMEM; goto err; } + end_pos=disk_cache+info_length; errpos=2; VOID(my_seek(kfile,0L,MY_SEEK_SET,MYF(0))); @@ -288,6 +297,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) for (i=0 ; i < keys ; i++) { disk_pos=mi_keydef_read(disk_pos, &share->keyinfo[i]); + disk_pos_assert(disk_pos + share->keyinfo[i].keysegs * HA_KEYSEG_SIZE, + end_pos); if (share->keyinfo[i].key_alg == HA_KEY_ALG_RTREE) have_rtree=1; set_if_smaller(share->blocksize,share->keyinfo[i].block_length); @@ -361,6 +372,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) for (i=0 ; i < uniques ; i++) { disk_pos=mi_uniquedef_read(disk_pos, &share->uniqueinfo[i]); + disk_pos_assert(disk_pos + share->uniqueinfo[i].keysegs * + HA_KEYSEG_SIZE, end_pos); share->uniqueinfo[i].seg=pos; for (j=0 ; j < share->uniqueinfo[i].keysegs; j++,pos++) { @@ -384,6 +397,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) } } + disk_pos_assert(disk_pos + share->base.fields *MI_COLUMNDEF_SIZE, end_pos); for (i=j=offset=0 ; i < share->base.fields ; i++) { disk_pos=mi_recinfo_read(disk_pos,&share->rec[i]); diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c index b5da87355c6..8c7713c4b4d 100644 --- a/myisam/mi_test2.c +++ b/myisam/mi_test2.c @@ -646,13 +646,13 @@ int main(int argc, char *argv[]) (long) range_records > (long) records*14/10+2) { printf("mi_records_range for key: %d returned %ld; Should be about %ld\n", - i, range_records, records); + i, (long) range_records, (long) records); goto end; } if (verbose && records) { printf("mi_records_range returned %ld; Exact is %ld (diff: %4.2g %%)\n", - range_records,records, + (long) range_records, (long) records, labs((long) range_records-(long) records)*100.0/records); } @@ -667,7 +667,7 @@ int main(int argc, char *argv[]) { puts("Wrong info from mi_info"); printf("Got: records: %ld delete: %ld i_keys: %d\n", - info.records,info.deleted,info.keys); + (long) info.records, (long) info.deleted,info.keys); } if (verbose) { @@ -822,8 +822,8 @@ w_requests: %10lu\n\ writes: %10lu\n\ r_requests: %10lu\n\ reads: %10lu\n", - _my_blocks_used,_my_cache_w_requests, _my_cache_write, - _my_cache_r_requests,_my_cache_read); + my_blocks_used, my_cache_w_requests, my_cache_write, + my_cache_r_requests, my_cache_read); } end_key_cache(); if (blob_buffer) diff --git a/myisam/rt_index.c b/myisam/rt_index.c index e3f64940203..f02d6121eb5 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -188,6 +188,12 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag) uint nod_cmp_flag; MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; + if (info->update & HA_STATE_DELETED) + { + return rtree_find_first(info, keynr, info->lastkey, info->lastkey_length, + search_flag); + } + if (!info->buff_used) { uchar *key = info->int_keypos; @@ -814,6 +820,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) goto err1; info->s->state.key_root[keynr] = new_root; } + info->update= HA_STATE_DELETED; return 0; err1: @@ -911,7 +918,7 @@ ha_rows rtree_estimate(MI_INFO *info, uint keynr, uchar *key, if (nod_flag) { if (i) - res = (int)(area / i * info->state->records); + res = (ha_rows) (area / i * info->state->records); else res = HA_POS_ERROR; } diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 82c2b1f8510..f669d217026 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -47,7 +47,7 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, dlen = _mi_calc_blob_length(keyseg->bit_start, pos); memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*)); - sp_mbr_from_wkb(dptr, dlen, SPDIMS, mbr); + sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */ for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) { @@ -56,6 +56,31 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, pos = ((byte*)mbr) + keyseg->start; if (keyseg->flag & HA_SWAP_KEY) { +#ifdef HAVE_ISNAN + if (keyseg->type == HA_KEYTYPE_FLOAT) + { + float nr; + float4get(nr, pos); + if (isnan(nr)) + { + /* Replace NAN with zero */ + bzero(key, length); + key+= length; + continue; + } + } + else if (keyseg->type == HA_KEYTYPE_DOUBLE) + { + double nr; + float8get(nr, pos); + if (isnan(nr)) + { + bzero(key, length); + key+= length; + continue; + } + } +#endif pos += length; while (length--) { @@ -99,19 +124,19 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, double *mbr) { double ord; - double *mbr_end = mbr + n_dims * 2; + double *mbr_end= mbr + n_dims * 2; while (mbr < mbr_end) { if ((*wkb) > end - 8) return -1; float8get(ord, (*wkb)); - (*wkb) += 8; + (*wkb)+= 8; if (ord < *mbr) - *mbr = ord; + float8store((char*) mbr, ord); mbr++; if (ord > *mbr) - *mbr = ord; + float8store((char*) mbr, ord); mbr++; } return 0; diff --git a/myisam/sp_test.c b/myisam/sp_test.c index 7ae41c2088c..7021cb4a8ee 100644 --- a/myisam/sp_test.c +++ b/myisam/sp_test.c @@ -272,7 +272,7 @@ int run_test(const char *filename) create_key(key, nrecords*upd); print_key(key," INTERSECT\n"); hrows=mi_records_in_range(file,0,key,0,HA_READ_MBR_INTERSECT,record+1,0,0); - printf(" %ld rows\n",hrows); + printf(" %ld rows\n", (long) hrows); if (mi_close(file)) goto err; diff --git a/mysql-test/include/have_openssl_1.inc b/mysql-test/include/have_openssl_1.inc index 4d3646abdc2..887309c7e23 100644 --- a/mysql-test/include/have_openssl_1.inc +++ b/mysql-test/include/have_openssl_1.inc @@ -1,4 +1,4 @@ -- require r/have_openssl_1.require disable_query_log; -show variables like "have_openssl"; +SHOW STATUS LIKE 'Ssl_cipher'; enable_query_log; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index db1fab7a50d..8e0490f441e 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -208,6 +208,7 @@ DBUSER="" START_WAIT_TIMEOUT=10 STOP_WAIT_TIMEOUT=10 TEST_REPLICATION=0 +MYSQL_TEST_SSL_OPTS="" while test $# -gt 0; do case "$1" in @@ -238,7 +239,10 @@ while test $# -gt 0; do EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \ --ssl-ca=$BASEDIR/SSL/cacert.pem \ --ssl-cert=$BASEDIR/SSL/server-cert.pem \ - --ssl-key=$BASEDIR/SSL/server-key.pem" ;; + --ssl-key=$BASEDIR/SSL/server-key.pem" + MYSQL_TEST_SSL_OPTS="--ssl-ca=$BASEDIR/SSL/cacert.pem \ + --ssl-cert=$BASEDIR/SSL/client-cert.pem \ + --ssl-key=$BASEDIR/SSL/client-key.pem" ;; --no-manager | --skip-manager) USE_MANAGER=0 ;; --manager) USE_MANAGER=1 @@ -330,7 +334,7 @@ while test $# -gt 0; do USE_RUNNING_SERVER="" ;; --valgrind) - VALGRIND="valgrind --alignment=8 --leak-check=yes" + VALGRIND="valgrind --alignment=8 --leak-check=yes --num-callers=16" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc" SLEEP_TIME_AFTER_RESTART=10 @@ -353,7 +357,8 @@ while test $# -gt 0; do --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \ --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace" - EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT --debug" + EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \ + --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace" ;; --fast) FAST_START=1 @@ -493,7 +498,7 @@ fi MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ - --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT" + --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS" MYSQL_TEST_BIN=$MYSQL_TEST MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS" GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client @@ -812,8 +817,8 @@ start_master() fi # Remove stale binary logs $RM -f $MYSQL_TEST_DIR/var/log/master-bin.* - # Remove old master.info files - $RM -f $MYSQL_TEST_DIR/var/master-data/master.info + # Remove old master.info and relay-log.info files + $RM -f $MYSQL_TEST_DIR/var/master-data/master.info $MYSQL_TEST_DIR/var/master-data/relay-log.info #run master initialization shell script if one exists @@ -917,7 +922,7 @@ start_slave() slave_port=`expr $SLAVE_MYPORT + $1` slave_log="$SLAVE_MYLOG.$1" slave_err="$SLAVE_MYERR.$1" - slave_datadir="var/$slave_ident-data/" + slave_datadir="$SLAVE_MYDDIR/../$slave_ident-data/" slave_pid="$MYRUN_DIR/mysqld-$slave_ident.pid" slave_sock="$SLAVE_MYSOCK-$1" else @@ -932,7 +937,7 @@ start_slave() fi # Remove stale binary logs and old master.info files $RM -f $MYSQL_TEST_DIR/var/log/$slave_ident-*bin.* - $RM -f $MYSQL_TEST_DIR/$slave_datadir/master.info + $RM -f $slave_datadir/master.info $slave_datadir/relay-log.info #run slave initialization shell script if one exists if [ -f "$slave_init_script" ] ; @@ -1161,7 +1166,7 @@ run_testcase () echo "CURRENT_TEST: $tname" >> $MASTER_MYERR start_master else - if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] ; + if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || [ -f $master_init_script ] then EXTRA_MASTER_OPT="" stop_master diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 48882f42219..60764494417 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -1,6 +1,6 @@ drop table if exists t1,t2; -create table t1 (i int, j int); -insert into t1 values (1,2), (3,4), (5,6), (7,8); +create table t1 (i int, j int, empty_string char(10), bool char(1), d date); +insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); select count(*) from t1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype count(*) 4 4 1 1 0 0 4.0000 0.0000 ENUM('4') NOT NULL @@ -8,11 +8,24 @@ select * from t1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +select * from t1 procedure analyse(2); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +t1.i 1 7 1 1 0 0 4.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +t1.j 2 8 1 1 0 0 5.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL create table t2 select * from t1 procedure analyse(); select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL drop table t1,t2; EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 66efd2ba567..e79e6aab56b 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -84,6 +84,16 @@ ordid ord 3 sdj 1 zzz drop table t1; +create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id)); +create table t2 (sid char(20), id int(2)); +insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL); +insert into t1 select * from t2; +select * from t1; +sid id +skr 1 +skr 2 +test 1 +drop table t1,t2; create table t1 (a int not null primary key auto_increment); insert into t1 values (0); update t1 set a=0; diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index e4f41517f94..e53c3c3eb55 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -1,20 +1,25 @@ set SQL_LOG_BIN=0; drop table if exists t1, t2, t3; -create table t1(n int); -backup table t1 to '../bogus'; +create table t4(n int); +backup table t4 to '../bogus'; Table Op Msg_type Msg_text -test.t1 backup error Failed copying .frm file: errno = X -test.t1 backup status Operation failed -backup table t1 to '../tmp'; +test.t4 backup error Failed copying .frm file (errno: X) +test.t4 backup status Operation failed +backup table t4 to '../tmp'; Table Op Msg_type Msg_text -test.t1 backup status OK -drop table t1; -restore table t1 from '../tmp'; +test.t4 backup status OK +backup table t4 to '../tmp'; Table Op Msg_type Msg_text -test.t1 restore status OK -select count(*) from t1; +test.t4 backup error Failed copying .frm file (errno: X) +test.t4 backup status Operation failed +drop table t4; +restore table t4 from '../tmp'; +Table Op Msg_type Msg_text +test.t4 restore status OK +select count(*) from t4; count(*) 0 +create table t1(n int); insert into t1 values (23),(45),(67); backup table t1 to '../tmp'; Table Op Msg_type Msg_text @@ -35,9 +40,8 @@ create table t2(m int not null primary key); create table t3(k int not null primary key); insert into t2 values (123),(145),(167); insert into t3 values (223),(245),(267); -backup table t1,t2,t3 to '../tmp'; +backup table t2,t3 to '../tmp'; Table Op Msg_type Msg_text -test.t1 backup status OK test.t2 backup status OK test.t3 backup status OK drop table t1,t2,t3; @@ -61,13 +65,14 @@ k 223 245 267 -drop table t1,t2,t3; +drop table t1,t2,t3,t4; restore table t1 from '../tmp'; Table Op Msg_type Msg_text test.t1 restore status OK -lock tables t1 write; -backup table t1 to '../tmp'; +rename table t1 to t5; +lock tables t5 write; +backup table t5 to '../tmp'; unlock tables; Table Op Msg_type Msg_text -test.t1 backup status OK -drop table t1; +test.t5 backup status OK +drop table t5; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 5228ae50a83..0780b97890f 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -62,6 +62,15 @@ a$1 $b c$ create table test_$1.test2$ (a int); drop table test_$1.test2$; drop database test_$1; +create table `` (a int); +Incorrect table name '' +drop table if exists ``; +Incorrect table name '' +create table t1 (`` int); +Incorrect column name '' +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' create table t1 (a int auto_increment not null primary key, B CHAR(20)); insert into t1 (b) values ("hello"),("my"),("world"); create table t2 (key (b)) select * from t1; @@ -244,3 +253,26 @@ Incorrect table name 'a/a' drop table t1, t2, t3; drop table t3; drop database test_$1; +SET SESSION table_type="heap"; +SELECT @@table_type; +@@table_type +HEAP +CREATE TABLE t1 (a int not null); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0' +) TYPE=HEAP CHARSET=latin1 +drop table t1; +SET SESSION table_type="gemini"; +SELECT @@table_type; +@@table_type +GEMINI +CREATE TABLE t1 (a int not null); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0' +) TYPE=MyISAM CHARSET=latin1 +SET SESSION table_type=default; +drop table t1; diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index a2ff8a606cb..a0150dc485a 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -92,7 +92,7 @@ z Ä ä ß -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_de; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci; latin1_f A a @@ -121,7 +121,7 @@ Y y Z z -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci; latin1_f A a @@ -181,7 +181,7 @@ z ü SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' -SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A a @@ -210,7 +210,7 @@ z Ä ä ß -SELECT latin1_f COLLATE latin1_de AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A a @@ -239,7 +239,7 @@ Y y Z z -SELECT latin1_f COLLATE latin1_ci_as AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A a @@ -268,7 +268,7 @@ Y y Z z -SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A AD @@ -297,7 +297,7 @@ z ä å ü -SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; latin1_f count(*) @@ -329,7 +329,7 @@ Z 2 Å 2 Ä 2 ß 1 -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_de; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci; latin1_f count(*) A 4 AD 2 @@ -344,7 +344,7 @@ UE 2 Ü 2 Y 2 Z 2 -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci; latin1_f count(*) A 2 AD 2 @@ -391,7 +391,7 @@ z 1 ü 1 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' -SELECT DISTINCT latin1_f FROM t1; +SELECT DISTINCT latin1_f FROM t1; latin1_f A AD @@ -406,7 +406,7 @@ UE SS ß Z -SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; latin1_f COLLATE latin1 A AD @@ -421,8 +421,8 @@ UE SS ß Z -SELECT DISTINCT latin1_f COLLATE latin1_de FROM t1; -latin1_f COLLATE latin1_de +SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1; +latin1_f COLLATE latin1_german2_ci A AD AE @@ -436,8 +436,8 @@ SS ß Y Z -SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1; -latin1_f COLLATE latin1_ci_as +SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1; +latin1_f COLLATE latin1_general_ci A AD AE @@ -452,7 +452,7 @@ SS ß Y Z -SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; latin1_f COLLATE latin1_bin A a @@ -481,7 +481,7 @@ Y y Z z -SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; +SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' SHOW CREATE TABLE t1; Table Create Table @@ -523,7 +523,7 @@ Variable_name Value client_collation latin1 SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' -latin1 latin1 2 1 +latin1 latin1 3 1 SET NAMES latin1 COLLATE latin1_bin; SHOW VARIABLES LIKE 'client_collation'; Variable_name Value @@ -538,35 +538,35 @@ Variable_name Value client_collation latin1_bin SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' -latin1 latin1_bin 2 0 +latin1 latin1_bin 3 0 SET NAMES koi8r; SHOW VARIABLES LIKE 'client_collation'; Variable_name Value client_collation koi8r SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' -latin1 latin1 2 1 +latin1 latin1 3 1 SET COLLATION koi8r_bin; SHOW VARIABLES LIKE 'client_collation'; Variable_name Value client_collation koi8r_bin SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' -latin1 latin1 2 1 +latin1 latin1 3 1 SET COLLATION DEFAULT; SHOW VARIABLES LIKE 'client_collation'; Variable_name Value client_collation koi8r SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' -latin1 latin1 2 1 +latin1 latin1 3 1 SET NAMES DEFAULT; SHOW VARIABLES LIKE 'client_collation'; Variable_name Value client_collation latin1 SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; charset('a') collation('a') coercibility('a') 'a'='A' -latin1 latin1 2 1 +latin1 latin1 3 1 SET NAMES latin1 COLLATE koi8r; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' SET NAMES 'DEFAULT'; diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index e5ae6f249ee..b79bc67138c 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -1,93 +1,95 @@ drop table if exists t1; -create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b)); +create table t1 (a char (20) not null, b int not null auto_increment, index (a,b)); insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb'); insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf'); insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb'); insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa'); insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae'); -insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'); +insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a'); select a,b from t1 order by a,b; a b -a 35 -ac 2 -ad 4 +a 1 +a 2 +ac 1 +ad 1 ä 1 -ae 3 -ää 31 -aeae 33 -ääa 32 -aeb 6 -Äc 5 -é 38 -É 39 -eä 28 -o 37 -oc 15 -od 18 -ö 14 -oe 17 -Öa 16 -oeb 20 -Öc 19 -öo 30 -q 34 -s 21 -ss 22 -ß 23 -ssa 25 -ßa 27 -ßb 24 -ssc 26 -u 36 -uc 8 -ud 10 -ue 9 -Ü 11 -ueb 12 -üc 7 -uf 13 -uü 29 +ae 2 +ää 1 +aeae 2 +ääa 1 +aeb 1 +Äc 1 +é 1 +É 2 +eä 1 +o 1 +oc 1 +od 1 +ö 1 +oe 2 +Öa 1 +oeb 1 +Öc 1 +öo 1 +q 1 +s 1 +ss 1 +ß 2 +ssa 1 +ßa 2 +ßb 1 +ssc 1 +u 1 +uc 1 +ud 1 +ue 1 +Ü 2 +ueb 1 +üc 1 +uf 1 +uü 1 select a,b from t1 order by upper(a),b; a b -a 35 -ac 2 -ad 4 +a 1 +a 2 +ac 1 +ad 1 ä 1 -ae 3 -ää 31 -aeae 33 -ääa 32 -aeb 6 -Äc 5 -é 38 -É 39 -eä 28 -o 37 -oc 15 -od 18 -ö 14 -oe 17 -Öa 16 -oeb 20 -Öc 19 -öo 30 -q 34 -s 21 -ss 22 -ß 23 -ssa 25 -ßa 27 -ßb 24 -ssc 26 -u 36 -uc 8 -ud 10 -ue 9 -Ü 11 -ueb 12 -üc 7 -uf 13 -uü 29 +ae 2 +ää 1 +aeae 2 +ääa 1 +aeb 1 +Äc 1 +é 1 +É 2 +eä 1 +o 1 +oc 1 +od 1 +ö 1 +oe 2 +Öa 1 +oeb 1 +Öc 1 +öo 1 +q 1 +s 1 +ss 1 +ß 2 +ssa 1 +ßa 2 +ßb 1 +ssc 1 +u 1 +uc 1 +ud 1 +ue 1 +Ü 2 +ueb 1 +üc 1 +uf 1 +uü 1 select a from t1 order by a desc; a uü @@ -129,44 +131,46 @@ ae ad ac a +a check table t1; Table Op Msg_type Msg_text test.t1 check status OK select * from t1 where a like "ö%"; a b -ö 14 -Öa 16 -Öc 19 -öo 30 +ö 1 +Öa 1 +Öc 1 +öo 1 select * from t1 where a like binary "%É%"; a b -É 39 +É 2 select * from t1 where a like "%Á%"; a b -a 35 -ac 2 -ad 4 -ae 3 -aeae 33 -ääa 32 -aeb 6 -Öa 16 -ssa 25 -ßa 27 +a 1 +a 2 +ac 1 +ad 1 +ae 2 +aeae 2 +ääa 1 +aeb 1 +Öa 1 +ssa 1 +ßa 2 select * from t1 where a like "%U%"; a b -u 36 -uc 8 -ud 10 -ue 9 -ueb 12 -uf 13 -uü 29 +u 1 +uc 1 +ud 1 +ue 1 +ueb 1 +uf 1 +uü 1 select * from t1 where a like "%ss%"; a b -ss 22 -ssa 25 -ssc 26 +ss 1 +ssa 1 +ssc 1 drop table t1; select strcmp('ä','ae'),strcmp('ae','ä'),strcmp('aeq','äq'),strcmp('äq','aeq'); strcmp('ä','ae') strcmp('ae','ä') strcmp('aeq','äq') strcmp('äq','aeq') diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index 096ddf8188b..4d31ab6c274 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -1327,10 +1327,10 @@ INSERT INTO t1 (ucs2_f,comment) VALUES (0x0565,'ARMENIAN SMALL ECH'); INSERT INTO t1 (ucs2_f,comment) VALUES (0x0566,'ARMENIAN SMALL ZA'); ALTER TABLE t1 ADD armscii8_f CHAR(32) CHARACTER SET armscii8 NOT NULL; ALTER TABLE t1 ADD greek_f CHAR(32) CHARACTER SET greek NOT NULL; -UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE 'GRE%'; -UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE 'ARM%'; -UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=''; -UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=''; +UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE%'; +UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%'; +UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8''; +UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2''; SELECT * FROM t1; comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f LAT SMALL A a a a a diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 4fa85ea9cbc..ae216f9b380 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -24,11 +24,26 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; -CREATE TABLE `t` ( +CREATE TABLE `t1` ( `i` int(10) NOT NULL default '0', `i2` int(10) NOT NULL default '0', PRIMARY KEY (`i`) -) TYPE=MyISAM CHARSET=latin1; -DELETE FROM t USING t WHERE post='1'; +); +DELETE FROM t1 USING t1 WHERE post='1'; Unknown column 'post' in 'where clause' -drop table if exists t; +drop table t1; +CREATE TABLE t1 ( +bool char(0) default NULL, +not_null varchar(20) binary NOT NULL default '', +misc integer not null, +PRIMARY KEY (not_null) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); +select * from t1 where misc > 5 and bool is null; +bool not_null misc +NULL c 6 +NULL d 7 +delete from t1 where misc > 5 and bool is null; +select * from t1 where misc > 5 and bool is null; +bool not_null misc +drop table t1; diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index c2085ba12da..f90e694f5f0 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -1,10 +1,20 @@ drop table if exists t1; create table t1 (a varchar(10), key(a)); insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +explain select * from t1 where a like 'abc%'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 1 Using where; Using index +explain select * from t1 where a like concat('abc','%'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 1 Using where; Using index select * from t1 where a like "abc%"; a abc abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd select * from t1 where a like "ABC%"; a abc diff --git a/mysql-test/r/func_system.result b/mysql-test/r/func_system.result index 83c2ad6e020..83e78a30396 100644 --- a/mysql-test/r/func_system.result +++ b/mysql-test/r/func_system.result @@ -1,8 +1,8 @@ select database(),user() like "%@%"; database() user() like "%@%" test 1 -select version()>="3.23.29"; -version()>="3.23.29" +select version()>=_utf8"3.23.29"; +version()>=_utf8"3.23.29" 1 select TRUE,FALSE,NULL; TRUE FALSE NULL diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index 9fcf03db838..d415b77692b 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -49,6 +49,9 @@ select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; select 10 % 7, 10 mod 7, 10 div 3; 10 % 7 10 mod 7 10 div 3 3 3 3 +select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; +(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2 +18446744073709551615 18446744073709551615 9223372036854775807 select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; 5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 0 1 diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result new file mode 100644 index 00000000000..173a065adc2 --- /dev/null +++ b/mysql-test/r/gis-rtree.result @@ -0,0 +1,712 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +g GEOMETRY NOT NULL, +SPATIAL KEY(g) +) TYPE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fid` int(11) NOT NULL auto_increment, + `g` geometry NOT NULL default '', + PRIMARY KEY (`fid`), + SPATIAL KEY `g` (`g`(32)) +) TYPE=MyISAM CHARSET=latin1 +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(148 148, 152 152)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(147 147, 153 153)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(146 146, 154 154)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(145 145, 155 155)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(144 144, 156 156)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(143 143, 157 157)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(142 142, 158 158)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(141 141, 159 159)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(140 140, 160 160)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(139 139, 161 161)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(138 138, 162 162)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(137 137, 163 163)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(136 136, 164 164)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(135 135, 165 165)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(134 134, 166 166)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(133 133, 167 167)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(132 132, 168 168)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(131 131, 169 169)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(130 130, 170 170)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(129 129, 171 171)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(128 128, 172 172)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(127 127, 173 173)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(126 126, 174 174)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(125 125, 175 175)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(124 124, 176 176)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(123 123, 177 177)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(122 122, 178 178)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(121 121, 179 179)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(120 120, 180 180)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(119 119, 181 181)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(118 118, 182 182)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(117 117, 183 183)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(116 116, 184 184)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(115 115, 185 185)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(114 114, 186 186)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(113 113, 187 187)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(112 112, 188 188)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(111 111, 189 189)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(110 110, 190 190)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(109 109, 191 191)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(108 108, 192 192)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(107 107, 193 193)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(106 106, 194 194)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(105 105, 195 195)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(104 104, 196 196)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(103 103, 197 197)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(102 102, 198 198)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(101 101, 199 199)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(100 100, 200 200)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(99 99, 201 201)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(98 98, 202 202)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(97 97, 203 203)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(96 96, 204 204)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(95 95, 205 205)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(94 94, 206 206)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(93 93, 207 207)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(92 92, 208 208)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(91 91, 209 209)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(90 90, 210 210)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(89 89, 211 211)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(88 88, 212 212)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(87 87, 213 213)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(86 86, 214 214)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(85 85, 215 215)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(84 84, 216 216)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(83 83, 217 217)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(82 82, 218 218)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(81 81, 219 219)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(80 80, 220 220)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(79 79, 221 221)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(78 78, 222 222)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(77 77, 223 223)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(76 76, 224 224)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(75 75, 225 225)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(74 74, 226 226)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(73 73, 227 227)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(72 72, 228 228)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(71 71, 229 229)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(70 70, 230 230)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(69 69, 231 231)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(68 68, 232 232)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(67 67, 233 233)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(66 66, 234 234)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(65 65, 235 235)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(64 64, 236 236)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(63 63, 237 237)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(62 62, 238 238)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(61 61, 239 239)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(60 60, 240 240)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(59 59, 241 241)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(58 58, 242 242)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(57 57, 243 243)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(56 56, 244 244)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(55 55, 245 245)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(54 54, 246 246)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(53 53, 247 247)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(52 52, 248 248)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(51 51, 249 249)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(50 50, 250 250)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(49 49, 251 251)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(48 48, 252 252)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(47 47, 253 253)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(46 46, 254 254)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(45 45, 255 255)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(44 44, 256 256)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(43 43, 257 257)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(42 42, 258 258)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(41 41, 259 259)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(40 40, 260 260)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(39 39, 261 261)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(38 38, 262 262)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(37 37, 263 263)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(36 36, 264 264)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(35 35, 265 265)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(34 34, 266 266)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(33 33, 267 267)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(32 32, 268 268)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(31 31, 269 269)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(30 30, 270 270)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(29 29, 271 271)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(28 28, 272 272)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(27 27, 273 273)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(26 26, 274 274)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(25 25, 275 275)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(24 24, 276 276)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(23 23, 277 277)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(22 22, 278 278)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(21 21, 279 279)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(20 20, 280 280)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(19 19, 281 281)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(18 18, 282 282)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(17 17, 283 283)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(16 16, 284 284)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(15 15, 285 285)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(14 14, 286 286)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(13 13, 287 287)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(12 12, 288 288)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(11 11, 289 289)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(10 10, 290 290)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(9 9, 291 291)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(8 8, 292 292)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(7 7, 293 293)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(6 6, 294 294)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(5 5, 295 295)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(4 4, 296 296)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(3 3, 297 297)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(2 2, 298 298)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 1, 299 299)')); +SELECT count(*) FROM t1; +count(*) +150 +EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range g g 32 NULL 4 Using where +SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); +fid AsText(g) +1 LINESTRING(150 150,150 150) +11 LINESTRING(140 140,160 160) +2 LINESTRING(149 149,151 151) +3 LINESTRING(148 148,152 152) +4 LINESTRING(147 147,153 153) +5 LINESTRING(146 146,154 154) +6 LINESTRING(145 145,155 155) +7 LINESTRING(144 144,156 156) +8 LINESTRING(143 143,157 157) +9 LINESTRING(142 142,158 158) +10 LINESTRING(141 141,159 159) +DROP TABLE t1; +CREATE TABLE t2 ( +fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +g GEOMETRY NOT NULL +) TYPE=MyISAM; +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))); +INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))); +ALTER TABLE t2 ADD SPATIAL KEY(g); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `fid` int(11) NOT NULL auto_increment, + `g` geometry NOT NULL default '', + PRIMARY KEY (`fid`), + SPATIAL KEY `g` (`g`(32)) +) TYPE=MyISAM CHARSET=latin1 +SELECT count(*) FROM t2; +count(*) +100 +EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g, +GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range g g 32 NULL 4 Using where +SELECT fid, AsText(g) FROM t2 WHERE Within(g, +GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +fid AsText(g) +45 LINESTRING(51 51,60 60) +55 LINESTRING(41 51,50 60) +56 LINESTRING(41 41,50 50) +46 LINESTRING(51 41,60 50) +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +99 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +98 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +97 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +96 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +95 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +94 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +93 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +92 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +91 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +90 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +89 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +88 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +87 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +86 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +85 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +84 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +83 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +82 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +81 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +80 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +79 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +78 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +77 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +76 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +75 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +74 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +73 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +72 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +71 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +70 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +69 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +68 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +67 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +66 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +65 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +64 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +63 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +62 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +61 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +60 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +59 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +58 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +57 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +56 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +55 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +54 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +53 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +52 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +51 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +50 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +49 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +48 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +47 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +46 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +45 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +44 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +43 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +42 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +41 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +40 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +39 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +38 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +37 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +36 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +35 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +34 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +33 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +32 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +31 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +30 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +29 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +28 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +27 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +26 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +25 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +24 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +23 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +22 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +21 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +20 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +19 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +18 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +17 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +16 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +15 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +14 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +13 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +12 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +11 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +10 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))))); +SELECT count(*) FROM t2; +count(*) +9 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))))); +SELECT count(*) FROM t2; +count(*) +8 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))))); +SELECT count(*) FROM t2; +count(*) +7 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))))); +SELECT count(*) FROM t2; +count(*) +6 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))))); +SELECT count(*) FROM t2; +count(*) +5 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))))); +SELECT count(*) FROM t2; +count(*) +4 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))))); +SELECT count(*) FROM t2; +count(*) +3 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))))); +SELECT count(*) FROM t2; +count(*) +2 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))))); +SELECT count(*) FROM t2; +count(*) +1 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))))); +SELECT count(*) FROM t2; +count(*) +0 +DROP TABLE t2; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 25c3d14212b..3771245bff9 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -7,6 +7,38 @@ CREATE TABLE mls (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING); CREATE TABLE mp (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON); CREATE TABLE gc (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION); CREATE TABLE geo (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); +SHOW FIELDS FROM pt; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g point binary YES NULL +SHOW FIELDS FROM ls; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g linestring binary YES NULL +SHOW FIELDS FROM p; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g polygon binary YES NULL +SHOW FIELDS FROM mpt; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g multipoint binary YES NULL +SHOW FIELDS FROM mls; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g multilinestring binary YES NULL +SHOW FIELDS FROM mp; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g multipolygon binary YES NULL +SHOW FIELDS FROM gc; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g geometrycollection binary YES NULL +SHOW FIELDS FROM geo; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g geometry binary YES NULL INSERT INTO pt VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), @@ -15,26 +47,26 @@ INSERT INTO pt VALUES INSERT INTO ls VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), -(107, LineString(Point(10, 10), Point(40, 10))); +(107, GeometryFromWKB(LineString(Point(10, 10), Point(40, 10)))); INSERT INTO p VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), -(110, Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))); +(110, GeometryFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); INSERT INTO mpt VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), -(113, MultiPoint(Point(3, 6), Point(4, 10))); +(113, GeometryFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); INSERT INTO mls VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), -(116, MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))); +(116, GeometryFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); INSERT INTO mp VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), -(119, MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))); +(119, GeometryFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); INSERT INTO gc VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), -(121, GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))); +(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); INSERT into geo SELECT * FROM pt; INSERT into geo SELECT * FROM ls; INSERT into geo SELECT * FROM p; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index e6f3256d779..d13f31d6bef 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -305,6 +305,11 @@ score count(*) 2 1 1 2 drop table t1; +create table t1 (a date default null, b date default null); +insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01'); +select a,min(b) c,count(distinct rand()) from t1 group by a having c<a + interval 1 day; +a c count(distinct rand()) +drop table t1; CREATE TABLE t1 (a char(1)); INSERT INTO t1 VALUES ('A'),('B'),('A'),('B'),('A'),('B'),(NULL),('a'),('b'),(NULL),('A'),('B'),(NULL); SELECT a FROM t1 GROUP BY a; diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require index dae48a472b5..032b60d544a 100644 --- a/mysql-test/r/have_openssl_1.require +++ b/mysql-test/r/have_openssl_1.require @@ -1,2 +1,2 @@ Variable_name Value -have_openssl YES +Ssl_cipher EDH-RSA-DES-CBC3-SHA diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index ffd62ceabb6..76022b66100 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -23,7 +23,7 @@ a b 4 6 alter table t1 add c int not null, add key (c,a); drop table t1; -create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps"; +create table t1 (a int not null,b int not null, primary key (a)) type=memory comment="testing heaps"; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a > 0; select * from t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 5bc21501eca..52b6fc307ae 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2; +drop table if exists t1,t2,t3; create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb; insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); select id, code, name from t1 order by id; @@ -140,13 +140,13 @@ id parent_id level 1015 102 2 explain select level from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 12 Using where; Using index +1 SIMPLE t1 ref level level 1 const # Using where; Using index explain select level,id from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 12 Using where; Using index +1 SIMPLE t1 ref level level 1 const # Using where; Using index explain select level,id,parent_id from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 12 Using where +1 SIMPLE t1 ref level level 1 const # Using where select level,id from t1 where level=1; level id 1 1002 @@ -168,9 +168,9 @@ Table Op Msg_type Msg_text test.t1 optimize error The handler for the table doesn't support optimize show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 id A 87 NULL NULL BTREE -t1 1 parent_id 1 parent_id A 43 NULL NULL BTREE -t1 1 level 1 level A 6 NULL NULL BTREE +t1 0 PRIMARY 1 id A # NULL NULL BTREE +t1 1 parent_id 1 parent_id A # NULL NULL BTREE +t1 1 level 1 level A # NULL NULL BTREE drop table t1; CREATE TABLE t1 ( gesuchnr int(11) DEFAULT '0' NOT NULL, @@ -1073,3 +1073,133 @@ id select * from t2; id t1_id drop table t1,t2; +DROP TABLE IF EXISTS t1,t2; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +id +1 +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +id +2 +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +id +3 +DROP TABLE t1,t2; +set autocommit=0; +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) TYPE=InnoDB; +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; +SELECT * FROM t1; +id value +this-key will disappear +SELECT * FROM t2; +id value +this-key will also disappear +SELECT * FROM t3; +id1 id2 +ROLLBACK; +SELECT * FROM t1; +id value +SELECT * FROM t2; +id value +SELECT * FROM t3; +id1 id2 +my-test-1 my-test-2 +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +id1 id2 +my-test-1 my-test-2 +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +a b +1 1 +102 2 +103 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +drop table t1; +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) type=innodb; +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update t1,t2 set t1.a=t1.a+100; +select * from t1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; +a b +201 1 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +102 12 +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b where t1.b between 3 and 5; +select * from t1; +a b +201 1 +103 5 +104 6 +106 6 +105 7 +107 7 +108 8 +109 9 +102 12 +select * from t2; +a b +1 5 +2 5 +3 5 +4 5 +5 5 +6 5 +7 5 +8 5 +9 5 +drop table t1,t2; diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 274a4dec85d..09b819888eb 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -251,3 +251,26 @@ t1_id t2_id type cost_unit min_value max_value t3_id item_id id name 22 1 Percent Cost 100 -1 6 291 1 s1 23 1 Percent Cost 100 -1 21 291 1 s1 drop table t1,t2; +CREATE TABLE t1 ( +siteid varchar(25) NOT NULL default '', +emp_id varchar(30) NOT NULL default '', +rate_code varchar(10) default NULL, +UNIQUE KEY site_emp (siteid,emp_id), +KEY siteid (siteid) +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); +CREATE TABLE t2 ( +siteid varchar(25) NOT NULL default '', +rate_code varchar(10) NOT NULL default '', +base_rate float NOT NULL default '0', +PRIMARY KEY (siteid,rate_code), +FULLTEXT KEY rate_code (rate_code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('rivercats','cust',20); +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; +rate_code base_rate +cust 20 +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith'; +rate_code base_rate +cust 20 +drop table t1,t2; diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index 20bc9b9572f..b808fca0acf 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t2; create table t1(n int); insert into t1 values (1); lock tables t1 write; @@ -17,3 +17,10 @@ unlock tables; n 1 drop table t1; +create table t1 (a int); +create table t2 (a int); +lock table t1 write, t2 write; + insert t1 select * from t2; +drop table t2; +Table 'test.t2' doesn't exist +drop table t1; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 4dbb3c8adb1..da1c429df63 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -260,3 +260,67 @@ INSERT INTO t3 VALUES (1,'jedan'),(2,'dva'); update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj; update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj; drop table t1,t2,t3; +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)); +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)); +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update t1,t2 set t1.a=t1.a+100; +select * from t1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; +a b +201 1 +102 12 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b where t1.b between 3 and 5; +select * from t1; +a b +201 1 +102 12 +103 5 +104 6 +105 7 +106 6 +107 7 +108 8 +109 9 +select * from t2; +a b +1 3 +2 3 +3 3 +4 3 +5 3 +6 3 +7 3 +8 3 +9 3 +drop table t1,t2; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index b5c67dfbcb0..65b882c0a9b 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -1,2 +1,32 @@ -SHOW STATUS LIKE 'SSL%'; -Variable_name Value +drop table if exists t1; +create table t1(f1 int); +insert into t1 values (5); +grant select on test.* to ssl_user1@localhost require SSL; +grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com"; +flush privileges; +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user1@localhost' to database 'test' +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user2@localhost' to database 'test' +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user3@localhost' to database 'test' +select * from t1; +f1 +5 +delete from t1; +Access denied for user: 'ssl_user4@localhost' to database 'test' +delete from mysql.user where user='ssl_user%'; +delete from mysql.db where user='ssl_user%'; +flush privileges; +drop table t1; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 30a0cd01c51..00d79ec0b6e 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -377,7 +377,7 @@ a set CHARACTER SET cp1251_koi8; select * from t1; a -À +? set CHARACTER SET DEFAULT; show status like "Qcache_queries_in_cache"; Variable_name Value diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result index cc3df4730f2..8aa667df063 100644 --- a/mysql-test/r/rpl000001.result +++ b/mysql-test/r/rpl000001.result @@ -31,7 +31,7 @@ n 2 select sum(length(word)) from t1; sum(length(word)) -1021 +1022 drop table t1,t3; reset master; stop slave; diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/r/rpl_loaddatalocal.result new file mode 100644 index 00000000000..b49ea842485 --- /dev/null +++ b/mysql-test/r/rpl_loaddatalocal.result @@ -0,0 +1,14 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1(a int); +select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; +truncate table t1; +load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; +select a,count(*) from t1 group by a; +a count(*) +1 10000 +drop table t1; diff --git a/mysql-test/r/rpl_relayspace.result b/mysql-test/r/rpl_relayspace.result new file mode 100644 index 00000000000..610419980b5 --- /dev/null +++ b/mysql-test/r/rpl_relayspace.result @@ -0,0 +1,13 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +create table t1 (a int); +reset slave; +start slave; +select master_pos_wait('master-bin.001',5000,45)=-1; +master_pos_wait('master-bin.001',5000,45)=-1 +0 diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 9ed54f7c253..a2bf24cad54 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3242,6 +3242,17 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; DO 1; DO benchmark(100,1+1),1,1; +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM; INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) TYPE=MyISAM; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index cac8cd3d71e..5a9a8699d06 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -78,3 +78,9 @@ EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref expedition expedition 8 const 1 Using where drop table t1; +create table t1 (a datetime not null, b datetime not null); +insert into t1 values (now(), now()); +insert into t1 values (now(), now()); +select * from t1 where a is null or b is null; +a b +drop table t1; diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 26dedf544c4..0c75155146d 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -84,3 +84,23 @@ date date_time time_stamp 2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00 2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00 drop table t1; +show variables like 'new'; +Variable_name Value +new OFF +create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), +t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), +t14 timestamp(14)); +insert t1 values (0,0,0,0,0,0,0), +("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59"); +select * from t1; +t2 t4 t6 t8 t10 t12 t14 +0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 +set new=1; +select * from t1; +t2 t4 t6 t8 t10 t12 t14 +0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 +drop table t1; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index b66d75e2b3a..822fab5ae47 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -156,17 +156,17 @@ show variables like 'net_buffer_length'; Variable_name Value net_buffer_length 1048576 set GLOBAL character set cp1251_koi8; -show global variables like "convert_character_set"; +show global variables like "client_collation"; Variable_name Value -convert_character_set cp1251_koi8 +client_collation cp1251 set character set cp1251_koi8; -show variables like "convert_character_set"; +show variables like "client_collation"; Variable_name Value -convert_character_set cp1251_koi8 +client_collation cp1251 set global character set default, session character set default; -show variables like "convert_character_set"; +show variables like "client_collation"; Variable_name Value -convert_character_set cp1251_koi8 +client_collation latin1 select @@timestamp>0; @@timestamp>0 1 @@ -193,12 +193,12 @@ set SESSION query_cache_size=10000; Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL set GLOBAL table_type=DEFAULT; Variable 'table_type' doesn't have a default value -set convert_character_set=UNKNOWN_CHARACTER_SET; +set client_collation=UNKNOWN_CHARACTER_SET; Unknown character set: 'UNKNOWN_CHARACTER_SET' set character set unknown; Unknown character set: 'unknown' set character set 0; -Wrong argument type to variable 'convert_character_set' +Wrong argument type to variable 'client_collation' set global autocommit=1; Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL select @@global.timestamp; @@ -218,8 +218,8 @@ select @@autocommit, @@big_tables; 1 1 set global binlog_cache_size=100; set bulk_insert_buffer_size=100; -set convert_character_set=cp1251_koi8; -set convert_character_set=default; +set character set cp1251_koi8; +set character set default; set @@global.concurrent_insert=1; set global connect_timeout=100; select @@delay_key_write; diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 117ca40ce54..6aca345b282 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -5,10 +5,11 @@ --disable_warnings drop table if exists t1,t2; --enable_warnings -create table t1 (i int, j int); -insert into t1 values (1,2), (3,4), (5,6), (7,8); +create table t1 (i int, j int, empty_string char(10), bool char(1), d date); +insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); select count(*) from t1 procedure analyse(); select * from t1 procedure analyse(); +select * from t1 procedure analyse(2); create table t2 select * from t1 procedure analyse(); select * from t2; drop table t1,t2; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 30979202bd7..d7f67fe80d4 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -54,6 +54,13 @@ insert into t1 values (NULL,'sdj'),(NULL,'sdj'),(NULL,"abc"),(NULL,'abc'),(NULL, select * from t1; drop table t1; +create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id)); +create table t2 (sid char(20), id int(2)); +insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL); +insert into t1 select * from t2; +select * from t1; +drop table t1,t2; + # # Test of auto_increment columns when they are set to 0 # @@ -64,3 +71,4 @@ update t1 set a=0; select * from t1; check table t1; drop table t1; + diff --git a/mysql-test/t/backup-master.sh b/mysql-test/t/backup-master.sh new file mode 100755 index 00000000000..99da5857afe --- /dev/null +++ b/mysql-test/t/backup-master.sh @@ -0,0 +1,5 @@ +#!/bin/sh +if [ "$MYSQL_TEST_DIR" ] +then + rm -f $MYSQL_TEST_DIR/var/tmp/*.frm $MYSQL_TEST_DIR/var/tmp/*.MY? +fi diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 02ef72ef66d..a66c07fd27f 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -1,3 +1,7 @@ +# +# This test is a bit tricky as we can't use backup table to overwrite an old +# table +# connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con1; @@ -5,13 +9,17 @@ set SQL_LOG_BIN=0; --disable_warnings drop table if exists t1, t2, t3; --enable_warnings +create table t4(n int); +--replace_result "errno: 2" "errno: X" "errno: 22" "errno: X" "errno: 23" "errno: X" +backup table t4 to '../bogus'; +backup table t4 to '../tmp'; +--replace_result "errno: 17" "errno: X" +backup table t4 to '../tmp'; +drop table t4; +restore table t4 from '../tmp'; +select count(*) from t4; + create table t1(n int); ---replace_result "errno = 1" "errno = X" "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X" -backup table t1 to '../bogus'; -backup table t1 to '../tmp'; -drop table t1; -restore table t1 from '../tmp'; -select count(*) from t1; insert into t1 values (23),(45),(67); backup table t1 to '../tmp'; drop table t1; @@ -22,23 +30,24 @@ create table t2(m int not null primary key); create table t3(k int not null primary key); insert into t2 values (123),(145),(167); insert into t3 values (223),(245),(267); -backup table t1,t2,t3 to '../tmp'; +backup table t2,t3 to '../tmp'; drop table t1,t2,t3; restore table t1,t2,t3 from '../tmp'; select n from t1; select m from t2; select k from t3; -drop table t1,t2,t3; +drop table t1,t2,t3,t4; restore table t1 from '../tmp'; connection con2; +rename table t1 to t5; --send -lock tables t1 write; +lock tables t5 write; connection con1; --send -backup table t1 to '../tmp'; +backup table t5 to '../tmp'; connection con2; reap; unlock tables; connection con1; reap; -drop table t1; +drop table t5; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 70a589c4be6..cda9307804b 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -58,6 +58,14 @@ create table test_$1.test2$ (a int); drop table test_$1.test2$; drop database test_$1; +--error 1103 +create table `` (a int); +--error 1103 +drop table if exists ``; +--error 1166 +create table t1 (`` int); +drop table if exists t1; + # # Test of CREATE ... SELECT with indexes # @@ -159,3 +167,18 @@ drop table t1, t2, t3; drop table t3; drop database test_$1; +# +# Test default table type +# +SET SESSION table_type="heap"; +SELECT @@table_type; +CREATE TABLE t1 (a int not null); +show create table t1; +drop table t1; +# Test what happens when using a non existing table type +SET SESSION table_type="gemini"; +SELECT @@table_type; +CREATE TABLE t1 (a int not null); +show create table t1; +SET SESSION table_type=default; +drop table t1; diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test index c2ebf39170e..e2631a06156 100644 --- a/mysql-test/t/ctype_collate.test +++ b/mysql-test/t/ctype_collate.test @@ -58,8 +58,8 @@ INSERT INTO t1 (latin1_f) VALUES (_latin1'z'); SELECT latin1_f FROM t1 ORDER BY latin1_f; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1; -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_de; -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin; --error 1251 SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; @@ -67,20 +67,20 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; --SELECT latin1_f COLLATE koi8r FROM t1 ; -- AS + ORDER BY -SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -SELECT latin1_f COLLATE latin1_de AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -SELECT latin1_f COLLATE latin1_ci_as AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; --error 1251 -SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -- GROUP BY SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1; -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_de; -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin; --error 1251 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; @@ -88,29 +88,29 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; -- DISTINCT -SELECT DISTINCT latin1_f FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1_de FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; +SELECT DISTINCT latin1_f FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; --error 1251 -SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; +SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; -- Aggregates ---SELECT MAX(k COLLATE latin1_de) +--SELECT MAX(k COLLATE latin1_german2_ci) --FROM t1 -- WHERE --SELECT * --FROM t1 ---WHERE (_latin1'Mu"ller' COLLATE latin1_de) = k +--WHERE (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k --HAVING --SELECT * --FROM t1 ---HAVING (_latin1'Mu"ller' COLLATE latin1_de) = k +--HAVING (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k # diff --git a/mysql-test/t/ctype_latin1_de-master.opt b/mysql-test/t/ctype_latin1_de-master.opt index 98accd58c46..62f864d501d 100644 --- a/mysql-test/t/ctype_latin1_de-master.opt +++ b/mysql-test/t/ctype_latin1_de-master.opt @@ -1 +1 @@ ---default-character-set=latin1_de +--default-character-set=latin1_german2_ci diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index a4b4b816ec4..e0591913f68 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -4,13 +4,13 @@ --disable_warnings drop table if exists t1; --enable_warnings -create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b)); +create table t1 (a char (20) not null, b int not null auto_increment, index (a,b)); insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb'); insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf'); insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb'); insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa'); insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae'); -insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'); +insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a'); select a,b from t1 order by a,b; select a,b from t1 order by upper(a),b; select a from t1 order by a desc; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index ddb7034be10..05f3687d330 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -194,10 +194,10 @@ INSERT INTO t1 (ucs2_f,comment) VALUES (0x0566,'ARMENIAN SMALL ZA'); ALTER TABLE t1 ADD armscii8_f CHAR(32) CHARACTER SET armscii8 NOT NULL; ALTER TABLE t1 ADD greek_f CHAR(32) CHARACTER SET greek NOT NULL; -UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE 'GRE%'; -UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE 'ARM%'; -UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=''; -UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=''; +UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE%'; +UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%'; +UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8''; +UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2''; SELECT * FROM t1; SET NAMES 'binary'; SELECT * FROM t1; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 57321739bfb..91216ff9c3a 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -38,11 +38,30 @@ insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(2 delete from t1 where a=27; drop table t1; -CREATE TABLE `t` ( +CREATE TABLE `t1` ( `i` int(10) NOT NULL default '0', `i2` int(10) NOT NULL default '0', PRIMARY KEY (`i`) -) TYPE=MyISAM CHARSET=latin1; +); -- error 1054 -DELETE FROM t USING t WHERE post='1'; -drop table if exists t; +DELETE FROM t1 USING t1 WHERE post='1'; +drop table t1; + +# +# CHAR(0) bug - not actually DELETE bug, but anyway... +# + +CREATE TABLE t1 ( + bool char(0) default NULL, + not_null varchar(20) binary NOT NULL default '', + misc integer not null, + PRIMARY KEY (not_null) +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7); + +select * from t1 where misc > 5 and bool is null; +delete from t1 where misc > 5 and bool is null; +select * from t1 where misc > 5 and bool is null; + +drop table t1; diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 47590ae7559..90b376e34df 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -8,10 +8,13 @@ drop table if exists t1; create table t1 (a varchar(10), key(a)); insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); -select * from t1 where a like "abc%"; -select * from t1 where a like "ABC%"; -select * from t1 where a like "test%"; -select * from t1 where a like "te_t"; +explain select * from t1 where a like 'abc%'; +explain select * from t1 where a like concat('abc','%'); +select * from t1 where a like "abc%"; +select * from t1 where a like concat("abc","%"); +select * from t1 where a like "ABC%"; +select * from t1 where a like "test%"; +select * from t1 where a like "te_t"; # # The following will test the Turbo Boyer-Moore code diff --git a/mysql-test/t/func_system.test b/mysql-test/t/func_system.test index c69526644f4..db366e3ab49 100644 --- a/mysql-test/t/func_system.test +++ b/mysql-test/t/func_system.test @@ -3,5 +3,5 @@ # select database(),user() like "%@%"; -select version()>="3.23.29"; +select version()>=_utf8"3.23.29"; select TRUE,FALSE,NULL; diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test index 8810aefc20f..bdf58ee4b15 100644 --- a/mysql-test/t/func_test.test +++ b/mysql-test/t/func_test.test @@ -18,6 +18,7 @@ select -1.49 or -1.49,0.6 or 0.6; select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; select 10 % 7, 10 mod 7, 10 div 3; +select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; # # Wrong usage of functions diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test new file mode 100644 index 00000000000..0368ddb41cb --- /dev/null +++ b/mysql-test/t/gis-rtree.test @@ -0,0 +1,69 @@ +# +# test of rtree (using with spatial data) +# +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +CREATE TABLE t1 ( + fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + g GEOMETRY NOT NULL, + SPATIAL KEY(g) +) TYPE=MyISAM; + +SHOW CREATE TABLE t1; + +let $1=150; +let $2=150; +while ($1) +{ + eval INSERT INTO t1 (g) VALUES (GeomFromText('LineString($1 $1, $2 $2)')); + dec $1; + inc $2; +} + +SELECT count(*) FROM t1; +EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); +SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); + +DROP TABLE t1; + +CREATE TABLE t2 ( + fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + g GEOMETRY NOT NULL +) TYPE=MyISAM; + +let $1=10; +while ($1) +{ + let $2=10; + while ($2) + { + eval INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10)))); + dec $2; + } + dec $1; +} + +ALTER TABLE t2 ADD SPATIAL KEY(g); +SHOW CREATE TABLE t2; +SELECT count(*) FROM t2; +EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g, + GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +SELECT fid, AsText(g) FROM t2 WHERE Within(g, + GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); + +let $1=10; +while ($1) +{ + let $2=10; + while ($2) + { + eval DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))))); + SELECT count(*) FROM t2; + dec $2; + } + dec $1; +} + +DROP TABLE t2; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 35bb682f732..179dd12e6a3 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -15,6 +15,16 @@ CREATE TABLE mp (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON); CREATE TABLE gc (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION); CREATE TABLE geo (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); +SHOW FIELDS FROM pt; +SHOW FIELDS FROM ls; +SHOW FIELDS FROM p; +SHOW FIELDS FROM mpt; +SHOW FIELDS FROM mls; +SHOW FIELDS FROM mp; +SHOW FIELDS FROM gc; +SHOW FIELDS FROM geo; + + INSERT INTO pt VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), @@ -24,32 +34,32 @@ INSERT INTO pt VALUES INSERT INTO ls VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), -(107, LineString(Point(10, 10), Point(40, 10))); +(107, GeometryFromWKB(LineString(Point(10, 10), Point(40, 10)))); INSERT INTO p VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), -(110, Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))); +(110, GeometryFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); INSERT INTO mpt VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), -(113, MultiPoint(Point(3, 6), Point(4, 10))); +(113, GeometryFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); INSERT INTO mls VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), -(116, MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))); +(116, GeometryFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); INSERT INTO mp VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), -(119, MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))); +(119, GeometryFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); INSERT INTO gc VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), -(121, GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))); +(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); INSERT into geo SELECT * FROM pt; INSERT into geo SELECT * FROM ls; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index dfcf72eb2c3..85ec680b3a2 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -78,7 +78,8 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (1,'1970-01-01','1997-10-17 00:00:00',2529,1,21000,11886,'check',0,'F',16200,6); -!$1056 SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000 AS IsNew FROM t1 AS P JOIN t1 as PP WHERE P.URID = PP.URID GROUP BY method,IsNew; +--error 1056 +SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000 AS IsNew FROM t1 AS P JOIN t1 as PP WHERE P.URID = PP.URID GROUP BY method,IsNew; drop table t1; @@ -265,6 +266,14 @@ select sql_big_result score,count(*) from t1 group by score desc; drop table t1; # + +# not purely group_by bug, but group_by is involved... + +create table t1 (a date default null, b date default null); +insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01'); +select a,min(b) c,count(distinct rand()) from t1 group by a having c<a + interval 1 day; +drop table t1; + # Compare with hash keys # diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index cd5dbd5afbe..22d9e57a574 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -20,7 +20,7 @@ select * from t1; alter table t1 add c int not null, add key (c,a); drop table t1; -create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps"; +create table t1 (a int not null,b int not null, primary key (a)) type=memory comment="testing heaps"; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a > 0; select * from t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index b8ba55d9230..4d1a620d67f 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -5,7 +5,7 @@ # --disable_warnings -drop table if exists t1,t2; +drop table if exists t1,t2,t3; --enable_warnings create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb; @@ -22,6 +22,8 @@ drop table t1; # # A bit bigger test +# The 'replace_result' statements are needed because the cardinality calculated +# by innodb is not always the same between runs # CREATE TABLE t1 ( @@ -43,12 +45,16 @@ update ignore t1 set id=id+1; # This will change all rows select * from t1; update ignore t1 set id=1023 where id=1010; select * from t1 where parent_id=102; +--replace_result 12 # 6 # explain select level from t1 where level=1; +--replace_result 12 # 6 # explain select level,id from t1 where level=1; +--replace_result 12 # 6 # 5 # explain select level,id,parent_id from t1 where level=1; select level,id from t1 where level=1; select level,id,parent_id from t1 where level=1; optimize table t1; +--replace_result 87 # 50 # 48 # 43 # 25 # 24 # 6 # 3 # show keys from t1; drop table t1; @@ -717,3 +723,85 @@ delete t1,t2 from t1,t2 where t1.id=t2.t1_id; select * from t1; select * from t2; drop table t1,t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +DROP TABLE t1,t2; + +# +# Test of range_optimizer +# + +set autocommit=0; + +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; + +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; + +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) TYPE=InnoDB; + +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; + +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; + +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +ROLLBACK; + +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; + +# +# Check update with conflicting key +# + +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +# We need the a < 1000 test here to quard against the halloween problems +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +drop table t1; + +# +# Test multi update with different join methods +# + +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) type=innodb; +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); + +# Full join, without key +update t1,t2 set t1.a=t1.a+100; +select * from t1; + +# unique key +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; + +# ref key +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; + +# Range key (in t1) +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b where t1.b between 3 and 5; +select * from t1; +select * from t2; + +drop table t1,t2; diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 59c0c37e40d..7840e128ac7 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -248,3 +248,27 @@ CREATE TABLE t2 ( INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5'); select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2; drop table t1,t2; + +# +# Bug in range optimiser with MAYBE_KEY +# + +CREATE TABLE t1 ( + siteid varchar(25) NOT NULL default '', + emp_id varchar(30) NOT NULL default '', + rate_code varchar(10) default NULL, + UNIQUE KEY site_emp (siteid,emp_id), + KEY siteid (siteid) +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); +CREATE TABLE t2 ( + siteid varchar(25) NOT NULL default '', + rate_code varchar(10) NOT NULL default '', + base_rate float NOT NULL default '0', + PRIMARY KEY (siteid,rate_code), + FULLTEXT KEY rate_code (rate_code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('rivercats','cust',20); +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith'; +drop table t1,t2; diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 0c6c59d0444..fa095275182 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -7,7 +7,7 @@ -- source include/not_embedded.inc --disable_warnings -drop table if exists t1; +drop table if exists t1,t2; --enable_warnings # Test to see if select will get the lock ahead of low priority update @@ -51,3 +51,22 @@ reap; connection reader; reap; drop table t1; + +# +# Test problem when using locks on many tables and droping a table that +# is to-be-locked by another thread +# + +connection locker; +create table t1 (a int); +create table t2 (a int); +lock table t1 write, t2 write; +connection reader; +send insert t1 select * from t2; +connection locker; +drop table t2; +connection reader; +--error 1146 +reap; +connection locker; +drop table t1; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 6156da82ec0..390dd58d806 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -232,3 +232,31 @@ INSERT INTO t3 VALUES (1,'jedan'),(2,'dva'); update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj; update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj; drop table t1,t2,t3; + +# +# Test multi update with different join methods +# + +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)); +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)); +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); + +# Full join, without key +update t1,t2 set t1.a=t1.a+100; +select * from t1; + +# unique key +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; + +# ref key +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; + +# Range key (in t1) +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b where t1.b between 3 and 5; +select * from t1; +select * from t2; + +drop table t1,t2; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 8dfd0d8c2f9..3af7406cef3 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -1,6 +1,43 @@ -# We test openssl. Result set is optimized to be compiled with --with-openssl but -# SSL is swithced off in some reason --- source include/have_openssl_2.inc +# We test openssl. Result set is optimized to be compiled with --with-openssl. +# Use mysql-test-run with --with-openssl option. +-- source include/have_openssl_1.inc -SHOW STATUS LIKE 'SSL%'; +drop table if exists t1; +create table t1(f1 int); +insert into t1 values (5); +grant select on test.* to ssl_user1@localhost require SSL; +grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com"; +flush privileges; +connect (con1,localhost,ssl_user1,,); +connect (con2,localhost,ssl_user2,,); +connect (con3,localhost,ssl_user3,,); +connect (con4,localhost,ssl_user4,,); + +connection con1; +select * from t1; +--error 1044; +delete from t1; + +connection con2; +select * from t1; +--error 1044; +delete from t1; + +connection con3; +select * from t1; +--error 1044; +delete from t1; + +connection con4; +select * from t1; +--error 1044; +delete from t1; + +connection default; +delete from mysql.user where user='ssl_user%'; +delete from mysql.db where user='ssl_user%'; +flush privileges; +drop table t1; diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test new file mode 100644 index 00000000000..70f4ab96b6a --- /dev/null +++ b/mysql-test/t/rpl_loaddatalocal.test @@ -0,0 +1,36 @@ +# See if "LOAD DATA LOCAL INFILE" is well replicated +# (LOAD DATA LOCAL INFILE is not written to the binlog +# the same way as LOAD DATA INFILE : Append_blocks are smaller). +# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE : +# - the loaded file was not written entirely to the master's binlog, +# only the first 4KB, 8KB or 16KB usually. +# - the loaded file's first line was not written entirely to the +# master's binlog (1st char was absent) +source include/master-slave.inc; + +create table t1(a int); +let $1=10000; +disable_query_log; +set SQL_LOG_BIN=0; +while ($1) +{ +#eval means expand $ expressions + eval insert into t1 values(1); + dec $1; +} +set SQL_LOG_BIN=1; +enable_query_log; +select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1; +#This will generate a 20KB file, now test LOAD DATA LOCAL +truncate table t1; +load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1; +system rm ./var/master-data/rpl_loaddatalocal.select_outfile ; +save_master_pos; +connection slave; +sync_with_master; +select a,count(*) from t1 group by a; +connection master; +drop table t1; +save_master_pos; +connection slave; +sync_with_master; diff --git a/mysql-test/t/rpl_relayspace-slave.opt b/mysql-test/t/rpl_relayspace-slave.opt new file mode 100644 index 00000000000..9365a2a0a26 --- /dev/null +++ b/mysql-test/t/rpl_relayspace-slave.opt @@ -0,0 +1 @@ + -O relay_log_space_limit=1024
\ No newline at end of file diff --git a/mysql-test/t/rpl_relayspace.test b/mysql-test/t/rpl_relayspace.test new file mode 100644 index 00000000000..8d4f01339c7 --- /dev/null +++ b/mysql-test/t/rpl_relayspace.test @@ -0,0 +1,33 @@ +# The slave is started with relay_log_space_limit=1024 bytes, +# to force the deadlock + +source include/master-slave.inc; +connection slave; +stop slave; +connection master; +create table t1 (a int); +let $1=200; +disable_query_log; +while ($1) +{ +# eval means expand $ expressions + eval insert into t1 values( $1 ); + dec $1; +} +# This will generate one 10kB master's binlog +enable_query_log; +save_master_pos; +connection slave; +reset slave; +start slave; +# The I/O thread stops filling the relay log when +# it's 1kB. And the SQL thread cannot purge this relay log +# as purge is done only when the SQL thread switches to another +# relay log, which does not exist here. +# So we should have a deadlock. +# if it is not resolved automatically we'll detect +# it with master_pos_wait that waits for farther than 1kB; +# it will timeout after 45 seconds; +# also the slave will probably not cooperate to shutdown +# (as 2 threads are locked) +select master_pos_wait('master-bin.001',5000,45)=-1; diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 0852eb584d5..8ad5109d2c6 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -91,6 +91,7 @@ sync_slave_with_master; connection master; purge master logs to 'master-bin.000002'; show binary logs; +--sleep 1; purge logs before now(); show binary logs; insert into t2 values (65); diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index d4effd2026c..3c26cf1903b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1722,11 +1722,27 @@ drop table t4, t3, t2, t1; # # Test of DO +# DO 1; DO benchmark(100,1+1),1,1; # +# random in WHERE clause +# + +CREATE TABLE t1 ( + id mediumint(8) unsigned NOT NULL auto_increment, + pseudo varchar(35) NOT NULL default '', + PRIMARY KEY (id), + UNIQUE KEY pseudo (pseudo) +); +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +DROP TABLE t1; + +# # Test of bug with SUM(CASE...) # diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index f791cd76d34..e9c45b2908f 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -62,3 +62,8 @@ INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00'); SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; drop table t1; +create table t1 (a datetime not null, b datetime not null); +insert into t1 values (now(), now()); +insert into t1 values (now(), now()); +select * from t1 where a is null or b is null; +drop table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 1c9275ecd0a..cd76dbe6ab0 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -58,3 +58,17 @@ INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000); #INSERT INTO t1 VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000); SELECT * FROM t1; drop table t1; + +show variables like 'new'; +create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), + t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), + t14 timestamp(14)); +insert t1 values (0,0,0,0,0,0,0), +("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", +"1997-12-31 23:47:59"); +select * from t1; +set new=1; +select * from t1; +drop table t1; + diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 39aa5a20a71..4bde54f868a 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -92,11 +92,11 @@ set net_buffer_length=2000000000; show variables like 'net_buffer_length'; set GLOBAL character set cp1251_koi8; -show global variables like "convert_character_set"; +show global variables like "client_collation"; set character set cp1251_koi8; -show variables like "convert_character_set"; +show variables like "client_collation"; set global character set default, session character set default; -show variables like "convert_character_set"; +show variables like "client_collation"; select @@timestamp>0; set @@rand_seed1=10000000,@@rand_seed2=1000000; @@ -123,7 +123,7 @@ set SESSION query_cache_size=10000; --error 1230 set GLOBAL table_type=DEFAULT; --error 1115 -set convert_character_set=UNKNOWN_CHARACTER_SET; +set client_collation=UNKNOWN_CHARACTER_SET; --error 1115 set character set unknown; --error 1232 @@ -148,8 +148,8 @@ set big_tables=1; select @@autocommit, @@big_tables; set global binlog_cache_size=100; set bulk_insert_buffer_size=100; -set convert_character_set=cp1251_koi8; -set convert_character_set=default; +set character set cp1251_koi8; +set character set default; set @@global.concurrent_insert=1; set global connect_timeout=100; select @@delay_key_write; diff --git a/mysys/charset.c b/mysys/charset.c index ce44353b065..e1545dc4f8f 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -110,6 +110,7 @@ static void init_state_maps(CHARSET_INFO *cs) /* Special handling of hex and binary strings */ state_map[(uchar)'x']= state_map[(uchar)'X']= (uchar) MY_LEX_IDENT_OR_HEX; state_map[(uchar)'b']= state_map[(uchar)'b']= (uchar) MY_LEX_IDENT_OR_BIN; + state_map[(uchar)'n']= state_map[(uchar)'N']= (uchar) MY_LEX_IDENT_OR_NCHAR; } @@ -270,6 +271,9 @@ static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) if (from->name) to->name= my_once_strdup(from->name,MYF(MY_WME)); + if (from->comment) + to->comment= my_once_strdup(from->comment,MYF(MY_WME)); + if (from->ctype) { to->ctype= (uchar*) my_once_memdup((char*) from->ctype, @@ -338,7 +342,10 @@ static int add_collation(CHARSET_INFO *cs) } else { - all_charsets[cs->number]->state |= cs->state; + CHARSET_INFO *dst= all_charsets[cs->number]; + dst->state |= cs->state; + if (cs->comment) + dst->comment= my_once_strdup(cs->comment,MYF(MY_WME)); } cs->number= 0; cs->primary_number= 0; @@ -546,7 +553,10 @@ uint get_charset_number(const char *charset_name) for (cs= all_charsets; cs < all_charsets+255; ++cs) { - if ( cs[0] && cs[0]->name && !strcasecmp(cs[0]->name, charset_name)) + if ( cs[0] && cs[0]->name && + (!strcasecmp(cs[0]->name, charset_name) || + (!strcasecmp(cs[0]->csname, charset_name) && + (cs[0]->state & MY_CS_PRIMARY)))) return cs[0]->number; } return 0; /* this mimics find_type() */ diff --git a/mysys/default.c b/mysys/default.c index 0ae409f1015..83dd177f6b4 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -38,6 +38,7 @@ #include "mysys_priv.h" #include "m_string.h" #include "m_ctype.h" +#include <my_dir.h> char *defaults_extra_file=0; @@ -61,13 +62,13 @@ DATADIR, NullS, }; -#define default_ext ".cnf" /* extension for config file */ +#define default_ext ".cnf" /* extension for config file */ #ifdef __WIN__ #include <winbase.h> #define windows_ext ".ini" #endif -static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, +static my_bool search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc, const char *dir, const char *config_file, const char *ext, TYPELIB *group); @@ -242,6 +243,20 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, { strmov(name,config_file); } + fn_format(name,name,"","",4); +#if !defined(__WIN__) && !defined(OS2) + { + MY_STAT stat_info; + if (!my_stat(name,&stat_info,MYF(0))) + return 0; + if (stat_info.st_mode & S_IWOTH) /* ignore world-writeable files */ + { + fprintf(stderr, "warning: World-writeable config file %s is ignored\n", + name); + return 0; + } + } +#endif if (!(fp = my_fopen(fn_format(name,name,"","",4),O_RDONLY,MYF(0)))) return 0; /* Ignore wrong files */ diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 482a594fa73..45cbcdb3ab7 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -29,42 +29,42 @@ #include <assert.h> #include <stdarg.h> -/* - Some compilation flags have been added specifically for this module - to control the following: - - not to let a thread to yield the control when reading directly - from key cache, which might improve performance in many cases; - to enable this add: - #define SERIALIZED_READ_FROM_CACHE - - to set an upper bound for number of threads simultaneously - using the key cache; this setting helps to determine an optimal - size for hash table and improve performance when the number of - blocks in the key cache much less than the number of threads - accessing it; - to set this number equal to <N> add - #define MAX_THREADS <N> - - to substitute calls of pthread_cond_wait for calls of - pthread_cond_timedwait (wait with timeout set up); - this setting should be used only when you want to trap a deadlock - situation, which theoretically should not happen; - to set timeout equal to <T> seconds add - #define KEYCACHE_TIMEOUT <T> - - to enable the module traps and to send debug information from - key cache module to a special debug log add: - #define KEYCACHE_DEBUG - the name of this debug log file <LOG NAME> can be set through: - #define KEYCACHE_DEBUG_LOG <LOG NAME> - if the name is not defined, it's set by default; - if the KEYCACHE_DEBUG flag is not set up and we are in a debug - mode, i.e. when ! defined(DBUG_OFF), the debug information from the - module is sent to the regular debug log. - - Example of the settings: - #define SERIALIZED_READ_FROM_CACHE - #define MAX_THREADS 100 - #define KEYCACHE_TIMEOUT 1 - #define KEYCACHE_DEBUG - #define KEYCACHE_DEBUG_LOG "my_key_cache_debug.log" +/* + Some compilation flags have been added specifically for this module + to control the following: + - not to let a thread to yield the control when reading directly + from key cache, which might improve performance in many cases; + to enable this add: + #define SERIALIZED_READ_FROM_CACHE + - to set an upper bound for number of threads simultaneously + using the key cache; this setting helps to determine an optimal + size for hash table and improve performance when the number of + blocks in the key cache much less than the number of threads + accessing it; + to set this number equal to <N> add + #define MAX_THREADS <N> + - to substitute calls of pthread_cond_wait for calls of + pthread_cond_timedwait (wait with timeout set up); + this setting should be used only when you want to trap a deadlock + situation, which theoretically should not happen; + to set timeout equal to <T> seconds add + #define KEYCACHE_TIMEOUT <T> + - to enable the module traps and to send debug information from + key cache module to a special debug log add: + #define KEYCACHE_DEBUG + the name of this debug log file <LOG NAME> can be set through: + #define KEYCACHE_DEBUG_LOG <LOG NAME> + if the name is not defined, it's set by default; + if the KEYCACHE_DEBUG flag is not set up and we are in a debug + mode, i.e. when ! defined(DBUG_OFF), the debug information from the + module is sent to the regular debug log. + + Example of the settings: + #define SERIALIZED_READ_FROM_CACHE + #define MAX_THREADS 100 + #define KEYCACHE_TIMEOUT 1 + #define KEYCACHE_DEBUG + #define KEYCACHE_DEBUG_LOG "my_key_cache_debug.log" */ #if defined(MSDOS) && !defined(M_IC80386) @@ -83,20 +83,24 @@ #define COND_FOR_SAVED 1 #define COND_FOR_READERS 2 -typedef pthread_cond_t KEYCACHE_CONDVAR; -typedef struct st_keycache_wqueue -{ /* info about requests in a waiting queue */ +typedef pthread_cond_t KEYCACHE_CONDVAR; + +/* info about requests in a waiting queue */ +typedef struct st_keycache_wqueue +{ struct st_my_thread_var *last_thread; /* circular list of waiting threads */ } KEYCACHE_WQUEUE; +/* descriptor of the page in the key cache block buffer */ typedef struct st_keycache_page -{ /* descriptor of the page in the key cache block buffer */ +{ int file; /* file to which the page belongs to */ my_off_t filepos; /* position of the page in the file */ } KEYCACHE_PAGE; -typedef struct st_hash_link -{ /* element in the chain of a hash table bucket */ +/* element in the chain of a hash table bucket */ +typedef struct st_hash_link +{ struct st_hash_link *next, **prev; /* to connect links in the same bucket */ struct st_block_link *block; /* reference to the block for the page: */ File file; /* from such a file */ @@ -117,8 +121,9 @@ typedef struct st_hash_link #define PAGE_TO_BE_READ 1 #define PAGE_WAIT_TO_BE_READ 2 +/* key cache block */ typedef struct st_block_link -{ /* key cache block */ +{ struct st_block_link *next_used, **prev_used; /* to connect links in the LRU chain (ring) */ struct st_block_link @@ -143,40 +148,36 @@ static uint key_cache_shift; #define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */ #define FLUSH_CACHE 2000 /* sort this many blocks at once */ -static KEYCACHE_WQUEUE +static KEYCACHE_WQUEUE waiting_for_hash_link; /* queue of requests waiting for a free hash link */ -static KEYCACHE_WQUEUE +static KEYCACHE_WQUEUE waiting_for_block; /* queue of requests waiting for a free block */ -static HASH_LINK **_my_hash_root; /* arr. of entries into hash table buckets */ -static uint _my_hash_entries; /* max number of entries in the hash table */ -static HASH_LINK *_my_hash_link_root; /* memory for hash table links */ -static int _my_hash_links; /* max number of hash links */ -static int _my_hash_links_used; /* number of hash links currently used */ -static HASH_LINK *_my_free_hash_list; /* list of free hash links */ -static BLOCK_LINK *_my_block_root; /* memory for block links */ -static int _my_disk_blocks; /* max number of blocks in the cache */ -static byte HUGE_PTR *_my_block_mem; /* memory for block buffers */ -static BLOCK_LINK *_my_used_last; /* ptr to the last block of the LRU chain */ -ulong _my_blocks_used, /* number of currently used blocks */ - _my_blocks_changed; /* number of currently dirty blocks */ +static HASH_LINK **my_hash_root; /* arr. of entries into hash table buckets */ +static uint my_hash_entries; /* max number of entries in the hash table */ +static HASH_LINK *my_hash_link_root; /* memory for hash table links */ +static int my_hash_links; /* max number of hash links */ +static int my_hash_links_used; /* number of hash links currently used */ +static HASH_LINK *my_free_hash_list; /* list of free hash links */ +static BLOCK_LINK *my_block_root; /* memory for block links */ +static int my_disk_blocks; /* max number of blocks in the cache */ +static byte HUGE_PTR *my_block_mem; /* memory for block buffers */ +static BLOCK_LINK *my_used_last; /* ptr to the last block of the LRU chain */ +ulong my_blocks_used, /* number of currently used blocks */ + my_blocks_changed; /* number of currently dirty blocks */ #if defined(KEYCACHE_DEBUG) static -ulong _my_blocks_available; /* number of blocks available in the LRU chain */ +ulong my_blocks_available; /* number of blocks available in the LRU chain */ #endif /* defined(KEYCACHE_DEBUG) */ -ulong _my_cache_w_requests,_my_cache_write, /* counters */ - _my_cache_r_requests,_my_cache_read; /* for statistics */ -static BLOCK_LINK +ulong my_cache_w_requests, my_cache_write, /* counters */ + my_cache_r_requests, my_cache_read; /* for statistics */ +static BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash table for file dirty blocks */ static BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash table for other file blocks */ /* that are not free */ -#ifndef DBUG_OFF -static my_bool _my_printed; -#endif - #define KEYCACHE_HASH(f, pos) \ - (((ulong) ((pos) >> key_cache_shift)+(ulong) (f)) & (_my_hash_entries-1)) + (((ulong) ((pos) >> key_cache_shift)+(ulong) (f)) & (my_hash_entries-1)) #define FILE_HASH(f) ((uint) (f) & (CHANGED_BLOCKS_HASH-1)) #define DEFAULT_KEYCACHE_DEBUG_LOG "keycache_debug.log" @@ -194,11 +195,11 @@ static void keycache_debug_print _VARARGS((const char *fmt,...)); #define KEYCACHE_DEBUG_CLOSE \ if (keycache_debug_log) fclose(keycache_debug_log) #else -#define KEYCACHE_DEBUG_OPEN +#define KEYCACHE_DEBUG_OPEN #define KEYCACHE_DEBUG_CLOSE #endif /* defined(KEYCACHE_DEBUG_LOG) */ -#if defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) +#if defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) #define KEYCACHE_DBUG_PRINT(l, m) \ { if (keycache_debug_log) fprintf(keycache_debug_log, "%s: ", l); \ keycache_debug_print m; } @@ -224,15 +225,15 @@ static long keycache_thread_id; #define KEYCACHE_THREAD_TRACE_END(l) \ KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id)) #else -#define KEYCACHE_THREAD_TRACE_BEGIN(l) -#define KEYCACHE_THREAD_TRACE_END(l) -#define KEYCACHE_THREAD_TRACE(l) +#define KEYCACHE_THREAD_TRACE_BEGIN(l) +#define KEYCACHE_THREAD_TRACE_END(l) +#define KEYCACHE_THREAD_TRACE(l) #endif /* defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF) */ #define BLOCK_NUMBER(b) \ - ((uint) (((char*)(b) - (char *) _my_block_root) / sizeof(BLOCK_LINK))) + ((uint) (((char*)(b) - (char *) my_block_root) / sizeof(BLOCK_LINK))) #define HASH_LINK_NUMBER(h) \ - ((uint) (((char*)(h) - (char *) _my_hash_link_root) / sizeof(HASH_LINK))) + ((uint) (((char*)(h) - (char *) my_hash_link_root) / sizeof(HASH_LINK))) #if (defined(KEYCACHE_TIMEOUT) && !defined(__WIN__)) || defined(KEYCACHE_DEBUG) static int keycache_pthread_cond_wait(pthread_cond_t *cond, @@ -266,18 +267,19 @@ static uint next_power(uint value) /* - Initialize the key cache, - return number of blocks in it + Initialize the key cache, + return number of blocks in it */ + int init_key_cache(ulong use_mem) { uint blocks, hash_links, length; int error; - + DBUG_ENTER("init_key_cache"); - + KEYCACHE_DEBUG_OPEN; - if (key_cache_inited && _my_disk_blocks > 0) + if (key_cache_inited && my_disk_blocks > 0) { DBUG_PRINT("warning",("key cache already in use")); DBUG_RETURN(0); @@ -285,101 +287,101 @@ int init_key_cache(ulong use_mem) if (! key_cache_inited) { key_cache_inited=TRUE; - _my_disk_blocks= -1; + my_disk_blocks= -1; key_cache_shift=my_bit_log2(key_cache_block_size); - DBUG_PRINT("info",("key_cache_block_size: %u", + DBUG_PRINT("info",("key_cache_block_size: %u", key_cache_block_size)); -#ifndef DBUG_OFF - _my_printed=0; -#endif } - - _my_cache_w_requests=_my_cache_r_requests=_my_cache_read=_my_cache_write=0; - - _my_block_mem=NULL; - _my_block_root=NULL; - + + my_cache_w_requests= my_cache_r_requests= my_cache_read= my_cache_write=0; + + my_block_mem=NULL; + my_block_root=NULL; + blocks= (uint) (use_mem/(sizeof(BLOCK_LINK)+2*sizeof(HASH_LINK)+ sizeof(HASH_LINK*)*5/4+key_cache_block_size)); /* It doesn't make sense to have too few blocks (less than 8) */ - if (blocks >= 8 && _my_disk_blocks < 0) + if (blocks >= 8 && my_disk_blocks < 0) { for (;;) { - /* Set _my_hash_entries to the next bigger 2 power */ - if ((_my_hash_entries=next_power(blocks)) < blocks*5/4) - _my_hash_entries<<=1; + /* Set my_hash_entries to the next bigger 2 power */ + if ((my_hash_entries=next_power(blocks)) < blocks*5/4) + my_hash_entries<<=1; hash_links=2*blocks; #if defined(MAX_THREADS) if (hash_links < MAX_THREADS + blocks - 1) hash_links=MAX_THREADS + blocks - 1; #endif - while ((length=blocks*sizeof(BLOCK_LINK)+hash_links*sizeof(HASH_LINK)+ - sizeof(HASH_LINK*)*_my_hash_entries)+ - ((ulong) blocks << key_cache_shift) > - use_mem) + while ((length=(ALIGN_SIZE(blocks*sizeof(BLOCK_LINK))+ + ALIGN_SIZE(hash_links*sizeof(HASH_LINK))+ + ALIGN_SIZE(sizeof(HASH_LINK*)*my_hash_entries)))+ + ((ulong) blocks << key_cache_shift) > use_mem) blocks--; /* Allocate memory for cache page buffers */ - if ((_my_block_mem=my_malloc_lock((ulong) blocks*key_cache_block_size, - MYF(0)))) + if ((my_block_mem=my_malloc_lock((ulong) blocks*key_cache_block_size, + MYF(0)))) { - /* + /* Allocate memory for blocks, hash_links and hash entries; - For each block 2 hash links are allocated + For each block 2 hash links are allocated */ - if ((_my_block_root=(BLOCK_LINK*) my_malloc((uint) length,MYF(0)))) + if ((my_block_root=(BLOCK_LINK*) my_malloc((uint) length,MYF(0)))) break; - my_free_lock(_my_block_mem,MYF(0)); + my_free_lock(my_block_mem,MYF(0)); } - if (blocks < 8) + if (blocks < 8) { my_errno=ENOMEM; goto err; } blocks=blocks/4*3; } - _my_disk_blocks=(int) blocks; - _my_hash_links=hash_links; - _my_hash_root=(HASH_LINK**) (_my_block_root+blocks); - _my_hash_link_root=(HASH_LINK*) (_my_hash_root+_my_hash_entries); - bzero((byte*) _my_block_root,_my_disk_blocks*sizeof(BLOCK_LINK)); - bzero((byte*) _my_hash_root,_my_hash_entries*sizeof(HASH_LINK*)); - bzero((byte*) _my_hash_link_root,_my_hash_links*sizeof(HASH_LINK)); - _my_hash_links_used=0; - _my_free_hash_list=NULL; - _my_blocks_used=_my_blocks_changed=0; + my_disk_blocks=(int) blocks; + my_hash_links=hash_links; + my_hash_root= (HASH_LINK**) ((char*) my_block_root + + ALIGN_SIZE(blocks*sizeof(BLOCK_LINK))); + my_hash_link_root= (HASH_LINK*) ((char*) my_hash_root + + ALIGN_SIZE((sizeof(HASH_LINK*) * + my_hash_entries))); + bzero((byte*) my_block_root, my_disk_blocks*sizeof(BLOCK_LINK)); + bzero((byte*) my_hash_root, my_hash_entries*sizeof(HASH_LINK*)); + bzero((byte*) my_hash_link_root, my_hash_links*sizeof(HASH_LINK)); + my_hash_links_used=0; + my_free_hash_list=NULL; + my_blocks_used= my_blocks_changed=0; #if defined(KEYCACHE_DEBUG) - _my_blocks_available=0; + my_blocks_available=0; #endif /* The LRU chain is empty after initialization */ - _my_used_last=NULL; - + my_used_last=NULL; + waiting_for_hash_link.last_thread=NULL; waiting_for_block.last_thread=NULL; DBUG_PRINT("exit", ("disk_blocks: %d block_root: %lx hash_entries: %d hash_root: %lx \ hash_links: %d hash_link_root %lx", - _my_disk_blocks,_my_block_root,_my_hash_entries,_my_hash_root, - _my_hash_links,_my_hash_link_root)); + my_disk_blocks, my_block_root, my_hash_entries, my_hash_root, + my_hash_links, my_hash_link_root)); } bzero((gptr) changed_blocks,sizeof(changed_blocks[0])*CHANGED_BLOCKS_HASH); bzero((gptr) file_blocks,sizeof(file_blocks[0])*CHANGED_BLOCKS_HASH); - + DBUG_RETURN((int) blocks); - + err: error=my_errno; - if (_my_block_mem) - my_free_lock((gptr) _my_block_mem,MYF(0)); - if (_my_block_mem) - my_free((gptr) _my_block_root,MYF(0)); + if (my_block_mem) + my_free_lock((gptr) my_block_mem,MYF(0)); + if (my_block_mem) + my_free((gptr) my_block_root,MYF(0)); my_errno=error; DBUG_RETURN(0); } /* - Resize the key cache + Resize the key cache */ int resize_key_cache(ulong use_mem) { @@ -394,51 +396,54 @@ int resize_key_cache(ulong use_mem) end_key_cache(); /* the following will work even if memory is 0 */ blocks=init_key_cache(use_mem); - keycache_pthread_mutex_unlock(&THR_LOCK_keycache); + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); return blocks; } /* - Remove key_cache from memory + Remove key_cache from memory */ + void end_key_cache(void) { DBUG_ENTER("end_key_cache"); - if (_my_disk_blocks > 0) + if (my_disk_blocks > 0) { - if (_my_block_mem) + if (my_block_mem) { - my_free_lock((gptr) _my_block_mem,MYF(0)); - my_free((gptr) _my_block_root,MYF(0)); + my_free_lock((gptr) my_block_mem,MYF(0)); + my_free((gptr) my_block_root,MYF(0)); } - _my_disk_blocks= -1; + my_disk_blocks= -1; } KEYCACHE_DEBUG_CLOSE; key_cache_inited=0; DBUG_PRINT("status", ("used: %d changed: %d w_requests: %ld \ writes: %ld r_requests: %ld reads: %ld", - _my_blocks_used,_my_blocks_changed,_my_cache_w_requests, - _my_cache_write,_my_cache_r_requests,_my_cache_read)); + my_blocks_used, my_blocks_changed, my_cache_w_requests, + my_cache_write, my_cache_r_requests, my_cache_read)); DBUG_VOID_RETURN; } /* end_key_cache */ /* - Link a thread into double-linked queue of waiting threads + Link a thread into double-linked queue of waiting threads */ + static inline void link_into_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread) -{ +{ struct st_my_thread_var *last; if (! (last=wqueue->last_thread)) - { /* Queue is empty */ + { + /* Queue is empty */ thread->next=thread; thread->prev=&thread->next; } else - { + { thread->prev=last->next->prev; last->next->prev=&thread->next; thread->next=last->next; @@ -448,16 +453,17 @@ static inline void link_into_queue(KEYCACHE_WQUEUE *wqueue, } /* - Unlink a thread from double-linked queue of waiting threads + Unlink a thread from double-linked queue of waiting threads */ + static inline void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread) -{ +{ KEYCACHE_DBUG_PRINT("unlink_from_queue", ("thread %ld", thread->id)); if (thread->next == thread) /* The queue contains only one member */ wqueue->last_thread=NULL; - else + else { thread->next->prev=thread->prev; *thread->prev=thread->next; @@ -470,16 +476,17 @@ static inline void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, /* - Add a thread to single-linked queue of waiting threads + Add a thread to single-linked queue of waiting threads */ + static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread) -{ +{ struct st_my_thread_var *last; if (! (last=wqueue->last_thread)) thread->next=thread; else - { + { thread->next=last->next; last->next=thread; } @@ -488,10 +495,11 @@ static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue, /* - Remove all threads from queue signaling them to proceed + Remove all threads from queue signaling them to proceed */ -static inline void release_queue(KEYCACHE_WQUEUE *wqueue) -{ + +static void release_queue(KEYCACHE_WQUEUE *wqueue) +{ struct st_my_thread_var *last=wqueue->last_thread; struct st_my_thread_var *next=last->next; struct st_my_thread_var *thread; @@ -509,8 +517,9 @@ static inline void release_queue(KEYCACHE_WQUEUE *wqueue) /* - Unlink a block from the chain of dirty/clean blocks + Unlink a block from the chain of dirty/clean blocks */ + static inline void unlink_changed(BLOCK_LINK *block) { if (block->next_changed) @@ -520,8 +529,9 @@ static inline void unlink_changed(BLOCK_LINK *block) /* - Link a block into the chain of dirty/clean blocks + Link a block into the chain of dirty/clean blocks */ + static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead) { block->prev_changed=phead; @@ -532,11 +542,12 @@ static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead) /* - Unlink a block from the chain of dirty/clean blocks, if it's asked for, - and link it to the chain of clean blocks for the specified file + Unlink a block from the chain of dirty/clean blocks, if it's asked for, + and link it to the chain of clean blocks for the specified file */ -static inline void link_to_file_list(BLOCK_LINK *block,int file, - my_bool unlink) + +static void link_to_file_list(BLOCK_LINK *block,int file, + my_bool unlink) { if (unlink) unlink_changed(block); @@ -544,27 +555,29 @@ static inline void link_to_file_list(BLOCK_LINK *block,int file, if (block->status & BLOCK_CHANGED) { block->status&=~BLOCK_CHANGED; - _my_blocks_changed--; + my_blocks_changed--; } } -/* - Unlink a block from the chain of clean blocks for the specified - file and link it to the chain of dirty blocks for this file +/* + Unlink a block from the chain of clean blocks for the specified + file and link it to the chain of dirty blocks for this file */ + static inline void link_to_changed_list(BLOCK_LINK *block) { unlink_changed(block); link_changed(block,&changed_blocks[FILE_HASH(block->hash_link->file)]); block->status|=BLOCK_CHANGED; - _my_blocks_changed++; + my_blocks_changed++; } /* - Link a block to the LRU chain at the beginning or at the end + Link a block to the LRU chain at the beginning or at the end */ + static void link_block(BLOCK_LINK *block, my_bool at_end) { KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests)); @@ -579,7 +592,7 @@ static void link_block(BLOCK_LINK *block, my_bool at_end) { thread=next_thread; next_thread=thread->next; - /* + /* We notify about the event all threads that ask for the same page as the first thread in the queue */ @@ -589,78 +602,79 @@ static void link_block(BLOCK_LINK *block, my_bool at_end) unlink_from_queue(&waiting_for_block, thread); block->requests++; } - } + } while (thread != last_thread); hash_link->block=block; KEYCACHE_THREAD_TRACE("link_block: after signaling"); #if defined(KEYCACHE_DEBUG) - KEYCACHE_DBUG_PRINT("link_block", + KEYCACHE_DBUG_PRINT("link_block", ("linked,unlinked block %u status=%x #requests=%u #available=%u", BLOCK_NUMBER(block),block->status, - block->requests,_my_blocks_available)); + block->requests, my_blocks_available)); #endif return; } - if (_my_used_last) + if (my_used_last) { - _my_used_last->next_used->prev_used=&block->next_used; - block->next_used=_my_used_last->next_used; - block->prev_used=&_my_used_last->next_used; - _my_used_last->next_used=block; + my_used_last->next_used->prev_used=&block->next_used; + block->next_used= my_used_last->next_used; + block->prev_used= &my_used_last->next_used; + my_used_last->next_used=block; if (at_end) - _my_used_last=block; + my_used_last=block; } else { /* The LRU chain is empty */ - _my_used_last=block->next_used=block; + my_used_last=block->next_used=block; block->prev_used=&block->next_used; } KEYCACHE_THREAD_TRACE("link_block"); #if defined(KEYCACHE_DEBUG) - _my_blocks_available++; - KEYCACHE_DBUG_PRINT("link_block", + my_blocks_available++; + KEYCACHE_DBUG_PRINT("link_block", ("linked block %u:%1u status=%x #requests=%u #available=%u", BLOCK_NUMBER(block),at_end,block->status, - block->requests,_my_blocks_available)); - KEYCACHE_DBUG_ASSERT(_my_blocks_available <= _my_blocks_used); + block->requests, my_blocks_available)); + KEYCACHE_DBUG_ASSERT(my_blocks_available <= my_blocks_used); #endif } /* - Unlink a block from the LRU chain + Unlink a block from the LRU chain */ -static inline void unlink_block(BLOCK_LINK *block) + +static void unlink_block(BLOCK_LINK *block) { if (block->next_used == block) /* The list contains only one member */ - _my_used_last=NULL; - else + my_used_last=NULL; + else { block->next_used->prev_used=block->prev_used; *block->prev_used=block->next_used; - if (_my_used_last == block) - _my_used_last=STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used); + if (my_used_last == block) + my_used_last=STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used); } block->next_used=NULL; - + KEYCACHE_THREAD_TRACE("unlink_block"); #if defined(KEYCACHE_DEBUG) - _my_blocks_available--; - KEYCACHE_DBUG_PRINT("unlink_block", + my_blocks_available--; + KEYCACHE_DBUG_PRINT("unlink_block", ("unlinked block %u status=%x #requests=%u #available=%u", BLOCK_NUMBER(block),block->status, - block->requests,_my_blocks_available)); - KEYCACHE_DBUG_ASSERT(_my_blocks_available >= 0); + block->requests, my_blocks_available)); + KEYCACHE_DBUG_ASSERT(my_blocks_available >= 0); #endif } /* - Register requests for a block + Register requests for a block */ -static inline void reg_requests(BLOCK_LINK *block, int count) +static void reg_requests(BLOCK_LINK *block, int count) { if (! block->requests) /* First request for the block unlinks it */ @@ -669,10 +683,11 @@ static inline void reg_requests(BLOCK_LINK *block, int count) } -/* - Unregister request for a block - linking it to the LRU chain if it's the last request +/* + Unregister request for a block + linking it to the LRU chain if it's the last request */ + static inline void unreg_request(BLOCK_LINK *block, int at_end) { if (! --block->requests) @@ -680,18 +695,19 @@ static inline void unreg_request(BLOCK_LINK *block, int at_end) } /* - Remove a reader of the page in block + Remove a reader of the page in block */ + static inline void remove_reader(BLOCK_LINK *block) -{ +{ if (! --block->hash_link->requests && block->condvar) keycache_pthread_cond_signal(block->condvar); } /* - Wait until the last reader of the page in block - signals on its termination + Wait until the last reader of the page in block + signals on its termination */ static inline void wait_for_readers(BLOCK_LINK *block) { @@ -706,8 +722,9 @@ static inline void wait_for_readers(BLOCK_LINK *block) /* - add a hash link to a bucket in the hash_table + Add a hash link to a bucket in the hash_table */ + static inline void link_hash(HASH_LINK **start, HASH_LINK *hash_link) { if (*start) @@ -719,9 +736,10 @@ static inline void link_hash(HASH_LINK **start, HASH_LINK *hash_link) /* - Remove a hash link from the hash table + Remove a hash link from the hash table */ -static inline void unlink_hash(HASH_LINK *hash_link) + +static void unlink_hash(HASH_LINK *hash_link) { KEYCACHE_DBUG_PRINT("unlink_hash", ("file %u, filepos %lu #requests=%u", (uint) hash_link->file,(ulong) hash_link->diskpos, hash_link->requests)); @@ -730,7 +748,8 @@ static inline void unlink_hash(HASH_LINK *hash_link) hash_link->next->prev=hash_link->prev; hash_link->block=NULL; if (waiting_for_hash_link.last_thread) - { /* Signal that A free hash link appeared */ + { + /* Signal that A free hash link appeared */ struct st_my_thread_var *last_thread=waiting_for_hash_link.last_thread; struct st_my_thread_var *first_thread=last_thread->next; struct st_my_thread_var *next_thread=first_thread; @@ -745,7 +764,7 @@ static inline void unlink_hash(HASH_LINK *hash_link) thread=next_thread; page= (KEYCACHE_PAGE *) thread->opt_info; next_thread=thread->next; - /* + /* We notify about the event all threads that ask for the same page as the first thread in the queue */ @@ -756,18 +775,20 @@ static inline void unlink_hash(HASH_LINK *hash_link) } } while (thread != last_thread); - link_hash(&_my_hash_root[KEYCACHE_HASH(hash_link->file, - hash_link->diskpos)], hash_link); + link_hash(&my_hash_root[KEYCACHE_HASH(hash_link->file, + hash_link->diskpos)], hash_link); return; - } - hash_link->next=_my_free_hash_list; - _my_free_hash_list=hash_link; + } + hash_link->next= my_free_hash_list; + my_free_hash_list=hash_link; } + /* - Get the hash link for a page + Get the hash link for a page */ -static inline HASH_LINK *get_hash_link(int file, my_off_t filepos) + +static HASH_LINK *get_hash_link(int file, my_off_t filepos) { reg1 HASH_LINK *hash_link, **start; KEYCACHE_PAGE page; @@ -784,7 +805,7 @@ restart: start contains the head of the bucket list, hash_link points to the first member of the list */ - hash_link=*(start=&_my_hash_root[KEYCACHE_HASH(file, filepos)]); + hash_link= *(start= &my_hash_root[KEYCACHE_HASH(file, filepos)]); #if defined(KEYCACHE_DEBUG) cnt=0; #endif @@ -795,7 +816,7 @@ restart: hash_link= hash_link->next; #if defined(KEYCACHE_DEBUG) cnt++; - if (! (cnt <= _my_hash_links_used)) + if (! (cnt <= my_hash_links_used)) { int i; for (i=0, hash_link=*start ; @@ -805,22 +826,24 @@ restart: (uint) hash_link->file,(ulong) hash_link->diskpos)); } } - KEYCACHE_DBUG_ASSERT(n <= _my_hash_links_used); + KEYCACHE_DBUG_ASSERT(n <= my_hash_links_used); #endif } if (! hash_link) - { /* There is no hash link in the hash table for the pair (file, filepos) */ - if (_my_free_hash_list) + { + /* There is no hash link in the hash table for the pair (file, filepos) */ + if (my_free_hash_list) { - hash_link=_my_free_hash_list; - _my_free_hash_list=hash_link->next; + hash_link= my_free_hash_list; + my_free_hash_list=hash_link->next; } - else if (_my_hash_links_used < _my_hash_links) + else if (my_hash_links_used < my_hash_links) { - hash_link= &_my_hash_link_root[_my_hash_links_used++]; + hash_link= &my_hash_link_root[my_hash_links_used++]; } else - { /* Wait for a free hash link */ + { + /* Wait for a free hash link */ struct st_my_thread_var *thread=my_thread_var; KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting")); page.file=file; page.filepos=filepos; @@ -836,16 +859,17 @@ restart: } /* Register the request for the page */ hash_link->requests++; - + return hash_link; } /* - Get a block for the file page requested by a keycache read/write operation; - If the page is not in the cache return a free block, if there is none - return the lru block after saving its buffer if the page is dirty -*/ + Get a block for the file page requested by a keycache read/write operation; + If the page is not in the cache return a free block, if there is none + return the lru block after saving its buffer if the page is dirty +*/ + static BLOCK_LINK *find_key_block(int file, my_off_t filepos, int wrmode, int *page_st) { @@ -853,7 +877,7 @@ static BLOCK_LINK *find_key_block(int file, my_off_t filepos, BLOCK_LINK *block; int error=0; int page_status; - + DBUG_ENTER("find_key_block"); KEYCACHE_THREAD_TRACE("find_key_block:begin"); DBUG_PRINT("enter", ("file %u, filepos %lu, wrmode %lu", @@ -863,22 +887,22 @@ static BLOCK_LINK *find_key_block(int file, my_off_t filepos, #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2",test_key_cache("start of find_key_block",0);); #endif - + restart: /* Find the hash link for the requested page (file, filepos) */ hash_link=get_hash_link(file, filepos); - + page_status=-1; if ((block=hash_link->block) && block->hash_link == hash_link && (block->status & BLOCK_READ)) page_status=PAGE_READ; - - if (page_status == PAGE_READ && (block->status & BLOCK_IN_SWITCH)) - { /* This is a request for a page to be removed from cache */ - - KEYCACHE_DBUG_PRINT("find_key_block", + + if (page_status == PAGE_READ && (block->status & BLOCK_IN_SWITCH)) + { + /* This is a request for a page to be removed from cache */ + KEYCACHE_DBUG_PRINT("find_key_block", ("request for old page in block %u",BLOCK_NUMBER(block))); - /* + /* Only reading requests can proceed until the old dirty page is flushed, all others are to be suspended, then resubmitted */ @@ -887,7 +911,7 @@ restart: else { hash_link->requests--; - KEYCACHE_DBUG_PRINT("find_key_block", + KEYCACHE_DBUG_PRINT("find_key_block", ("request waiting for old page to be saved")); { struct st_my_thread_var *thread=my_thread_var; @@ -900,47 +924,51 @@ restart: } while(thread->next); } - KEYCACHE_DBUG_PRINT("find_key_block", + KEYCACHE_DBUG_PRINT("find_key_block", ("request for old page resubmitted")); /* Resubmit the request */ goto restart; } } else - { /* This is a request for a new page or for a page not to be removed */ + { + /* This is a request for a new page or for a page not to be removed */ if (! block) - { /* No block is assigned for the page yet */ - if (_my_blocks_used < (uint) _my_disk_blocks) - { /* There are some never used blocks, take first of them */ - hash_link->block=block= &_my_block_root[_my_blocks_used]; - block->buffer=ADD_TO_PTR(_my_block_mem, - ((ulong) _my_blocks_used*key_cache_block_size), + { + /* No block is assigned for the page yet */ + if (my_blocks_used < (uint) my_disk_blocks) + { + /* There are some never used blocks, take first of them */ + hash_link->block=block= &my_block_root[my_blocks_used]; + block->buffer=ADD_TO_PTR(my_block_mem, + ((ulong) my_blocks_used*key_cache_block_size), byte*); block->status=0; block->length=0; block->offset=key_cache_block_size; block->requests=1; - _my_blocks_used++; + my_blocks_used++; link_to_file_list(block, file, 0); block->hash_link=hash_link; page_status=PAGE_TO_BE_READ; - KEYCACHE_DBUG_PRINT("find_key_block", + KEYCACHE_DBUG_PRINT("find_key_block", ("got never used block %u",BLOCK_NUMBER(block))); } else - { /* There are no never used blocks, use a block from the LRU chain */ + { + /* There are no never used blocks, use a block from the LRU chain */ /* - Wait until a new block is added to the LRU chain; + Wait until a new block is added to the LRU chain; several threads might wait here for the same page, all of them must get the same block */ - - if (! _my_used_last) + + if (! my_used_last) { struct st_my_thread_var *thread=my_thread_var; thread->opt_info=(void *) hash_link; link_into_queue(&waiting_for_block, thread); - do + do { keycache_pthread_cond_wait(&thread->suspend,&THR_LOCK_keycache); } @@ -950,50 +978,53 @@ restart: block=hash_link->block; if (! block) { - /* - Take the first block from the LRU chain + /* + Take the first block from the LRU chain unlinking it from the chain */ - block=_my_used_last->next_used; + block= my_used_last->next_used; reg_requests(block,1); hash_link->block=block; } - - if (block->hash_link != hash_link && ! (block->status & BLOCK_IN_SWITCH) ) - { /* this is a primary request for a new page */ + + if (block->hash_link != hash_link && + ! (block->status & BLOCK_IN_SWITCH) ) + { + /* this is a primary request for a new page */ block->status|=BLOCK_IN_SWITCH; - - KEYCACHE_DBUG_PRINT("find_key_block", + + KEYCACHE_DBUG_PRINT("find_key_block", ("got block %u for new page",BLOCK_NUMBER(block))); - + if (block->status & BLOCK_CHANGED) - { /* The block contains a dirty page - push it out of the cache */ - + { + /* The block contains a dirty page - push it out of the cache */ + KEYCACHE_DBUG_PRINT("find_key_block",("block is dirty")); - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - /* - The call is thread safe because only the current - thread might change the block->hash_link value + /* + The call is thread safe because only the current + thread might change the block->hash_link value */ error=my_pwrite(block->hash_link->file,block->buffer, block->length,block->hash_link->diskpos, - MYF(MY_NABP | MY_WAIT_IF_FULL)); + MYF(MY_NABP | MY_WAIT_IF_FULL)); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_write++; + my_cache_write++; } - + block->status|=BLOCK_REASSIGNED; if (block->hash_link) { - /* - Wait until all pending read requests - for this page are executed - (we could have avoided this waiting, if we had read - a page in the cache in a sweep, without yielding control) + /* + Wait until all pending read requests + for this page are executed + (we could have avoided this waiting, if we had read + a page in the cache in a sweep, without yielding control) */ wait_for_readers(block); - + /* Remove the hash link for this page from the hash table */ unlink_hash(block->hash_link); /* All pending requests for this page must be resubmitted */ @@ -1006,7 +1037,7 @@ restart: block->offset=key_cache_block_size; block->hash_link=hash_link; page_status=PAGE_TO_BE_READ; - + KEYCACHE_DBUG_ASSERT(block->hash_link->block == block); KEYCACHE_DBUG_ASSERT(hash_link->block->hash_link == hash_link); } @@ -1018,8 +1049,8 @@ restart: PAGE_READ : PAGE_WAIT_TO_BE_READ; } } - - _my_cache_read++; + + my_cache_read++; } else { @@ -1029,10 +1060,10 @@ restart: PAGE_READ : PAGE_WAIT_TO_BE_READ; } } - + KEYCACHE_DBUG_ASSERT(page_status != -1); *page_st=page_status; - + #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2",test_key_cache("end of find_key_block",0);); #endif @@ -1042,55 +1073,58 @@ restart: /* - Read into a key cache block buffer from disk; - do not to report error when the size of successfully read - portion is less than read_length, but not less than min_length + Read into a key cache block buffer from disk; + do not to report error when the size of successfully read + portion is less than read_length, but not less than min_length */ + static void read_block(BLOCK_LINK *block, uint read_length, uint min_length, my_bool primary) { uint got_length; - + /* On entry THR_LOCK_keycache is locked */ - + KEYCACHE_THREAD_TRACE("read_block"); if (primary) - { /* - This code is executed only by threads - that submitted primary requests + { + /* + This code is executed only by threads + that submitted primary requests */ - - KEYCACHE_DBUG_PRINT("read_block", + + KEYCACHE_DBUG_PRINT("read_block", ("page to be read by primary request")); - + /* Page is not in buffer yet, is to be read from disk */ keycache_pthread_mutex_unlock(&THR_LOCK_keycache); got_length=my_pread(block->hash_link->file,block->buffer, read_length,block->hash_link->diskpos,MYF(0)); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - if (got_length < min_length) + if (got_length < min_length) block->status|=BLOCK_ERROR; else { block->status=BLOCK_READ; block->length=got_length; } - KEYCACHE_DBUG_PRINT("read_block", + KEYCACHE_DBUG_PRINT("read_block", ("primary request: new page in cache")); /* Signal that all pending requests for this page now can be processed */ if (block->wqueue[COND_FOR_REQUESTED].last_thread) release_queue(&block->wqueue[COND_FOR_REQUESTED]); } - else - { /* - This code is executed only by threads - that submitted secondary requests + else + { + /* + This code is executed only by threads + that submitted secondary requests */ - KEYCACHE_DBUG_PRINT("read_block", + KEYCACHE_DBUG_PRINT("read_block", ("secondary request waiting for new page to be read")); { struct st_my_thread_var *thread=my_thread_var; - /* Put the request into a queue and wait until it can be processed */ + /* Put the request into a queue and wait until it can be processed */ add_to_queue(&block->wqueue[COND_FOR_REQUESTED],thread); do { @@ -1098,44 +1132,45 @@ static void read_block(BLOCK_LINK *block, uint read_length, } while (thread->next); } - KEYCACHE_DBUG_PRINT("read_block", + KEYCACHE_DBUG_PRINT("read_block", ("secondary request: new page in cache")); } } /* - Read a block of data from a cached file into a buffer; - if return_buffer is set then the cache buffer is returned if - it can be used; - filepos must be a multiple of 'block_length', but it doesn't - have to be a multiple of key_cache_block_size; - returns adress from where data is read + Read a block of data from a cached file into a buffer; + if return_buffer is set then the cache buffer is returned if + it can be used; + filepos must be a multiple of 'block_length', but it doesn't + have to be a multiple of key_cache_block_size; + returns adress from where data is read */ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, - uint block_length __attribute__((unused)), - int return_buffer __attribute__((unused))) + uint block_length __attribute__((unused)), + int return_buffer __attribute__((unused))) { int error=0; DBUG_ENTER("key_cache_read"); DBUG_PRINT("enter", ("file %u, filepos %lu, length %u", (uint) file,(ulong) filepos,length)); - - if (_my_disk_blocks > 0) - { /* Key cache is used */ + + if (my_disk_blocks > 0) + { + /* Key cache is used */ reg1 BLOCK_LINK *block; uint offset= (uint) (filepos & (key_cache_block_size-1)); byte *start=buff; uint read_length; uint status; int page_st; - + #ifndef THREAD if (block_length > key_cache_block_size || offset) return_buffer=0; #endif - + /* Read data in key_cache_block_size increments */ filepos-= offset; do @@ -1144,7 +1179,7 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, key_cache_block_size : length; KEYCACHE_DBUG_ASSERT(read_length > 0); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_r_requests++; + my_cache_r_requests++; block=find_key_block(file,filepos,0,&page_st); if (page_st != PAGE_READ) { @@ -1154,26 +1189,26 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, } else if (! (block->status & BLOCK_ERROR) && block->length < read_length + offset) - { - /* - Impossible if nothing goes wrong: - this could only happen if we are using a file with - small key blocks and are trying to read outside the file + { + /* + Impossible if nothing goes wrong: + this could only happen if we are using a file with + small key blocks and are trying to read outside the file */ my_errno=-1; block->status|=BLOCK_ERROR; } - + if (! ((status=block->status) & BLOCK_ERROR)) { #ifndef THREAD - if (! return_buffer) + if (! return_buffer) #endif { #if !defined(SERIALIZED_READ_FROM_CACHE) keycache_pthread_mutex_unlock(&THR_LOCK_keycache); #endif - + /* Copy data from the cache buffer */ if (!(read_length & 511)) bmove512(buff,block->buffer+offset,read_length); @@ -1185,35 +1220,35 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, #endif } } - + remove_reader(block); - /* - Link the block into the LRU chain - if it's the last submitted request for the block + /* + Link the block into the LRU chain + if it's the last submitted request for the block */ unreg_request(block,1); - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - + if (status & BLOCK_ERROR) DBUG_RETURN((byte *) 0); - + #ifndef THREAD if (return_buffer) return (block->buffer); #endif - + buff+=read_length; filepos+=read_length; offset=0; - + } while ((length-= read_length)); DBUG_RETURN(start); } - + /* Key cache is not used */ - statistic_increment(_my_cache_r_requests,&THR_LOCK_keycache); - statistic_increment(_my_cache_read,&THR_LOCK_keycache); + statistic_increment(my_cache_r_requests,&THR_LOCK_keycache); + statistic_increment(my_cache_read,&THR_LOCK_keycache); if (my_pread(file,(byte*) buff,length,filepos,MYF(MY_NABP))) error=1; DBUG_RETURN(error? (byte*) 0 : buff); @@ -1221,12 +1256,13 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, /* - Write a buffer into disk; - filepos must be a multiple of 'block_length', but it doesn't - have to be a multiple of key cache block size; - if !dont_write then all dirty pages involved in writing should - have been flushed from key cache before the function starts + Write a buffer into disk; + filepos must be a multiple of 'block_length', but it doesn't + have to be a multiple of key cache block size; + if !dont_write then all dirty pages involved in writing should + have been flushed from key cache before the function starts */ + int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, uint block_length __attribute__((unused)), int dont_write) @@ -1239,31 +1275,33 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, (uint) file,(ulong) filepos,length,block_length)); if (!dont_write) - { /* Force writing from buff into disk */ - statistic_increment(_my_cache_write, &THR_LOCK_keycache); + { + /* Force writing from buff into disk */ + statistic_increment(my_cache_write, &THR_LOCK_keycache); if (my_pwrite(file,buff,length,filepos,MYF(MY_NABP | MY_WAIT_IF_FULL))) DBUG_RETURN(1); } - + #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache",test_key_cache("start of key_cache_write",1);); #endif - - if (_my_disk_blocks > 0) - { /* Key cache is used */ + + if (my_disk_blocks > 0) + { + /* Key cache is used */ uint read_length; uint offset= (uint) (filepos & (key_cache_block_size-1)); int page_st; - + /* Write data in key_cache_block_size increments */ filepos-= offset; do { read_length= length > key_cache_block_size ? - key_cache_block_size : length; + key_cache_block_size : length; KEYCACHE_DBUG_ASSERT(read_length > 0); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_w_requests++; + my_cache_w_requests++; block=find_key_block(file, filepos, 1, &page_st); if (page_st != PAGE_READ && (offset || read_length < key_cache_block_size)) @@ -1271,19 +1309,20 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, offset + read_length >= key_cache_block_size? offset : key_cache_block_size, offset,(my_bool)(page_st == PAGE_TO_BE_READ)); - + if (!dont_write) - { /* buff has been written to disk at start */ - if ((block->status & BLOCK_CHANGED) && + { + /* buff has been written to disk at start */ + if ((block->status & BLOCK_CHANGED) && (!offset && read_length >= key_cache_block_size)) link_to_file_list(block, block->hash_link->file, 1); } else if (! (block->status & BLOCK_CHANGED)) link_to_changed_list(block); - + set_if_smaller(block->offset,offset) set_if_bigger(block->length,read_length+offset); - + if (! (block->status & BLOCK_ERROR)) { if (!(read_length & 511)) @@ -1291,26 +1330,26 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, else memcpy(block->buffer+offset,buff,(size_t) read_length); } - - block->status|=BLOCK_READ; - + + block->status|=BLOCK_READ; + /* Unregister the request */ block->hash_link->requests--; unreg_request(block,1); - + if (block->status & BLOCK_ERROR) { keycache_pthread_mutex_unlock(&THR_LOCK_keycache); error=1; break; } - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - + buff+=read_length; filepos+=read_length; offset=0; - + } while ((length-= read_length)); } else @@ -1318,8 +1357,8 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, /* Key cache is not used */ if (dont_write) { - statistic_increment(_my_cache_w_requests, &THR_LOCK_keycache); - statistic_increment(_my_cache_write, &THR_LOCK_keycache); + statistic_increment(my_cache_w_requests, &THR_LOCK_keycache); + statistic_increment(my_cache_write, &THR_LOCK_keycache); if (my_pwrite(file,(byte*) buff,length,filepos,MYF(MY_NABP | MY_WAIT_IF_FULL))) error=1; } @@ -1332,32 +1371,33 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, } -/* - Free block: remove reference to it from hash table, - remove it from the chain file of dirty/clean blocks - and add it at the beginning of the LRU chain -*/ +/* + Free block: remove reference to it from hash table, + remove it from the chain file of dirty/clean blocks + and add it at the beginning of the LRU chain +*/ + static void free_block(BLOCK_LINK *block) { KEYCACHE_THREAD_TRACE("free block"); - KEYCACHE_DBUG_PRINT("free_block", - ("block %u to be freed",BLOCK_NUMBER(block))); - if (block->hash_link) + KEYCACHE_DBUG_PRINT("free_block", + ("block %u to be freed",BLOCK_NUMBER(block))); + if (block->hash_link) { block->status|=BLOCK_REASSIGNED; wait_for_readers(block); unlink_hash(block->hash_link); } - + unlink_changed(block); block->status=0; block->length=0; block->offset=key_cache_block_size; KEYCACHE_THREAD_TRACE("free block"); - KEYCACHE_DBUG_PRINT("free_block", + KEYCACHE_DBUG_PRINT("free_block", ("block is freed")); unreg_request(block,0); - block->hash_link=NULL; + block->hash_link=NULL; } @@ -1368,10 +1408,11 @@ static int cmp_sec_link(BLOCK_LINK **a, BLOCK_LINK **b) } -/* - Flush a portion of changed blocks to disk, - free used blocks if requested +/* + Flush a portion of changed blocks to disk, + free used blocks if requested */ + static int flush_cached_blocks(File file, BLOCK_LINK **cache, BLOCK_LINK **end, enum flush_type type) @@ -1379,27 +1420,27 @@ static int flush_cached_blocks(File file, BLOCK_LINK **cache, int error; int last_errno=0; uint count=end-cache; - + /* Don't lock the cache during the flush */ keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - /* - As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH - we are guarunteed no thread will change them + /* + As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH + we are guarunteed no thread will change them */ qsort((byte*) cache,count,sizeof(*cache),(qsort_cmp) cmp_sec_link); - + keycache_pthread_mutex_lock(&THR_LOCK_keycache); for ( ; cache != end ; cache++) { BLOCK_LINK *block= *cache; - - KEYCACHE_DBUG_PRINT("flush_cached_blocks", + + KEYCACHE_DBUG_PRINT("flush_cached_blocks", ("block %u to be flushed", BLOCK_NUMBER(block))); keycache_pthread_mutex_unlock(&THR_LOCK_keycache); error=my_pwrite(file,block->buffer+block->offset,block->length, block->hash_link->diskpos,MYF(MY_NABP | MY_WAIT_IF_FULL)); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_write++; + my_cache_write++; if (error) { block->status|= BLOCK_ERROR; @@ -1409,42 +1450,44 @@ static int flush_cached_blocks(File file, BLOCK_LINK **cache, /* type will never be FLUSH_IGNORE_CHANGED here */ if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE)) { - _my_blocks_changed--; + my_blocks_changed--; free_block(block); } - else + else { block->status&=~BLOCK_IN_FLUSH; link_to_file_list(block,file,1); unreg_request(block,1); } - + } return last_errno; } /* - Flush all blocks for a file to disk + Flush all blocks for a file to disk */ + int flush_key_blocks(File file, enum flush_type type) { int last_errno=0; BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache; DBUG_ENTER("flush_key_blocks"); DBUG_PRINT("enter",("file: %d blocks_used: %d blocks_changed: %d", - file,_my_blocks_used,_my_blocks_changed)); - + file, my_blocks_used, my_blocks_changed)); + #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache",test_key_cache("start of flush_key_blocks",0);); #endif - + keycache_pthread_mutex_lock(&THR_LOCK_keycache); - - cache=cache_buff; - if (_my_disk_blocks > 0 && + + cache=cache_buff; + if (my_disk_blocks > 0 && (!my_disable_flush_key_blocks || type != FLUSH_KEEP)) - { /* Key cache exists and flush is not disabled */ + { + /* Key cache exists and flush is not disabled */ int error=0; uint count=0; BLOCK_LINK **pos,**end; @@ -1453,10 +1496,10 @@ int flush_key_blocks(File file, enum flush_type type) #if defined(KEYCACHE_DEBUG) uint cnt=0; #endif - + if (type != FLUSH_IGNORE_CHANGED) { - /* + /* Count how many key blocks we have to cache to be able to flush all dirty pages with minimum seek moves */ @@ -1467,18 +1510,18 @@ int flush_key_blocks(File file, enum flush_type type) if (block->hash_link->file == file) { count++; - KEYCACHE_DBUG_ASSERT(count<=_my_blocks_used); + KEYCACHE_DBUG_ASSERT(count<= my_blocks_used); } } /* Allocate a new buffer only if its bigger than the one we have */ - if (count > FLUSH_CACHE && + if (count > FLUSH_CACHE && !(cache=(BLOCK_LINK**) my_malloc(sizeof(BLOCK_LINK*)*count,MYF(0)))) { - cache=cache_buff; + cache=cache_buff; count=FLUSH_CACHE; } } - + /* Retrieve the blocks and write them to a buffer to be flushed */ restart: end=(pos=cache)+count; @@ -1488,37 +1531,40 @@ restart: { #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif next=block->next_changed; if (block->hash_link->file == file) { - /* + /* Mark the block with BLOCK_IN_FLUSH in order not to let other threads to use it for new pages and interfere with our sequence ot flushing dirty file pages */ block->status|= BLOCK_IN_FLUSH; - + if (! (block->status & BLOCK_IN_SWITCH)) - { /* - We care only for the blocks for which flushing was not - initiated by other threads as a result of page swapping - */ + { + /* + We care only for the blocks for which flushing was not + initiated by other threads as a result of page swapping + */ reg_requests(block,1); - if (type != FLUSH_IGNORE_CHANGED) - { /* It's not a temporary file */ + if (type != FLUSH_IGNORE_CHANGED) + { + /* It's not a temporary file */ if (pos == end) - { /* - This happens only if there is not enough - memory for the big block + { + /* + This happens only if there is not enough + memory for the big block */ if ((error=flush_cached_blocks(file,cache,end,type))) - last_errno=error; - /* - Restart the scan as some other thread might have changed - the changed blocks chain: the blocks that were in switch - state before the flush started have to be excluded + last_errno=error; + /* + Restart the scan as some other thread might have changed + the changed blocks chain: the blocks that were in switch + state before the flush started have to be excluded */ goto restart; } @@ -1527,12 +1573,13 @@ restart: else { /* It's a temporary file */ - _my_blocks_changed--; + my_blocks_changed--; free_block(block); } } else - { /* Link the block into a list of blocks 'in switch' */ + { + /* Link the block into a list of blocks 'in switch' */ unlink_changed(block); link_changed(block,&first_in_switch); } @@ -1561,7 +1608,7 @@ restart: } #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif } /* The following happens very seldom */ @@ -1576,7 +1623,7 @@ restart: { #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif next=block->next_changed; if (block->hash_link->file == file && @@ -1589,9 +1636,9 @@ restart: } } } - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - + #ifndef DBUG_OFF DBUG_EXECUTE("check_keycache", test_key_cache("end of flush_key_blocks",0);); @@ -1604,30 +1651,31 @@ restart: } -/* - Flush all blocks in the key cache to disk +/* + Flush all blocks in the key cache to disk */ + static int flush_all_key_blocks() { #if defined(KEYCACHE_DEBUG) uint cnt=0; #endif - while (_my_blocks_changed > 0) + while (my_blocks_changed > 0) { BLOCK_LINK *block; - for (block=_my_used_last->next_used ; ; block=block->next_used) + for (block= my_used_last->next_used ; ; block=block->next_used) { if (block->hash_link) { #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif if (flush_key_blocks(block->hash_link->file, FLUSH_RELEASE)) return 1; break; } - if (block == _my_used_last) + if (block == my_used_last) break; } } @@ -1637,13 +1685,13 @@ static int flush_all_key_blocks() #ifndef DBUG_OFF /* - Test if disk-cache is ok + Test if disk-cache is ok */ -static void test_key_cache(const char *where __attribute__((unused)), +static void test_key_cache(const char *where __attribute__((unused)), my_bool lock __attribute__((unused))) { /* TODO */ -} +} #endif #if defined(KEYCACHE_TIMEOUT) @@ -1680,7 +1728,7 @@ static void keycache_dump() break; } while (thread != last); - + i=0; thread=last=waiting_for_block.last_thread; fprintf(keycache_dump_file, "queue of threads waiting for block\n"); @@ -1698,11 +1746,11 @@ static void keycache_dump() } while (thread != last); - for (i=0 ; i< _my_blocks_used ; i++) + for (i=0 ; i< my_blocks_used ; i++) { int j; - block=&_my_block_root[i]; - hash_link=block->hash_link; + block= &my_block_root[i]; + hash_link= block->hash_link; fprintf(keycache_dump_file, "block:%u hash_link:%d status:%x #requests=%u waiting_for_readers:%d\n", i, (int) (hash_link ? HASH_LINK_NUMBER(hash_link) : -1), @@ -1713,6 +1761,7 @@ static void keycache_dump() thread=last=wqueue->last_thread; fprintf(keycache_dump_file, "queue #%d\n", j); if (thread) + { do { thread=thread->next; @@ -1722,20 +1771,23 @@ static void keycache_dump() break; } while (thread != last); + } } } fprintf(keycache_dump_file, "LRU chain:"); - block=_my_used_last; + block= my_used_last; if (block) + { do { block=block->next_used; fprintf(keycache_dump_file, "block:%u, ", BLOCK_NUMBER(block)); } - while (block != _my_used_last); + while (block != my_used_last); + } fprintf(keycache_dump_file, "\n"); - + fclose(keycache_dump_file); } @@ -1744,7 +1796,7 @@ static void keycache_dump() #if defined(KEYCACHE_TIMEOUT) && !defined(__WIN__) -static int keycache_pthread_cond_wait(pthread_cond_t *cond, +static int keycache_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { int rc; @@ -1754,8 +1806,8 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond, #if defined(KEYCACHE_DEBUG) int cnt=0; #endif - - /* Get current time */ + + /* Get current time */ gettimeofday(&now, &tz); /* Prepare timeout value */ timeout.tv_sec = now.tv_sec + KEYCACHE_TIMEOUT; @@ -1773,16 +1825,16 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond, KEYCACHE_THREAD_TRACE_BEGIN("finished waiting"); #if defined(KEYCACHE_DEBUG) if (rc == ETIMEDOUT) - { + { fprintf(keycache_debug_log,"aborted by keycache timeout\n"); fclose(keycache_debug_log); abort(); } #endif - + if (rc == ETIMEDOUT) keycache_dump(); - + #if defined(KEYCACHE_DEBUG) KEYCACHE_DBUG_ASSERT(rc != ETIMEDOUT); #else @@ -1867,4 +1919,3 @@ void keycache_debug_log_close(void) #endif /* defined(KEYCACHE_DEBUG_LOG) */ #endif /* defined(KEYCACHE_DEBUG) */ - diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 4d3b0604984..abd51369f95 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -25,6 +25,8 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size __attribute__((unused))) { + DBUG_ENTER("init_alloc_root"); + DBUG_PRINT("enter",("root: %lx", mem_root)); mem_root->free= mem_root->used= mem_root->pre_alloc= 0; mem_root->min_malloc= 32; mem_root->block_size= block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8; @@ -45,24 +47,27 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, } } #endif + DBUG_VOID_RETURN; } gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) { #if defined(HAVE_purify) && defined(EXTRA_DEBUG) reg1 USED_MEM *next; - Size+=ALIGN_SIZE(sizeof(USED_MEM)); + DBUG_ENTER("alloc_root"); + DBUG_PRINT("enter",("root: %lx", mem_root)); + Size+=ALIGN_SIZE(sizeof(USED_MEM)); if (!(next = (USED_MEM*) my_malloc(Size,MYF(MY_WME)))) { if (mem_root->error_handler) (*mem_root->error_handler)(); - return((gptr) 0); /* purecov: inspected */ + DBUG_RETURN((gptr) 0); /* purecov: inspected */ } next->next= mem_root->used; next->size= Size; mem_root->used= next; - return (gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM))); + DBUG_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); #else uint get_size, block_size; gptr point; @@ -151,8 +156,9 @@ void free_root(MEM_ROOT *root, myf MyFlags) { reg1 USED_MEM *next,*old; DBUG_ENTER("free_root"); + DBUG_PRINT("enter",("root: %lx flags: %u", root, (uint) MyFlags)); - if (!root) + if (!root) /* QQ: Should be deleted */ DBUG_VOID_RETURN; /* purecov: inspected */ if (MyFlags & MY_MARK_BLOCKS_FREE) { diff --git a/mysys/my_copy.c b/mysys/my_copy.c index 012eaec4ea8..84eda781a09 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -31,17 +31,29 @@ struct utimbuf { #endif - /* - Ordinary ownership and accesstimes are copied from 'from-file' - if MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then - the modes of to-file isn't changed - Dont set MY_FNABP or MY_NABP bits on when calling this function ! - */ +/* + int my_copy(const char *from, const char *to, myf MyFlags) + + NOTES + Ordinary ownership and accesstimes are copied from 'from-file' + If MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then + the modes of to-file isn't changed + If MyFlags & MY_DONT_OVERWRITE_FILE is set, we will give an error + if the file existed. + + WARNING + Don't set MY_FNABP or MY_NABP bits on when calling this function ! + + RETURN + 0 ok + # Error + +*/ int my_copy(const char *from, const char *to, myf MyFlags) { uint Count; - int new_file_stat; + int new_file_stat, create_flag; File from_file,to_file; char buff[IO_SIZE]; struct stat stat_buff,new_stat_buff; @@ -62,8 +74,10 @@ int my_copy(const char *from, const char *to, myf MyFlags) } if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) stat_buff=new_stat_buff; + create_flag= (MyFlags & MY_DONT_OVERWRITE_FILE) ? O_EXCL : O_TRUNC; + if ((to_file= my_create(to,(int) stat_buff.st_mode, - O_WRONLY | O_TRUNC | O_BINARY | O_SHARE, + O_WRONLY | create_flag | O_BINARY | O_SHARE, MyFlags)) < 0) goto err; diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index c6fe606eaaf..759c96462f6 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -431,8 +431,8 @@ int handle_options(int *argc, char ***argv, Will set the option value to given value */ -static int setval (const struct my_option *opts, char *argument, - my_bool set_maximum_value) +static int setval(const struct my_option *opts, char *argument, + my_bool set_maximum_value) { int err= 0; diff --git a/mysys/my_lib.c b/mysys/my_lib.c index a06120894c5..035bafd07b9 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -103,7 +103,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1]; #endif DBUG_ENTER("my_dir"); - DBUG_PRINT("my",("path: '%s' stat: %d MyFlags: %d",path,MyFlags)); + DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags)); #if defined(THREAD) && !defined(HAVE_READDIR_R) pthread_mutex_lock(&THR_LOCK_open); diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c index a652fae3574..d079b9f66a5 100644 --- a/mysys/my_tempnam.c +++ b/mysys/my_tempnam.c @@ -115,13 +115,19 @@ my_string my_tempnam(const char *dir, const char *pfx, old_env=(char**)environ; if (dir) { /* Don't use TMPDIR if dir is given */ - ((char**) environ)=(char**) temp_env; + /* + The following strange cast is required because the IBM compiler on AIX + doesn't allow us to cast the value of environ. + The cast of environ is needed as some systems doesn't allow us to + update environ with a char ** pointer. (const mismatch) + */ + (*(char***) &environ)=(char**) temp_env; temp_env[0]=0; } #endif res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */ #if !defined(OS2) && !defined(__NETWARE__) - ((char**) environ)=(char**) old_env; + (*(char***) &environ)=(char**) old_env; #endif if (!res) DBUG_PRINT("error",("Got error: %d from tempnam",errno)); diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index c796bd1956a..b6e7cb47234 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -945,6 +945,54 @@ void thr_abort_locks(THR_LOCK *lock) } +/* + Abort all locks for specific table/thread combination + + This is used to abort all locks for a specific thread +*/ + +void thr_abort_locks_for_thread(THR_LOCK *lock, pthread_t thread) +{ + THR_LOCK_DATA *data; + DBUG_ENTER("thr_abort_locks_for_thread"); + + pthread_mutex_lock(&lock->mutex); + for (data= lock->read_wait.data; data ; data= data->next) + { + if (pthread_equal(thread, data->thread)) + { + DBUG_PRINT("info",("Aborting read-wait lock")); + data->type= TL_UNLOCK; /* Mark killed */ + pthread_cond_signal(data->cond); + data->cond= 0; /* Removed from list */ + + if (((*data->prev)= data->next)) + data->next->prev= data->prev; + else + lock->read_wait.last= data->prev; + } + } + for (data= lock->write_wait.data; data ; data= data->next) + { + if (pthread_equal(thread, data->thread)) + { + DBUG_PRINT("info",("Aborting write-wait lock")); + data->type= TL_UNLOCK; + pthread_cond_signal(data->cond); + data->cond= 0; + + if (((*data->prev)= data->next)) + data->next->prev= data->prev; + else + lock->write_wait.last= data->prev; + } + } + pthread_mutex_unlock(&lock->mutex); + DBUG_VOID_RETURN; +} + + + /* Upgrade a WRITE_DELAY lock to a WRITE_LOCK */ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data) diff --git a/netware/BUILD/compile-netware-START b/netware/BUILD/compile-netware-START index ceac111b36c..2941d8868e4 100755 --- a/netware/BUILD/compile-netware-START +++ b/netware/BUILD/compile-netware-START @@ -17,7 +17,7 @@ set -e base_configs=" \ --host=i686-pc-netware \ --enable-local-infile \ - --with-extra-charsets=latin1_de \ + --with-extra-charsets=all \ --prefix=N:/mysql \ " diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index d37a3ed5472..d2b64409c88 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -1,18 +1,18 @@ #! /bin/sh -# WINE_BUILD_DIR, BUILD_DIR, and VERSION must be correct before compiling +# WINE_BUILD_DIR, BUILD_DIR, and VERSION must be changed before compiling # This values are normally changed by the nwbootstrap script -# the default is "F:/mydev" +# the default for WINE_BUILD_DIR is "F:/mydev" export MYDEV="WINE_BUILD_DIR" -export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/zlib-1.1.4" -export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4" -export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a" +export MWCNWx86Includes="$MYDEV/libc/include" +export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib" +export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib" export WINEPATH="$MYDEV/mw/bin" -# the default added path is "$HOME/mydev/mysql-x.x-x/netware/BUILD" +# the default for BUILD_DIR is "$HOME/mydev" export PATH="$PATH:BUILD_DIR/mysql-VERSION/netware/BUILD" export AR='mwldnlm' diff --git a/netware/mysql_fix_privilege_tables.pl b/netware/mysql_fix_privilege_tables.pl new file mode 100644 index 00000000000..fd5bc11dde1 --- /dev/null +++ b/netware/mysql_fix_privilege_tables.pl @@ -0,0 +1,125 @@ +#----------------------------------------------------------------------------- +# Copyright (C) 2002 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# This notice applies to changes, created by or for Novell, Inc., +# to preexisting works for which notices appear elsewhere in this file. + +# Copyright (c) 2003 Novell, Inc. All Rights Reserved. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +#----------------------------------------------------------------------------- + +use strict; +use Mysql; + +print "MySQL Fix Privilege Tables Script\n\n"; + +print "NOTE: This script updates your privilege tables to the lastest\n"; +print " specifications!\n\n"; + +#----------------------------------------------------------------------------- +# get the current root password +#----------------------------------------------------------------------------- + +print "In order to log into MySQL to update it, we'll need the current\n"; +print "password for the root user. If you've just installed MySQL, and\n"; +print "you haven't set the root password yet, the password will be blank,\n"; +print "so you should just press enter here.\n\n"; + +print "Enter the current password for root: "; +my $password = <STDIN>; +chomp $password; +print "\n"; + +my $conn = Mysql->connect("localhost", "mysql", "root", $password) + || die "Unable to connect to MySQL."; + +print "OK, successfully used the password, moving on...\n\n"; + + +#----------------------------------------------------------------------------- +# MySQL 4.0.2 +#----------------------------------------------------------------------------- + +print "Adding new fields used by MySQL 4.0.2 to the privilege tables...\n"; +print "NOTE: You can ignore any Duplicate column errors.\n"; +$conn->query(" \ +ALTER TABLE user \ +ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, \ +ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, \ +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, \ +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, \ +ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, \ +ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, \ +ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; \ +") && $conn->query(" \ +UPDATE user SET show_db_priv=select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>''; \ +"); + +#----------------------------------------------------------------------------- +# MySQL 4.0 Limitations +#----------------------------------------------------------------------------- + +print "Adding new fields used by MySQL 4.0 security limitations...\n"; + +$conn->query(" \ +ALTER TABLE user \ +ADD max_questions int(11) NOT NULL AFTER x509_subject, \ +ADD max_updates int(11) unsigned NOT NULL AFTER max_questions, \ +ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; \ +"); + +#----------------------------------------------------------------------------- +# MySQL 4.0 DB and Host privs +#----------------------------------------------------------------------------- + +print "Adding new fields used by MySQL 4.0 locking and temporary table security...\n"; + +$conn->query(" \ +ALTER TABLE db \ +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, \ +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; \ +"); + +$conn->query(" \ +ALTER TABLE host \ +ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, \ +ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; \ +"); + +#----------------------------------------------------------------------------- +# done +#----------------------------------------------------------------------------- + +print "\n\nAll done!\n\n"; + +print "Thanks for using MySQL!\n\n"; + diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c index 59c40eb61e6..1ab90775e02 100644 --- a/netware/mysqld_safe.c +++ b/netware/mysqld_safe.c @@ -36,6 +36,7 @@ ******************************************************************************/
char autoclose;
char basedir[PATH_MAX];
+char checktables; char datadir[PATH_MAX];
char pid_file[PATH_MAX];
char address[PATH_MAX];
@@ -54,6 +55,7 @@ FILE *log_fd = NULL; ******************************************************************************/
+void usage(void); void vlog(char *, va_list);
void log(char *, ...);
void start_defaults(int, char*[]);
@@ -74,6 +76,42 @@ void mysql_start(int, char*[]); /******************************************************************************
+ usage() + + Show usage. + +******************************************************************************/ +void usage(void) +{ + // keep the screen up + setscreenmode(SCR_NO_MODE); + + puts("\ +\n\ +usage: mysqld_safe [options]\n\ +\n\ +Program to start the MySQL daemon and restart it if it dies unexpectedly.\n\ +All options, besides those listed below, are passed on to the MySQL daemon.\n\ +\n\ +options:\n\ +\n\ +--autoclose Automatically close the mysqld_safe screen.\n\ +\n\ +--check-tables Check the tables before starting the MySQL daemon.\n\ +\n\ +--err-log=<file> Send the MySQL daemon error output to <file>.\n\ +\n\ +--help Show this help information.\n\ +\n\ +--mysqld=<file> Use the <file> MySQL daemon.\n\ +\n\ + "); + + exit(-1); +} + +/****************************************************************************** + vlog()
Log the message.
@@ -136,6 +174,9 @@ void start_defaults(int argc, char *argv[]) // basedir
get_basedir(argv[0], basedir);
+ // check-tables + checktables = FALSE; + // hostname
if (gethostname(hostname,PATH_MAX) < 0)
{
@@ -279,13 +320,15 @@ void parse_args(int argc, char *argv[]) OPT_PORT,
OPT_ERR_LOG,
OPT_SAFE_LOG,
- OPT_MYSQLD
+ OPT_MYSQLD, + OPT_HELP };
static struct option options[] =
{
{"autoclose", no_argument, &autoclose, TRUE},
{"basedir", required_argument, 0, OPT_BASEDIR},
+ {"check-tables", no_argument, &checktables, TRUE}, {"datadir", required_argument, 0, OPT_DATADIR},
{"pid-file", required_argument, 0, OPT_PID_FILE},
{"bind-address", required_argument, 0, OPT_BIND_ADDRESS},
@@ -293,6 +336,7 @@ void parse_args(int argc, char *argv[]) {"err-log", required_argument, 0, OPT_ERR_LOG},
{"safe-log", required_argument, 0, OPT_SAFE_LOG},
{"mysqld", required_argument, 0, OPT_MYSQLD},
+ {"help", no_argument, 0, OPT_HELP}, {0, 0, 0, 0}
};
@@ -341,6 +385,10 @@ void parse_args(int argc, char *argv[]) strcpy(mysqld, optarg);
break;
+ case OPT_HELP: + usage(); + break; + default:
// ignore
break;
@@ -563,6 +611,8 @@ void mysql_start(int argc, char *argv[]) static char *private_options[] =
{
"--autoclose",
+ "--check-tables", + "--help", "--err-log=",
"--mysqld=",
NULL
@@ -594,7 +644,7 @@ void mysql_start(int argc, char *argv[]) do
{
// check the database tables
- check_tables();
+ if (checktables) check_tables(); // status
time(&cal);
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 3b4d19b7eed..88f561e0e6d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -58,10 +58,9 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ - mysqlbug \ - fill_help_tables.sql + mysqlbug -pkgdata_DATA = make_binary_distribution +pkgdata_DATA = fill_help_tables.sql # mysqlbug should be distributed built so that people can report build # failures with it. @@ -81,8 +80,8 @@ CLEANFILES = @server_scripts@ \ mysqlhotcopy \ mysqldumpslow \ mysqld_multi \ - fill_help_tables \ - fill_help_tables.sql + fill_help_tables \ + fill_help_tables.sql SUPERCLEANFILES = mysqlbug @@ -103,6 +102,7 @@ SUFFIXES = .sh -e 's!@''libexecdir''@!$(libexecdir)!g' \ -e 's!@''pkglibdir''@!$(pkglibdir)!g' \ -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \ + -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \ -e 's!@''CC''@!@CC@!'\ -e 's!@''CXX''@!@CXX@!'\ -e 's!@''GXX''@!@GXX@!'\ @@ -137,7 +137,12 @@ SUFFIXES = .sh # Don't update the files from bitkeeper %::SCCS/s.% -all: fill_help_tables.sql make_win_src_distribution +all: fill_help_tables.sql make_win_src_distribution make_binary_distribution + +# The following rule is here to ensure that build will continue +# even if we don't have perl installed. In this case the help tables +# will be empty fill_help_tables.sql: fill_help_tables ../Docs/manual.texi - ./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql + -./fill_help_tables < ../Docs/manual.texi > fill_help_tables.sql + echo "" >> fill_help_tables.sql diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 52dfa018d6e..e21b0ff2bb0 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -111,12 +111,12 @@ sub flush_all $example= prepare_example($example); if ($func_name ne "" && $text ne "" && !($func_name =~ /[abcdefghikjlmnopqrstuvwxyz]/)){ - print "INSERT INTO help_topic (name,description,example) VALUES ("; + print "INSERT IGNORE INTO help_topic (name,description,example) VALUES ("; print "'$func_name',"; print "'$text',"; print "'$example'"; print ");\n"; - print "INSERT INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; + print "INSERT IGNORE INTO help_relation (help_category_id,help_topic_id) VALUES (\@cur_category,LAST_INSERT_ID());\n"; } $func_name= ""; @@ -131,11 +131,11 @@ sub new_category $category= prepare_text($category); - print "INSERT INTO help_category (name) VALUES (\'$category\');\n"; + print "INSERT IGNORE INTO help_category (name) VALUES (\'$category\');\n"; print "SET \@cur_category=LAST_INSERT_ID();\n"; } -#print "INSERT INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; +#print "INSERT IGNORE INTO db (Host,DB,User,Select_priv) VALUES ('%','mysql_help','','Y');\n"; #print "CREATE DATABASE mysql_help;\n"; print "USE mysql;\n"; @@ -236,4 +236,3 @@ print "DELETE help_category "; print "FROM help_category "; print "LEFT JOIN help_relation ON help_category.help_category_id=help_relation.help_category_id "; print "WHERE help_relation.help_category_id is null;" - diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 2fff531c4c8..5ed76cefdb4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -160,6 +160,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi $CP support-files/* $BASE/support-files +$CP scripts/fill_help_tables.sql $BASE/support-files if [ $BASE_SYSTEM = "netware" ] ; then rm -f $BASE/support-files/magic \ @@ -183,14 +184,14 @@ do done $CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then $CP scripts/* $BASE/bin - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db + $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index dcb2849f370..0ce45c8d114 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2002 MySQL AB +# Copyright (C) 2002-2003 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file. # This scripts creates the privilege tables db, host, user, tables_priv, @@ -43,6 +43,7 @@ parse_arguments() { --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --verbose) verbose=1 ;; *) if test -n "$pick_args" then @@ -76,6 +77,8 @@ execdir= bindir= basedir= force=0 +verbose=0 +fill_help_tables="" parse_arguments `$print_defaults $defaults mysqld mysql_install_db` parse_arguments PICK-ARGS-FROM-ARGV "$@" @@ -85,17 +88,37 @@ then basedir=@prefix@ bindir=@bindir@ execdir=@libexecdir@ + pkgdatadir=@pkgdatadir@ else bindir="$basedir/bin" -if test -x "$basedir/libexec/mysqld" -then - execdir="$basedir/libexec" -elif test -x "@libexecdir@/mysqld" + if test -x "$basedir/libexec/mysqld" + then + execdir="$basedir/libexec" + elif test -x "@libexecdir@/mysqld" + then + execdir="@libexecdir@" + else + execdir="$basedir/bin" + fi + + # find fill_help_tables.sh + for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts @pkgdatadir@ + do + if test -f $i/fill_help_tables.sql + then + pkgdatadir=$i + fi + done +fi + +if test -f $pkgdatadir/fill_help_tables.sql then - execdir="@libexecdir@" + fill_help_tables=$pkgdatadir/fill_help_tables.sql else - execdir="$basedir/bin" -fi + if test $verbose -eq 1 + then + echo "Could not find help file 'fill_help_tables.sql'". + fi fi mdata=$ldata/mysql @@ -160,8 +183,9 @@ c_t="" c_c="" # Check for old tables if test ! -f $mdata/db.frm then - echo "Preparing db table" - + if test $verbose -eq 1 ; then + echo "Preparing db table" + fi # mysqld --bootstrap wants one command/line c_d="$c_d CREATE TABLE db (" c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," @@ -190,7 +214,9 @@ fi if test ! -f $mdata/host.frm then - echo "Preparing host table" + if test $verbose -eq 1 ; then + echo "Preparing host table" + fi c_h="$c_h CREATE TABLE host (" c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," @@ -214,7 +240,9 @@ fi if test ! -f $mdata/user.frm then - echo "Preparing user table" + if test $verbose -eq 1 ; then + echo "Preparing user table" + fi c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," @@ -256,7 +284,8 @@ then REPLACE 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','','','','',0,0,0); - INSERT INTO user (host,user) values ('localhost','');" + INSERT INTO user (host,user) values ('localhost',''); +" if test "$windows" -eq 0 then @@ -270,7 +299,9 @@ fi if test ! -f $mdata/func.frm then - echo "Preparing func table" + if test $verbose -eq 1 ; then + echo "Preparing func table" + fi c_f="$c_f CREATE TABLE func (" c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," @@ -284,7 +315,9 @@ fi if test ! -f $mdata/tables_priv.frm then - echo "Preparing tables_priv table" + if test $verbose -eq 1 ; then + echo "Preparing tables_priv table" + fi c_t="$c_t CREATE TABLE tables_priv (" c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL," @@ -303,7 +336,9 @@ fi if test ! -f $mdata/columns_priv.frm then - echo "Preparing columns_priv table" + if test $verbose -eq 1 ; then + echo "Preparing columns_priv table" + fi c_c="$c_c CREATE TABLE columns_priv (" c_c="$c_c Host char(60) binary DEFAULT '' NOT NULL," @@ -331,7 +366,7 @@ then c_p="$c_p comment='Stored Procedures';" fi -echo "Installing all prepared tables" +echo "Installing privilege tables" if ( cat << END_OF_DATA use mysql; @@ -351,7 +386,10 @@ $c_t $c_c $c_p END_OF_DATA - cat fill_help_tables.sql + if test -n "$fill_help_tables" + then + cat $fill_help_tables + fi ) | eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \ --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" then @@ -391,7 +429,6 @@ then echo "The latest information about MySQL is available on the web at" echo "http://www.mysql.com" echo "Support MySQL by buying support/licenses at https://order.mysql.com" - echo exit 0 else echo "Installation of grant tables failed!" diff --git a/scripts/mysql_tableinfo.sh b/scripts/mysql_tableinfo.sh index bfe9be377c7..f5083a776c6 100644 --- a/scripts/mysql_tableinfo.sh +++ b/scripts/mysql_tableinfo.sh @@ -10,7 +10,7 @@ mysql_tableinfo - creates and populates information tables with the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS), SHOW COLUMNS and SHOW INDEX. -This is version 1.0. +This is version 1.1. =head1 SYNOPSIS @@ -62,7 +62,7 @@ GetOptions( \%opt, "quiet|q", ) or usage("Invalid option"); -if ($opt{help}) {usage();} +if ($opt{'help'}) {usage();} my ($db_to_write,$db_like_wild,$tbl_like_wild); if (@ARGV==0) @@ -74,6 +74,8 @@ $db_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV; $tbl_like_wild=($ARGV[0])?$ARGV[0]:"%"; shift @ARGV; if (@ARGV>0) { usage("Too many arguments"); } +$0 = $1 if $0 =~ m:/([^/]+)$:; + my $info_db="`".$opt{'prefix'}."db`"; my $info_tbl="`".$opt{'prefix'}."tbl". (($opt{'tbl-status'})?"_status":"")."`"; @@ -84,11 +86,11 @@ my $info_idx="`".$opt{'prefix'}."idx`"; # --- connect to the database --- my $dsn = ";host=$opt{'host'}"; -$dsn .= ";port=$opt{port}" if $opt{port}; -$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; +$dsn .= ";port=$opt{'port'}" if $opt{'port'}; +$dsn .= ";mysql_socket=$opt{'socket'}" if $opt{'socket'}; my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=perl", - $opt{user}, $opt{password}, + $opt{'user'}, $opt{'password'}, { RaiseError => 1, PrintError => 0, @@ -104,20 +106,19 @@ if (!$opt{'quiet'}) { print "\n!! This program is doing to do:\n\n"; print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'}); - print "**DELETE** FROM ... WHERE `Database LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild + print "**DELETE** FROM ... WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild **INSERT** INTO ... on the following tables :\n"; - my $i; - foreach $i (($info_db, $info_tbl), - (($opt{'col'})?$info_col:()), - (($opt{'idx'})?$info_idx:())) + + foreach (($info_db, $info_tbl), + (($opt{'col'})?$info_col:()), + (($opt{'idx'})?$info_idx:())) { - print(" $db_to_write.$i\n"); + print(" $db_to_write.$_\n"); } print "\nContinue (you can skip this confirmation step with --quiet) ? (y|n) [n]"; - my $answer=<STDIN>; - unless ($answer =~ /^\s*y\s*$/i) + if (<STDIN> !~ /^\s*y\s*$/i) { print "Nothing done!\n";exit; } @@ -126,17 +127,16 @@ on the following tables :\n"; if ($opt{'clear'} or $opt{'clear-only'}) { #do not drop the $db_to_write database ! - my $i; - foreach $i (($info_db, $info_tbl), - (($opt{'col'})?$info_col:()), - (($opt{'idx'})?$info_idx:())) + foreach (($info_db, $info_tbl), + (($opt{'col'})?$info_col:()), + (($opt{'idx'})?$info_idx:())) { - $dbh->do("DROP TABLE IF EXISTS $db_to_write.$i"); + $dbh->do("DROP TABLE IF EXISTS $db_to_write.$_"); } if ($opt{'clear-only'}) { print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); - exit(); + exit; } } @@ -151,14 +151,14 @@ $dbh->do("CREATE DATABASE IF NOT EXISTS $db_to_write"); $dbh->do("USE $db_to_write"); #get databases -$sth{db}=$dbh->prepare("SHOW DATABASES LIKE $db_like_wild"); -$sth{db}->execute; +$sth{'db'}=$dbh->prepare("SHOW DATABASES LIKE $db_like_wild"); +$sth{'db'}->execute; #create $info_db which will receive info about databases. #Ensure that the first column to be called "Database" (as SHOW DATABASES LIKE #returns a varying #column name (of the form "Database (%...)") which is not suitable) -$extra_col_desc{db}=do_create_table("db",$info_db,undef,"`Database`"); +$extra_col_desc{'db'}=do_create_table("db",$info_db,undef,"`Database`"); #we'll remember the type of the `Database` column (as returned by #SHOW DATABASES), which we will need when creating the next tables. @@ -166,55 +166,56 @@ $extra_col_desc{db}=do_create_table("db",$info_db,undef,"`Database`"); $dbh->do("DELETE FROM $info_db WHERE `Database` LIKE $db_like_wild"); -while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases +while ($row{'db'}=$sth{'db'}->fetchrow_arrayref) #go through all databases { #insert the database name $dbh->do("INSERT INTO $info_db VALUES(" - .join_quote(@{$row{db}}).")"); + .join(',' , ( map $dbh->quote($_), @{$row{'db'}} ) ).")" ); #for each database, get tables - $sth{tbl}=$dbh->prepare("SHOW TABLE" + $sth{'tbl'}=$dbh->prepare("SHOW TABLE" .( ($opt{'tbl-status'}) ? " STATUS" : "S" ) - ." from `${$row{db}}[0]` LIKE $tbl_like_wild"); - $sth{tbl}->execute; + ." from `$row{'db'}->[0]` LIKE $tbl_like_wild"); + $sth{'tbl'}->execute; unless ($done_create_table{$info_tbl}) #tables must be created only once, and out-of-date info must be #cleared once { $done_create_table{$info_tbl}=1; - $extra_col_desc{table}= + $extra_col_desc{'tbl'}= do_create_table("tbl",$info_tbl, #add an extra column (database name) at the left #and ensure that the table name will be called "Table" #(this is unncessesary with #SHOW TABLE STATUS, but necessary with SHOW TABLES (which returns a column #named "Tables_in_...")) - "`Database` ".$extra_col_desc{db},"`Table`"); + "`Database` ".$extra_col_desc{'db'},"`Table`"); $dbh->do("DELETE FROM $info_tbl WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild"); } - while (@{$row{tbl}}=$sth{tbl}->fetchrow_array) + while ($row{'tbl'}=$sth{'tbl'}->fetchrow_arrayref) { $dbh->do("INSERT INTO $info_tbl VALUES(" - .$dbh->quote(${$row{db}}[0]).",".join_quote(@{$row{tbl}}).")"); + .$dbh->quote($row{'db'}->[0])."," + .join(',' , ( map $dbh->quote($_), @{$row{'tbl'}} ) ).")"); #for each table, get columns... if ($opt{'col'}) { - $sth{col}=$dbh->prepare("SHOW COLUMNS FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`"); - $sth{col}->execute; + $sth{'col'}=$dbh->prepare("SHOW COLUMNS FROM `$row{'tbl'}->[0]` FROM `$row{'db'}->[0]`"); + $sth{'col'}->execute; unless ($done_create_table{$info_col}) { $done_create_table{$info_col}=1; do_create_table("col",$info_col, - "`Database` ".$extra_col_desc{db}."," - ."`Table` ".$extra_col_desc{table}."," + "`Database` ".$extra_col_desc{'db'}."," + ."`Table` ".$extra_col_desc{'tbl'}."," ."`Seq_in_table` BIGINT(3)"); #We need to add a sequence number (1 for the first column of the table, #2 for the second etc) so that users are able to retrieve columns in order @@ -225,13 +226,13 @@ while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases AND `Table` LIKE $tbl_like_wild"); } my $col_number=0; - while (@{$row{col}}=$sth{col}->fetchrow_array) + while ($row{'col'}=$sth{'col'}->fetchrow_arrayref) { $dbh->do("INSERT INTO $info_col VALUES(" - .$dbh->quote(${$row{db}}[0])."," - .$dbh->quote(${$row{tbl}}[0])."," + .$dbh->quote($row{'db'}->[0])."," + .$dbh->quote($row{'tbl'}->[0])."," .++$col_number."," - .join_quote(@{$row{col}}).")"); + .join(',' , ( map $dbh->quote($_), @{$row{'col'}} ) ).")"); } } @@ -239,22 +240,22 @@ while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases if ($opt{'idx'}) { - $sth{idx}=$dbh->prepare("SHOW INDEX FROM `${$row{tbl}}[0]` FROM `${$row{db}}[0]`"); - $sth{idx}->execute; + $sth{'idx'}=$dbh->prepare("SHOW INDEX FROM `$row{'tbl'}->[0]` FROM `$row{'db'}->[0]`"); + $sth{'idx'}->execute; unless ($done_create_table{$info_idx}) { $done_create_table{$info_idx}=1; do_create_table("idx",$info_idx, - "`Database` ".$extra_col_desc{db}); + "`Database` ".$extra_col_desc{'db'}); $dbh->do("DELETE FROM $info_idx WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild"); } - while (@{$row{idx}}=$sth{idx}->fetchrow_array) + while ($row{'idx'}=$sth{'idx'}->fetchrow_arrayref) { $dbh->do("INSERT INTO $info_idx VALUES(" - .$dbh->quote(${$row{db}}[0])."," - .join_quote(@{$row{idx}}).")"); + .$dbh->quote($row{'db'}->[0])."," + .join(',' , ( map $dbh->quote($_), @{$row{'idx'}} ) ).")"); } } } @@ -263,37 +264,30 @@ while (@{$row{db}}=$sth{db}->fetchrow_array) #go through all databases print "Wrote to database $db_to_write .\n" unless ($opt{'quiet'}); exit; -sub join_quote -{ - my (@list)=@_; my $i; - foreach $i (@list) { $i=$dbh->quote($i); } - return (join ',',@list); -} sub do_create_table { my ($sth_key,$target_tbl,$extra_col_desc,$first_col_name)=@_; my $create_table_query=$extra_col_desc; - my ($i,$type,$first_col_desc,$col_desc); + my ($i,$first_col_desc,$col_desc); for ($i=0;$i<$sth{$sth_key}->{NUM_OF_FIELDS};$i++) { if ($create_table_query) { $create_table_query.=", "; } - $type=$sth{$sth_key}->{mysql_type_name}->[$i]; - $col_desc=$type; - if ($type =~ /char|int/i) + $col_desc=$sth{$sth_key}->{mysql_type_name}->[$i]; + if ($col_desc =~ /char|int/i) { $col_desc.="($sth{$sth_key}->{PRECISION}->[$i])"; } - elsif ($type =~ /decimal|numeric/i) #(never seen that) + elsif ($col_desc =~ /decimal|numeric/i) #(never seen that) { $col_desc.= "($sth{$sth_key}->{PRECISION}->[$i],$sth{$sth_key}->{SCALE}->[$i])"; } - elsif ($type !~ /date/i) #date and datetime are OK, + elsif ($col_desc !~ /date/i) #date and datetime are OK, #no precision or scale for them { - warn "unexpected column type '$type' + warn "unexpected column type '$col_desc' (neither 'char','int','decimal|numeric') when creating $target_tbl, hope table creation will go OK\n"; } @@ -393,6 +387,10 @@ Caution: info tables contain certain columns (e.g. Database, Table, Null...) whose names, as they are MySQL reserved words, need to be backquoted (`...`) when used in SQL statements. +Caution: as information fetching and info tables filling happen at the +same time, info tables may contain inaccurate information about +themselves. + =head1 OPTIONS =over 4 diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 3ccf5301503..094b1fbfcd3 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -38,7 +38,12 @@ parse_arguments() { --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; + --user=*) + if test $SET_USER -eq 0 + then + user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 + fi + ;; # these two might have been set in a [mysqld_safe] section of my.cnf # they get passed via environment variables to mysqld_safe diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index 1ae2550d69d..82c8a3a90e4 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -39,7 +39,7 @@ # as such, and clarify ones such as "mediumint" with comments such as # "3-byte int" or "same as xxx". -$version="1.60"; +$version="1.61"; use DBI; use Getopt::Long; @@ -74,7 +74,7 @@ usage() if ($opt_help || $opt_Information); version() && exit(0) if ($opt_version); $opt_suffix = '-'.$opt_suffix if (length($opt_suffix) != 0); -$opt_config_file = "$pwd/$opt_dir/$opt_server$opt_suffix.cfg" +$opt_config_file = "$pwd/$opt_dir/$opt_server$opt_suffix.cfg" if (length($opt_config_file) == 0); $log_prefix=' ###'; # prefix for log lines in result file $safe_query_log=''; @@ -540,7 +540,7 @@ else " Please start it and try again\n"; exit 1; } - $dbh=safe_connect(); + $dbh=retry_connect(); } @@ -2880,9 +2880,10 @@ As all used queries are legal according to some SQL standard. any reasonable SQL server should be able to run this test without any problems. -All questions is cached in $opt_dir/'server_name'.cfg that future runs will use -limits found in previous runs. Remove this file if you want to find the -current limits for your version of the database server. +All questions is cached in $opt_dir/'server_name'[-suffix].cfg that +future runs will use limits found in previous runs. Remove this file +if you want to find the current limits for your version of the +database server. This program uses some table names while testing things. If you have any tables with the name of 'crash_me' or 'crash_qxxxx' where 'x' is a number, @@ -3152,7 +3153,29 @@ sub safe_connect } # -# Check if the server is upp and running. If not, ask the user to restart it +# Test connecting a couple of times before giving an error +# This is needed to get the server time to free old connections +# after the connect test +# + +sub retry_connect +{ + my ($dbh, $i); + for ($i=0 ; $i < 10 ; $i++) + { + if (($dbh=DBI->connect($server->{'data_source'},$opt_user,$opt_password, + { PrintError => 0, AutoCommit => 1}))) + { + $dbh->{LongReadLen}= 16000000; # Set max retrieval buffer + return $dbh; + } + sleep(1); + } + return safe_connect(); +} + +# +# Check if the server is up and running. If not, ask the user to restart it # sub check_connect diff --git a/sql/convert.cc b/sql/convert.cc index 84003af3922..bfdf49bf42d 100644 --- a/sql/convert.cc +++ b/sql/convert.cc @@ -14,6 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#if 0 /* ** Convert tables between different character sets @@ -460,3 +461,5 @@ bool CONVERT::store(String *packet,const char *from,uint length) packet->length((uint) (store_dest(to, from, length)-packet->ptr())); return 0; } + +#endif diff --git a/sql/field.cc b/sql/field.cc index 0c17209003c..7d877a02bf7 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4285,7 +4285,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, :Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, table_arg, cs), - packlength(blob_pack_length), geom_flag(true) + geom_flag(true), packlength(blob_pack_length) { flags|= BLOB_FLAG; if (table) @@ -4525,7 +4525,7 @@ void Field_blob::get_key_image(char *buff,uint length, MBR mbr; Geometry gobj; - gobj.create_from_wkb(blob,blob_length); + gobj.create_from_wkb(blob + SRID_SIZE, blob_length - SRID_SIZE); gobj.get_mbr(&mbr); float8store(buff, mbr.xmin); float8store(buff+8, mbr.xmax); @@ -4555,35 +4555,6 @@ void Field_blob::set_key_image(char *buff,uint length, CHARSET_INFO *cs) } -void Field_geom::get_key_image(char *buff,uint length,CHARSET_INFO *cs, - imagetype type) -{ - length-=HA_KEY_BLOB_LENGTH; - ulong blob_length=get_length(ptr); - char *blob; - get_ptr(&blob); - - MBR mbr; - Geometry gobj; - gobj.create_from_wkb(blob,blob_length); - gobj.get_mbr(&mbr); - float8store(buff, mbr.xmin); - float8store(buff+8, mbr.xmax); - float8store(buff+16, mbr.ymin); - float8store(buff+24, mbr.ymax); - return; -} - -void Field_geom::set_key_image(char *buff,uint length,CHARSET_INFO *cs) -{ - Field_blob::set_key_image(buff, length, cs); -} - -void Field_geom::sql_type(String &res) const -{ - res.set("geometry", 8, &my_charset_latin1); -} - int Field_blob::key_cmp(const byte *key_ptr, uint max_key_length) { char *blob1; @@ -4776,6 +4747,90 @@ uint Field_blob::max_packed_col_length(uint max_length) return (max_length > 255 ? 2 : 1)+max_length; } + +void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs, + imagetype type) +{ + length-= HA_KEY_BLOB_LENGTH; + ulong blob_length= get_length(ptr); + char *blob; + get_ptr(&blob); + + MBR mbr; + Geometry gobj; + gobj.create_from_wkb(blob + SRID_SIZE, blob_length - SRID_SIZE); + gobj.get_mbr(&mbr); + float8store(buff, mbr.xmin); + float8store(buff + 8, mbr.xmax); + float8store(buff + 16, mbr.ymin); + float8store(buff + 24, mbr.ymax); + return; +} + + +void Field_geom::set_key_image(char *buff, uint length, CHARSET_INFO *cs) +{ + Field_blob::set_key_image(buff, length, cs); +} + +void Field_geom::sql_type(String &res) const +{ + CHARSET_INFO *cs= &my_charset_latin1; + switch (geom_type) + { + case GEOM_POINT: + res.set("point", 5, cs); + break; + case GEOM_LINESTRING: + res.set("linestring", 10, cs); + break; + case GEOM_POLYGON: + res.set("polygon", 7, cs); + break; + case GEOM_MULTIPOINT: + res.set("multipoint", 10, cs); + break; + case GEOM_MULTILINESTRING: + res.set("multilinestring", 15, cs); + break; + case GEOM_MULTIPOLYGON: + res.set("multipolygon", 12, cs); + break; + case GEOM_GEOMETRYCOLLECTION: + res.set("geometrycollection", 18, cs); + break; + default: + res.set("geometry", 8, cs); + } +} + + +int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs) +{ + if (!length) + { + bzero(ptr, Field_blob::pack_length()); + } + else + { + // Should check given WKB + if (length < 4 + 1 + 4 + 8 + 8) // SRID + WKB_HEADER + X + Y + return 1; + uint32 wkb_type= uint4korr(from + 5); + if (wkb_type < 1 || wkb_type > 7) + return 1; + Field_blob::store_length(length); + if (table->copy_blobs || length <= MAX_FIELD_WIDTH) + { // Must make a copy + value.copy(from, length, cs); + from= value.ptr(); + } + bmove(ptr + packlength, (char*) &from, sizeof(char*)); + } + return 0; +} + + /**************************************************************************** ** enum type. ** This is a string which only can have a selection of different values. @@ -5257,6 +5312,7 @@ Field *make_field(char *ptr, uint32 field_length, uint pack_flag, enum_field_types field_type, CHARSET_INFO *field_charset, + Field::geometry_type geom_type, Field::utype unireg_check, TYPELIB *interval, const char *field_name, @@ -5280,7 +5336,7 @@ Field *make_field(char *ptr, uint32 field_length, if (f_is_geom(pack_flag)) return new Field_geom(ptr,null_pos,null_bit, unireg_check, field_name, table, - pack_length); + pack_length, geom_type); if (f_is_blob(pack_flag)) return new Field_blob(ptr,null_pos,null_bit, unireg_check, field_name, table, diff --git a/sql/field.h b/sql/field.h index 37d194ac372..1b7906f9fb5 100644 --- a/sql/field.h +++ b/sql/field.h @@ -50,7 +50,12 @@ public: enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL, CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD, BIT_FIELD, TIMESTAMP_FIELD,CAPITALIZE,BLOB_FIELD}; - + enum geometry_type + { + GEOM_GEOMETRY = 0, GEOM_POINT = 1, GEOM_LINESTRING = 2, GEOM_POLYGON = 3, + GEOM_MULTIPOINT = 4, GEOM_MULTILINESTRING = 5, GEOM_MULTIPOLYGON = 6, + GEOM_GEOMETRYCOLLECTION = 7 + }; enum imagetype { itRAW, itMBR}; utype unireg_check; @@ -71,7 +76,7 @@ public: virtual String *val_str(String*,String *)=0; virtual Item_result result_type () const=0; virtual Item_result cmp_type () const { return result_type(); } - bool eq(Field *field) { return ptr == field->ptr; } + bool eq(Field *field) { return ptr == field->ptr && null_ptr == field->null_ptr; } virtual bool eq_def(Field *field); virtual uint32 pack_length() const { return (uint32) field_length; } virtual void reset(void) { bzero(ptr,pack_length()); } @@ -843,9 +848,10 @@ public: class Field_blob :public Field_str { + bool geom_flag; +protected: uint packlength; String value; // For temporaries - bool geom_flag; public: Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, @@ -855,7 +861,7 @@ public: struct st_table *table_arg, CHARSET_INFO *cs) :Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0, NONE, field_name_arg, table_arg, cs), - packlength(3), geom_flag(true) + geom_flag(true), packlength(3) { flags|= BLOB_FLAG; } @@ -930,18 +936,26 @@ public: class Field_geom :public Field_blob { public: + enum geometry_type geom_type; + Field_geom(char *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, - struct st_table *table_arg,uint blob_pack_length) + struct st_table *table_arg,uint blob_pack_length, + enum geometry_type geom_type_arg) :Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, - field_name_arg, table_arg, blob_pack_length,&my_charset_bin) {} + field_name_arg, table_arg, blob_pack_length,&my_charset_bin) + { geom_type= geom_type_arg; } Field_geom(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg, - struct st_table *table_arg) + struct st_table *table_arg, enum geometry_type geom_type_arg) :Field_blob(len_arg, maybe_null_arg, field_name_arg, - table_arg, &my_charset_bin) {} + table_arg, &my_charset_bin) + { geom_type= geom_type_arg; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY; } - enum_field_types type() const { return FIELD_TYPE_GEOMETRY;} + enum_field_types type() const { return FIELD_TYPE_GEOMETRY; } void sql_type(String &str) const; + int store(const char *to, uint length, CHARSET_INFO *charset); + int store(double nr) { return 1; } + int store(longlong nr) { return 1; } void get_key_image(char *buff,uint length, CHARSET_INFO *cs,imagetype type); void set_key_image(char *buff,uint length, CHARSET_INFO *cs); @@ -1029,6 +1043,7 @@ public: Field::utype unireg_check; TYPELIB *interval; // Which interval to use CHARSET_INFO *charset; + Field::geometry_type geom_type; Field *field; // For alter table uint8 row,col,sc_length,interval_id; // For rea_create_table @@ -1082,6 +1097,7 @@ Field *make_field(char *ptr, uint32 field_length, uchar *null_pos, uchar null_bit, uint pack_flag, enum_field_types field_type, CHARSET_INFO *cs, + Field::geometry_type geom_type, Field::utype unireg_check, TYPELIB *interval, const char *field_name, struct st_table *table); diff --git a/sql/filesort.cc b/sql/filesort.cc index cc7b15f1f4a..0f6e4d7abba 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -68,7 +68,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, SQL_SELECT *select, ha_rows max_rows, ha_rows *examined_rows) { int error; - ulong memavl; + ulong memavl, min_sort_memory; uint maxbuffer; BUFFPEK *buffpek; ha_rows records; @@ -123,7 +123,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, goto err; memavl= thd->variables.sortbuff_size; - while (memavl >= MIN_SORT_MEMORY) + min_sort_memory= max(MIN_SORT_MEMORY, param.sort_length*MERGEBUFF2); + while (memavl >= min_sort_memory) { ulong old_memavl; ulong keys= memavl/(param.sort_length+sizeof(char*)); @@ -132,10 +133,10 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, MYF(0)))) break; old_memavl=memavl; - if ((memavl=memavl/4*3) < MIN_SORT_MEMORY && old_memavl > MIN_SORT_MEMORY) - memavl=MIN_SORT_MEMORY; + if ((memavl=memavl/4*3) < min_sort_memory && old_memavl > min_sort_memory) + memavl= min_sort_memory; } - if (memavl < MIN_SORT_MEMORY) + if (memavl < min_sort_memory) { my_error(ER_OUTOFMEMORY,MYF(ME_ERROR+ME_WAITTANG), thd->variables.sortbuff_size); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 76d57f9b3bb..ce26ee705dd 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -151,6 +151,19 @@ innobase_release_stat_resources( } /************************************************************************ +Call this function when mysqld passes control to the client. That is to +avoid deadlocks on the adaptive hash S-latch possibly held by thd. For more +documentation, see handler.cc. */ + +void +innobase_release_temporary_latches( +/*===============================*/ + void* innobase_tid) +{ + innobase_release_stat_resources((trx_t*)innobase_tid); +} + +/************************************************************************ Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth time calls srv_active_wake_master_thread. This function should be used when a single database operation may introduce a small need for @@ -895,12 +908,13 @@ innobase_commit_low( trx_t* trx) /* in: transaction handle */ { #ifdef HAVE_REPLICATION + /* TODO: Guilhem should check if master_log_name, pending + etc. are right if the master log gets rotated! Possible bug here. + Comment by Heikki March 4, 2003. */ + if (current_thd->slave_thread) { /* Update the replication position info inside InnoDB */ -#ifdef NEED_TO_BE_FIXED - trx->mysql_relay_log_file_name = active_mi->rli.log_file_name; - trx->mysql_relay_log_pos = active_mi->rli.relay_log_pos; -#endif + trx->mysql_master_log_file_name = active_mi->rli.master_log_name; trx->mysql_master_log_pos = ((ib_longlong) @@ -3512,6 +3526,16 @@ ha_innobase::records_in_range( prebuilt->trx->op_info = (char*)""; + /* The MySQL optimizer seems to believe an estimate of 0 rows is + always accurate and may return the result 'Empty set' based on that. + The accuracy is not guaranteed, and even if it were, for a locking + read we should anyway perform the search to set the next-key lock. + Add 1 to the value to make sure MySQL does not make the assumption! */ + + if (n_rows == 0) { + n_rows = 1; + } + DBUG_RETURN((ha_rows) n_rows); } diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 86fb5d1947b..56546e3e8d0 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -209,3 +209,4 @@ int innodb_show_status(THD* thd); my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name, uint full_name_len); +void innobase_release_temporary_latches(void* innobase_tid); diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 26268f5deaf..7e8dab5daed 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -420,7 +420,7 @@ int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt) param.db_name = table->table_cache_key; param.table_name = table->table_name; param.testflag = 0; - mi_check_print_error(¶m,errmsg, my_errno); + mi_check_print_error(¶m, errmsg, my_errno); DBUG_RETURN(error); } } @@ -438,17 +438,17 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt) if (fn_format_relative_to_data_home(dst_path, table_name, backup_dir, reg_ext)) { - errmsg = "Failed in fn_format() for .frm file: errno = %d"; + errmsg = "Failed in fn_format() for .frm file (errno: %d)"; error = HA_ADMIN_INVALID; goto err; } if (my_copy(fn_format(src_path, table->path,"", reg_ext, MY_UNPACK_FILENAME), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { error = HA_ADMIN_FAILED; - errmsg = "Failed copying .frm file: errno = %d"; + errmsg = "Failed copying .frm file (errno: %d)"; goto err; } @@ -456,7 +456,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt) if (!fn_format(dst_path, dst_path, "", MI_NAME_DEXT, MY_REPLACE_EXT | MY_UNPACK_FILENAME | MY_SAFE_PATH)) { - errmsg = "Failed in fn_format() for .MYD file: errno = %d"; + errmsg = "Failed in fn_format() for .MYD file (errno: %d)"; error = HA_ADMIN_INVALID; goto err; } @@ -464,9 +464,9 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt) if (my_copy(fn_format(src_path, table->path,"", MI_NAME_DEXT, MY_UNPACK_FILENAME), dst_path, - MYF(MY_WME | MY_HOLD_ORIGINAL_MODES))) + MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE))) { - errmsg = "Failed copying .MYD file: errno = %d"; + errmsg = "Failed copying .MYD file (errno: %d)"; error= HA_ADMIN_FAILED; goto err; } @@ -1034,7 +1034,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, { int error; uint i,j,recpos,minpos,fieldpos,temp_length,length; - bool found_auto_increment=0; + bool found_real_auto_increment=0; enum ha_base_keytype type; char buff[FN_REFLEN]; KEY *pos; @@ -1049,7 +1049,8 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, &recinfo,(table_arg->fields*2+2)*sizeof(MI_COLUMNDEF), &keydef, table_arg->keys*sizeof(MI_KEYDEF), &keyseg, - ((table_arg->key_parts + table_arg->keys) * sizeof(HA_KEYSEG)), + ((table_arg->key_parts + table_arg->keys) * + sizeof(HA_KEYSEG)), 0))) DBUG_RETURN(1); @@ -1107,13 +1108,8 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, keydef[i].seg[j].null_bit=0; keydef[i].seg[j].null_pos=0; } - if (j == 0 && field->flags & AUTO_INCREMENT_FLAG && - !found_auto_increment) - { - keydef[i].flag|=HA_AUTO_KEY; - found_auto_increment=1; - } - if ((field->type() == FIELD_TYPE_BLOB) || (field->type() == FIELD_TYPE_GEOMETRY)) + if (field->type() == FIELD_TYPE_BLOB || + field->type() == FIELD_TYPE_GEOMETRY) { keydef[i].seg[j].flag|=HA_BLOB_PART; /* save number of bytes used to pack length */ @@ -1124,6 +1120,12 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, keyseg+=pos->key_parts; } + if (table_arg->found_next_number_field) + { + keydef[table_arg->next_number_index].flag|= HA_AUTO_KEY; + found_real_auto_increment= table_arg->next_number_key_offset == 0; + } + recpos=0; recinfo_pos=recinfo; while (recpos < (uint) table_arg->reclength) { @@ -1193,6 +1195,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, bzero((char*) &create_info,sizeof(create_info)); create_info.max_rows=table_arg->max_rows; create_info.reloc_rows=table_arg->min_rows; + create_info.with_auto_increment=found_real_auto_increment; create_info.auto_increment=(info->auto_increment_value ? info->auto_increment_value -1 : (ulonglong) 0); @@ -1257,6 +1260,35 @@ longlong ha_myisam::get_auto_increment() } +/* + Find out how many rows there is in the given range + + SYNOPSIS + records_in_range() + inx Index to use + start_key Start of range. Null pointer if from first key + start_key_len Length of start key + start_search_flag Flag if start key should be included or not + end_key End of range. Null pointer if to last key + end_key_len Length of end key + end_search_flag Flag if start key should be included or not + + NOTES + start_search_flag can have one of the following values: + HA_READ_KEY_EXACT Include the key in the range + HA_READ_AFTER_KEY Don't include key in range + + end_search_flag can have one of the following values: + HA_READ_BEFORE_KEY Don't include key in range + HA_READ_AFTER_KEY Include all 'end_key' values in the range + + RETURN + HA_POS_ERROR Something is wrong with the index tree. + 0 There is no matching keys in the given range + number > 0 There is approximately 'number' matching rows in + the range. +*/ + ha_rows ha_myisam::records_in_range(int inx, const byte *start_key,uint start_key_len, enum ha_rkey_function start_search_flag, @@ -1271,6 +1303,7 @@ ha_rows ha_myisam::records_in_range(int inx, end_search_flag); } + int ha_myisam::ft_read(byte * buf) { int error; diff --git a/sql/handler.cc b/sql/handler.cc index af9b2fd4a35..5353e78cd11 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -121,8 +121,15 @@ handler *get_new_handler(TABLE *table, enum db_type db_type) #endif case DB_TYPE_HEAP: return new ha_heap(table); - case DB_TYPE_MYISAM: default: // should never happen + { + enum db_type def=(enum db_type) current_thd->variables.table_type; + /* Try first with 'default table type' */ + if (db_type != def) + return get_new_handler(table, def); + } + /* Fall back to MyISAM */ + case DB_TYPE_MYISAM: return new ha_myisam(table); case DB_TYPE_MRG_MYISAM: return new ha_myisammrg(table); @@ -238,8 +245,10 @@ int ha_autocommit_or_rollback(THD *thd, int error) handler must be the same as in the binlog. arguments: + thd: the thread handle of the current connection log_file_name: latest binlog file name end_offset: the offset in the binlog file up to which we wrote + return value: 0 if success, 1 if error */ int ha_report_binlog_offset_and_commit(THD *thd, @@ -266,6 +275,34 @@ int ha_report_binlog_offset_and_commit(THD *thd, return error; } +/* + This function should be called when MySQL sends rows of a SELECT result set + or the EOF mark to the client. It releases a possible adaptive hash index + S-latch held by thd in InnoDB and also releases a possible InnoDB query + FIFO ticket to enter InnoDB. To save CPU time, InnoDB allows a thd to + keep them over several calls of the InnoDB handler interface when a join + is executed. But when we let the control to pass to the client they have + to be released because if the application program uses mysql_use_result(), + it may deadlock on the S-latch if the application on another connection + performs another SQL query. In MySQL-4.1 this is even more important because + there a connection can have several SELECT queries open at the same time. + + arguments: + thd: the thread handle of the current connection + return value: always 0 +*/ + +int ha_release_temporary_latches(THD *thd) +{ +#ifdef HAVE_INNOBASE_DB + THD_TRANS *trans; + trans = &thd->transaction.all; + if (trans->innobase_tid) + innobase_release_temporary_latches(trans->innobase_tid); +#endif + return 0; +} + int ha_commit_trans(THD *thd, THD_TRANS* trans) { int error=0; @@ -473,7 +510,8 @@ int handler::ha_open(const char *name, int mode, int test_if_locked) int error; DBUG_ENTER("handler::open"); DBUG_PRINT("enter",("name: %s db_type: %d db_stat: %d mode: %d lock_test: %d", - name, table->db_type, table->db_stat, mode, test_if_locked)); + name, table->db_type, table->db_stat, mode, + test_if_locked)); if ((error=open(name,mode,test_if_locked))) { diff --git a/sql/handler.h b/sql/handler.h index 6cbd83af282..c6a4578a26c 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -373,6 +373,7 @@ void ha_resize_key_cache(void); int ha_start_stmt(THD *thd); int ha_report_binlog_offset_and_commit(THD *thd, char *log_file_name, my_off_t end_offset); +int ha_release_temporary_latches(THD *thd); int ha_commit_trans(THD *thd, THD_TRANS *trans); int ha_rollback_trans(THD *thd, THD_TRANS *trans); int ha_autocommit_or_rollback(THD *thd, int error); diff --git a/sql/item.cc b/sql/item.cc index 17047bde916..f4c27061e53 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -40,7 +40,7 @@ Item::Item(): { marker= 0; maybe_null=null_value=with_sum_func=unsigned_flag=0; - coercibility=COER_NOCOLL; + coercibility=COER_IMPLICIT; name= 0; decimals= 0; max_length= 0; THD *thd= current_thd; @@ -94,20 +94,23 @@ bool Item::check_cols(uint c) void Item::set_name(const char *str,uint length, CHARSET_INFO *cs) { if (!length) - length= str ? strlen(str) : 0; - while (length && !my_isgraph(cs,*str)) - { // Fix problem with yacc - length--; - str++; - } - if (!my_charset_same(cs, system_charset_info)) + name= (char*) str; // Empty string, used by AS + else { - String tmp; - tmp.copy(str, length, cs, system_charset_info); - name=sql_strmake(tmp.ptr(),min(tmp.length(),MAX_FIELD_WIDTH)); + while (length && !my_isgraph(cs,*str)) + { // Fix problem with yacc + length--; + str++; + } + if (length && !my_charset_same(cs, system_charset_info)) + { + String tmp; + tmp.copy(str, length, cs, system_charset_info); + name=sql_strmake(tmp.ptr(),min(tmp.length(),MAX_FIELD_WIDTH)); + } + else + name=sql_strmake(str,min(length,MAX_FIELD_WIDTH)); } - else - name=sql_strmake(str,min(length,MAX_FIELD_WIDTH)); } /* @@ -190,6 +193,47 @@ Item_splocal::this_const_item() const return thd->spcont->get_item(m_offset); } +bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1, + CHARSET_INFO *cs2, enum coercion co2) +{ + if (cs1 == &my_charset_bin || cs2 == &my_charset_bin) + { + set_charset(&my_charset_bin, COER_NOCOLL); + return 0; + } + + if (!my_charset_same(cs1,cs2)) + return 1; + + if (co1 < co2) + { + set_charset(cs1, co1); + } + else if (co2 < co1) + { + set_charset(cs2, co2); + } + else // co2 == co1 + { + if (cs1 != cs2) + { + if (co1 == COER_EXPLICIT) + { + return 1; + } + else + { + CHARSET_INFO *bin= get_charset_by_csname(cs1->csname, MY_CS_BINSORT,MYF(0)); + if (!bin) + return 1; + set_charset(bin, COER_NOCOLL); + } + } + else + set_charset(cs2, co2); + } + return 0; +} Item_field::Item_field(Field *f) :Item_ident(NullS,f->table_name,f->field_name) { @@ -214,8 +258,7 @@ void Item_field::set_field(Field *field_par) table_name=field_par->table_name; field_name=field_par->field_name; unsigned_flag=test(field_par->flags & UNSIGNED_FLAG); - set_charset(field_par->charset()); - coercibility= COER_IMPLICIT; + set_charset(field_par->charset(), COER_IMPLICIT); } const char *Item_ident::full_name() const @@ -280,6 +323,17 @@ bool Item_field::get_date(TIME *ltime,bool fuzzydate) return 0; } +bool Item_field::get_date_result(TIME *ltime,bool fuzzydate) +{ + if ((null_value=result_field->is_null()) || + result_field->get_date(ltime,fuzzydate)) + { + bzero((char*) ltime,sizeof(*ltime)); + return 1; + } + return 0; +} + bool Item_field::get_time(TIME *ltime) { if ((null_value=field->is_null()) || field->get_time(ltime)) @@ -958,6 +1012,7 @@ Item_varbinary::Item_varbinary(const char *str, uint str_length) str+=2; } *ptr=0; // Keep purify happy + coercibility= COER_COERCIBLE; } longlong Item_varbinary::val_int() diff --git a/sql/item.h b/sql/item.h index 0518154ac64..8009439b708 100644 --- a/sql/item.h +++ b/sql/item.h @@ -39,8 +39,8 @@ public: SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM}; enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE }; - enum coercion { COER_NOCOLL=3, COER_COERCIBLE=2, - COER_IMPLICIT=1, COER_EXPLICIT=0 }; + enum coercion { COER_COERCIBLE=3, COER_IMPLICIT=2, + COER_NOCOLL=1, COER_EXPLICIT=0 }; String str_value; /* used to store value */ my_string name; /* Name from select */ @@ -98,6 +98,8 @@ public: virtual void split_sum_func(Item **ref_pointer_array, List<Item> &fields) {} virtual bool get_date(TIME *ltime,bool fuzzydate); virtual bool get_time(TIME *ltime); + virtual bool get_date_result(TIME *ltime,bool fuzzydate) + { return get_date(ltime,fuzzydate); } virtual bool is_null() { return 0; }; virtual void top_level_item() {} virtual void set_result_field(Field *field) {} @@ -113,6 +115,13 @@ public: CHARSET_INFO *default_charset() const; CHARSET_INFO *charset() const { return str_value.charset(); }; void set_charset(CHARSET_INFO *cs) { str_value.set_charset(cs); } + void set_charset(CHARSET_INFO *cs, enum coercion coer) + { + str_value.set_charset(cs); + coercibility= coer; + } + bool set_charset(CHARSET_INFO *cs1, enum coercion co1, + CHARSET_INFO *cs2, enum coercion co2); virtual void set_outer_resolving() {} virtual Item *this_item() { return this; } /* For SPs mostly. */ virtual Item *this_const_item() const { return const_cast<Item*>(this); } /* For SPs mostly. */ @@ -239,8 +248,9 @@ public: } Field *tmp_table_field() { return result_field; } Field *tmp_table_field(TABLE *t_arg) { return result_field; } - bool get_date(TIME *ltime,bool fuzzydate); - bool get_time(TIME *ltime); + bool get_date(TIME *ltime,bool fuzzydate); + bool get_date_result(TIME *ltime,bool fuzzydate); + bool get_time(TIME *ltime); bool is_null() { return field->is_null(); } Item *get_tmp_table_item(THD *thd); friend class Item_default_value; @@ -565,8 +575,8 @@ public: return (*ref)->null_value; } bool get_date(TIME *ltime,bool fuzzydate) - { - return (null_value=(*ref)->get_date(ltime,fuzzydate)); + { + return (null_value=(*ref)->get_date_result(ltime,fuzzydate)); } bool send(Protocol *prot, String *tmp){ return (*ref)->send(prot, tmp); } void make_field(Send_field *field) { (*ref)->make_field(field); } @@ -577,7 +587,7 @@ public: enum Item_result result_type () const { return (*ref)->result_type(); } enum_field_types field_type() const { return (*ref)->field_type(); } table_map used_tables() const { return (*ref)->used_tables(); } - void set_result_field(Field *field) { result_field= field; } + void set_result_field(Field *field) { result_field= field; } bool is_result_field() { return 1; } void save_in_result_field(bool no_conversions) { diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 998b38513a9..4d2aaf5a0f2 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -87,6 +87,49 @@ static bool convert_constant_item(Field *field, Item **item) return 0; } +bool Item_bool_func2::set_cmp_charset(CHARSET_INFO *cs1, enum coercion co1, + CHARSET_INFO *cs2, enum coercion co2) +{ + if((cs1 == &my_charset_bin) || (cs2 == &my_charset_bin)) + { + cmp_charset= &my_charset_bin; + return 0; + } + + if ((co1 == COER_NOCOLL) || (co2 == COER_NOCOLL)) + return 1; + + if (!my_charset_same(cs1,cs2)) + return 1; + + if (co1 < co2) + cmp_charset= cs1; + else if (co2 < co1) + cmp_charset= cs2; + else // co1==co2 + { + if (cs1 == cs2) + cmp_charset= cs1; + else + { + if (co1 == COER_COERCIBLE) + { + CHARSET_INFO *c= get_charset_by_csname(cs1->csname,MY_CS_PRIMARY,MYF(0)); + if (c) + { + cmp_charset= c; + return 0; + } + else + return 1; + } + else + return 1; + } + } + return 0; +} + void Item_bool_func2::fix_length_and_dec() { max_length= 1; // Function returns 0 or 1 @@ -124,9 +167,12 @@ void Item_bool_func2::fix_length_and_dec() } } } - /* QQ: COERCIBILITY */ - cmp_charset= (args[0]->binary() || args[1]->binary()) ? - &my_charset_bin : args[0]->charset(); + if (set_cmp_charset(args[0]->charset(), args[0]->coercibility, + args[1]->charset(), args[1]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + return; + } set_cmp_func(); } @@ -604,6 +650,9 @@ Item_func_ifnull::fix_length_and_dec() args[1]->result_type())) != REAL_RESULT) decimals= 0; + if (set_charset(args[0]->charset(),args[0]->coercibility, + args[1]->charset(),args[1]->coercibility)) + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); } @@ -644,11 +693,13 @@ Item_func_ifnull::val_str(String *str) if (!args[0]->null_value) { null_value=0; + res->set_charset(charset()); return res; } res=args[1]->val_str(str); if ((null_value=args[1]->null_value)) return 0; + res->set_charset(charset()); return res; } @@ -677,8 +728,12 @@ Item_func_if::fix_length_and_dec() else if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT) { cached_result_type = STRING_RESULT; - set_charset((args[1]->binary() || args[2]->binary()) ? - &my_charset_bin : args[1]->charset()); + if (set_charset(args[1]->charset(), args[1]->coercibility, + args[2]->charset(), args[2]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + return; + } } else { @@ -714,6 +769,7 @@ Item_func_if::val_str(String *str) { Item *arg= args[0]->val_int() ? args[1] : args[2]; String *res=arg->val_str(str); + res->set_charset(charset()); null_value=arg->null_value; return res; } @@ -1748,7 +1804,7 @@ longlong Item_func_like::val_int() null_value=0; if (canDoTurboBM) return turboBM_matches(res->ptr(), res->length()) ? 1 : 0; - return my_wildcmp(charset(), + return my_wildcmp(cmp_charset, res->ptr(),res->ptr()+res->length(), res2->ptr(),res2->ptr()+res2->length(), escape,wild_one,wild_many) ? 0 : 1; @@ -1759,12 +1815,16 @@ longlong Item_func_like::val_int() Item_func::optimize_type Item_func_like::select_optimize() const { - if (args[1]->type() == STRING_ITEM) + if (args[1]->const_item()) { - if (((Item_string *) args[1])->str_value[0] != wild_many) + String* res2= args[1]->val_str((String *)&tmp_value2); + + if (!res2) + return OPTIMIZE_NONE; + + if (*res2->ptr() != wild_many) { - if ((args[0]->result_type() != STRING_RESULT) || - ((Item_string *) args[1])->str_value[0] != wild_one) + if (args[0]->result_type() != STRING_RESULT || *res2->ptr() != wild_one) return OPTIMIZE_OP; } } @@ -1777,14 +1837,12 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref) if (Item_bool_func2::fix_fields(thd, tlist, ref)) return 1; - /* - Comparision is by default done according to character set of LIKE - QQ: COERCIBILITY - */ - if (cmp_charset == &my_charset_bin) - set_charset(&my_charset_bin); - else - set_charset(args[1]->charset()); + if (set_cmp_charset(args[0]->charset(), args[0]->coercibility, + args[1]->charset(), args[1]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + return 1; + } /* We could also do boyer-more for non-const items, but as we would have to @@ -2200,17 +2258,19 @@ longlong Item_cond_xor::val_int() longlong Item_func_spatial_rel::val_int() { - String *res1=args[0]->val_str(&tmp_value1); - String *res2=args[1]->val_str(&tmp_value2); + String *res1= args[0]->val_str(&tmp_value1); + String *res2= args[1]->val_str(&tmp_value2); Geometry g1, g2; - MBR mbr1,mbr2; - - if ((null_value=(args[0]->null_value || - args[1]->null_value || - g1.create_from_wkb(res1->ptr(),res1->length()) || - g2.create_from_wkb(res2->ptr(),res2->length()) || - g1.get_mbr(&mbr1) || - g2.get_mbr(&mbr2)))) + MBR mbr1, mbr2; + + if ((null_value= (args[0]->null_value || + args[1]->null_value || + g1.create_from_wkb(res1->ptr() + SRID_SIZE, + res1->length() - SRID_SIZE) || + g2.create_from_wkb(res2->ptr() + SRID_SIZE, + res2->length() - SRID_SIZE) || + g1.get_mbr(&mbr1) || + g2.get_mbr(&mbr2)))) return 0; switch (spatial_rel) @@ -2260,15 +2320,16 @@ longlong Item_func_issimple::val_int() longlong Item_func_isclosed::val_int() { String tmp; - String *wkb=args[0]->val_str(&tmp); + String *swkb= args[0]->val_str(&tmp); Geometry geom; int isclosed; - null_value= (!wkb || - args[0]->null_value || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,is_closed) || - geom.is_closed(&isclosed)); + null_value= (!swkb || + args[0]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom,is_closed) || + geom.is_closed(&isclosed)); return (longlong) isclosed; } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index b9d8615beb4..e7670755396 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -122,6 +122,8 @@ public: { cmp.set_cmp_func(this, tmp_arg, tmp_arg+1); } + bool set_cmp_charset(CHARSET_INFO *cs1, enum coercion co1, + CHARSET_INFO *cs2, enum coercion co2); optimize_type select_optimize() const { return OPTIMIZE_OP; } virtual enum Functype rev_functype() const { return UNKNOWN_FUNC; } bool have_rev_func() const { return rev_functype() != UNKNOWN_FUNC; } diff --git a/sql/item_create.cc b/sql/item_create.cc index d90c708fc0f..3bc6fa47e83 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -433,7 +433,7 @@ Item *create_func_version(void) { return new Item_string(NullS,server_version, (uint) strlen(server_version), - default_charset_info); + system_charset_info); } Item *create_func_weekday(Item* a) @@ -475,162 +475,168 @@ Item *create_func_is_free_lock(Item* a) return new Item_func_is_free_lock(a); } +Item *create_func_is_used_lock(Item* a) +{ + current_thd->lex.uncacheable(); + return new Item_func_is_used_lock(a); +} + Item *create_func_quote(Item* a) { return new Item_func_quote(a); } -Item *create_func_geometry_from_text(Item* a) +Item *create_func_as_text(Item *a) { - return new Item_func_geometry_from_text(a); + return new Item_func_as_text(a); } -Item *create_func_as_text(Item* a) +Item *create_func_srid(Item *a) { - return new Item_func_as_text(a); + return new Item_func_srid(a); } -Item *create_func_startpoint(Item* a) +Item *create_func_startpoint(Item *a) { return new Item_func_spatial_decomp(a, Item_func::SP_STARTPOINT); } -Item *create_func_endpoint(Item* a) +Item *create_func_endpoint(Item *a) { return new Item_func_spatial_decomp(a, Item_func::SP_ENDPOINT); } -Item *create_func_exteriorring(Item* a) +Item *create_func_exteriorring(Item *a) { return new Item_func_spatial_decomp(a, Item_func::SP_EXTERIORRING); } -Item *create_func_pointn(Item* a, Item* b) +Item *create_func_pointn(Item *a, Item *b) { - return new Item_func_spatial_decomp_n(a,b,Item_func::SP_POINTN); + return new Item_func_spatial_decomp_n(a, b, Item_func::SP_POINTN); } -Item *create_func_interiorringn(Item* a, Item* b) +Item *create_func_interiorringn(Item *a, Item *b) { - return new Item_func_spatial_decomp_n(a,b,Item_func::SP_INTERIORRINGN); + return new Item_func_spatial_decomp_n(a, b, Item_func::SP_INTERIORRINGN); } -Item *create_func_geometryn(Item* a, Item* b) +Item *create_func_geometryn(Item *a, Item *b) { - return new Item_func_spatial_decomp_n(a,b,Item_func::SP_GEOMETRYN); + return new Item_func_spatial_decomp_n(a, b, Item_func::SP_GEOMETRYN); } -Item *create_func_centroid(Item* a) +Item *create_func_centroid(Item *a) { return new Item_func_centroid(a); } -Item *create_func_envelope(Item* a) +Item *create_func_envelope(Item *a) { return new Item_func_envelope(a); } -Item *create_func_equals(Item* a, Item* b) +Item *create_func_equals(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_EQUALS_FUNC); } -Item *create_func_disjoint(Item* a, Item* b) +Item *create_func_disjoint(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_DISJOINT_FUNC); } -Item *create_func_intersects(Item* a, Item* b) +Item *create_func_intersects(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_INTERSECTS_FUNC); } -Item *create_func_touches(Item* a, Item* b) +Item *create_func_touches(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_TOUCHES_FUNC); } -Item *create_func_crosses(Item* a, Item* b) +Item *create_func_crosses(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_CROSSES_FUNC); } -Item *create_func_within(Item* a, Item* b) +Item *create_func_within(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_WITHIN_FUNC); } -Item *create_func_contains(Item* a, Item* b) +Item *create_func_contains(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_CONTAINS_FUNC); } -Item *create_func_overlaps(Item* a, Item* b) +Item *create_func_overlaps(Item *a, Item *b) { return new Item_func_spatial_rel(a, b, Item_func::SP_OVERLAPS_FUNC); } -Item *create_func_isempty(Item* a) +Item *create_func_isempty(Item *a) { return new Item_func_isempty(a); } -Item *create_func_issimple(Item* a) +Item *create_func_issimple(Item *a) { return new Item_func_issimple(a); } -Item *create_func_isclosed(Item* a) +Item *create_func_isclosed(Item *a) { return new Item_func_isclosed(a); } -Item *create_func_geometry_type(Item* a) +Item *create_func_geometry_type(Item *a) { return new Item_func_geometry_type(a); } -Item *create_func_dimension(Item* a) +Item *create_func_dimension(Item *a) { return new Item_func_dimension(a); } -Item *create_func_x(Item* a) +Item *create_func_x(Item *a) { return new Item_func_x(a); } -Item *create_func_y(Item* a) +Item *create_func_y(Item *a) { return new Item_func_y(a); } -Item *create_func_numpoints(Item* a) +Item *create_func_numpoints(Item *a) { return new Item_func_numpoints(a); } -Item *create_func_numinteriorring(Item* a) +Item *create_func_numinteriorring(Item *a) { return new Item_func_numinteriorring(a); } -Item *create_func_numgeometries(Item* a) +Item *create_func_numgeometries(Item *a) { return new Item_func_numgeometries(a); } -Item *create_func_area(Item* a) +Item *create_func_area(Item *a) { return new Item_func_area(a); } -Item *create_func_glength(Item* a) +Item *create_func_glength(Item *a) { return new Item_func_glength(a); } -Item *create_func_point(Item* a, Item* b) +Item *create_func_point(Item *a, Item *b) { - return new Item_func_point(a,b); + return new Item_func_point(a, b); } diff --git a/sql/item_create.h b/sql/item_create.h index 135bd6b02c4..0e2295b6d4f 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -100,42 +100,43 @@ Item *create_func_version(void); Item *create_func_weekday(Item* a); Item *create_load_file(Item* a); Item *create_func_is_free_lock(Item* a); +Item *create_func_is_used_lock(Item* a); Item *create_func_quote(Item* a); -Item *create_func_geometry_from_text(Item* a); -Item *create_func_as_text(Item* a); -Item *create_func_startpoint(Item* a); -Item *create_func_endpoint(Item* a); -Item *create_func_exteriorring(Item* a); -Item *create_func_centroid(Item* a); -Item *create_func_envelope(Item* a); -Item *create_func_pointn(Item* a, Item* b); -Item *create_func_interiorringn(Item* a, Item* b); -Item *create_func_geometryn(Item* a, Item* b); +Item *create_func_geometry_from_text(Item *a); +Item *create_func_as_text(Item *a); +Item *create_func_srid(Item *a); +Item *create_func_startpoint(Item *a); +Item *create_func_endpoint(Item *a); +Item *create_func_exteriorring(Item *a); +Item *create_func_centroid(Item *a); +Item *create_func_envelope(Item *a); +Item *create_func_pointn(Item *a, Item *b); +Item *create_func_interiorringn(Item *a, Item *b); +Item *create_func_geometryn(Item *a, Item *b); -Item *create_func_equals(Item* a, Item* b); -Item *create_func_disjoint(Item* a, Item* b); -Item *create_func_intersects(Item* a, Item* b); -Item *create_func_touches(Item* a, Item* b); -Item *create_func_crosses(Item* a, Item* b); -Item *create_func_within(Item* a, Item* b); -Item *create_func_contains(Item* a, Item* b); -Item *create_func_overlaps(Item* a, Item* b); +Item *create_func_equals(Item *a, Item *b); +Item *create_func_disjoint(Item *a, Item *b); +Item *create_func_intersects(Item *a, Item *b); +Item *create_func_touches(Item *a, Item *b); +Item *create_func_crosses(Item *a, Item *b); +Item *create_func_within(Item *a, Item *b); +Item *create_func_contains(Item *a, Item *b); +Item *create_func_overlaps(Item *a, Item *b); -Item *create_func_isempty(Item* a); -Item *create_func_issimple(Item* a); -Item *create_func_isclosed(Item* a); +Item *create_func_isempty(Item *a); +Item *create_func_issimple(Item *a); +Item *create_func_isclosed(Item *a); -Item *create_func_geometry_type(Item* a); -Item *create_func_dimension(Item* a); -Item *create_func_x(Item* a); -Item *create_func_y(Item* a); -Item *create_func_area(Item* a); -Item *create_func_glength(Item* a); +Item *create_func_geometry_type(Item *a); +Item *create_func_dimension(Item *a); +Item *create_func_x(Item *a); +Item *create_func_y(Item *a); +Item *create_func_area(Item *a); +Item *create_func_glength(Item *a); -Item *create_func_numpoints(Item* a); -Item *create_func_numinteriorring(Item* a); -Item *create_func_numgeometries(Item* a); - -Item *create_func_point(Item* a,Item* b); +Item *create_func_numpoints(Item *a); +Item *create_func_numinteriorring(Item *a); +Item *create_func_numgeometries(Item *a); +Item *create_func_point(Item *a, Item *b); diff --git a/sql/item_func.cc b/sql/item_func.cc index ef65352ff73..05d66f9bfcb 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -110,7 +110,6 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) return 0; // Fatal error if flag is set! if (arg_count) { // Print purify happy - bool first_coll= 1; for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++) { if ((*arg)->fix_fields(thd, tables, arg) || @@ -119,38 +118,6 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) if ((*arg)->maybe_null) maybe_null=1; - if ((*arg)->result_type() == STRING_RESULT) - { - /* - Set return character set to first argument if we are returning a - string. - */ - if (first_coll) - { - set_charset((*arg)->charset()); - coercibility= (*args)->coercibility; - first_coll= 0; - } - else if ((*arg)->charset() == &my_charset_bin || - charset() == &my_charset_bin) - { - set_charset(&my_charset_bin); - coercibility= COER_NOCOLL; - } - else if ((*arg)->coercibility < coercibility) - { - if (!my_charset_same(charset(),(*arg)->charset())) - { - set_charset(&my_charset_bin); - coercibility= COER_NOCOLL; - } - else - { - coercibility= (*arg)->coercibility; - set_charset((*arg)->charset()); - } - } - } with_sum_func= with_sum_func || (*arg)->with_sum_func; used_tables_cache|=(*arg)->used_tables(); const_item_cache&= (*arg)->const_item(); @@ -502,12 +469,15 @@ longlong Item_func_int_div::val_int() longlong val2=args[1]->val_int(); if ((null_value= val2 == 0 || args[0]->null_value || args[1]->null_value)) return 0; - return value/val2; + return (unsigned_flag ? + (ulonglong) value / (ulonglong) val2 : + value / val2); } void Item_func_int_div::fix_length_and_dec() { + find_num_type(); max_length=args[0]->max_length - args[0]->decimals; maybe_null=1; } @@ -794,20 +764,28 @@ double Item_func_round::val() double value=args[0]->val(); int dec=(int) args[1]->val_int(); uint abs_dec=abs(dec); + double tmp; + /* + tmp2 is here to avoid return the value with 80 bit precision + This will fix that the test round(0.1,1) = round(0.1,1) is true + */ + volatile double tmp2; if ((null_value=args[0]->null_value || args[1]->null_value)) return 0.0; - double tmp=(abs_dec < array_elements(log_10) ? - log_10[abs_dec] : pow(10.0,(double) abs_dec)); + tmp=(abs_dec < array_elements(log_10) ? + log_10[abs_dec] : pow(10.0,(double) abs_dec)); if (truncate) { if (value >= 0) - return dec < 0 ? floor(value/tmp)*tmp : floor(value*tmp)/tmp; + tmp2= dec < 0 ? floor(value/tmp)*tmp : floor(value*tmp)/tmp; else - return dec < 0 ? ceil(value/tmp)*tmp : ceil(value*tmp)/tmp; + tmp2= dec < 0 ? ceil(value/tmp)*tmp : ceil(value*tmp)/tmp; } - return dec < 0 ? rint(value/tmp)*tmp : rint(value*tmp)/tmp; + else + tmp2=dec < 0 ? rint(value/tmp)*tmp : rint(value*tmp)/tmp; + return tmp2; } @@ -843,7 +821,7 @@ void Item_func_rand::fix_length_and_dec() double Item_func_rand::val() { - return rnd(rand); + return my_rnd(rand); } longlong Item_func_sign::val_int() @@ -880,9 +858,13 @@ void Item_func_min_max::fix_length_and_dec() maybe_null=0; cmp_type=item_cmp_type(cmp_type,args[i]->result_type()); if (i==0) - set_charset(args[i]->charset()); - else if (args[i]->charset() == &my_charset_bin) - set_charset(&my_charset_bin); + set_charset(args[i]->charset(), args[i]->coercibility); + else if (set_charset(charset(), coercibility, + args[i]->charset(), args[i]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + break; + } } } @@ -934,6 +916,7 @@ String *Item_func_min_max::val_str(String *str) } } } + res->set_charset(charset()); return res; } case ROW_RESULT: @@ -1635,8 +1618,10 @@ public: bool locked; pthread_cond_t cond; pthread_t thread; + ulong thread_id; - ULL(const char *key_arg,uint length) :key_length(length),count(1),locked(1) + ULL(const char *key_arg,uint length, ulong id) + :key_length(length),count(1),locked(1), thread_id(id) { key=(char*) my_memdup((byte*) key_arg,length,MYF(0)); pthread_cond_init(&cond,NULL); @@ -1840,7 +1825,7 @@ longlong Item_func_get_lock::val_int() if (!(ull= ((ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(), res->length())))) { - ull=new ULL(res->ptr(),res->length()); + ull=new ULL(res->ptr(),res->length(), thd->thread_id); if (!ull || !ull->initialized()) { delete ull; @@ -2701,6 +2686,28 @@ longlong Item_func_is_free_lock::val_int() return 0; } +longlong Item_func_is_used_lock::val_int() +{ + String *res=args[0]->val_str(&value); + THD *thd=current_thd; + ULL *ull; + + null_value=1; + if (!res || !res->length()) + return 0; + + pthread_mutex_lock(&LOCK_user_locks); + ull= (ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(), + res->length()); + pthread_mutex_unlock(&LOCK_user_locks); + if (!ull || !ull->locked) + return 0; + + null_value=0; + return ull->thread_id; +} + + /************************************************************************** Spatial functions @@ -2709,120 +2716,133 @@ longlong Item_func_is_free_lock::val_int() longlong Item_func_dimension::val_int() { uint32 dim; - String *wkb=args[0]->val_str(&value); + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - args[0]->null_value || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - geom.dimension(&dim)); - + null_value= (!swkb || + args[0]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + geom.dimension(&dim)); return (longlong) dim; } longlong Item_func_numinteriorring::val_int() { uint32 num; - String *wkb=args[0]->val_str(&value); + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,num_interior_ring) || + null_value= (!swkb || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, num_interior_ring) || geom.num_interior_ring(&num)); - return (longlong) num; } longlong Item_func_numgeometries::val_int() { - uint32 num=0; - String *wkb=args[0]->val_str(&value); + uint32 num= 0; + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,num_geometries) || - geom.num_geometries(&num)); - + null_value= (!swkb || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, num_geometries) || + geom.num_geometries(&num)); return (longlong) num; } longlong Item_func_numpoints::val_int() { - uint32 num=0; - String *wkb=args[0]->val_str(&value); + uint32 num; + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - args[0]->null_value || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,num_points) || - geom.num_points(&num)); - + null_value= (!swkb || + args[0]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, num_points) || + geom.num_points(&num)); return (longlong) num; } double Item_func_x::val() { - double res=0; - String *wkb=args[0]->val_str(&value); + double res; + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,get_x) || - geom.get_x(&res)); - + null_value= (!swkb || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, get_x) || + geom.get_x(&res)); return res; } double Item_func_y::val() { - double res=0; - String *wkb=args[0]->val_str(&value); + double res; + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,get_y) || - geom.get_y(&res)); - + null_value= (!swkb || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, get_y) || + geom.get_y(&res)); return res; } double Item_func_area::val() { - double res=0; - String *wkb=args[0]->val_str(&value); + double res; + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,area) || - geom.area(&res)); - + null_value= (!swkb || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, area) || + geom.area(&res)); return res; } double Item_func_glength::val() { - double res=0; - String *wkb=args[0]->val_str(&value); + double res; + String *swkb= args[0]->val_str(&value); Geometry geom; - null_value= (!wkb || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,length) || - geom.length(&res)); + null_value= (!swkb || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, length) || + geom.length(&res)); return res; } +longlong Item_func_srid::val_int() +{ + String *swkb= args[0]->val_str(&value); + Geometry geom; + + null_value= (!swkb || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE)); + uint32 res= uint4korr(swkb->ptr()); + return (longlong) res; +} + int Item_func_sp::execute(Item **itp) { diff --git a/sql/item_func.h b/sql/item_func.h index 5e7452d70bc..1c70d00f7e7 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1112,6 +1112,17 @@ public: }; +class Item_func_srid: public Item_int_func +{ + String value; +public: + Item_func_srid(Item *a): Item_int_func(a) {} + longlong val_int(); + const char *func_name() const { return "srid"; } + void fix_length_and_dec() { max_length= 10; } +}; + + class Item_func_match_nl :public Item_func_match { public: @@ -1151,6 +1162,16 @@ public: void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1;} }; +class Item_func_is_used_lock :public Item_int_func +{ + String value; +public: + Item_func_is_used_lock(Item *a) :Item_int_func(a) {} + longlong val_int(); + const char *func_name() const { return "is_used_lock"; } + void fix_length_and_dec() { decimals=0; max_length=10; maybe_null=1;} +}; + /* For type casts */ enum Item_cast diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index f68a0dc9e73..2a0194aba28 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -235,8 +235,6 @@ String *Item_func_concat::val_str(String *str) use_as_buff= &tmp_value; for (i=1 ; i < arg_count ; i++) { - if (args[i]->binary()) - set_charset(&my_charset_bin); if (res->length() == 0) { if (!(res=args[i]->val_str(str))) @@ -265,7 +263,6 @@ String *Item_func_concat::val_str(String *str) str->append(*res2); } res=str; - res->set_charset(charset()); } else if (res == &tmp_value) { @@ -277,7 +274,6 @@ String *Item_func_concat::val_str(String *str) if (tmp_value.replace(0,0,*res)) goto null; res= &tmp_value; - res->set_charset(charset()); use_as_buff=str; // Put next arg here } else if (tmp_value.is_alloced() && res2->ptr() >= tmp_value.ptr() && @@ -296,7 +292,6 @@ String *Item_func_concat::val_str(String *str) *res)) goto null; res= &tmp_value; - res->set_charset(charset()); use_as_buff=str; // Put next arg here } else @@ -306,11 +301,11 @@ String *Item_func_concat::val_str(String *str) tmp_value.append(*res2)) goto null; res= &tmp_value; - res->set_charset(charset()); use_as_buff=str; } } } + res->set_charset(charset()); return res; null: @@ -321,9 +316,21 @@ null: void Item_func_concat::fix_length_and_dec() { + bool first_coll= 1; max_length=0; + + set_charset(args[0]->charset(),args[0]->coercibility); for (uint i=0 ; i < arg_count ; i++) + { max_length+=args[i]->max_length; + if (set_charset(charset(), coercibility, + args[i]->charset(), args[i]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + break; + } + } + if (max_length > MAX_BLOB_WIDTH) { max_length=MAX_BLOB_WIDTH; @@ -590,6 +597,7 @@ String *Item_func_concat_ws::val_str(String *str) use_as_buff=str; } } + res->set_charset(charset()); return res; null: @@ -614,9 +622,18 @@ void Item_func_concat_ws::split_sum_func(Item **ref_pointer_array, void Item_func_concat_ws::fix_length_and_dec() { + set_charset(separator->charset(),separator->coercibility); max_length=separator->max_length*(arg_count-1); for (uint i=0 ; i < arg_count ; i++) + { max_length+=args[i]->max_length; + if (set_charset(charset(), coercibility, + args[i]->charset(), args[i]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + break; + } + } if (max_length > MAX_BLOB_WIDTH) { max_length=MAX_BLOB_WIDTH; @@ -978,6 +995,7 @@ void Item_func_substr::fix_length_and_dec() { max_length=args[0]->max_length; + set_charset(args[0]->charset(), args[0]->coercibility); if (args[1]->const_item()) { int32 start=(int32) args[1]->val_int()-1; @@ -1574,10 +1592,22 @@ void Item_func_elt::fix_length_and_dec() { max_length=0; decimals=0; - for (uint i=1 ; i < arg_count ; i++) + + for (uint i=0 ; i < arg_count ; i++) { set_if_bigger(max_length,args[i]->max_length); set_if_bigger(decimals,args[i]->decimals); + if (i == 0) + set_charset(args[i]->charset(),args[i]->coercibility); + else + { + if (set_charset(charset(), coercibility, + args[i]->charset(), args[i]->coercibility)) + { + my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name()); + break; + } + } } maybe_null=1; // NULL if wrong first arg with_sum_func= with_sum_func || item->with_sum_func; @@ -1638,13 +1668,16 @@ longlong Item_func_elt::val_int() String *Item_func_elt::val_str(String *str) { uint tmp; + String *res; if ((tmp=(uint) item->val_int()) == 0 || tmp > arg_count) { null_value=1; return NULL; } null_value=0; - return args[tmp-1]->val_str(str); + res= args[tmp-1]->val_str(str); + res->set_charset(charset()); + return res; } @@ -1791,6 +1824,7 @@ inline String* alloc_buffer(String *res,String *str,String *tmp_value, void Item_func_repeat::fix_length_and_dec() { + set_charset(args[0]->charset(), args[0]->coercibility); if (args[1]->const_item()) { max_length=(long) (args[0]->max_length * args[1]->val_int()); @@ -2027,9 +2061,9 @@ String *Item_func_conv_charset::val_str(String *str) void Item_func_conv_charset::fix_length_and_dec() { - max_length = args[0]->max_length*conv_charset->mbmaxlen; - coercibility= COER_IMPLICIT; set_charset(conv_charset); + max_length = args[0]->max_length*conv_charset->mbmaxlen; + set_charset(conv_charset, COER_IMPLICIT); } @@ -2101,25 +2135,6 @@ outp: } -bool Item_func_conv_charset::fix_fields(THD *thd,struct st_table_list *tables, Item **ref) -{ - char buff[STACK_BUFF_ALLOC]; // Max argument in function - used_tables_cache=0; - const_item_cache=1; - - if (thd && check_stack_overrun(thd,buff)) - return 0; // Fatal error if flag is set! - if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1)) - return 1; - maybe_null=args[0]->maybe_null; - const_item_cache=args[0]->const_item(); - set_charset(conv_charset); - fix_length_and_dec(); - fixed= 1; - return 0; -} - - void Item_func_conv_charset3::fix_length_and_dec() { max_length = args[0]->max_length; @@ -2134,24 +2149,11 @@ String *Item_func_set_collation::val_str(String *str) return str; } -bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables, Item **ref) +void Item_func_set_collation::fix_length_and_dec() { CHARSET_INFO *set_collation; - String tmp, *str; const char *colname; - char buff[STACK_BUFF_ALLOC]; // Max argument in function - used_tables_cache=0; - const_item_cache=1; - - if (thd && check_stack_overrun(thd,buff)) - return 0; // Fatal error if flag is set! - if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1)) - return 1; - if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1)) - return 2; - maybe_null=args[0]->maybe_null || args[1]->maybe_null; - - str= args[1]->val_str(&tmp); + String tmp, *str= args[1]->val_str(&tmp); colname= str->c_ptr(); if (!strncmp(colname,"BINARY",6)) set_collation= get_charset_by_csname(args[0]->charset()->csname, @@ -2162,26 +2164,20 @@ bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables, if (!set_collation) { my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), str->c_ptr()); - return 1; + return; } if (!my_charset_same(args[0]->charset(),set_collation)) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), set_collation->name,args[0]->charset()->csname); - return 1; + return; } - set_charset(set_collation); - - coercibility= COER_EXPLICIT; - with_sum_func= with_sum_func || args[0]->with_sum_func; - used_tables_cache=args[0]->used_tables(); - const_item_cache=args[0]->const_item(); - fix_length_and_dec(); - fixed= 1; - return 0; + set_charset(set_collation, COER_EXPLICIT); + max_length= args[0]->max_length; } + bool Item_func_set_collation::eq(const Item *item, bool binary_cmp) const { /* Assume we don't have rtti */ @@ -2509,10 +2505,19 @@ String *Item_func_geometry_from_text::val_str(String *str) { Geometry geom; String arg_val; - String *wkt = args[0]->val_str(&arg_val); + String *wkt= args[0]->val_str(&arg_val); GTextReadStream trs(wkt->ptr(), wkt->length()); + uint32 srid; + if ((arg_count == 2) && !args[1]->null_value) + srid= args[1]->val_int(); + else + srid= 0; + + if (str->reserve(SRID_SIZE, 512)) + return 0; str->length(0); + str->q_append(srid); if ((null_value=(args[0]->null_value || geom.create_from_wkt(&trs, str, 0)))) return 0; return str; @@ -2525,19 +2530,51 @@ void Item_func_geometry_from_text::fix_length_and_dec() } +String *Item_func_geometry_from_wkb::val_str(String *str) +{ + String arg_val; + String *wkb= args[0]->val_str(&arg_val); + Geometry geom; + uint32 srid; + + if ((arg_count == 2) && !args[1]->null_value) + srid= args[1]->val_int(); + else + srid= 0; + + if (str->reserve(SRID_SIZE, 512)) + return 0; + str->length(0); + str->q_append(srid); + if ((null_value= (args[0]->null_value || + geom.create_from_wkb(wkb->ptr(), wkb->length())))) + return 0; + + str->append(*wkb); + return str; +} + + +void Item_func_geometry_from_wkb::fix_length_and_dec() +{ + max_length=MAX_BLOB_WIDTH; +} + + String *Item_func_as_text::val_str(String *str) { String arg_val; - String *wkt = args[0]->val_str(&arg_val); + String *swkb= args[0]->val_str(&arg_val); Geometry geom; - if ((null_value=(args[0]->null_value || - geom.create_from_wkb(wkt->ptr(),wkt->length())))) + if ((null_value= (args[0]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE)))) return 0; str->length(0); - if ((null_value=geom.as_wkt(str))) + if ((null_value= geom.as_wkt(str))) return 0; return str; @@ -2550,11 +2587,12 @@ void Item_func_as_text::fix_length_and_dec() String *Item_func_geometry_type::val_str(String *str) { - String *wkt = args[0]->val_str(str); + String *swkb= args[0]->val_str(str); Geometry geom; - if ((null_value=(args[0]->null_value || - geom.create_from_wkb(wkt->ptr(),wkt->length())))) + if ((null_value= (args[0]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE)))) return 0; str->copy(geom.get_class_info()->m_name, strlen(geom.get_class_info()->m_name), @@ -2565,14 +2603,19 @@ String *Item_func_geometry_type::val_str(String *str) String *Item_func_envelope::val_str(String *str) { - String *res = args[0]->val_str(str); + String *res= args[0]->val_str(str); Geometry geom; - if ((null_value = args[0]->null_value || - geom.create_from_wkb(res->ptr(),res->length()))) + if ((null_value= args[0]->null_value || + geom.create_from_wkb(res->ptr() + SRID_SIZE, + res->length() - SRID_SIZE))) return 0; + uint32 srid= uint4korr(res->ptr()); + if (res->reserve(SRID_SIZE, 512)) + return 0; res->length(0); + res->q_append(srid); return (null_value= geom.envelope(res)) ? 0 : res; } @@ -2580,15 +2623,22 @@ String *Item_func_envelope::val_str(String *str) String *Item_func_centroid::val_str(String *str) { String arg_val; - String *wkb = args[0]->val_str(&arg_val); + String *swkb= args[0]->val_str(&arg_val); Geometry geom; - null_value = args[0]->null_value || - geom.create_from_wkb(wkb->ptr(),wkb->length()) || - !GEOM_METHOD_PRESENT(geom,centroid) || - geom.centroid(str); + if ((null_value= args[0]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE) || + !GEOM_METHOD_PRESENT(geom, centroid))) + return 0; + + if (str->reserve(SRID_SIZE, 512)) + return 0; + str->length(0); + uint32 srid= uint4korr(swkb->ptr()); + str->q_append(srid); - return null_value ? 0: str; + return (null_value= geom.centroid(str)) ? 0 : str; } @@ -2599,15 +2649,20 @@ String *Item_func_centroid::val_str(String *str) String *Item_func_spatial_decomp::val_str(String *str) { String arg_val; - String *wkb = args[0]->val_str(&arg_val); + String *swkb= args[0]->val_str(&arg_val); Geometry geom; - if ((null_value = (args[0]->null_value || - geom.create_from_wkb(wkb->ptr(),wkb->length())))) + if ((null_value= (args[0]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE)))) return 0; - null_value=1; + null_value= 1; + if (str->reserve(SRID_SIZE, 512)) + return 0; str->length(0); + uint32 srid= uint4korr(swkb->ptr()); + str->q_append(srid); switch(decomp_func) { case SP_STARTPOINT: @@ -2628,7 +2683,7 @@ String *Item_func_spatial_decomp::val_str(String *str) default: goto ret; } - null_value=0; + null_value= 0; ret: return null_value ? 0 : str; @@ -2638,28 +2693,30 @@ ret: String *Item_func_spatial_decomp_n::val_str(String *str) { String arg_val; - String *wkb = args[0]->val_str(&arg_val); - long n = (long) args[1]->val_int(); + String *swkb= args[0]->val_str(&arg_val); + long n= (long) args[1]->val_int(); Geometry geom; - if ((null_value = (args[0]->null_value || - args[1]->null_value || - geom.create_from_wkb(wkb->ptr(),wkb->length()) ))) + if ((null_value= (args[0]->null_value || args[1]->null_value || + geom.create_from_wkb(swkb->ptr() + SRID_SIZE, + swkb->length() - SRID_SIZE)))) return 0; - null_value=1; - + null_value= 1; + if (str->reserve(SRID_SIZE, 512)) + return 0; + str->length(0); + uint32 srid= uint4korr(swkb->ptr()); + str->q_append(srid); switch(decomp_func_n) { case SP_POINTN: - if (!GEOM_METHOD_PRESENT(geom,point_n) || - geom.point_n(n,str)) + if (!GEOM_METHOD_PRESENT(geom,point_n) || geom.point_n(n,str)) goto ret; break; case SP_GEOMETRYN: - if (!GEOM_METHOD_PRESENT(geom,geometry_n) || - geom.geometry_n(n,str)) + if (!GEOM_METHOD_PRESENT(geom,geometry_n) || geom.geometry_n(n,str)) goto ret; break; @@ -2672,7 +2729,7 @@ String *Item_func_spatial_decomp_n::val_str(String *str) default: goto ret; } - null_value=0; + null_value= 0; ret: return null_value ? 0 : str; @@ -2695,9 +2752,9 @@ String *Item_func_point::val_str(String *str) double x= args[0]->val(); double y= args[1]->val(); - if ( (null_value = (args[0]->null_value || - args[1]->null_value || - str->realloc(1+4+8+8)))) + if ( (null_value= (args[0]->null_value || + args[1]->null_value || + str->realloc(1 + 4 + 8 + 8)))) return 0; str->length(0); @@ -2724,19 +2781,19 @@ String *Item_func_spatial_collection::val_str(String *str) String arg_value; uint i; - null_value=1; + null_value= 1; str->length(0); - if (str->reserve(9,512)) + if (str->reserve(1 + 4 + 4, 512)) return 0; - str->q_append((char)Geometry::wkbNDR); - str->q_append((uint32)coll_type); - str->q_append((uint32)arg_count); + str->q_append((char) Geometry::wkbNDR); + str->q_append((uint32) coll_type); + str->q_append((uint32) arg_count); - for (i = 0; i < arg_count; ++i) + for (i= 0; i < arg_count; ++i) { - String *res = args[i]->val_str(&arg_value); + String *res= args[i]->val_str(&arg_value); if (args[i]->null_value) goto ret; @@ -2747,16 +2804,16 @@ String *Item_func_spatial_collection::val_str(String *str) any checkings for item types, so just copy them into target collection */ - if ((null_value=(str->reserve(res->length(),512)))) + if ((null_value= str->reserve(res->length(), 512))) goto ret; - str->q_append(res->ptr(),res->length()); + str->q_append(res->ptr(), res->length()); } else { enum Geometry::wkbType wkb_type; uint32 len=res->length(); - const char *data=res->ptr()+1; + const char *data= res->ptr() + 1; /* In the case of named collection we must to @@ -2767,8 +2824,8 @@ String *Item_func_spatial_collection::val_str(String *str) if (len < 5) goto ret; wkb_type= (Geometry::wkbType) uint4korr(data); - data+=4; - len-=5; + data+= 4; + len-= 5; if (wkb_type != item_type) goto ret; @@ -2779,17 +2836,17 @@ String *Item_func_spatial_collection::val_str(String *str) if (len < WKB_HEADER_SIZE) goto ret; - data-=WKB_HEADER_SIZE; - len+=WKB_HEADER_SIZE; - if (str->reserve(len,512)) + data-= WKB_HEADER_SIZE; + len+= WKB_HEADER_SIZE; + if (str->reserve(len, 512)) goto ret; - str->q_append(data,len); + str->q_append(data, len); break; case Geometry::wkbLineString: - if (str->reserve(POINT_DATA_SIZE,512)) + if (str->reserve(POINT_DATA_SIZE, 512)) goto ret; - str->q_append(data,POINT_DATA_SIZE); + str->q_append(data, POINT_DATA_SIZE); break; case Geometry::wkbPolygon: @@ -2800,25 +2857,25 @@ String *Item_func_spatial_collection::val_str(String *str) if (len < 4 + 2 * POINT_DATA_SIZE) goto ret; - uint32 llen=len; - const char *ldata=data; + uint32 llen= len; + const char *ldata= data; - n_points=uint4korr(data); - data+=4; - float8get(x1,data); - data+=8; - float8get(y1,data); - data+=8; + n_points= uint4korr(data); + data+= 4; + float8get(x1, data); + data+= 8; + float8get(y1, data); + data+= 8; - data+=(n_points-2) * POINT_DATA_SIZE; + data+= (n_points - 2) * POINT_DATA_SIZE; - float8get(x2,data); - float8get(y2,data+8); + float8get(x2, data); + float8get(y2, data + 8); if ((x1 != x2) || (y1 != y2)) goto ret; - if (str->reserve(llen,512)) + if (str->reserve(llen, 512)) goto ret; str->q_append(ldata, llen); } diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 8bfa4317698..07b7eb2d165 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -151,7 +151,11 @@ class Item_str_conv :public Item_str_func { public: Item_str_conv(Item *item) :Item_str_func(item) {} - void fix_length_and_dec() { max_length = args[0]->max_length; } + void fix_length_and_dec() + { + set_charset(args[0]->charset(), args[0]->coercibility); + max_length = args[0]->max_length; + } }; @@ -573,7 +577,6 @@ class Item_func_conv_charset :public Item_str_func public: Item_func_conv_charset(Item *a, CHARSET_INFO *cs) :Item_str_func(a) { conv_charset=cs; } - bool fix_fields(THD *thd,struct st_table_list *tables,Item **ref); String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "conv_charset"; } @@ -584,9 +587,7 @@ class Item_func_set_collation :public Item_str_func public: Item_func_set_collation(Item *a, Item *b) :Item_str_func(a,b) {}; String *val_str(String *); - bool fix_fields(THD *thd,struct st_table_list *tables, Item **ref); - void fix_length_and_dec() - { max_length = args[0]->max_length; } + void fix_length_and_dec(); bool eq(const Item *item, bool binary_cmp) const; const char *func_name() const { return "set_collation"; } }; @@ -632,15 +633,28 @@ public: Spatial functions ********************************************************/ +#define SRID_SIZE sizeof(uint32) + class Item_func_geometry_from_text :public Item_str_func { public: Item_func_geometry_from_text(Item *a) :Item_str_func(a) {} + Item_func_geometry_from_text(Item *a, Item *srid) :Item_str_func(a, srid) {} const char *func_name() const { return "geometryfromtext"; } String *val_str(String *); void fix_length_and_dec(); }; +class Item_func_geometry_from_wkb: public Item_str_func +{ +public: + Item_func_geometry_from_wkb(Item *a) :Item_str_func(a) {} + Item_func_geometry_from_wkb(Item *a, Item *srid) :Item_str_func(a, srid) {} + const char *func_name() const { return "geometryfromwkb"; } + String *val_str(String *); + void fix_length_and_dec(); +}; + class Item_func_as_text :public Item_str_func { public: @@ -683,7 +697,8 @@ public: class Item_func_point :public Item_str_func { public: - Item_func_point(Item *a,Item *b) :Item_str_func(a,b) {} + Item_func_point(Item *a, Item *b) :Item_str_func(a, b) {} + Item_func_point(Item *a, Item *b, Item *srid) :Item_str_func(a, b, srid) {} const char *func_name() const { return "point"; } String *val_str(String *); void fix_length_and_dec(){max_length=MAX_BLOB_WIDTH;} diff --git a/sql/key.cc b/sql/key.cc index feda9e156b3..37ef6339f20 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -271,5 +271,13 @@ bool check_if_key_used(TABLE *table, uint idx, List<Item> &fields) return 1; } } + + /* + If table handler has primary key as part of the index, check that primary + key is not updated + */ + if (idx != table->primary_key && table->primary_key < MAX_KEY && + (table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX)) + return check_if_key_used(table, table->primary_key, fields); return 0; } diff --git a/sql/lex.h b/sql/lex.h index 2992acfe4c6..9e9cb75da1c 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -267,6 +267,7 @@ static SYMBOL symbols[] = { { "MEDIUMINT", SYM(MEDIUMINT),0,0}, { "MERGE", SYM(MERGE_SYM),0,0}, { "MEDIUM", SYM(MEDIUM_SYM),0,0}, + { "MEMORY", SYM(MEMORY_SYM),0,0}, { "MIDDLEINT", SYM(MEDIUMINT),0,0}, /* For powerbuilder */ { "MIN_ROWS", SYM(MIN_ROWS),0,0}, { "MINUTE", SYM(MINUTE_SYM),0,0}, @@ -510,9 +511,12 @@ static SYMBOL sql_functions[] = { { "GEOMETRYN", SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_geometryn)}, { "GEOMETRYTYPE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_geometry_type)}, { "GEOMCOLLFROMTEXT", SYM(GEOMCOLLFROMTEXT),0,0}, + { "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT),0,0}, { "GEOMFROMTEXT", SYM(GEOMFROMTEXT),0,0}, { "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT),0,0}, - { "GLENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_glength)}, + { "GEOMFROMWKB", SYM(GEOMFROMWKB),0,0}, + { "GEOMETRYFROMWKB", SYM(GEOMFROMWKB),0,0}, + { "GLENGTH", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_glength)}, { "GREATEST", SYM(GREATEST_SYM),0,0}, { "GROUP_UNIQUE_USERS", SYM(GROUP_UNIQUE_USERS),0,0}, { "HEX", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_hex)}, @@ -526,6 +530,7 @@ static SYMBOL sql_functions[] = { { "ISEMPTY", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isempty)}, { "ISNULL", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)}, { "IS_FREE_LOCK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_free_lock)}, + { "IS_USED_LOCK", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_used_lock)}, { "LAST_INSERT_ID", SYM(LAST_INSERT_ID),0,0}, { "ISSIMPLE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_issimple)}, { "LCASE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)}, @@ -594,6 +599,7 @@ static SYMBOL sql_functions[] = { { "SOUNDEX", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)}, { "SPACE", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)}, { "SQRT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)}, + { "SRID", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_srid)}, { "STARTPOINT", SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_startpoint)}, { "STD", SYM(STD_SYM),0,0}, { "STDDEV", SYM(STD_SYM),0,0}, diff --git a/sql/lock.cc b/sql/lock.cc index 8f342b28d67..82004298453 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -319,6 +319,25 @@ void mysql_lock_abort(THD *thd, TABLE *table) } +/* Abort one thread / table combination */ + +void mysql_lock_abort_for_thread(THD *thd, TABLE *table) +{ + MYSQL_LOCK *locked; + TABLE *write_lock_used; + DBUG_ENTER("mysql_lock_abort_for_thread"); + + if ((locked = get_lock_data(thd,&table,1,1,&write_lock_used))) + { + for (uint i=0; i < locked->lock_count; i++) + thr_abort_locks_for_thread(locked->locks[i]->lock, + table->in_use->real_id); + my_free((gptr) locked,MYF(0)); + } + DBUG_VOID_RETURN; +} + + MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b) { MYSQL_LOCK *sql_lock; @@ -478,11 +497,12 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) { TABLE *table; char key[MAX_DBKEY_LENGTH]; + char *db= table_list->db ? table_list->db : (thd->db ? thd->db : (char*) ""); uint key_length; DBUG_ENTER("lock_table_name"); safe_mutex_assert_owner(&LOCK_open); - key_length=(uint) (strmov(strmov(key,table_list->db)+1,table_list->real_name) + key_length=(uint) (strmov(strmov(key,db)+1,table_list->real_name) -key)+ 1; /* Only insert the table if we haven't insert it already */ @@ -511,7 +531,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) my_free((gptr) table,MYF(0)); DBUG_RETURN(-1); } - if (remove_table_from_cache(thd, table_list->db, table_list->real_name)) + if (remove_table_from_cache(thd, db, table_list->real_name)) DBUG_RETURN(1); // Table is in use DBUG_RETURN(0); } @@ -555,6 +575,77 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(result); } + +/* + Lock all tables in list with a name lock + + SYNOPSIS + lock_table_names() + thd Thread handle + table_list Names of tables to lock + + NOTES + One must have a lock on LOCK_open when calling this + + RETURN + 0 ok + 1 Fatal error (end of memory ?) +*/ + +bool lock_table_names(THD *thd, TABLE_LIST *table_list) +{ + bool got_all_locks=1; + TABLE_LIST *lock_table; + + for (lock_table=table_list ; lock_table ; lock_table=lock_table->next) + { + int got_lock; + if ((got_lock=lock_table_name(thd,lock_table)) < 0) + goto end; // Fatal error + if (got_lock) + got_all_locks=0; // Someone is using table + } + + /* If some table was in use, wait until we got the lock */ + if (!got_all_locks && wait_for_locked_table_names(thd, table_list)) + goto end; + return 0; + +end: + unlock_table_names(thd, table_list, lock_table); + return 1; +} + + +/* + Unlock all tables in list with a name lock + + SYNOPSIS + unlock_table_names() + thd Thread handle + table_list Names of tables to unlock + last_table Don't unlock any tables after this one. + (default 0, which will unlock all tables) + + NOTES + One must have a lock on LOCK_open when calling this + This function will send a COND_refresh signal to inform other threads + that the name locks are removed + + RETURN + 0 ok + 1 Fatal error (end of memory ?) +*/ + +void unlock_table_names(THD *thd, TABLE_LIST *table_list, + TABLE_LIST *last_table) +{ + for (TABLE_LIST *table=table_list ; table != last_table ; table=table->next) + unlock_table_name(thd,table); + pthread_cond_broadcast(&COND_refresh); +} + + static void print_lock_error(int error) { int textno; diff --git a/sql/log.cc b/sql/log.cc index 170e976e643..cd4c2a38ac8 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -654,6 +654,8 @@ int MYSQL_LOG::purge_first_log(struct st_relay_log_info* rli) */ pthread_mutex_lock(&rli->log_space_lock); rli->log_space_total -= rli->relay_log_pos; + //tell the I/O thread to take the relay_log_space_limit into account + rli->ignore_log_space_limit= 0; pthread_mutex_unlock(&rli->log_space_lock); pthread_cond_broadcast(&rli->log_space_cond); @@ -1194,6 +1196,7 @@ bool MYSQL_LOG::write(Log_event* event_info) goto err; } } +#if 0 if (thd->variables.convert_set) { char buf[256], *p; @@ -1204,6 +1207,7 @@ bool MYSQL_LOG::write(Log_event* event_info) if (e.write(file)) goto err; } +#endif } event_info->set_log_pos(this); if (event_info->write(file) || @@ -1321,6 +1325,14 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache) */ { Query_log_event qinfo(thd, "BEGIN", 5, TRUE); + /* + Now this Query_log_event has artificial log_pos 0. It must be adjusted + to reflect the real position in the log. Not doing it would confuse the + slave: it would prevent this one from knowing where he is in the master's + binlog, which would result in wrong positions being shown to the user, + MASTER_POS_WAIT undue waiting etc. + */ + qinfo.set_log_pos(this); if (qinfo.write(&log_file)) goto err; } @@ -1343,6 +1355,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache) { Query_log_event qinfo(thd, "COMMIT", 6, TRUE); + qinfo.set_log_pos(this); if (qinfo.write(&log_file) || flush_io_cache(&log_file)) goto err; } diff --git a/sql/log_event.cc b/sql/log_event.cc index 3a1dbb6485e..5e3340b4cf7 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -328,7 +328,7 @@ int Log_event::exec_event(struct st_relay_log_info* rli) ****************************************************************************/ void Log_event::pack_info(Protocol *protocol) { - protocol->store("",0); + protocol->store("", &my_charset_bin); } @@ -550,6 +550,15 @@ err: sql_print_error("Error in Log_event::read_log_event(): '%s', \ data_len=%d,event_type=%d",error,data_len,head[EVENT_TYPE_OFFSET]); my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); + /* + The SQL slave thread will check if file->error<0 to know + if there was an I/O error. Even if there is no "low-level" I/O errors + with 'file', any of the high-level above errors is worrying + enough to stop the SQL thread now ; as we are skipping the current event, + going on with reading and successfully executing other events can + only corrupt the slave's databases. So stop. + */ + file->error= -1; } return res; } @@ -866,7 +875,6 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) int Query_log_event::exec_event(struct st_relay_log_info* rli) { int expected_error,actual_error = 0; - init_sql_alloc(&thd->mem_root, 8192,0); thd->db = rewrite_db((char*)db); /* @@ -943,7 +951,7 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->db = thd->query = 0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); - thd->variables.convert_set = 0; + //thd->variables.convert_set = 0; close_thread_tables(thd); free_root(&thd->mem_root,0); return 1; @@ -954,7 +962,7 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) thd->query= 0; // just to be sure VOID(pthread_mutex_unlock(&LOCK_thread_count)); // assume no convert for next query unless set explictly - thd->variables.convert_set = 0; + //thd->variables.convert_set = 0; close_thread_tables(thd); if (thd->query_error || thd->is_fatal_error) @@ -1066,6 +1074,7 @@ int Start_log_event::write_data(IO_CACHE* file) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) int Start_log_event::exec_event(struct st_relay_log_info* rli) { + DBUG_ENTER("Start_log_event::exec_event"); /* All temporary tables was deleted on the master */ close_temporary_tables(thd); /* @@ -1073,7 +1082,7 @@ int Start_log_event::exec_event(struct st_relay_log_info* rli) */ if (!rli->mi->old_format) cleanup_load_tmpdir(); - return Log_event::exec_event(rli); + DBUG_RETURN(Log_event::exec_event(rli)); } #endif @@ -1526,7 +1535,6 @@ void Load_log_event::set_fields(List<Item> &field_list) int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, bool use_rli_only_for_errors) { - init_sql_alloc(&thd->mem_root, 8192,0); thd->db = rewrite_db((char*)db); DBUG_ASSERT(thd->query == 0); thd->query = 0; // Should not be needed @@ -1545,6 +1553,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, tables.db = thd->db; tables.alias = tables.real_name = (char*)table_name; tables.lock_type = TL_WRITE; + tables.updating= 1; // the table will be opened in mysql_load if (table_rules_on && !tables_ok(thd, &tables)) { @@ -2154,9 +2163,6 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) double real_val; longlong int_val; - if (type != ROW_RESULT) - init_sql_alloc(&thd->mem_root, 8192,0); - if (is_null) { it= new Item_null(); diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc index 4b0575c8579..b7e2a803e42 100644 --- a/sql/mf_iocache.cc +++ b/sql/mf_iocache.cc @@ -70,13 +70,17 @@ int _my_b_net_read(register IO_CACHE *info, byte *Buffer, /* to set up stuff for my_b_get (no _) */ info->read_end = (info->read_pos = (byte*) net->read_pos) + read_length; Buffer[0] = info->read_pos[0]; /* length is always 1 */ - info->read_pos++; /* info->request_pos is used by log_loaded_block() to know the size - of the current block + of the current block. + info->pos_in_file is used by log_loaded_block() too. */ + info->pos_in_file+= read_length; info->request_pos=info->read_pos; + + info->read_pos++; + DBUG_RETURN(0); } diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 62d2620ad75..c4be04943c0 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -62,7 +62,9 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); #endif #endif -#define files_charset_info system_charset_info +extern CHARSET_INFO *system_charset_info; +extern CHARSET_INFO *files_charset_info; +extern CHARSET_INFO *national_charset_info; /*************************************************************************** Configuration parameters @@ -526,6 +528,7 @@ int mysqld_show_variables(THD *thd,const char *wild); int mysqld_show(THD *thd, const char *wild, show_var_st *variables, enum enum_var_type value_type); int mysqld_show_charsets(THD *thd,const char *wild); +int mysqld_show_collations(THD *thd,const char *wild); int mysqld_show_table_types(THD *thd); int mysqld_show_privileges(THD *thd); int mysqld_show_column_types(THD *thd); @@ -562,7 +565,8 @@ bool add_field_to_list(THD *thd, char *field_name, enum enum_field_types type, char *length, char *decimal, uint type_modifier, Item *default_value, Item *comment, - char *change, TYPELIB *interval,CHARSET_INFO *cs); + char *change, TYPELIB *interval,CHARSET_INFO *cs, + uint uint_geom_type); void store_position_for_column(const char *name); bool add_to_list(THD *thd, SQL_LIST &list,Item *group,bool asc=0); void add_join_on(TABLE_LIST *b,Item *expr); @@ -780,6 +784,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock); void mysql_unlock_some_tables(THD *thd, TABLE **table,uint count); void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table); void mysql_lock_abort(THD *thd, TABLE *table); +void mysql_lock_abort_for_thread(THD *thd, TABLE *table); MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b); bool lock_global_read_lock(THD *thd); void unlock_global_read_lock(THD *thd); @@ -791,6 +796,9 @@ int lock_and_wait_for_table_name(THD *thd, TABLE_LIST *table_list); int lock_table_name(THD *thd, TABLE_LIST *table_list); void unlock_table_name(THD *thd, TABLE_LIST *table_list); bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list); +bool lock_table_names(THD *thd, TABLE_LIST *table_list); +void unlock_table_names(THD *thd, TABLE_LIST *table_list, + TABLE_LIST *last_table= 0); /* old unireg functions */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7f9c39e7e8f..ac3703c5a1d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -894,7 +894,7 @@ extern "C" void unireg_abort(int exit_code) DBUG_ENTER("unireg_abort"); if (exit_code) sql_print_error("Aborting\n"); - clean_up(1); /* purecov: inspected */ + clean_up(exit_code || !opt_bootstrap); /* purecov: inspected */ DBUG_PRINT("quit",("done with cleanup in unireg_abort")); my_thread_end(); clean_up_mutexes(); @@ -2760,7 +2760,7 @@ static void create_new_thread(THD *thd) max_used_connections=thread_count-delayed_insert_threads; thd->thread_id=thread_id++; for (uint i=0; i < 8 ; i++) // Generate password teststring - thd->scramble[i]= (char) (rnd(&sql_rand)*94+33); + thd->scramble[i]= (char) (my_rnd(&sql_rand)*94+33); thd->scramble[8]=0; // Back it up as old clients may need it memcpy(thd->old_scramble,thd->scramble,9); @@ -3754,8 +3754,10 @@ struct my_option my_long_options[] = {"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT, "Simulate memory shortage when compiled with the --with-debug=full option", 0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"new", 'n', "Use very new possible 'unsafe' functions", 0, 0, 0, GET_NO_ARG, - NO_ARG, 0, 0, 0, 0, 0, 0}, + {"new", 'n', "Use very new possible 'unsafe' functions", + (gptr*) &global_system_variables.new_mode, + (gptr*) &max_system_variables.new_mode, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef NOT_YET {"no-mix-table-types", OPT_NO_MIX_TYPE, "Don't allow commands with uses two different table types", (gptr*) &opt_no_mix_types, (gptr*) &opt_no_mix_types, 0, GET_BOOL, NO_ARG, @@ -3943,8 +3945,8 @@ struct my_option my_long_options[] = (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG, IF_PURIFY(0,1), 0, 0, 0, 0, 0}, #endif - {"user", 'u', "Run mysqld daemon as user", (gptr*) &mysqld_user, - (gptr*) &mysqld_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "Run mysqld daemon as user", 0, 0, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'v', "Synonym for option -v", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, @@ -4120,9 +4122,9 @@ struct my_option my_long_options[] = (gptr*) &max_connect_errors, (gptr*) &max_connect_errors, 0, GET_ULONG, REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ~0L, 0, 1, 0}, {"max_delayed_threads", OPT_MAX_DELAYED_THREADS, - "Don't start more than this number of threads to handle INSERT DELAYED statements.", + "Don't start more than this number of threads to handle INSERT DELAYED statements. This option does not yet have effect (on TODO), unless it is set to zero, which means INSERT DELAYED is not used.", (gptr*) &max_insert_delayed_threads, (gptr*) &max_insert_delayed_threads, - 0, GET_ULONG, REQUIRED_ARG, 20, 1, 16384, 0, 1, 0}, + 0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0}, {"max_error_count", OPT_MAX_ERROR_COUNT, "Max number of errors/warnings to store for a statement", (gptr*) &global_system_variables.max_error_count, @@ -4413,13 +4415,13 @@ struct show_var_st status_vars[]= { {"Handler_rollback", (char*) &ha_rollback_count, SHOW_LONG}, {"Handler_update", (char*) &ha_update_count, SHOW_LONG}, {"Handler_write", (char*) &ha_write_count, SHOW_LONG}, - {"Key_blocks_used", (char*) &_my_blocks_used, SHOW_LONG_CONST}, - {"Key_read_requests", (char*) &_my_cache_r_requests, SHOW_LONG}, - {"Key_reads", (char*) &_my_cache_read, SHOW_LONG}, - {"Key_write_requests", (char*) &_my_cache_w_requests, SHOW_LONG}, - {"Key_writes", (char*) &_my_cache_write, SHOW_LONG}, - {"Max_used_connections", (char*) &max_used_connections, SHOW_LONG}, - {"Not_flushed_key_blocks", (char*) &_my_blocks_changed, SHOW_LONG_CONST}, + {"Key_blocks_used", (char*) &my_blocks_used, SHOW_LONG_CONST}, + {"Key_read_requests", (char*) &my_cache_r_requests, SHOW_LONG}, + {"Key_reads", (char*) &my_cache_read, SHOW_LONG}, + {"Key_write_requests", (char*) &my_cache_w_requests, SHOW_LONG}, + {"Key_writes", (char*) &my_cache_write, SHOW_LONG}, + {"Max_used_connections", (char*) &max_used_connections, SHOW_LONG}, + {"Not_flushed_key_blocks", (char*) &my_blocks_changed, SHOW_LONG_CONST}, {"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_CONST}, {"Open_tables", (char*) 0, SHOW_OPENTABLES}, {"Open_files", (char*) &my_file_opened, SHOW_LONG_CONST}, @@ -4549,6 +4551,7 @@ static void set_options(void) sizeof(mysql_real_data_home)-1); /* Set default values for some variables */ + global_system_variables.convert_result_charset= TRUE; global_system_variables.table_type= DB_TYPE_MYISAM; global_system_variables.tx_isolation= ISO_REPEATABLE_READ; global_system_variables.select_limit= (ulonglong) HA_POS_ERROR; @@ -4606,12 +4609,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), /* Correct pointer set by my_getopt (for embedded library) */ mysql_data_home= mysql_real_data_home; break; + case 'u': + if (!mysqld_user) + mysqld_user= argument; + else + fprintf(stderr, "Warning: Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n", argument, mysqld_user); + break; case 'L': strmake(language, argument, sizeof(language)-1); break; - case 'n': - opt_specialflag|= SPECIAL_NEW_FUNC; - break; case 'o': protocol_version=PROTOCOL_VERSION-1; break; @@ -4807,8 +4813,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_SAFE: opt_specialflag|= SPECIAL_SAFE_MODE; delay_key_write_options= (uint) DELAY_KEY_WRITE_NONE; - myisam_recover_options= HA_RECOVER_NONE; // To be changed - ha_open_options&= ~(HA_OPEN_ABORT_IF_CRASHED | HA_OPEN_DELAY_KEY_WRITE); + myisam_recover_options= HA_RECOVER_DEFAULT; + ha_open_options&= ~(HA_OPEN_DELAY_KEY_WRITE); break; case (int) OPT_SKIP_PRIOR: opt_specialflag|= SPECIAL_NO_PRIOR; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index c4c5cd28b39..92bab76bedd 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1301,7 +1301,8 @@ key_and(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) } if (((clone_flag & CLONE_KEY2_MAYBE) && - !(clone_flag & CLONE_KEY1_MAYBE)) || + !(clone_flag & CLONE_KEY1_MAYBE) && + key2->type != SEL_ARG::MAYBE_KEY) || key1->type == SEL_ARG::MAYBE_KEY) { // Put simple key in key2 swap(SEL_ARG *,key1,key2); @@ -1329,7 +1330,10 @@ key_and(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) { key1->maybe_smaller(); if (key2->next_key_part) + { + key1->use_count--; // Incremented in and_all_keys return and_all_keys(key1,key2,clone_flag); + } key2->use_count--; // Key2 doesn't have a tree } return key1; @@ -2028,7 +2032,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root) { if (this == root && use_count != 1) { - sql_print_error("Use_count: Wrong count %lu for root",use_count); + sql_print_error("Note: Use_count: Wrong count %lu for root",use_count); return; } if (this->type != SEL_ARG::KEY_RANGE) @@ -2042,7 +2046,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root) ulong count=count_key_part_usage(root,pos->next_key_part); if (count > pos->next_key_part->use_count) { - sql_print_error("Use_count: Wrong count for key at %lx, %lu should be %lu", + sql_print_error("Note: Use_count: Wrong count for key at %lx, %lu should be %lu", pos,pos->next_key_part->use_count,count); return; } @@ -2050,7 +2054,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root) } } if (e_count != elements) - sql_print_error("Wrong use count: %u for tree at %lx", e_count, + sql_print_error("Warning: Wrong use count: %u for tree at %lx", e_count, (gptr) this); } diff --git a/sql/password.c b/sql/password.c index 5ed05ae6c0e..257547671e5 100644 --- a/sql/password.c +++ b/sql/password.c @@ -118,14 +118,14 @@ static void old_randominit(struct rand_struct *rand_st,ulong seed1) Generate Random number SYNOPSIS - rnd() + my_rnd() rand_st INOUT Structure used for number generation RETURN Generated pseudo random number */ -double rnd(struct rand_struct *rand_st) +double my_rnd(struct rand_struct *rand_st) { rand_st->seed1=(rand_st->seed1*3+rand_st->seed2) % rand_st->max_value; rand_st->seed2=(rand_st->seed1+rand_st->seed2+33) % rand_st->max_value; @@ -152,7 +152,7 @@ void create_random_string(int length,struct rand_struct *rand_st,char *target) char *end=target+length; /* Use pointer arithmetics as it is faster way to do so. */ for (; target<end ; target++) - *target= (char) (rnd(rand_st)*94+33); + *target= (char) (my_rnd(rand_st)*94+33); } @@ -293,7 +293,7 @@ void make_scrambled_password(char *to,const char *password, { to[0]=PVERSION41_CHAR; /* New passwords have version prefix */ /* Rnd returns number from 0 to 1 so this would be good salt generation.*/ - salt=(unsigned short) (rnd(rand_st)*65535+1); + salt=(unsigned short) (my_rnd(rand_st)*65535+1); /* Use only 2 first bytes from it */ sprintf(to+1,"%04x",salt); /* First hasing is done without salt */ @@ -435,7 +435,7 @@ char get_password_version(const char *password) -inline uint char_val(char X) +static inline unsigned int char_val(char X) { return (uint) (X >= '0' && X <= '9' ? X-'0' : X >= 'A' && X <= 'Z' ? X-'A'+10 : @@ -652,10 +652,10 @@ char *scramble(char *to,const char *message,const char *password, randominit(&rand_st,hash_pass[0] ^ hash_message[0], hash_pass[1] ^ hash_message[1]); while (*msg++) - *to++= (char) (floor(rnd(&rand_st)*31)+64); + *to++= (char) (floor(my_rnd(&rand_st)*31)+64); if (!old_ver) { /* Make it harder to break */ - char extra=(char) (floor(rnd(&rand_st)*31)); + char extra=(char) (floor(my_rnd(&rand_st)*31)); while (to_start != to) *(to_start++)^=extra; } @@ -711,11 +711,11 @@ my_bool check_scramble(const char *scrambled, const char *message, hash_pass[1] ^ hash_message[1]); to=buff; for (pos=scrambled ; *pos ; pos++) - *to++=(char) (floor(rnd(&rand_st)*31)+64); + *to++=(char) (floor(my_rnd(&rand_st)*31)+64); if (old_ver) extra=0; else - extra=(char) (floor(rnd(&rand_st)*31)); + extra=(char) (floor(my_rnd(&rand_st)*31)); to=buff; while (*scrambled) { diff --git a/sql/protocol.cc b/sql/protocol.cc index 9fb32daf57f..2d53d545066 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -43,11 +43,6 @@ bool Protocol::net_store_data(const char *from, uint length) packet->length((uint) (to+length-packet->ptr())); return 0; } - -inline bool Protocol::convert_str(const char *from, uint length) -{ - return convert->store(packet, from, length); -} #endif @@ -472,7 +467,6 @@ char *net_store_data(char *to,longlong from) void Protocol::init(THD *thd_arg) { thd=thd_arg; - convert=thd->variables.convert_set; packet= &thd->packet; #ifndef DEBUG_OFF field_types= 0; @@ -487,15 +481,12 @@ void Protocol::init(THD *thd_arg) send_fields() THD Thread data object list List of items to send to client - convert object used to convertation to another character set flag Bit mask with the following functions: 1 send number of rows 2 send default values DESCRIPTION Sum fields has table name empty and field_name. - Uses send_fields_convert() and send_fields() depending on - if we have an active character set convert or not. RETURN VALUES 0 ok @@ -712,13 +703,13 @@ bool Protocol_simple::store(const char *from, uint length, CHARSET_INFO *cs) field_types[field_pos] <= MYSQL_TYPE_GEOMETRY)); field_pos++; #endif - if (convert) - return convert_str(from, length); - if (cs != this->thd->charset()) + if (!my_charset_same(cs, this->thd->charset()) && + (cs != &my_charset_bin) && + (this->thd->charset() != &my_charset_bin) && + (this->thd->variables.convert_result_charset)) { - String tmp; - tmp.copy(from, length, cs, this->thd->charset()); - return net_store_data(tmp.ptr(), tmp.length()); + convert.copy(from, length, cs, this->thd->charset()); + return net_store_data(convert.ptr(), convert.length()); } else return net_store_data(from, length); @@ -811,18 +802,18 @@ bool Protocol_simple::store(Field *field) field_pos++; #endif char buff[MAX_FIELD_WIDTH]; - String tmp1(buff,sizeof(buff), &my_charset_bin); - field->val_str(&tmp1,&tmp1); - if (convert) - return convert_str(tmp1.ptr(), tmp1.length()); - if (field->charset() != this->thd->charset()) + String str(buff,sizeof(buff), &my_charset_bin); + field->val_str(&str,&str); + if (!my_charset_same(field->charset(), this->thd->charset()) && + (field->charset() != &my_charset_bin) && + (this->thd->charset() != &my_charset_bin) && + (this->thd->variables.convert_result_charset)) { - String tmp; - tmp.copy(tmp1.ptr(), tmp1.length(), tmp1.charset(), this->thd->charset()); - return net_store_data(tmp.ptr(), tmp.length()); + convert.copy(str.ptr(), str.length(), str.charset(), this->thd->charset()); + return net_store_data(convert.ptr(), convert.length()); } else - return net_store_data(tmp1.ptr(), tmp1.length()); + return net_store_data(str.ptr(), str.length()); } @@ -929,8 +920,6 @@ bool Protocol_prep::store(const char *from,uint length, CHARSET_INFO *cs) field_types[field_pos] <= MYSQL_TYPE_GEOMETRY)); #endif field_pos++; - if (convert) - return convert_str(from, length); return net_store_data(from, length); } diff --git a/sql/protocol.h b/sql/protocol.h index e9df013e81c..418814a9623 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -20,7 +20,6 @@ #define PACKET_BUFFET_EXTRA_ALLOC 1024 -class CONVERT; class i_string; class THD; #ifdef EMBEDDED_LIBRARY @@ -31,23 +30,22 @@ class Protocol protected: THD *thd; String *packet; + String convert; uint field_pos; #ifndef DEBUG_OFF enum enum_field_types *field_types; #endif uint field_count; bool net_store_data(const char *from, uint length); - bool convert_str(const char *from, uint length); #ifdef EMBEDDED_LIBRARY char **next_field; MYSQL_FIELD *next_mysql_field; MEM_ROOT *alloc; #endif public: - CONVERT *convert; - Protocol() {} Protocol(THD *thd) { init(thd); } + virtual ~Protocol() {} void init(THD* thd); bool send_fields(List<Item> *list, uint flag); bool send_records_num(List<Item> *list, ulonglong records); diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 413ccb7fde2..46791c13219 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -449,8 +449,33 @@ int show_new_master(THD* thd) } } +/* + Asks the master for the list of its other connected slaves. + This is for failsafe replication : + in order for failsafe replication to work, the servers involved in replication + must know of each other. We accomplish this by having each slave report to the + master how to reach it, and on connection, each slave receives information + about where the other slaves are. + + SYNOPSIS + update_slave_list() + mysql pre-existing connection to the master + mi master info + + NOTES + mi is used only to give detailed error messages which include the + hostname/port of the master, the username used by the slave to connect to + the master. + If the user used by the slave to connect to the master does not have the + REPLICATION SLAVE privilege, it will pop in this function because SHOW SLAVE + HOSTS will fail on the master. + + RETURN VALUES + 1 error + 0 success + */ -int update_slave_list(MYSQL* mysql) +int update_slave_list(MYSQL* mysql, MASTER_INFO* mi) { MYSQL_RES* res=0; MYSQL_ROW row; @@ -462,7 +487,7 @@ int update_slave_list(MYSQL* mysql) if (mc_mysql_query(mysql,"SHOW SLAVE HOSTS",16) || !(res = mc_mysql_store_result(mysql))) { - error = "Query error"; + error= mc_mysql_error(mysql); goto err; } @@ -476,7 +501,8 @@ int update_slave_list(MYSQL* mysql) port_ind=4; break; default: - error = "Invalid number of fields in SHOW SLAVE HOSTS"; + error= "the master returned an invalid number of fields for SHOW SLAVE \ +HOSTS"; goto err; } @@ -494,7 +520,7 @@ int update_slave_list(MYSQL* mysql) { if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME)))) { - error = "Out of memory"; + error= "the slave is out of memory"; pthread_mutex_unlock(&LOCK_slave_list); goto err; } @@ -518,7 +544,9 @@ err: mc_mysql_free_result(res); if (error) { - sql_print_error("Error updating slave list: %s",error); + sql_print_error("While trying to obtain the list of slaves from the master \ +'%s:%d', user '%s' got the following error: '%s'", + mi->host, mi->port, mi->user, error); DBUG_RETURN(1); } DBUG_RETURN(0); diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h index 72ea0cf2a56..a9c504330ab 100644 --- a/sql/repl_failsafe.h +++ b/sql/repl_failsafe.h @@ -20,7 +20,7 @@ extern const char* rpl_role_type[], *rpl_status_type[]; pthread_handler_decl(handle_failsafe_rpl,arg); void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status); int find_recovery_captain(THD* thd, MYSQL* mysql); -int update_slave_list(MYSQL* mysql); +int update_slave_list(MYSQL* mysql, MASTER_INFO* mi); extern HASH slave_list; diff --git a/sql/set_var.cc b/sql/set_var.cc index 0b85f50e0ef..c4a4819689c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -105,11 +105,12 @@ sys_var_str sys_charset("character_set", sys_update_charset, sys_set_default_charset); sys_var_client_collation sys_client_collation("client_collation"); -sys_var_thd_conv_charset sys_convert_charset("convert_character_set"); sys_var_bool_ptr sys_concurrent_insert("concurrent_insert", &myisam_concurrent_insert); sys_var_long_ptr sys_connect_timeout("connect_timeout", &connect_timeout); +sys_var_thd_bool sys_convert_result_charset("convert_result_charset", + &SV::convert_result_charset); sys_var_enum sys_delay_key_write("delay_key_write", &delay_key_write_options, &delay_key_write_typelib, @@ -194,6 +195,7 @@ sys_var_thd_ulong sys_net_write_timeout("net_write_timeout", sys_var_thd_ulong sys_net_retry_count("net_retry_count", &SV::net_retry_count, fix_net_retry_count); +sys_var_thd_bool sys_new_mode("new", &SV::new_mode); sys_var_thd_ulong sys_read_buff_size("read_buffer_size", &SV::read_buff_size); sys_var_thd_ulong sys_read_rnd_buff_size("read_rnd_buffer_size", @@ -337,7 +339,7 @@ sys_var *sys_variables[]= &sys_client_collation, &sys_concurrent_insert, &sys_connect_timeout, - &sys_convert_charset, + &sys_convert_result_charset, &sys_default_week_format, &sys_delay_key_write, &sys_delayed_insert_limit, @@ -383,6 +385,7 @@ sys_var *sys_variables[]= &sys_net_retry_count, &sys_net_wait_timeout, &sys_net_write_timeout, + &sys_new_mode, &sys_pseudo_thread_id, &sys_query_cache_size, #ifdef HAVE_QUERY_CACHE @@ -445,7 +448,7 @@ struct show_var_st init_vars[]= { {sys_client_collation.name, (char*) &sys_client_collation, SHOW_SYS}, {sys_concurrent_insert.name,(char*) &sys_concurrent_insert, SHOW_SYS}, {sys_connect_timeout.name, (char*) &sys_connect_timeout, SHOW_SYS}, - {sys_convert_charset.name, (char*) &sys_convert_charset, SHOW_SYS}, + {sys_convert_result_charset.name, (char*) &sys_convert_result_charset, SHOW_SYS}, {"datadir", mysql_real_data_home, SHOW_CHAR}, {"default_week_format", (char*) &sys_default_week_format, SHOW_SYS}, {sys_delay_key_write.name, (char*) &sys_delay_key_write, SHOW_SYS}, @@ -539,6 +542,7 @@ struct show_var_st init_vars[]= { {sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS}, {sys_net_retry_count.name, (char*) &sys_net_retry_count, SHOW_SYS}, {sys_net_write_timeout.name,(char*) &sys_net_write_timeout, SHOW_SYS}, + {sys_new_mode.name, (char*) &sys_new_mode, SHOW_SYS}, {"open_files_limit", (char*) &open_files_limit, SHOW_LONG}, {"pid_file", (char*) pidfile_name, SHOW_CHAR}, {"log_error", (char*) log_error_file, SHOW_CHAR}, @@ -1097,7 +1101,7 @@ byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type) } if (tmp.length()) tmp.length(tmp.length() - 1); - return (byte*) thd->strdup(tmp.c_ptr()); + return (byte*) thd->strmake(tmp.ptr(), tmp.length()); } @@ -1131,56 +1135,38 @@ byte *sys_var_thd_bit::value_ptr(THD *thd, enum_var_type type) } -bool sys_var_thd_conv_charset::check(THD *thd, set_var *var) -{ - CONVERT *tmp; - char buff[80]; - String str(buff,sizeof(buff), system_charset_info), *res; - - if (!var->value) // Default value - { - var->save_result.convert= (var->type != OPT_GLOBAL ? - global_system_variables.convert_set - : (CONVERT*) 0); - return 0; - } - if (!(res=var->value->val_str(&str))) - res= &empty_string; - - if (!(tmp=get_convert_set(res->c_ptr()))) - { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr()); - return 1; - } - var->save_result.convert=tmp; // Save for update - return 0; -} +typedef struct old_names_map_st { + const char *old_name; + const char *new_name; +} my_old_conv; +static my_old_conv old_conv[]= +{ + { "cp1251_koi8" , "cp1251" }, + { "cp1250_latin2" , "cp1250" }, + { "kam_latin2" , "keybcs2" }, + { "mac_latin2" , "MacRoman" }, + { "macce_latin2" , "MacCE" }, + { "pc2_latin2" , "pclatin2" }, + { "vga_latin2" , "pclatin1" }, + { "koi8_cp1251" , "koi8r" }, + { "win1251ukr_koi8_ukr" , "win1251ukr" }, + { "koi8_ukr_win1251ukr" , "koi8u" }, + { NULL , NULL } +}; -bool sys_var_thd_conv_charset::update(THD *thd, set_var *var) +static CHARSET_INFO *get_old_charset_by_name(const char *name) { - if (var->type == OPT_GLOBAL) - global_system_variables.convert_set= var->save_result.convert; - else + my_old_conv *c; + + for (c= old_conv; c->old_name; c++) { - thd->lex.convert_set= thd->variables.convert_set= - var->save_result.convert; - thd->protocol_simple.init(thd); - thd->protocol_prep.init(thd); + if (!my_strcasecmp(&my_charset_latin1,name,c->old_name)) + return get_charset_by_name(c->new_name,MYF(0)); } - return 0; + return NULL; } - -byte *sys_var_thd_conv_charset::value_ptr(THD *thd, enum_var_type type) -{ - CONVERT *conv= ((type == OPT_GLOBAL) ? - global_system_variables.convert_set : - thd->variables.convert_set); - return conv ? (byte*) conv->name : (byte*) ""; -} - - bool sys_var_client_collation::check(THD *thd, set_var *var) { CHARSET_INFO *tmp; @@ -1198,7 +1184,8 @@ bool sys_var_client_collation::check(THD *thd, set_var *var) if (!(res=var->value->val_str(&str))) res= &empty_string; - if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0)))) + if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0))) && + !(tmp=get_old_charset_by_name(res->c_ptr()))) { my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr()); return 1; @@ -1472,7 +1459,6 @@ void set_var_init() (*var)->option_limits= find_option(my_long_options, (*var)->name); hash_insert(&system_variable_hash, (byte*) *var); } - /* Special cases Needed because MySQL can't find the limits for a variable it it has diff --git a/sql/set_var.h b/sql/set_var.h index b84e0b888e2..d91b6796d20 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -406,23 +406,6 @@ public: }; -class sys_var_thd_conv_charset :public sys_var_thd -{ -public: - sys_var_thd_conv_charset(const char *name_arg) - :sys_var_thd(name_arg) - {} - bool check(THD *thd, set_var *var); - bool update(THD *thd, set_var *var); - SHOW_TYPE type() { return SHOW_CHAR; } - byte *value_ptr(THD *thd, enum_var_type type); - bool check_update_type(Item_result type) - { - return type != STRING_RESULT; /* Only accept strings */ - } - bool check_default(enum_var_type type) { return 0; } -}; - class sys_var_client_collation :public sys_var_thd { public: @@ -490,7 +473,6 @@ public: union { CHARSET_INFO *charset; - CONVERT *convert; ulong ulong_value; } save_result; diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml index 4d54b8b53ce..974c2968e55 100644 --- a/sql/share/charsets/Index.xml +++ b/sql/share/charsets/Index.xml @@ -11,6 +11,7 @@ To make maintaining easier please: <charset name="big5"> <family>Traditional Chinese</family> + <description>Big5 Traditional Chinese</description> <alias>big-5</alias> <alias>bigfive</alias> <alias>big-five</alias> @@ -24,14 +25,15 @@ To make maintaining easier please: <charset name="latin2"> <family>Central European</family> + <description>ISO 8859-2 Central European</description> <alias>csisolatin2</alias> <alias>iso-8859-2</alias> <alias>iso-ir-101</alias> <alias>iso_8859-2</alias> <alias>iso_8859-2:1987</alias> <alias>l2</alias> - <collation name="czech" id="2" order="Czech" flag="compiled"/> - <collation name="latin2" id="9" flag="primary"> + <collation name="latin2_czech_ci" id="2" order="Czech" flag="compiled"/> + <collation name="latin2_general_ci" id="9" flag="primary"> <order>Hungarian</order> <order>Polish</order> <order>Romanian</order> @@ -40,15 +42,16 @@ To make maintaining easier please: <order>Slovenian</order> <order>Sorbian</order> </collation> - <collation name="hungarian" id="21" order="Hungarian"/> - <collation name="croat" id="27" order="Croatian"/> + <collation name="latin2_hungarian_ci" id="21" order="Hungarian"/> + <collation name="latin2_croatian_ci" id="27" order="Croatian"/> <collation name="latin2_bin" id="77" order="Binary" flag="binary"/> </charset> <charset name="dec8"> <family>Western</family> - <collation name="dec_bin" id="69" order="Binary" flag="binary"/> - <collation name="dec8" id="3" flag="primary"> + <description>DEC West European</description> + <collation name="dec_bin" id="69" order="Binary" flag="binary"/> + <collation name="dec8" id="3" flag="primary"> <order>Dutch</order> <order>English</order> <order>French</order> @@ -62,6 +65,7 @@ To make maintaining easier please: <charset name="pclatin1"> <family>Western</family> + <description>DOS West European</description> <alias>850</alias> <alias>cp850</alias> <alias>cspc850multilingual</alias> @@ -81,6 +85,7 @@ To make maintaining easier please: <charset name="latin1"> <family>Western</family> + <description>ISO 8859-1 West European</description> <alias>csisolatin1</alias> <alias>iso-8859-1</alias> <alias>iso-ir-100</alias> @@ -88,12 +93,12 @@ To make maintaining easier please: <alias>iso_8859-1:1987</alias> <alias>l1</alias> <alias>latin1</alias> - <collation name="german1" id="5" order="German Duden"/> + <collation name="latin1_german1_ci" id="5" order="German Duden"/> <collation name="latin1" id="8" order="Finnish, Swedish" flag="primary"/> - <collation name="danish" id="15" order="Danish"/> - <collation name="latin1_de" id="31" order="German DIN" flag="compiled"/> - <collation name="latin1_bin" id="47" order="Binary" flag="binary"/> - <collation name="latin1_ci_as" id="48"> + <collation name="latin1_danish_ci" id="15" order="Danish"/> + <collation name="latin1_german2_ci" id="31" order="German Phonebook" flag="compiled"/> + <collation name="latin1_bin" id="47" order="Binary" flag="binary"/> + <collation name="latin1_general_ci" id="48"> <order>Dutch</order> <order>English</order> <order>French</order> @@ -103,7 +108,7 @@ To make maintaining easier please: <order>Pogtuguese</order> <order>Spanish</order> </collation> - <collation name="latin1_cs_as" id="49"> + <collation name="latin1_general_cs" id="49"> <order>Dutch</order> <order>English</order> <order>French</order> @@ -117,6 +122,7 @@ To make maintaining easier please: <charset name="hp8"> <family>Western</family> + <description>HP West European</description> <alias>hproman8</alias> <collation name="hp8_bin" id="72" order="Binary" flag="binary"/> <collation name="hp8" id="6" flag="primary"> @@ -133,6 +139,7 @@ To make maintaining easier please: <charset name="koi8r"> <family>Cyrillic</family> + <description>KOI8-R Relcom Russian</description> <alias>koi8-r</alias> <alias>cskoi8r</alias> <collation name="koi8r" id="7" order="Russian" flag="primary"/> @@ -141,6 +148,7 @@ To make maintaining easier please: <charset name="swe7"> <family>Western</family> + <description>7bit Swedish</description> <alias>iso-646-se</alias> <collation name="swe7" id="10" order="Swedish" flag="primary"/> <collation name="swe7_bin" id="82" order="Binary" flag="binary"/> @@ -148,6 +156,7 @@ To make maintaining easier please: <charset name="ascii"> <family>Western</family> + <description>US ASCII</description> <alias>us</alias> <alias>us-ascii</alias> <alias>csascii</alias> @@ -159,12 +168,14 @@ To make maintaining easier please: <charset name="ujis"> <family>Japanese</family> + <description>EUC-JP Japanese</description> <alias>euc-jp</alias> <collation name="ujis" id="12" order="Japanese" flag="primary"/> </charset> <charset name="sjis"> <family>Japanese</family> + <description>Shift-JIS Japanese</description> <alias>s-jis</alias> <alias>shift-jis</alias> <alias>x-sjis</alias> @@ -173,6 +184,7 @@ To make maintaining easier please: <charset name="cp1251"> <family>Cyrillic</family> + <description>Windows Cyrillic</description> <alias>windows-1251</alias> <alias>ms-cyr</alias> <alias>ms-cyrillic</alias> @@ -187,7 +199,7 @@ To make maintaining easier please: </collation> <collation name="win1251ukr" id="23" order="Depreciated"/> <collation name="cp1251_bin" id="50" order="Binary" flag="binary"/> - <collation name="cp1251_ci_as" id="51"> + <collation name="cp1251_ci" id="51"> <order>Belarusian</order> <order>Bulgarian</order> <order>Macedonian</order> @@ -196,7 +208,7 @@ To make maintaining easier please: <order>Mongolian</order> <order>Ukrainian</order> </collation> - <collation name="cp1251_cs_as" id="52"> + <collation name="cp1251_cs" id="52"> <order>Belarusian</order> <order>Bulgarian</order> <order>Macedonian</order> @@ -209,6 +221,7 @@ To make maintaining easier please: <charset name="hebrew"> <family>Hebrew</family> + <description>ISO 8859-8 Hebrew</description> <alias>csisolatinhebrew</alias> <alias>iso-8859-8</alias> <alias>iso-ir-138</alias> @@ -218,6 +231,7 @@ To make maintaining easier please: <charset name="tis620"> <family>Thai</family> + <description>TIS620 Thai</description> <alias>tis-620</alias> <collation name="tis620" id="18" order="Thai"> <flag>primary</flag> @@ -227,6 +241,7 @@ To make maintaining easier please: <charset name="euckr"> <family>Korean</family> + <description>EUC-KR Korean</description> <alias>euc_kr</alias> <alias>euc-kr</alias> <collation name="euckr" id="19" order="Korean"> @@ -237,17 +252,28 @@ To make maintaining easier please: <charset name="latin7"> <family>Baltic</family> + <description>ISO 8859-13 Baltic</description> <alias>BalticRim</alias> <alias>iso-8859-13</alias> <alias>l7</alias> - <collation name="estonia" id="20" order="Estonian" flag="primary"/> - <collation name="latvian" id="41" order="Latvian"/> - <collation name="latvian1" id="42" order="Latvian"/> + <collation name="latin7_estonian_ci" id="20"> + <order>Estonian</order> + <flag>primary</flag> + </collation> + <collation name="latin7_ci" id="41"> + <order>Latvian</order> + <order>Lithuanian</order> + </collation> + <collation name="latin7_cs" id="42"> + <order>Latvian</order> + <order>Lithuanian</order> + </collation> <collation name="latin7_bin" id="79" order="Binary" flag="binary"/> </charset> <charset name="koi8u"> <family>Cyrillic</family> + <description>KOI8-U Ukrainian</description> <alias>koi8-u</alias> <collation name="koi8u" id="22" order="Ukranian" flag="primary"/> <collation name="koi8u_bin" id="75" order="Binary" flag="binary"/> @@ -255,6 +281,7 @@ To make maintaining easier please: <charset name="gb2312"> <family>Simplified Chinese</family> + <description>GB2312 Simplified Chinese</description> <alias>chinese</alias> <alias>iso-ir-58</alias> <collation name="gb2312" id="24" order="Chinese"> @@ -265,6 +292,7 @@ To make maintaining easier please: <charset name="greek"> <family>Greek</family> + <description>ISO 8859-7 Greek</description> <alias>csisolatingreek</alias> <alias>ecma-118</alias> <alias>greek8</alias> @@ -276,6 +304,7 @@ To make maintaining easier please: <charset name="cp1250"> <family>Central European</family> + <description>Windows Central European</description> <alias>ms-ce</alias> <alias>windows-1250</alias> <collation name="cp1250" id="26" flag="primary"> @@ -293,6 +322,7 @@ To make maintaining easier please: <charset name="gbk"> <family>East Asian</family> + <description>GBK Simplified Chinese</description> <alias>cp936</alias> <collation name="gbk" id="28" order="Chinese"> <flag>primary</flag> @@ -302,6 +332,7 @@ To make maintaining easier please: <charset name="cp1257"> <family>Baltic</family> + <description>Windows Baltic</description> <alias>WinBaltRim</alias> <alias>windows-1257</alias> <collation name="cp1257" id="29" order="Depreciated"/> @@ -310,11 +341,11 @@ To make maintaining easier please: <order>Latvian</order> <order>Lithuanian</order> </collation> - <collation name="cp1257_ci_as" id="60"> + <collation name="cp1257_ci" id="60"> <order>Latvian</order> <order>Lithuanian</order> </collation> - <collation name="cp1257_cs_as" id="61"> + <collation name="cp1257_cs" id="61"> <order>Latvian</order> <order>Lithuanian</order> </collation> @@ -322,6 +353,7 @@ To make maintaining easier please: <charset name="latin5"> <family>South Asian</family> + <description>ISO 8859-9 Turkish</description> <alias>csisolatin5</alias> <alias>iso-8859-9</alias> <alias>iso-ir-148</alias> @@ -334,6 +366,7 @@ To make maintaining easier please: <charset name="armscii8"> <family>South Asian</family> + <description>ARMSCII-8 Armenian</description> <alias>armscii-8</alias> <collation name="armscii8" id="32" order="Armenian" flag="primary"/> <collation name="armscii_bin" id="64" order="Binary" flag="binary"/> @@ -341,17 +374,20 @@ To make maintaining easier please: <charset name="utf8"> <family>Unicode</family> + <description>UTF-8 Unicode</description> <alias>utf-8</alias> <collation name="utf8" id="33" flag="primary"/> </charset> <charset name="ucs2"> <family>Unicode</family> + <description>UCS-2 Unicode</description> <collation name="ucs2" id="35" flag="primary"/> </charset> <charset name="cp866"> <family>Cyrillic</family> + <description>DOS Russian</description> <alias>866</alias> <alias>csibm866</alias> <alias>ibm866</alias> @@ -362,12 +398,14 @@ To make maintaining easier please: <charset name="keybcs2"> <family>Central European</family> + <description>DOS Kamenicky Czech-Slovak</description> <collation name="keybcs2" id="37" order="Czech" flag="primary"/> <collation name="keybcs2_bin" id="73" order="Binary" flag="binary"/> </charset> -<charset name="MacCE"> +<charset name="macce"> <family>Central European</family> + <description>Mac Central European</description> <alias>MacCentralEurope</alias> <collation name="macce" id="38" flag="primary"> <order>Hungarian</order> @@ -379,7 +417,8 @@ To make maintaining easier please: <order>Sorbian</order> </collation> <collation name="macce_bin" id="43" order="Binary" flag="binary"/> - <collation name="macce_ci_ai" id="44"> + <!--collation name="macce_ci_ai" id="44"/--> + <collation name="macce_ci" id="45"> <order>Hungarian</order> <order>Polish</order> <order>Romanian</order> @@ -388,16 +427,7 @@ To make maintaining easier please: <order>Slovenian</order> <order>Sorbian</order> </collation> - <collation name="macce_ci_as" id="45"> - <order>Hungarian</order> - <order>Polish</order> - <order>Romanian</order> - <order>Croatian</order> - <order>Slovak</order> - <order>Slovenian</order> - <order>Sorbian</order> - </collation> - <collation name="macce_cs_as" id="46"> + <collation name="macce_cs" id="46"> <order>Hungarian</order> <order>Polish</order> <order>Romanian</order> @@ -408,8 +438,9 @@ To make maintaining easier please: </collation> </charset> -<charset name="MacRoman"> +<charset name="macroman"> <family>Western</family> + <description>Mac West European</description> <alias>Mac</alias> <alias>Macintosh</alias> <alias>csmacintosh</alias> @@ -424,17 +455,7 @@ To make maintaining easier please: <order>Spanish</order> </collation> <collation name="macroman_bin" id="53" order="Binary" flag="binary"/> - <collation name="macroman_ci_as" id="54"> - <order>Dutch</order> - <order>English</order> - <order>French</order> - <order>German Duden</order> - <order>Italian</order> - <order>Latin</order> - <order>Pogtuguese</order> - <order>Spanish</order> - </collation> - <collation name="macroman_ci_ai" id="55"> + <collation name="macroman_ci" id="54"> <order>Dutch</order> <order>English</order> <order>French</order> @@ -444,7 +465,8 @@ To make maintaining easier please: <order>Pogtuguese</order> <order>Spanish</order> </collation> - <collation name="macroman_cs_as" id="56"> + <!--collation name="macroman_ci_ai" id="55"/--> + <collation name="macroman_cs" id="56"> <order>Dutch</order> <order>English</order> <order>French</order> @@ -458,6 +480,7 @@ To make maintaining easier please: <charset name="pclatin2"> <family>Central European</family> + <description>DOS Central European</description> <alias>852</alias> <alias>cp852</alias> <alias>ibm852</alias> @@ -475,6 +498,7 @@ To make maintaining easier please: <charset name="cp1256"> <family>Arabic</family> + <description>Windows Arabic</description> <alias>ms-arab</alias> <alias>windows-1256</alias> <collation name="cp1256_bin" id="67" order="Binary" flag="binary"/> @@ -487,6 +511,7 @@ To make maintaining easier please: </charset> <charset name="binary"> + <description>Binary pseudo charset</description> <collation name="binary" id="63" order="Binary"> <flag>primary</flag> <flag>compiled</flag> diff --git a/sql/share/charsets/cp1251.xml b/sql/share/charsets/cp1251.xml index 79b71df9baf..98dd1186c0c 100644 --- a/sql/share/charsets/cp1251.xml +++ b/sql/share/charsets/cp1251.xml @@ -119,7 +119,7 @@ <collation name="cp1251_bin" flag="binary"/> -<collation name="cp1251_ci_as"> +<collation name="cp1251_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -141,7 +141,7 @@ </collation> -<collation name="cp1251_cs_as"> +<collation name="cp1251_cs"> <!-- # Case insensitive, accent sensitive # Sort order is correct for Belarusian, Bulgarian, Macedonian, diff --git a/sql/share/charsets/cp1257.xml b/sql/share/charsets/cp1257.xml index 7f1f8293aae..2966e5d1cfa 100644 --- a/sql/share/charsets/cp1257.xml +++ b/sql/share/charsets/cp1257.xml @@ -140,7 +140,7 @@ </collation> -<collation name="cp1257_ci_as"> +<collation name="cp1257_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -162,7 +162,7 @@ </collation> -<collation name="cp1257_cs_as"> +<collation name="cp1257_cs"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F diff --git a/sql/share/charsets/greek.xml b/sql/share/charsets/greek.xml index 1ad3d1bc9d2..6d8d0954655 100644 --- a/sql/share/charsets/greek.xml +++ b/sql/share/charsets/greek.xml @@ -4,6 +4,10 @@ <charset name="greek"> +<!-- It's ISO Greek rahter than WIN Greek because --> +<!-- 0xB6 is marked as upper letter, it's true for ISO Greek version --> +<!-- In Windows version this character is PILCROW SIGN --> + <ctype> <map> 00 diff --git a/sql/share/charsets/latin1.xml b/sql/share/charsets/latin1.xml index 87abbe06f77..1931f310d0b 100644 --- a/sql/share/charsets/latin1.xml +++ b/sql/share/charsets/latin1.xml @@ -115,7 +115,7 @@ </collation> -<collation name="german1"> +<collation name="latin1_german1_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -137,7 +137,7 @@ </collation> -<collation name="danish"> +<collation name="latin1_danish_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -159,13 +159,13 @@ </collation> -<collation name="latin1_de"/> +<collation name="latin1_german2_ci"/> <collation name="latin1_bin" flag="binary"/> -<collation name="latin1_ci_as"> +<collation name="latin1_general_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -187,7 +187,7 @@ </collation> -<collation name="latin1_cs_as"> +<collation name="latin1_general_cs"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F diff --git a/sql/share/charsets/latin2.xml b/sql/share/charsets/latin2.xml index 9be39dee47d..4de138d3ea0 100644 --- a/sql/share/charsets/latin2.xml +++ b/sql/share/charsets/latin2.xml @@ -93,7 +93,7 @@ </unicode> -<collation name="latin2"> +<collation name="latin2_general_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -115,7 +115,7 @@ </collation> -<collation name="croat"> +<collation name="latin2_croatian_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -137,10 +137,10 @@ </collation> -<collation name="czech"/> +<collation name="latin2_czech_ci"/> -<collation name="hungarian"> +<collation name="latin2_hungarian_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F diff --git a/sql/share/charsets/latin7.xml b/sql/share/charsets/latin7.xml index 89c14a3acd8..8fe8a5fbcb5 100644 --- a/sql/share/charsets/latin7.xml +++ b/sql/share/charsets/latin7.xml @@ -93,7 +93,7 @@ </unicode> -<collation name="estonia"> +<collation name="latin7_estonian_ci"> <map> 00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B @@ -115,7 +115,7 @@ </collation> -<collation name="latvian"> +<collation name="latin7_ci"> <!-- Created for case-sensitive record search --> <!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv --> <map> @@ -139,7 +139,7 @@ </collation> -<collation name="latvian1"> +<collation name="latin7_cs"> <!-- Created for case-insensitive record search --> <!-- Created by Andis & Rihards --> <map> diff --git a/sql/share/charsets/MacCE.xml b/sql/share/charsets/macce.xml index 9a6a392b426..0f39cb14b31 100644 --- a/sql/share/charsets/MacCE.xml +++ b/sql/share/charsets/macce.xml @@ -2,7 +2,7 @@ <charsets> -<charset name="MacCE"> +<charset name="macce"> <ctype> <map> @@ -139,7 +139,7 @@ </collation> -<collation name="macce_ci_as"> +<collation name="macce_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -162,7 +162,7 @@ </collation> -<collation name="macce_cs_as"> +<collation name="macce_cs"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F diff --git a/sql/share/charsets/MacRoman.xml b/sql/share/charsets/macroman.xml index 9dc4d73b3ef..8c8a9070084 100644 --- a/sql/share/charsets/MacRoman.xml +++ b/sql/share/charsets/macroman.xml @@ -2,7 +2,7 @@ <charsets> -<charset name="MacRoman"> +<charset name="macroman"> <ctype> <map> @@ -135,7 +135,7 @@ </map> </collation> -<collation name="macroman_ci_as"> +<collation name="macroman_ci"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F @@ -156,7 +156,7 @@ </map> </collation> -<collation name="macroman_cs_as"> +<collation name="macroman_cs"> <map> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 2d988a62860..ed02910549a 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -7,8 +7,8 @@ "hashchk", "isamchk", -"TAK", "NIE", +"TAK", "Nie mo¿na stworzyæ pliku '%-.64s' (Kod b³êdu: %d)", "Nie mo¿na stworzyæ tabeli '%-.64s' (Kod b³êdu: %d)", "Nie mo¿na stworzyæ bazy danych '%-.64s'. B³?d %d", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index befadcf02df..e136e2d4e35 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -1,246 +1,245 @@ -/* Copyright Abandoned 1998. +/* Copyright 2003 MySQL AB + Translation done in 2003 by Egor Egorov; Ensita.NET, http://www.ensita.net/ This file is public domain and comes with NO WARRANTY of any kind */ -/* Primary translation was done by "Timur I. Bakeyev" <translate@bat.ru> */ -/* Additional translation by "Alexander I. Barkov" <bar@izhcom.ru> */ /* charset: KOI8-R */ "hashchk", "isamchk", "îåô", "äá", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÆÁÊÌ '%-.64s' (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÔÁÂÌÉÃÕ '%-.64s' (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÂÁÚÕ '%-.64s'. ïÛÉÂËÁ: %d", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÂÁÚÕ '%-.64s'. âÁÚÁ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ", -"îÅ ÍÏÇÕ ÕÄÁÌÉÔØ ÂÁÚÕ '%-.64s'. âÁÚÁ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ", -"ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ ÂÁÚÙ (îÅ ÍÏÇÕ ÕÄÁÌÉÔØ '%-.64s', ÏÛÉÂËÁ %d)", -"ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ ÂÁÚÙ (îÅ ÍÏÇÕ ÕÄÁÌÉÔØ ËÁÔÁÌÏÇ '%-.64s', ÏÛÉÂËÁ %d)", -"ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ '%-.64s' (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÐÒÏÞÅÓÔØ ÚÁÐÉÓØ × ÓÉÓÔÅÍÎÏÊ ÔÁÂÌÉÃÅ", -"îÅ ÍÏÇÕ ÐÏÌÕÞÉÔØ ÓÔÁÔÕÓ '%-.64s' (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÏÐÒÅÄÅÌÉÔØ ÒÁÂÏÞÉÊ ËÁÔÁÌÏÇ (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÂÌÏËÉÒÏ×ÁÔØ ÆÁÊÌ (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÏÔËÒÙÔØ ÆÁÊÌ: '%-.64s'. (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÎÁÊÔÉ ÆÁÊÌ: '%-.64s' (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÐÒÏÞÅÓÔØ ËÁÔÁÌÏÇ '%-.64s' (ïÛÉÂËÁ: %d)", -"îÅ ÍÏÇÕ ÐÅÒÅÊÔÉ × ËÁÔÁÌÏÇ '%-.64s' (ïÛÉÂËÁ: %d)", -"úÁÐÉÓØ ÂÙÌÁ ÉÚÍÅÎÅÎÁ ÓÏ ×ÒÅÍÅÎÉ ÐÏÓÌÅÄÎÅÇÏ ÞÔÅÎÉÑ ÔÁÂÌÉÃÙ '%-.64s'", -"ðÅÒÅÐÏÌÎÅÎ ÄÉÓË (%-.64s). íÏÖÅÔ, ËÔÏ-ÎÉÂÕÄØ ÕÂÅÒÅÔ ÚÁ ÓÏÂÏÊ ÍÕÓÏÒ....", -"îÅ ÍÏÇÕ ÐÒÏÉÚ×ÅÓÔÉ ÚÁÐÉÓØ, ËÌÀÞ ÄÕÂÌÉÒÕÅÔÓÑ × ÔÁÂÌÉÃÅ '%-.64s'", -"ïÛÉÂËÁ ÐÒÉ ÚÁËÒÙÔÉÉ '%-.64s' (ïÛÉÂËÁ: %d)", -"ïÛÉÂËÁ ÞÔÅÎÉÑ ÆÁÊÌÁ '%-.64s' (ïÛÉÂËÁ: %d)", -"ïÛÉÂËÁ ÐÒÉ ÐÅÒÅÉÍÅÎÏ×ÁÎÉÉ '%-.64s' × '%-.64s' (ïÛÉÂËÁ: %d)", -"ïÛÉÂËÁ ÚÁÐÉÓÉ × ÆÁÊÌ '%-.64s' (ïÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÆÁÊÌ '%-.64s' (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÔÁÂÌÉÃÕ '%-.64s' (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.64s'. (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.64s'. âÁÚÁ ÄÁÎÎÙÈ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ", +"îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÂÁÚÕ ÄÁÎÎÙÈ '%-.64s'. ôÁËÏÊ ÂÁÚÙ ÄÁÎÎÙÈ ÎÅÔ", +"ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ ÂÁÚÙ ÄÁÎÎÙÈ (ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ '%-.64s', ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÂÁÚÕ ÄÁÎÎÙÈ (ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ËÁÔÁÌÏÇ '%-.64s', ÏÛÉÂËÁ: %d)", +"ïÛÉÂËÁ ÐÒÉ ÕÄÁÌÅÎÉÉ '%-.64s' (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÚÁÐÉÓØ × ÓÉÓÔÅÍÎÏÊ ÔÁÂÌÉÃÅ", +"îÅ×ÏÚÍÏÖÎÏ ÐÏÌÕÞÉÔØ ÓÔÁÔÕÓÎÕÀ ÉÎÆÏÒÍÁÃÉÀ Ï '%-.64s' (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÏÐÒÅÄÅÌÉÔØ ÒÁÂÏÞÉÊ ËÁÔÁÌÏÇ (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÐÏÓÔÁ×ÉÔØ ÂÌÏËÉÒÏ×ËÕ ÎÁ ÆÁÊÌÅ (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ: '%-.64s'. (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÎÁÊÔÉ ÆÁÊÌ: '%-.64s' (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ËÁÔÁÌÏÇ '%-.64s' (ÏÛÉÂËÁ: %d)", +"îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÊÔÉ × ËÁÔÁÌÏÇ '%-.64s' (ÏÛÉÂËÁ: %d)", +"úÁÐÉÓØ ÉÚÍÅÎÉÌÁÓØ Ó ÍÏÍÅÎÔÁ ÐÏÓÌÅÄÎÅÊ ×ÙÂÏÒËÉ × ÔÁÂÌÉÃÅ '%-.64s'", +"äÉÓË ÚÁÐÏÌÎÅÎ. (%s). ïÖÉÄÁÅÍ, ÐÏËÁ ËÔÏ-ÔÏ ÎÅ ÕÂÅÒÅÔ ÐÏÓÌÅ ÓÅÂÑ ÍÕÓÏÒ....", +"îÅ×ÏÚÍÏÖÎÏ ÐÒÏÉÚ×ÅÓÔÉ ÚÁÐÉÓØ, ÄÕÂÌÉÒÕÀÝÉÊÓÑ ËÌÀÞ × ÔÁÂÌÉÃÅ '%-.64s'", +"ïÛÉÂËÁ ÐÒÉ ÚÁËÒÙÔÉÉ '%-.64s' (ÏÛÉÂËÁ: %d)", +"ïÛÉÂËÁ ÞÔÅÎÉÑ ÆÁÊÌÁ '%-.64s' (ÏÛÉÂËÁ: %d)", +"ïÛÉÂËÁ ÐÒÉ ÐÅÒÅÉÍÅÎÏ×ÁÎÉÉ '%-.64s' × '%-.64s' (ÏÛÉÂËÁ: %d)", +"ïÛÉÂËÁ ÚÁÐÉÓÉ × ÆÁÊÌ '%-.64s' (ÏÛÉÂËÁ: %d)", "'%-.64s' ÚÁÂÌÏËÉÒÏ×ÁÎ ÄÌÑ ÉÚÍÅÎÅÎÉÊ", "óÏÒÔÉÒÏ×ËÁ ÐÒÅÒ×ÁÎÁ", -"View '%-.64s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ ÄÌÑ '%-.64s'", -"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ %d ÏÔ ÄÅÓËÒÉÐÔÏÒÁ ÔÁÂÌÉÃÙ", -"äÅÓËÒÉÐÔÏÒ ÔÁÂÌÉÃÙ '%-.64s' ÎÅ ÉÍÅÅÔ ÔÁËÏÇÏ Ó×ÏÊÓÔ×Á", -"îÅ ÍÏÇÕ ÎÁÊÔÉ ÚÁÐÉÓØ × '%-.64s'", -"îÅ×ÅÒÎÁÑ ÉÎÆÏÒÍÁÃÉÑ × ÆÁÊÌÅ: '%-.64s'", -"îÅ×ÅÒÎÙÊ ÉÎÄÅËÓÎÙÊ ÆÁÊÌ ÄÌÑ ÔÁÂÌÉÃÙ: '%-.64s'. ðÏÐÒÏÂÕÊÔÅ ÅÇÏ ×ÏÓÓÏÚÄÁÔØ", -"óÔÁÒÙÊ ÉÎÄÅËÓÎÙÊ ÆÁÊÌ ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'; òÅÉÎÄÅËÓÉÒÕÊÔÅ ÅÅ!", -"'%-.64s' ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ", -"îÅ È×ÁÔÁÅÔ ÐÁÍÑÔÉ. ðÅÒÅÇÒÕÚÉÔÅ ÓÅÒ×ÅÒ É ÐÏÐÒÏÂÕÊÔÅ ÓÎÏ×Á (ÎÕÖÎÏ %d ÂÁÊÔ)", -"îÅ È×ÁÔÁÅÔ ÐÁÍÑÔÉ ÄÌÑ ÓÏÒÔÉÒÏ×ËÉ. õ×ÅÌÉÞØÔÅ ÒÁÚÍÅÒ ÂÕÆÅÒÁ ÓÏÒÔÉÒÏ×ËÉ Õ ÓÅÒ×ÅÒÁ", -"îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ '%-.64s' (ïÛÉÂËÁ: %d)", +"ðÒÅÄÓÔÁ×ÌÅÎÉÅ '%-.64s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ ÄÌÑ '%-.64s'", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ %d ÏÔ ÏÂÒÁÂÏÔÞÉËÁ ÔÁÂÌÉÃ", +"ïÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ '%-.64s' ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÜÔÕ ×ÏÚÍÏÖÎÏÓÔØ", +"îÅ×ÏÚÍÏÖÎÏ ÎÁÊÔÉ ÚÁÐÉÓØ × '%-.64s'", +"îÅËÏÒÒÅËÔÎÁÑ ÉÎÆÏÒÍÁÃÉÑ × ÆÁÊÌÅ '%-.64s'", +"îÅËÏÒÒÅËÔÎÙÊ ÉÎÄÅËÓÎÙÊ ÆÁÊÌ ÄÌÑ ÔÁÂÌÉÃÙ: '%-.64s'. ðÏÐÒÏÂÕÊÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÅÇÏ", +"óÔÁÒÙÊ ÉÎÄÅËÓÎÙÊ ÆÁÊÌ ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'; ÏÔÒÅÍÏÎÔÉÒÕÊÔÅ ÅÇÏ!", +"ôÁÂÌÉÃÁ '%-.64s' ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ", +"îÅÄÏÓÔÁÔÏÞÎÏ ÐÁÍÑÔÉ. ðÅÒÅÚÁÐÕÓÔÉÔÅ ÓÅÒ×ÅÒ É ÐÏÐÒÏÂÕÊÔÅ ÅÝÅ ÒÁÚ (ÎÕÖÎÏ %d ÂÁÊÔ)", +"îÅÄÏÓÔÁÔÏÞÎÏ ÐÁÍÑÔÉ ÄÌÑ ÓÏÒÔÉÒÏ×ËÉ. õ×ÅÌÉÞØÔÅ ÒÁÚÍÅÒ ÂÕÆÅÒÁ ÓÏÒÔÉÒÏ×ËÉ ÎÁ ÓÅÒ×ÅÒÅ", +"îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅà ÆÁÊÌÁ '%-.64s' (ÏÛÉÂËÁ: %d)", "óÌÉÛËÏÍ ÍÎÏÇÏ ÓÏÅÄÉÎÅÎÉÊ", -"îÅÄÏÓÔÁÔÏË ÍÅÓÔÁ/ÐÁÍÑÔÉ ÄÌÑ ÎÉÔÉ", -"îÅ ÍÏÇÕ ÏÐÒÅÄÅÌÉÔØ ÉÍÑ ÈÏÓÔÁ ÐÏ ÷ÁÛÅÍÕ ÁÄÒÅÓÕ", -"îÅËÏÒÒÅËÔÎÁÑ ÉÎÉÃÉÁÌÉÚÁÃÉÑ Ó×ÑÚÉ", -"äÏÓÔÕÐ ÚÁËÒÙÔ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ: '%-.32s@%-.64s' Ë ÂÁÚÅ '%-.64s'", -"äÏÓÔÕÐ ÚÁËÒÙÔ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ: '%-.32s@%-.64s' (âÙÌ ÉÓÐÏÌØÚÏ×ÁÎ ÐÁÒÏÌØ: %-.64s)", -"îÅ ×ÙÂÒÁÎÁ ÂÁÚÁ", -"îÅÉÚ×ÅÓÔÎÁÑ ËÏÍÁÎÄÁ", -"óÔÏÌÂÅà '%-.64s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÐÕÓÔÙÍ/ÎÕÌÅ×ÙÍ", -"îÅÉÚ×ÅÓÔÎÁÑ ÂÁÚÁ '%-.64s'", -"ôÁÂÌÉÃÁ '%-.64s' ÕÖÅ ÅÓÔØ", +"îÅÄÏÓÔÁÔÏÞÎÏ ÐÁÍÑÔÉ; ÕÄÏÓÔÏ×ÅÒØÔÅÓØ, ÞÔÏ mysqld ÉÌÉ ËÁËÏÊ-ÌÉÂÏ ÄÒÕÇÏÊ ÐÒÏÃÅÓÓ ÎÅ ÚÁÎÉÍÁÅÔ ×ÓÀ ÄÏÓÔÕÐÎÕÀ ÐÁÍÑÔØ. åÓÌÉ ÎÅÔ, ÔÏ ×Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ulimit, ÞÔÏÂÙ ×ÙÄÅÌÉÔØ ÄÌÑ mysqld ÂÏÌØÛÅ ÐÁÍÑÔÉ, ÉÌÉ Õ×ÅÌÉÞÉÔØ ÏÂßÅÍ ÆÁÊÌÁ ÐÏÄËÁÞËÉ", +"îÅ×ÏÚÍÏÖÎÏ ÐÏÌÕÞÉÔØ ÉÍÑ ÈÏÓÔÁ ÄÌÑ ×ÁÛÅÇÏ ÁÄÒÅÓÁ", +"îÅËÏÒÒÅËÔÎÏÅ ÐÒÉ×ÅÔÓÔ×ÉÅ", +"äÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s@%-.64s' ÄÏÓÔÕÐ Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.64s' ÚÁËÒÙÔ", +"äÏÓÔÕÐ ÚÁËÒÙÔ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s@%-.64s' (ÂÙÌ ÉÓÐÏÌØÚÏ×ÁÎ ÐÁÒÏÌØ: %s)", +"âÁÚÁ ÄÁÎÎÙÈ ÎÅ ×ÙÂÒÁÎÁ", +"îÅÉÚ×ÅÓÔÎÁÑ ËÏÍÁÎÄÁ ËÏÍÍÕÎÉËÁÃÉÏÎÎÏÇÏ ÐÒÏÔÏËÏÌÁ", +"óÔÏÌÂÅà '%-.64s' ÎÅ ÍÏÖÅÔ ÐÒÉÎÉÍÁÔØ ×ÅÌÉÞÉÎÕ NULL", +"îÅÉÚ×ÅÓÔÎÁÑ ÂÁÚÁ ÄÁÎÎÙÈ '%-.64s'", +"ôÁÂÌÉÃÁ '%-.64s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ", "îÅÉÚ×ÅÓÔÎÁÑ ÔÁÂÌÉÃÁ '%-.64s'", -"ðÏÌÅ '%-.64s' × %-.64s ÎÅ ÏÄÎÏÚÎÁÞÎÏ", -"ðÒÏÉÓÈÏÄÉÔ ×ÙËÌÀÞÅÎÉÅ ÓÅÒ×ÅÒÁ", -"îÅÉÚ×ÅÓÔÎÏÅ ÐÏÌÅ '%-.64s' × %-.64s", -" '%-.64s' ÉÓÐÏÌØÚÏ×ÁÎÏ ×ÎÅ ×ÙÒÁÖÅÎÉÑ GROUP BY", -"îÅ ÍÏÇÕ ÐÒÏÉÚ×ÅÓÔÉ ÇÒÕÐÐÉÒÏ×ËÕ ÐÏ '%-.64s'", -"÷ ÏÄÎÏÍ ×ÙÒÁÖÅÎÉÉ ÓÏÄÅÒÖÁÔØÓÑ É ÉÍÅÎÁ ÐÏÌÅÊ, É ÓÕÍÍÉÒÕÀÝÉÅ ÆÕÎËÃÉÉ", -"þÉÓÌÏ ÓÔÏÌÂÃÏ× ÎÅ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÞÉÓÌÕ ÚÎÁÞÅÎÉÊ", -"óÌÉÛËÏÍ ÄÌÉÎÎÙÊ ÉÄÅÎÔÉÆÉËÁÔÏÒ: '%-.64s'", -"äÕÂÌÉÒÏ×ÁÎÎÏÅ ÉÍÑ ÐÏÌÑ '%-.64s'", -"äÕÂÌÉÒÏ×ÁÎÎÏÅ ÉÍÑ ËÌÀÞÁ '%-.64s'", -"ðÏ×ÔÏÒÑÀÝÅÅÓÑ ÚÎÁÞÅÎÉÅ '%-.64s' ÄÌÑ ËÌÀÞÁ %d", -"îÅ×ÅÒÎÙÊ ÓÐÅÃÉÆÉËÁÔÏÒ ÐÏÌÑ: '%-.64s'", -"%-.64s ÏËÏÌÏ '%-.64s', × ÓÔÒÏËÅ %d", -"ðÕÓÔÏÊ ÚÁÐÒÏÓ", -"îÅ ÕÎÉËÁÌØÎÁÑ ÔÁÂÌÉÃÁ/ÐÓÅ×ÄÏÎÉÍ: '%-.64s'", -"îÅ×ÅÒÎÏÅ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ '%-.64s'", -"ðÅÒ×ÉÞÎÙÊ ËÌÀÞ ÏÐÒÅÄÅÌÅÎ ÎÅÓËÏÌØËÏ ÒÁÚ", -"ïÐÒÅÄÅÌÅÎÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ËÌÀÞÅÊ. ÷ÏÚÍÏÖÎÏ ÍÁËÓÉÍÁÌØÎÏ %d ËÌÀÞÅÊ", -"ïÐÒÅÄÅÌÅÎÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÓÏÓÔÁ×ÌÑÀÝÉÈ ËÌÀÞÁ. ÷ÏÚÍÏÖÎÏ ÍÁËÓÉÍÁÌØÎÏ %d ÓÏÓÔÁ×ÌÑÀÝÉÈ", -"ëÌÀÞ ÓÌÉÛËÏÍ ÂÏÌØÛÏÊ. íÁËÓÉÍÁÌØÎÁÑ ÄÌÉÎÁ %d", -"ëÌÀÞÅ×ÏÅ ÐÏÌÅ '%-.64s' ÎÅ ÓÏÄÅÒÖÉÔÓÑ × ÔÁÂÌÉÃÅ", -"ïÂßÅËÔ BLOB '%-.64s' ÎÅ ÍÏÖÅÔ ÐÒÉÓÕÔÓÔ×Ï×ÁÔØ × ÏÐÒÅÄÅÌÅÎÉÉ ËÌÀÞÁ", -"óÌÉÛËÏÍ ×ÅÌÉË ÒÁÚÍÅÒ ÐÏÌÑ '%-.64s' (max = %d). ÷ÏÓÐÏÌØÚÕÊÔÅÓØ ÏÂßÅËÔÏÍ BLOB", -"á×ÔÏÍÁÔÉÞÅÓËÏÅ ÐÏÌÅ ÍÏÖÅÔ ÂÙÔØ ÔÏÌØËÏ ÏÄÎÏ É ÄÏÌÖÎÏ ÂÙÔØ ËÌÀÞÏÍ", -"%-.64s: îÁ Ó×ÑÚÉ!\n", -"%-.64s: îÏÒÍÁÌØÎÏÅ ÚÁ×ÅÒÛÅÎÉÅ\n", -"%-.64s: ðÏÌÕÞÅÎ ÓÉÇÎÁÌ %d. õÍÙ×ÁÀ ÒÕËÉ!\n", -"%-.64s: ïÔËÌÀÞÅÎÉÅ ×ÙÐÏÌÎÅÎÏ\n", -"%-.64s: ðÒÉÎÕÄÉÔÅÌØÎÏÅ ÐÒÅËÒÁÝÅÎÉÅ ÎÉÔÉ %ld ÐÏÌØÚÏ×ÁÔÅÌÑ: '%-.64s'\n", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ IP socket", -"ôÁÂÌÉÃÁ '%-.64s' ÉÍÅÅÔ ÉÎÄÅËÓ, ÎÅ ÓÏ×ÐÁÄÁÀÝÉÊ Ó ÕËÁÚÁÎÎÙÍ × CREATE INDEX. óÏÚÄÁÊÔÅ ÔÁÂÌÉÃÕ ÅÝÅ ÒÁÚ", -"òÁÚÄÅÌÉÔÅÌÉ ÐÏÌÅÊ ÎÅ ÓÏ×ÐÁÄÁÀÔ Ó ÏÖÉÄÁÅÍÙÍÉ. ðÒÏÞÔÉÔÅ ÎÁËÏÎÅà ÉÎÓÔÒÕËÃÉÀ!", -"îÅÌØÚÑ ÓÓÙÌÁÔØÓÑ ÎÁ ÆÉËÓÉÒÏ×ÁÎÎÕÀ ÄÌÉÎÕ ÓÔÒÏËÉ × BLOB. éÓÐÏÌØÚÕÊÔÅ 'fields terminated by'.", -"æÁÊÌ '%-.64s' ÄÏÌÖÅÎ ÂÙÔØ × ËÁÔÁÌÏÇÅ ÂÁÚ ÌÉÂÏ ÄÏÓÔÕÐÅÎ ×ÓÅÍ ÄÌÑ ÞÔÅÎÉÑ", -"æÁÊÌ '%-.64s' ÕÖÅ ÅÓÔØ", +"óÔÏÌÂÅà '%-.64s' × %-.64s ÚÁÄÁÎ ÎÅÏÄÎÏÚÎÁÞÎÏ", +"óÅÒ×ÅÒ ÎÁÈÏÄÉÔÓÑ × ÐÒÏÃÅÓÓÅ ÏÓÔÁÎÏ×ËÉ", +"îÅÉÚ×ÅÓÔÎÙÊ ÓÔÏÌÂÅà '%-.64s' × '%-.64s'", +"'%-.64s' ÎÅ ÐÒÉÓÕÔÓÔ×ÕÅÔ × GROUP BY", +"îÅ×ÏÚÍÏÖÎÏ ÐÒÏÉÚ×ÅÓÔÉ ÇÒÕÐÐÉÒÏ×ËÕ ÐÏ '%-.64s'", +"÷ÙÒÁÖÅÎÉÅ ÓÏÄÅÒÖÉÔ ÇÒÕÐÐÏ×ÙÅ ÆÕÎËÃÉÉ É ÓÔÏÌÂÃÙ, ÎÏ ÎÅ ×ËÌÀÞÁÅÔ GROUP BY. á ËÁË ×Ù ÕÍÕÄÒÉÌÉÓØ ÐÏÌÕÞÉÔØ ÜÔÏ ÓÏÏÂÝÅÎÉÅ Ï ÏÛÉÂËÅ?", +"ëÏÌÉÞÅÓÔ×Ï ÓÔÏÌÂÃÏ× ÎÅ ÓÏ×ÐÁÄÁÅÔ Ó ËÏÌÉÞÅÓÔ×ÏÍ ÚÎÁÞÅÎÉÊ", +"óÌÉÛËÏÍ ÄÌÉÎÎÙÊ ÉÄÅÎÔÉÆÉËÁÔÏÒ '%-.100s'", +"äÕÂÌÉÒÕÀÝÅÅÓÑ ÉÍÑ ÓÔÏÌÂÃÁ '%-.64s'", +"äÕÂÌÉÒÕÀÝÅÅÓÑ ÉÍÑ ËÌÀÞÁ '%-.64s'", +"äÕÂÌÉÒÕÀÝÁÑÓÑ ÚÁÐÉÓØ '%-.64s' ÐÏ ËÌÀÞÕ %d", +"îÅËÏÒÒÅËÔÎÙÊ ÏÐÒÅÄÅÌÉÔÅÌØ ÓÔÏÌÂÃÁ ÄÌÑ ÓÔÏÌÂÃÁ '%-.64s'", +"%s ÏËÏÌÏ '%-.80s' ÎÁ ÓÔÒÏËÅ %d", +"úÁÐÒÏÓ ÏËÁÚÁÌÓÑ ÐÕÓÔÙÍ", +"ðÏ×ÔÏÒÑÀÝÁÑÓÑ ÔÁÂÌÉÃÁ/ÐÓÅ×ÄÏÎÉÍ '%-.64s'", +"îÅËÏÒÒÅËÔÎÏÅ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ '%-.64s'", +"õËÁÚÁÎÏ ÎÅÓËÏÌØËÏ ÐÅÒ×ÉÞÎÙÈ ËÌÀÞÅÊ", +"õËÁÚÁÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ËÌÀÞÅÊ. òÁÚÒÅÛÁÅÔÓÑ ÕËÁÚÙ×ÁÔØ ÎÅ ÂÏÌÅÅ %d ËÌÀÞÅÊ", +"õËÁÚÁÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÞÁÓÔÅÊ ÓÏÓÔÁ×ÎÏÇÏ ËÌÀÞÁ. òÁÚÒÅÛÁÅÔÓÑ ÕËÁÚÙ×ÁÔØ ÎÅ ÂÏÌÅÅ %d ÞÁÓÔÅÊ", +"õËÁÚÁÎ ÓÌÉÛËÏÍ ÄÌÉÎÎÙÊ ËÌÀÞ. íÁËÓÉÍÁÌØÎÁÑ ÄÌÉÎÁ ËÌÀÞÁ ÓÏÓÔÁ×ÌÑÅÔ %d", +"ëÌÀÞÅ×ÏÊ ÓÔÏÌÂÅà '%-.64s' × ÔÁÂÌÉÃÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ", +"óÔÏÌÂÅà ÔÉÐÁ BLOB '%-.64s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÓÐÏÌØÚÏ×ÁÎ ËÁË ÚÎÁÞÅÎÉÅ ËÌÀÞÁ × ÔÁÂÌÉÃÅ ÔÁËÏÇÏ ÔÉÐÁ", +"óÌÉÛËÏÍ ÂÏÌØÛÁÑ ÄÌÉÎÁ ÓÔÏÌÂÃÁ '%-.64s' (ÍÁËÓÉÍÕÍ = %d). éÓÐÏÌØÚÕÊÔÅ ÔÉÐ BLOB ×ÍÅÓÔÏ ÔÅËÕÝÅÇÏ", +"îÅËÏÒÒÅËÔÎÏÅ ÏÐÒÅÄÅÌÅÎÉÅ ÔÁÂÌÉÃÙ: ÍÏÖÅÔ ÓÕÝÅÓÔ×Ï×ÁÔØ ÔÏÌØËÏ ÏÄÉÎ Á×ÔÏÉÎËÒÅÍÅÎÔÎÙÊ ÓÔÏÌÂÅÃ, É ÏÎ ÄÏÌÖÅÎ ÂÙÔØ ÏÐÒÅÄÅÌÅÎ ËÁË ËÌÀÞ", +"%s: çÏÔÏ× ÐÒÉÎÉÍÁÔØ ÓÏÅÄÉÎÅÎÉÑ.\n÷ÅÒÓÉÑ: '%s' ÓÏËÅÔ: '%s' ÐÏÒÔ: %d\n", +"%s: ëÏÒÒÅËÔÎÁÑ ÏÓÔÁÎÏ×ËÁ\n", +"%s: ðÏÌÕÞÅÎ ÓÉÇÎÁÌ %d. ðÒÅËÒÁÝÁÅÍ!\n", +"%s: ïÓÔÁÎÏ×ËÁ ÚÁ×ÅÒÛÅÎÁ\n", +"%s: ðÒÉÎÕÄÉÔÅÌØÎÏ ÚÁËÒÙ×ÁÅÍ ÐÏÔÏË %ld ÐÏÌØÚÏ×ÁÔÅÌÑ: '%-.32s'\n", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ IP-ÓÏËÅÔ", +"÷ ÔÁÂÌÉÃÅ '%-.64s' ÎÅÔ ÔÁËÏÇÏ ÉÎÄÅËÓÁ, ËÁË × CREATE INDEX. óÏÚÄÁÊÔÅ ÔÁÂÌÉÃÕ ÚÁÎÏ×Ï", +"áÒÇÕÍÅÎÔ ÒÁÚÄÅÌÉÔÅÌÑ ÐÏÌÅÊ - ÎÅ ÔÏÔ, ËÏÔÏÒÙÊ ÏÖÉÄÁÌÓÑ. ïÂÒÁÝÁÊÔÅÓØ Ë ÄÏËÕÍÅÎÔÁÃÉÉ", +"æÉËÓÉÒÏ×ÁÎÎÙÊ ÒÁÚÍÅÒ ÚÁÐÉÓÉ Ó ÐÏÌÑÍÉ ÔÉÐÁ BLOB ÉÓÐÏÌØÚÏ×ÁÔØ ÎÅÌØÚÑ. ðÒÉÍÅÎÑÊÔÅ 'fields terminated by'.", +"æÁÊÌ '%-.64s' ÄÏÌÖÅÎ ÎÁÈÏÄÉÔØÓÑ × ÔÏÍ ÖÅ ËÁÔÁÌÏÇÅ, ÞÔÏ É ÂÁÚÁ ÄÁÎÎÙÈ, ÉÌÉ ÂÙÔØ ÏÂÝÅÄÏÓÔÕÐÎÙÍ ÄÌÑ ÞÔÅÎÉÑ", +"æÁÊÌ '%-.80s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ", "úÁÐÉÓÅÊ: %ld õÄÁÌÅÎÏ: %ld ðÒÏÐÕÝÅÎÏ: %ld ðÒÅÄÕÐÒÅÖÄÅÎÉÊ: %ld", -"úÁÐÉÓÅÊ: %ld äÕÂÌÅÊ: %ld", -"îÅ×ÅÒÎÁÑ ÓÏÓÔÁ×ÌÑÀÝÁÑ ËÌÀÞÁ. äÁÎÎÁÑ ÓÏÓÔÁ×ÌÑÀÝÁÑ ÌÉÂÏ ÎÅ ÓÔÒÏËÏ×ÁÑ, ÌÉÂÏ ÂÏÌØÛÅ, ÞÅÍ ÍÏÖÅÔ ÂÙÔØ", -"îÅÌØÚÑ ÕÄÁÌÉÔØ ×ÓÅ ÐÏÌÑ ÞÅÒÅÚ ALTER TABLE. ÷ÏÓÐÏÌØÚÕÊÔÅÓØ DROP TABLE", -"îÅ ÍÏÇÕ ÓÂÒÏÓÉÔØ '%-.64s'. ðÒÏ×ÅÒØÔÅ, ÞÔÏ ÜÔÏ ÐÏÌÅ/ËÌÀÞ ÓÕÝÅÓÔ×ÕÀÔ", -"úÁÐÉÓÅÊ: %ld äÕÂÌÅÊ: %ld ðÒÅÄÕÐÒÅÖÄÅÎÉÊ: %ld", -"÷Ù ÎÅ ÍÏÖÅÔÅ ÕËÁÚÁÔØ ÉÚÍÅÎÅÑÍÕÀ ÔÁÂÌÉÃÕ '%-.64s' × ÓÐÉÓËÅ ÔÁÂÌÉà FROM", -"îÅÉÚ×ÅÓÔÎÁÑ ÎÉÔØ: %lu", -"÷Ù ÎÅ ×ÌÁÄÅÌÅà ÎÉÔÉ %lu", -"ôÁÂÌÉÃÙ ÎÅ ÉÓÐÏÌØÚÏ×ÁÎÙ", -"ïÞÅÎØ ÍÎÏÇÏ ÓÔÒÏË ÄÌÑ ÐÏÌÑ %-.64s É SET", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÕÎÉËÁÌØÎÙÊ ÌÏÇ-ÆÁÊÌ %-.64s.(1-999)\n", -"ôÁÂÌÉÃÁ '%-.64s' ÚÁÂÌÏËÉÒÏ×ÁÎÁ READ É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÏÂÎÏ×ÌÅÎÁ", -"ôÁÂÌÉÃÁ '%-.64s' ÎÅ ÂÙÌÁ ÂÌÏËÉÒÏ×ÁÎÁ LOCK TABLES", -"ïÂßÅËÔ BLOB '%-.64s' ÎÅ ÍÏÖÅÔ ÉÍÅÅÔ ÚÎÁÞÅÎÉÊ ÐÏ ÕÍÏÌÞÁÎÉÀ", -"îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ÂÁÚÙ '%-.64s'", -"îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ÔÁÂÌÉÃÙ '%-.64s'", -"SELECT ÏÂÒÁÂÏÔÁÅÔ ÏÞÅÎØ ÍÎÏÇÏ ÚÁÐÉÓÅÊ É ÜÔÏ îáäïìçï. ðÒÏ×ÅÒØÔÅ ÕÓÌÏ×ÉÅ WHERE É ×ÏÓÐÏÌØÚÕÊÔÅÓØ SQL_OPTION BIG_SELECTS=1 ÅÓÌÉ SELECT ËÏÒÒÅËÔÅÎ", +"úÁÐÉÓÅÊ: %ld äÕÂÌÉËÁÔÏ×: %ld", +"îÅËÏÒÒÅËÔÎÁÑ ÞÁÓÔØ ËÌÀÞÁ. éÓÐÏÌØÚÕÅÍÁÑ ÞÁÓÔØ ËÌÀÞÁ ÎÅ Ñ×ÌÑÅÔÓÑ ÓÔÒÏËÏÊ, ÕËÁÚÁÎÎÁÑ ÄÌÉÎÁ ÂÏÌØÛÅ, ÞÅÍ ÄÌÉÎÁ ÞÁÓÔÉ ËÌÀÞÁ, ÉÌÉ ÏÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÕÎÉËÁÌØÎÙÅ ÞÁÓÔÉ ËÌÀÞÁ", +"îÅÌØÚÑ ÕÄÁÌÉÔØ ×ÓÅ ÓÔÏÌÂÃÙ Ó ÐÏÍÏÝØÀ ALTER TABLE. éÓÐÏÌØÚÕÊÔÅ DROP TABLE", +"îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ (DROP) '%-.64s'. õÂÅÄÉÔÅÓØ ÞÔÏ ÓÔÏÌÂÅÃ/ËÌÀÞ ÄÅÊÓÔ×ÉÔÅÌØÎÏ ÓÕÝÅÓÔ×ÕÅÔ", +"úÁÐÉÓÅÊ: %ld äÕÂÌÉËÁÔÏ×: %ld ðÒÅÄÕÐÒÅÖÄÅÎÉÊ: %ld", +"îÅ ÄÏÐÕÓËÁÅÔÓÑ ÕËÁÚÁÎÉÅ ÔÁÂÌÉÃÙ '%-.64s' × ÓÐÉÓËÅ ÔÁÂÌÉà FROM ÄÌÑ ×ÎÅÓÅÎÉÑ × ÎÅÅ ÉÚÍÅÎÅÎÉÊ", +"îÅÉÚ×ÅÓÔÎÙÊ ÎÏÍÅÒ ÐÏÔÏËÁ: %lu", +"÷Ù ÎÅ Ñ×ÌÑÅÔÅÓØ ×ÌÁÄÅÌØÃÅÍ ÐÏÔÏËÁ %lu", +"îÉËÁËÉÅ ÔÁÂÌÉÃÙ ÎÅ ÉÓÐÏÌØÚÏ×ÁÎÙ", +"óÌÉÛËÏÍ ÍÎÏÇÏ ÚÎÁÞÅÎÉÊ ÄÌÑ ÓÔÏÌÂÃÁ %-.64s × SET", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÕÎÉËÁÌØÎÏÅ ÉÍÑ ÆÁÊÌÁ ÖÕÒÎÁÌÁ %-.64s.(1-999)\n", +"ôÁÂÌÉÃÁ '%-.64s' ÚÁÂÌÏËÉÒÏ×ÁÎÁ ÕÒÏ×ÎÅÍ READ lock É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ", +"ôÁÂÌÉÃÁ '%-.64s' ÎÅ ÂÙÌÁ ÚÁÂÌÏËÉÒÏ×ÁÎÁ Ó ÐÏÍÏÝØÀ LOCK TABLES", +"îÅ×ÏÚÍÏÖÎÏ ÕËÁÚÙ×ÁÔØ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ ÄÌÑ ÓÔÏÌÂÃÁ BLOB '%-.64s'", +"îÅËÏÒÒÅËÔÎÏÅ ÉÍÑ ÂÁÚÙ ÄÁÎÎÙÈ '%-.100s'", +"îÅËÏÒÒÅËÔÎÏÅ ÉÍÑ ÔÁÂÌÉÃÙ '%-.100s'", +"äÌÑ ÔÁËÏÊ ×ÙÂÏÒËÉ SELECT ÄÏÌÖÅÎ ÂÕÄÅÔ ÐÒÏÓÍÏÔÒÅÔØ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÚÁÐÉÓÅÊ É, ×ÉÄÉÍÏ, ÜÔÏ ÚÁÊÍÅÔ ÏÞÅÎØ ÍÎÏÇÏ ×ÒÅÍÅÎÉ. ðÒÏ×ÅÒØÔÅ ×ÁÛÅ ÕËÁÚÁÎÉÅ WHERE, É, ÅÓÌÉ × ÎÅÍ ×ÓÅ × ÐÏÒÑÄËÅ, ÕËÁÖÉÔÅ SET OPTION SQL_BIG_SELECTS=1", "îÅÉÚ×ÅÓÔÎÁÑ ÏÛÉÂËÁ", -"îÅÉÚ×ÅÓÔÎÁÑ ÐÒÏÃÅÄÕÒÁ %-.64s", -"îÅ×ÅÒÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÁÒÁÍÅÔÒÏ× × ×ÙÚÏ×Å %-.64s", -"îÅ×ÅÒÎÙÅ ÐÁÒÁÍÅÔÒÙ × ÐÒÏÃÅÄÕÒÅ %-.64s", -"îÅÉÚ×ÅÓÔÎÁÑ ÔÁÂÌÉÃÁ '%-.64s' × %-.64s", -"ðÏÌÅ '%-.64s' ÏÂßÑ×ÌÅÎÎÏ Ä×ÁÖÄÙ", -"îÅ×ÅÒÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÇÒÕÐÐÏ×ÏÊ ÆÕÎËÃÉÉ", -"ôÁÂÌÉÃÁ '%-.64s' ÉÓÐÏÌØÚÕÅÔ ÒÁÓÛÉÒÅÎÉÅ, ÎÅ ÓÕÝÅÓÔ×ÕÀÝÅÅ × ÄÁÎÎÏÊ ×ÅÒÓÉÉ MySQL", -"÷ ÔÁÂÌÉÃÅ ÄÏÌÖÎÏ ÂÙÔØ ÈÏÔÑ ÂÙ ÏÄÎÏ ÐÏÌÅ", +"îÅÉÚ×ÅÓÔÎÁÑ ÐÒÏÃÅÄÕÒÁ '%-.64s'", +"îÅËÏÒÒÅËÔÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÁÒÁÍÅÔÒÏ× ÄÌÑ ÐÒÏÃÅÄÕÒÙ '%-.64s'", +"îÅËÏÒÒÅËÔÎÙÅ ÐÁÒÁÍÅÔÒÙ ÄÌÑ ÐÒÏÃÅÄÕÒÙ '%-.64s'", +"îÅÉÚ×ÅÓÔÎÁÑ ÔÁÂÌÉÃÁ '%-.64s' × %-.32s", +"óÔÏÌÂÅà '%-.64s' ÕËÁÚÁÎ Ä×ÁÖÄÙ", +"îÅÐÒÁ×ÉÌØÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÇÒÕÐÐÏ×ÙÈ ÆÕÎËÃÉÊ", +"÷ ÔÁÂÌÉÃÅ '%-.64s' ÉÓÐÏÌØÚÕÀÔÓÑ ×ÏÚÍÏÖÎÏÓÔÉ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÍÙÅ × ÜÔÏÊ ×ÅÒÓÉÉ MySQL", +"÷ ÔÁÂÌÉÃÅ ÄÏÌÖÅÎ ÂÙÔØ ËÁË ÍÉÎÉÍÕÍ ÏÄÉÎ ÓÔÏÌÂÅÃ", "ôÁÂÌÉÃÁ '%-.64s' ÐÅÒÅÐÏÌÎÅÎÁ", -"îÅÉÚ×ÅÓÔÎÙÊ ÎÁÂÏÒ ÓÉÍ×ÏÌÏ×: '%-.64s'", -"óÌÉÛËÏÍ ÍÎÏÇÏ ÔÁÂÌÉÃ. MySQL ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÌØËÏ %d ÔÁÂÌÉÃ × ÏÂßÅÄÉÎÅÎÉÉ", -"óÌÉÛËÏÍ ÍÎÏÇÏ ÐÏÌÅÊ", -"óÌÉÛËÏÍ ÂÏÌØÛÏÊ ÒÁÚÍÅÒ ÚÁÐÉÓÉ. íÁËÓÉÍÁÌØÎÙÊ ÒÁÚÍÅÒ ÚÁÐÉÓÉ - %d, ÎÅ ÓÞÉÔÁÑ blob. úÁÍÅÎÉÔÅ ÎÅËÏÔÏÒÙÅ ÐÏÌÑ ÎÁ blob", -"ðÅÒÅÐÏÌÎÅÎÉÅ ÎÉÔÅ×ÏÇÏ ÓÔÅËÁ: éÓÐÏÌØÚÏ×ÁÎÏ %ld ÉÚ %ld. åÓÌÉ ÎÅÏÂÈÏÄÉÍÏ, ÉÓÐÏÌØÚÕÊÔÅ 'mysqld -O thread_stack=#' ÞÔÏÂÙ Õ×ÅÌÉÞÉÔØ ÒÁÚÍÅÒ ÓÔÅËÁ", -"ðÅÒÅËÒÅÓÔÎÁÑ ÚÁ×ÉÓÉÍÏÓÔØ × OUTER JOIN. ðÒÏ×ÅÒØÔÅ ÕÓÌÏ×ÉÑ ON", -"ðÏÌÅ '%-.32s' ÉÓÐÏÌØÚÕÅÔÓÑ ËÁË UNIQUE ÉÌÉ INDEX ÎÏ ÎÅ ÏÐÒÅÄÅÌÅÎÏ ËÁË NOT NULL", -"îÅ ÍÏÇÕ ÚÁÇÒÕÚÉÔØ ÆÕÎËÃÉÀ '%-.64s'", -"îÅ ÍÏÇÕ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÆÕÎËÃÉÀ '%-.64s'; %-.80s", -"îÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ ÐÕÔÉ ÄÌÑ ÒÁÚÄÅÌÑÅÍÙÈ ÂÉÂÌÉÏÔÅË", +"îÅÉÚ×ÅÓÔÎÁÑ ËÏÄÉÒÏ×ËÁ '%-.64s'", +"óÌÉÛËÏÍ ÍÎÏÇÏ ÔÁÂÌÉÃ. MySQL ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÌØËÏ %d ÔÁÂÌÉÃ × ÓÏÅÄÉÎÅÎÉÉ", +"óÌÉÛËÏÍ ÍÎÏÇÏ ÓÔÏÌÂÃÏ×", +"óÌÉÛËÏÍ ÂÏÌØÛÏÊ ÒÁÚÍÅÒ ÚÁÐÉÓÉ. íÁËÓÉÍÁÌØÎÙÊ ÒÁÚÍÅÒ ÓÔÒÏËÉ, ÉÓËÌÀÞÁÑ ÐÏÌÑ BLOB, - %d. ÷ÏÚÍÏÖÎÏ, ×ÁÍ ÓÌÅÄÕÅÔ ÉÚÍÅÎÉÔØ ÔÉÐ ÎÅËÏÔÏÒÙÈ ÐÏÌÅÊ ÎÁ BLOB", +"óÔÅË ÐÏÔÏËÏ× ÐÅÒÅÐÏÌÎÅÎ: ÉÓÐÏÌØÚÏ×ÁÎÏ: %ld ÉÚ %ld ÓÔÅËÁ. ðÒÉÍÅÎÑÊÔÅ 'mysqld -O thread_stack=#' ÄÌÑ ÕËÁÚÁÎÉÑ ÂÏÌØÛÅÇÏ ÒÁÚÍÅÒÁ ÓÔÅËÁ, ÅÓÌÉ ÎÅÏÂÈÏÄÉÍÏ", +"÷ OUTER JOIN ÏÂÎÁÒÕÖÅÎÁ ÐÅÒÅËÒÅÓÔÎÁÑ ÚÁ×ÉÓÉÍÏÓÔØ. ÷ÎÉÍÁÔÅÌØÎÏ ÐÒÏÁÎÁÌÉÚÉÒÕÊÔÅ Ó×ÏÉ ÕÓÌÏ×ÉÑ ON", +"óÔÏÌÂÅà '%-.64s' ÉÓÐÏÌØÚÕÅÔÓÑ × UNIQUE ÉÌÉ × INDEX, ÎÏ ÎÅ ÏÐÒÅÄÅÌÅÎ ËÁË NOT NULL", +"îÅ×ÏÚÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ ÆÕÎËÃÉÀ '%-.64s'", +"îÅ×ÏÚÍÏÖÎÏ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÆÕÎËÃÉÀ '%-.64s'; %-.80s", +"îÅÄÏÐÕÓÔÉÍÏ ÕËÁÚÙ×ÁÔØ ÐÕÔÉ ÄÌÑ ÄÉÎÁÍÉÞÅÓËÉÈ ÂÉÂÌÉÏÔÅË", "æÕÎËÃÉÑ '%-.64s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ", -"îÅ ÍÏÇÕ ÏÔËÒÙÔØ ÒÁÚÄÅÌÑÅÍÕÀ ÂÉÂÌÉÏÔÅËÕ '%-.64s' (ïÛÉÂËÁ: %d %-.64s)", -"îÅ ÍÏÇÕ ÎÁÊÔÉ ÆÕÎËÃÉÀ '%-.64s' × ÂÉÂÌÉÏÔÅËÅ'", +"îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÉÎÁÍÉÞÅÓËÕÀ ÂÉÂÌÉÏÔÅËÕ '%-.64s' (ÏÛÉÂËÁ: %d %-.64s)", +"îÅ×ÏÚÍÏÖÎÏ ÏÔÙÓËÁÔØ ÆÕÎËÃÉÀ '%-.64s' × ÂÉÂÌÉÏÔÅËÅ", "æÕÎËÃÉÑ '%-.64s' ÎÅ ÏÐÒÅÄÅÌÅÎÁ", -"èÏÓÔ '%-.64s' ÚÁÂÌÏËÉÒÏ×ÁÎ ÉÚ-ÚÁ ÏÂÉÌÉÑ ÏÛÉÂÏË ÓÏÅÄÉÎÅÎÉÑ. òÁÚÂÌÏËÉÒÏ×ÁÔØ ÍÏÖÎÏ Ó ÐÏÍÏÝØÀ 'mysqladmin flush-hosts'", -"èÏÓÔÕ '%-.64s' ÎÅ ÒÁÚÒÅÛÅÎÏ ÓÏÅÄÉÎÑÔØÓÑ Ó ÄÁÎÎÙÍ ÓÅÒ×ÅÒÏÍ MySQL", -"÷Ù ÐÏÄËÌÀÞÅÎÙ Ë MySQL ËÁË ÁÎÏÎÉÍÎÙÊ ÐÏÌØÚÏ×ÁÔÅÌØ É ÷ÁÍ ÎÅ ÒÁÚÒÅÛÅÎÏ ÉÚÍÅÎÑÔØ ÐÁÒÏÌÉ", -"÷Ù ÄÏÌÖÎÙ ÉÍÅÔØ ÐÒÁ×Á ÎÁ ÏÂÎÏ×ÌÅÎÉÅ ÔÁÂÌÉÃ × ÂÁÚÅ, ÞÔÏÂÙ ÉÚÍÅÎÉÔØ ÐÁÒÏÌØ ÄÒÕÇÉÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ", -"îÅ ÍÏÇÕ ÎÁÊÔÉ ÎÉ ÏÄÎÏÇÏ ÓÏÏÔ×ÅÔÓÔ×ÉÑ × ÔÁÂÌÉÃÅ ÐÏÌØÚÏ×ÁÔÅÌÅÊ", -"óÏÏÔ×ÅÔÓÔ×ÕÀÝÉÈ ÚÁÐÉÓÅÊ: %ld éÚÍÅÎÅÎÏ: %ld ðÒÅÄÕÐÒÅÖÄÅÎÉÊ: %ld", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÎÏ×ÕÀ ÎÉÔØ (ÏÛÉÂËÁ %d). åÓÌÉ ÜÔÏ ÎÅ ÉÚ-ÚÁ ÎÅÈ×ÁÔËÉ ÐÁÍÑÔÉ, ÐÏÓÍÏÔÒÉÔÅ × ÒÕËÏ×ÏÄÓÔ×Å ×ÏÚÍÏÖÎÙÅ OS-ÚÁ×ÉÓÉÍÙÅ ÇÌÀËÉ", -"þÉÓÌÏ ÓÔÏÌÂÃÏ× ÎÅ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÞÉÓÌÕ ÚÎÁÞÅÎÉÊ × ÓÔÒÏËÅ %ld", -"îÅ ÍÏÇÕ ÚÁÎÏ×Ï ÏÔËÒÙÔØ ÔÁÂÌÉÃÕ: '%-.64s", -"îÅÐÒÁ×ÉÌØÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÚÎÁÞÅÎÉÑ NULL", -"REGEXP ×ÅÒÎÕÌ ÏÛÉÂËÕ '%-.64s'", -"éÓÐÏÌØÚÏ×ÁÎÉÅ ÁÇÒÅÇÁÔÎÙÈ ÆÕÎËÃÉÊ (MIN(),MAX(),COUNT()...) ÓÏ×ÍÅÓÔÎÏ Ó ÏÂÙÞÎÙÍÉ ÚÎÁÞÅÎÉÑÍÉ ×ÏÚÍÏÖÎÏ ÔÏÌØËÏ ÐÒÉ ÎÁÌÉÞÉÉ ÒÁÚÄÅÌÁ GROUP BY", -"äÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' Ó ÈÏÓÔÁ '%-.64s' ÐÒÉ×ÉÌÅÇÉÉ ÎÅ ÏÐÒÅÄÅÌÅÎÙ", -"%-.16s ËÏÍÁÎÄÁ ÎÅ ÒÁÚÒÅÛÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ: '%-.32s@%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'", -"%-.16s ËÏÍÁÎÄÁ ÎÅ ÒÁÚÒÅÛÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ: '%-.32s@%-.64s'\n ÄÌÑ ÐÏÌÑ '%-.64s' ÉÚ ÔÁÂÌÉÃÙ '%-.64s'", -"úÁÄÁÎÙ ÎÅ×ÅÒÎÙÅ ÐÒÉ×ÉÌÅÇÉÉ ÄÌÑ ÔÁÂÌÉÃÙ", -"éÍÑ ÈÏÓÔÁ ÉÌÉ ÐÏÌØÚÏ×ÁÔÅÌÑ ÓÌÉÛËÏÍ ×ÅÌÉËÏ ÄÌÑ ÔÁÂÌÉÃÙ ÐÒÉ×ÉÌÅÇÉÊ", +"èÏÓÔ '%-.64s' ÚÁÂÌÏËÉÒÏ×ÁÎ ÉÚ-ÚÁ ÓÌÉÛËÏÍ ÂÏÌØÛÏÇÏ ËÏÌÉÞÅÓÔ×Á ÏÛÉÂÏË ÓÏÅÄÉÎÅÎÉÑ. òÁÚÂÌÏËÉÒÏ×ÁÔØ ÅÇÏ ÍÏÖÎÏ Ó ÐÏÍÏÝØÀ 'mysqladmin flush-hosts'", +"èÏÓÔÕ '%-.64s' ÎÅ ÒÁÚÒÅÛÁÅÔÓÑ ÐÏÄËÌÀÞÁÔØÓÑ Ë ÜÔÏÍÕ ÓÅÒ×ÅÒÕ MySQL", +"÷Ù ÉÓÐÏÌØÚÕÅÔÅ MySQL ÏÔ ÉÍÅÎÉ ÁÎÏÎÉÍÎÏÇÏ ÐÏÌØÚÏ×ÁÔÅÌÑ, Á ÁÎÏÎÉÍÎÙÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ ÎÅ ÒÁÚÒÅÛÁÅÔÓÑ ÍÅÎÑÔØ ÐÁÒÏÌÉ", +"äÌÑ ÔÏÇÏ ÞÔÏÂÙ ÉÚÍÅÎÑÔØ ÐÁÒÏÌÉ ÄÒÕÇÉÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ, Õ ×ÁÓ ÄÏÌÖÎÙ ÂÙÔØ ÐÒÉ×ÉÌÅÇÉÉ ÎÁ ÉÚÍÅÎÅÎÉÅ ÔÁÂÌÉÃ × ÂÁÚÅ ÄÁÎÎÙÈ mysql", +"îÅ×ÏÚÍÏÖÎÏ ÏÔÙÓËÁÔØ ÐÏÄÈÏÄÑÝÕÀ ÚÁÐÉÓØ × ÔÁÂÌÉÃÅ ÐÏÌØÚÏ×ÁÔÅÌÅÊ", +"óÏ×ÐÁÌÏ ÚÁÐÉÓÅÊ: %ld éÚÍÅÎÅÎÏ: %ld ðÒÅÄÕÐÒÅÖÄÅÎÉÊ: %ld", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÎÏ×ÙÊ ÐÏÔÏË (ÏÛÉÂËÁ %d). åÓÌÉ ÜÔÏ ÎÅ ÓÉÔÕÁÃÉÑ, Ó×ÑÚÁÎÎÁÑ Ó ÎÅÈ×ÁÔËÏÊ ÐÁÍÑÔÉ, ÔÏ ×ÁÍ ÓÌÅÄÕÅÔ ÉÚÕÞÉÔØ ÄÏËÕÍÅÎÔÁÃÉÀ ÎÁ ÐÒÅÄÍÅÔ ÏÐÉÓÁÎÉÑ ×ÏÚÍÏÖÎÏÊ ÏÛÉÂËÉ ÒÁÂÏÔÙ × ËÏÎËÒÅÔÎÏÊ ïó", +"ëÏÌÉÞÅÓÔ×Ï ÓÔÏÌÂÃÏ× ÎÅ ÓÏ×ÐÁÄÁÅÔ Ó ËÏÌÉÞÅÓÔ×ÏÍ ÚÎÁÞÅÎÉÊ × ÚÁÐÉÓÉ %ld", +"îÅ×ÏÚÍÏÖÎÏ ÚÁÎÏ×Ï ÏÔËÒÙÔØ ÔÁÂÌÉÃÕ '%-.64s'", +"îÅÐÒÁ×ÉÌØÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ×ÅÌÉÞÉÎÙ NULL", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ '%-.64s' ÏÔ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ", +"ïÄÎÏ×ÒÅÍÅÎÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÓÇÒÕÐÐÉÒÏ×ÁÎÎÙÈ (GROUP) ÓÔÏÌÂÃÏ× (MIN(),MAX(),COUNT(),...) Ó ÎÅÓÇÒÕÐÐÉÒÏ×ÁÎÎÙÍÉ ÓÔÏÌÂÃÁÍÉ Ñ×ÌÑÅÔÓÑ ÎÅËÏÒÒÅËÔÎÙÍ, ÅÓÌÉ × ×ÙÒÁÖÅÎÉÉ ÅÓÔØ GROUP BY", +"ôÁËÉÅ ÐÒÁ×Á ÎÅ ÏÐÒÅÄÅÌÅÎÙ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' ÎÁ ÈÏÓÔÅ '%-.64s'", +"ëÏÍÁÎÄÁ %-.16s ÚÁÐÒÅÝÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ '%-.32s@%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'", +"ëÏÍÁÎÄÁ %-.16s ÚÁÐÒÅÝÅÎÁ ÐÏÌØÚÏ×ÁÔÅÌÀ '%-.32s@%-.64s' ÄÌÑ ÓÔÏÌÂÃÁ '%-.64s' × ÔÁÂÌÉÃÅ '%-.64s'", +"îÅ×ÅÒÎÁÑ ËÏÍÁÎÄÁ GRANT ÉÌÉ REVOKE. ïÂÒÁÔÉÔÅÓØ Ë ÄÏËÕÍÅÎÔÁÃÉÉ, ÞÔÏÂÙ ×ÙÑÓÎÉÔØ, ËÁËÉÅ ÐÒÉ×ÉÌÅÇÉÉ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ", +"óÌÉÛËÏÍ ÄÌÉÎÎÏÅ ÉÍÑ ÐÏÌØÚÏ×ÁÔÅÌÑ/ÈÏÓÔÁ ÄÌÑ GRANT", "ôÁÂÌÉÃÁ '%-.64s.%-.64s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ", -"ðÒÉ×ÉÌÅÇÉÉ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' Ó ÈÏÓÔÁ '%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s' ÎÅ ÏÐÒÅÄÅÌÅÎÙ", -"äÁÎÎÁÑ ËÏÍÁÎÄÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ ÜÔÏÊ ×ÅÒÓÉÅÊ MySQL", -"ëÁËÁÑ-ÔÏ ÓÉÎÔÁËÓÉÞÅÓËÁÑ ÏÛÉÂËÁ", -"ðÏÔÏË ÄÌÑ delayed insert ÎÅ ÍÏÖÅÔ ÐÏÌÕÞÉÔØ ÂÌÏËÉÒÏ×ËÕ ÄÌÑ ÔÁÂÌÉÃÙ %-.64s", -"éÓÐÏÌØÚÕÅÔÓÑ ÓÌÉÛËÏÍ ÍÎÏÇÏ delayed ÐÏÔÏËÏ×", -"ðÒÅÒ×ÁÎÎÁÑ Ó×ÑÚØ %ld Ó ÂÁÚÏÊ ÄÁÎÎÙÈ: '%-.64s' ÐÏÌØÚÏ×ÁÔÅÌØ: '%-.64s' (%-.64s)", -"ðÁËÅÔ ÂÏÌØÛÅ ÞÅÍ 'max_allowed_packet'", -"ïÛÉÂËÁ ÞÔÅÎÉÑ ÉÚ ÔÒÕÂÙ ËÏÎÎÅËÔÁ", -"fcntl() ×ÅÒÎÕÌ ÏÛÉÂËÕ", -"ðÏÌÕÞÅÎ ÐÁËÅÔ × ÎÅÐÒÁ×ÉÌØÎÏÍ ÐÏÒÑÄËÅ", -"îÅ ÍÏÇÕ ÒÁÓÐÁËÏ×ÁÔØ ÐÁËÅÔ", -"ïÛÉÂËÁ ÐÒÉ ÞÔÅÎÉÉ ÐÁËÅÔÏ×", -"ôÁÊÍÁÕÔ ÐÒÉ ÞÔÅÎÉÉ ÐÁËÅÔÏ×", -"ïÛÉÂËÁ ÐÒÉ ÏÔÐÒÁ×ËÅ ÐÁËÅÔÏ×", -"ïÛÉÂËÁ ÐÒÉ ÏÔÐÒÁ×ËÅ ÐÁËÅÔÏ×", -"òÅÚÕÌØÔÉÒÕÀÝÁÑ ÓÔÒÏËÁ ÂÏÌØÛÅ ÞÅÍ max_allowed_packet", -"éÓÐÏÌØÚÕÅÍÁÑ ÔÁÂÌÉÃÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÐÏÌÑ BLOB/TEXT", -"éÓÐÏÌØÚÕÅÍÁÑ ÔÁÂÌÉÃÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÐÏÌÑ AUTO_INCREMENT", -"INSERT DELAYED ÎÅ ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ Ó ÔÁÂÌÉÃÅÊ '%-.64s', ÏÎÁ ÚÁÎÑÔÁ ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ LOCK TABLES", -"îÅ×ÅÒÎÏÅ ÉÍÑ ÐÏÌÑ '%-.100s'", -"ôÁÂÌÉÃÁ ÉÓÐÏÌØÚÕÅÍÏÇÏ ÔÉÐÁ ÎÅ ÍÏÖÅÔ ÉÎÄÅËÓÉÒÏ×ÁÔØ ÐÏÌÅ '%-.64s'", +"ôÁËÉÅ ÐÒÁ×Á ÎÅ ÏÐÒÅÄÅÌÅÎÙ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' ÎÁ ËÏÍÐØÀÔÅÒÅ '%-.64s' ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s'", +"üÔÁ ËÏÍÁÎÄÁ ÎÅ ÄÏÐÕÓËÁÅÔÓÑ × ÄÁÎÎÏÊ ×ÅÒÓÉÉ MySQL", +"õ ×ÁÓ ÏÛÉÂËÁ × ÚÁÐÒÏÓÅ. éÚÕÞÉÔÅ ÄÏËÕÍÅÎÔÁÃÉÀ ÐÏ ÉÓÐÏÌØÚÕÅÍÏÊ ×ÅÒÓÉÉ MySQL ÎÁ ÐÒÅÄÍÅÔ ËÏÒÒÅËÔÎÏÇÏ ÓÉÎÔÁËÓÉÓÁ", +"ðÏÔÏË, ÏÂÓÌÕÖÉ×ÁÀÝÉÊ ÏÔÌÏÖÅÎÎÕÀ ×ÓÔÁ×ËÕ (delayed insert), ÎÅ ÓÍÏÇ ÐÏÌÕÞÉÔØ ÚÁÐÒÁÛÉ×ÁÅÍÕÀ ÂÌÏËÉÒÏ×ËÕ ÎÁ ÔÁÂÌÉÃÕ %-.64s", +"óÌÉÛËÏÍ ÍÎÏÇÏ ÐÏÔÏËÏ×, ÏÂÓÌÕÖÉ×ÁÀÝÉÈ ÏÔÌÏÖÅÎÎÕÀ ×ÓÔÁ×ËÕ (delayed insert)", +"ðÒÅÒ×ÁÎÏ ÓÏÅÄÉÎÅÎÉÅ %ld Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.64s' ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' (%-.64s)", +"ðÏÌÕÞÅÎÎÙÊ ÐÁËÅÔ ÂÏÌØÛÅ, ÞÅÍ 'max_allowed_packet'", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ ÞÔÅÎÉÑ ÏÔ ÐÏÔÏËÁ ÓÏÅÄÉÎÅÎÉÑ (connection pipe)", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ ÏÔ fcntl()", +"ðÁËÅÔÙ ÐÏÌÕÞÅÎÙ × ÎÅ×ÅÒÎÏÍ ÐÏÒÑÄËÅ", +"îÅ×ÏÚÍÏÖÎÏ ÒÁÓÐÁËÏ×ÁÔØ ÐÁËÅÔ, ÐÏÌÕÞÅÎÎÙÊ ÞÅÒÅÚ ËÏÍÍÕÎÉËÁÃÉÏÎÎÙÊ ÐÒÏÔÏËÏÌ", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ × ÐÒÏÃÅÓÓÅ ÐÏÌÕÞÅÎÉÑ ÐÁËÅÔÁ ÞÅÒÅÚ ËÏÍÍÕÎÉËÁÃÉÏÎÎÙÊ ÐÒÏÔÏËÏÌ ", +"ðÏÌÕÞÅÎ ÔÁÊÍÁÕÔ ÏÖÉÄÁÎÉÑ ÐÁËÅÔÁ ÞÅÒÅÚ ËÏÍÍÕÎÉËÁÃÉÏÎÎÙÊ ÐÒÏÔÏËÏÌ ", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ ÐÒÉ ÐÅÒÅÄÁÞÅ ÐÁËÅÔÁ ÞÅÒÅÚ ËÏÍÍÕÎÉËÁÃÉÏÎÎÙÊ ÐÒÏÔÏËÏÌ ", +"ðÏÌÕÞÅÎ ÔÁÊÍÁÕÔ × ÐÒÏÃÅÓÓÅ ÐÅÒÅÄÁÞÉ ÐÁËÅÔÁ ÞÅÒÅÚ ËÏÍÍÕÎÉËÁÃÉÏÎÎÙÊ ÐÒÏÔÏËÏÌ ", +"òÅÚÕÌØÔÉÒÕÀÝÁÑ ÓÔÒÏËÁ ÂÏÌØÛÅ, ÞÅÍ 'max_allowed_packet'", +"éÓÐÏÌØÚÕÅÍÁÑ ÔÁÂÌÉÃÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÔÉÐÙ BLOB/TEXT", +"éÓÐÏÌØÚÕÅÍÁÑ ÔÁÂÌÉÃÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ Á×ÔÏÉÎËÒÅÍÅÎÔÎÙÅ ÓÔÏÌÂÃÙ", +"îÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ INSERT DELAYED ÄÌÑ ÔÁÂÌÉÃÙ '%-.64s', ÐÏÔÏÍÕ ÞÔÏ ÏÎÁ ÚÁÂÌÏËÉÒÏ×ÁÎÁ Ó ÐÏÍÏÝØÀ LOCK TABLES", +"îÅ×ÅÒÎÏÅ ÉÍÑ ÓÔÏÌÂÃÁ '%-.100s'", +"éÓÐÏÌØÚÏ×ÁÎÎÙÊ ÏÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ ÎÅ ÍÏÖÅÔ ÐÒÏÉÎÄÅËÓÉÒÏ×ÁÔØ ÓÔÏÌÂÅà '%-.64s'", "îÅ ×ÓÅ ÔÁÂÌÉÃÙ × MERGE ÏÐÒÅÄÅÌÅÎÙ ÏÄÉÎÁËÏ×Ï", -"îÅ ÍÏÇÕ ÐÉÓÁÔØ × ÔÁÂÌÉÃÕ '%-.64s' ÉÚ-ÚÁ UNIQUE ÕÓÌÏ×ÉÊ", -"ðÏÌÅ ÔÉÐÁ BLOB '%-.64s' × ÏÐÒÅÄÅÌÅÎÉÉ ÉÎÄÅËÓÁ ÂÅÚ ÕËÁÚÁÎÉÑ ÄÌÉÎÙ", -"÷ÓÅ ÞÁÓÔÉ PRIMARY KEY ÄÏÌÖÎÙ ÂÙÔØ NOT NULL; ÅÓÌÉ NULL × ÉÎÄÅËÓÅ ÎÅÏÂÈÏÄÉÍ, ÉÓÐÏÌØÚÕÊÔÅ UNIQUE", -"òÅÚÕÌØÔÁÔ ÓÏÄÅÒÖÉÔ ÂÏÌØÛÅ ÏÄÎÏÊ ÓÔÒÏËÉ", -"ôÁÂÌÉÃÁ ÜÔÏÇÏ ÔÉÐÁ ÏÂÑÚÁÎÁ ÉÍÅÔØ PRIMARY KEY", -"üÔÁ ËÏÐÉÑ MySQL ÓËÏÍÐÉÌÉÒÏ×ÁÎÁ ÂÅÚ ÐÏÄÄÅÒÖËÉ RAID", -"MySQL ÒÁÂÏÔÁÅÔ × ÒÅÖÉÍÅ ÚÁÝÉÔÙ ÏÔ ÄÕÒÁËÏ× (safe_mode) - ÎÅ ÍÏÇÕ UPDATE ÂÅÚ WHERE Ó ËÁËÉÍ-ÎÅÂÕÄØ KEY", -"éÎÄÅËÓ '%-.64s' ÎÅ ÎÁÊÄÅÎ × ÔÁÂÌÉÃÅ '%-.64s'", -"îÅ ÍÏÇÕ ÏÔËÒÙÔØ ÔÁÂÌÉÃÕ", -"äÁÎÎÙÊ ÔÉÐ ÔÁÂÌÉà ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ËÏÍÁÎÄÕ %s", -"üÔÁ ËÏÍÁÎÄÁ ×ÎÕÔÒÉ ÔÒÁÎÚÁËÃÉÉ ÚÁÐÒÅÝÅÎÁ", -"ïÛÉÂËÁ %d ×Ï ×ÒÅÍÑ COMMIT", -"ïÛÉÂËÁ %d ×Ï ×ÒÅÍÑ ROLLBACK", -"ïÛÉÂËÁ %d ×Ï ×ÒÅÍÑ FLUSH_LOGS", -"ïÛÉÂËÁ %d ×Ï ×ÒÅÍÑ CHECKPOINT", -"ðÒÅÒ×ÁÎÎÏÅ ÓÏÅÄÉÎÅÎÉÅ %ld Ë ÂÁÚÅ ÄÁÎÎÙÈ: '%-.64s' ÐÏÌØÚÏ×ÁÔÅÌØ: '%-.32s' ÈÏÓÔ: `%-.64s' (%-.64s)", -"üÔÏÔ ÔÉÐ ÔÁÂÌÉà ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ binary table dump", -"òÅÐÌÉËÁÃÉÏÎÎÙÊ ÌÏÇ ÚÁËÒÙÔ, ÎÅ ÍÏÇÕ ÓÄÅÌÁÔØ RESET MASTER", -"ïÛÉÂËÁ ÐÒÉ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÉ ÉÎÄÅËÓÁ ÐÅÒÅËÁÞÁÎÎÏÊ ÔÁÂÌÉÃÙ '%-.64s'", -"ïÛÉÂËÁ ÎÁ ÍÁÓÔÅÒÅ: '%-.64s'", -"óÅÔÅ×ÁÑ ÏÛÉÂËÁ ÐÒÉ ÞÔÅÎÉÉ Ó ÍÁÓÔÅÒÁ", -"óÅÔÅ×ÁÑ ÏÛÉÂËÁ ÐÒÉ ÐÉÓÁÎÉÉ ÍÁÓÔÅÒÕ", -"FULLTEXT ÉÎÄÅËÓ, ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÊ ÚÁÄÁÎÎÏÍÕ ÓÐÉÓËÕ ÓÔÏÌÂÃÏ×, ÎÅ ÎÁÊÄÅÎ", -"îÅ ÍÏÇÕ ×ÙÐÏÌÎÉÔØ ËÏÍÍÁÎÄÕ ÉÚ-ÚÁ ÁËÔÉ×ÎÙÈ locked ÔÁÂÌÉà ÉÌÉ ÁËÔÉ×ÎÏÊ ÔÒÁÎÚÁËÃÉÉ", +"îÅ×ÏÚÍÏÖÎÏ ÚÁÐÉÓÁÔØ × ÔÁÂÌÉÃÕ '%-.64s' ÉÚ-ÚÁ ÏÇÒÁÎÉÞÅÎÉÊ ÕÎÉËÁÌØÎÏÇÏ ËÌÀÞÁ", +"óÔÏÌÂÅà ÔÉÐÁ BLOB '%-.64s' ÂÙÌ ÕËÁÚÁÎ × ÏÐÒÅÄÅÌÅÎÉÉ ËÌÀÞÁ ÂÅÚ ÕËÁÚÁÎÉÑ ÄÌÉÎÙ ËÌÀÞÁ", +"÷ÓÅ ÞÁÓÔÉ ÐÅÒ×ÉÞÎÏÇÏ ËÌÀÞÁ (PRIMARY KEY) ÄÏÌÖÎÙ ÂÙÔØ ÏÐÒÅÄÅÌÅÎÙ ËÁË NOT NULL; åÓÌÉ ×ÁÍ ÎÕÖÎÁ ÐÏÄÄÅÒÖËÁ ×ÅÌÉÞÉÎ NULL × ËÌÀÞÅ, ×ÏÓÐÏÌØÚÕÊÔÅÓØ ÉÎÄÅËÓÏÍ UNIQUE", +"÷ ÒÅÚÕÌØÔÁÔÅ ×ÏÚ×ÒÁÝÅÎÁ ÂÏÌÅÅ ÞÅÍ ÏÄÎÁ ÓÔÒÏËÁ", +"üÔÏÔ ÔÉÐ ÔÁÂÌÉÃÙ ÔÒÅÂÕÅÔ ÏÐÒÅÄÅÌÅÎÉÑ ÐÅÒ×ÉÞÎÏÇÏ ËÌÀÞÁ", +"üÔÁ ×ÅÒÓÉÑ MySQL ÓËÏÍÐÉÌÉÒÏ×ÁÎÁ ÂÅÚ ÐÏÄÄÅÒÖËÉ RAID", +"÷Ù ÒÁÂÏÔÁÅÔÅ × ÒÅÖÉÍÅ ÂÅÚÏÐÁÓÎÙÈ ÏÂÎÏ×ÌÅÎÉÊ (safe update mode) É ÐÏÐÒÏÂÏ×ÁÌÉ ÉÚÍÅÎÉÔØ ÔÁÂÌÉÃÕ ÂÅÚ ÉÓÐÏÌØÚÏ×ÁÎÉÑ ËÌÀÞÅ×ÏÇÏ ÓÔÏÌÂÃÁ × ÞÁÓÔÉ WHERE", +"ëÌÀÞ '%-.64s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ × ÔÁÂÌÉÃÅ '%-.64s'", +"îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÔÁÂÌÉÃÕ", +"ïÂÒÁÂÏÔÞÉË ÔÁÂÌÉÃÙ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÜÔÏÇÏ: %s", +"÷ÁÍ ÎÅ ÒÁÚÒÅÛÅÎÏ ×ÙÐÏÌÎÑÔØ ÜÔÕ ËÏÍÁÎÄÕ × ÔÒÁÎÚÁËÃÉÉ", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ %d × ÐÒÏÃÅÓÓÅ COMMIT", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ %d × ÐÒÏÃÅÓÓÅ ROLLBACK", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ %d × ÐÒÏÃÅÓÓÅ FLUSH_LOGS", +"ðÏÌÕÞÅÎÁ ÏÛÉÂËÁ %d × ÐÒÏÃÅÓÓÅ CHECKPOINT", +"ðÒÅÒ×ÁÎÏ ÓÏÅÄÉÎÅÎÉÅ %ld Ë ÂÁÚÅ ÄÁÎÎÙÈ '%-.64s' ÐÏÌØÚÏ×ÁÔÅÌÑ '%-.32s' Ó ÈÏÓÔÁ `%-.64s' (%-.64s)", +"ïÂÒÁÂÏÔÞÉË ÜÔÏÊ ÔÁÂÌÉÃÙ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ Ä×ÏÉÞÎÏÇÏ ÓÏÈÒÁÎÅÎÉÑ ÏÂÒÁÚÁ ÔÁÂÌÉÃÙ (dump)", +"ä×ÏÉÞÎÙÊ ÖÕÒÎÁÌ ÏÂÎÏ×ÌÅÎÉÑ ÚÁËÒÙÔ, ÎÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ RESET MASTER", +"ïÛÉÂËÁ ÐÅÒÅÓÔÒÏÊËÉ ÉÎÄÅËÓÁ ÓÏÈÒÁÎÅÎÎÏÊ ÔÁÂÌÉÃÙ '%-.64s'", +"ïÛÉÂËÁ ÏÔ ÇÏÌÏ×ÎÏÇÏ ÓÅÒ×ÅÒÁ: '%-.64s'", +"÷ÏÚÎÉËÌÁ ÏÛÉÂËÁ ÞÔÅÎÉÑ × ÐÒÏÃÅÓÓÅ ËÏÍÍÕÎÉËÁÃÉÉ Ó ÇÏÌÏ×ÎÙÍ ÓÅÒ×ÅÒÏÍ", +"÷ÏÚÎÉËÌÁ ÏÛÉÂËÁ ÚÁÐÉÓÉ × ÐÒÏÃÅÓÓÅ ËÏÍÍÕÎÉËÁÃÉÉ Ó ÇÏÌÏ×ÎÙÍ ÓÅÒ×ÅÒÏÍ", +"îÅ×ÏÚÍÏÖÎÏ ÏÔÙÓËÁÔØ ÐÏÌÎÏÔÅËÓÔÏ×ÙÊ (FULLTEXT) ÉÎÄÅËÓ, ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÊ ÓÐÉÓËÕ ÓÔÏÌÂÃÏ×", +"îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÕËÁÚÁÎÎÕÀ ËÏÍÁÎÄÕ, ÐÏÓËÏÌØËÕ Õ ×ÁÓ ÐÒÉÓÕÔÓÔ×ÕÀÔ ÁËÔÉ×ÎÏ ÚÁÂÌÏËÉÒÏ×ÁÎÎÙÅ ÔÁÂÌÉÃÁ ÉÌÉ ÏÔËÒÙÔÁÑ ÔÒÁÎÚÁËÃÉÑ", "îÅÉÚ×ÅÓÔÎÁÑ ÓÉÓÔÅÍÎÁÑ ÐÅÒÅÍÅÎÎÁÑ '%-.64s'", -"ôÁÂÌÉÃÁ '%-.64s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÄÏÌÖÎÁ ÂÙÔØ ÉÓÐÒÁ×ÌÅÎÁ", -"ôÁÂÌÉÃÁ '%-.64s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÐÏÓÌÅÄÎÑÑ ÐÏÐÙÔËÁ ÉÓÐÒÁ×ÌÅÎÉÑ (Á×ÔÏÍÁÔÉÞÅÓËÁÑ?) ÎÅ ÕÄÁÌÁÓØ", -"ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÎÅËÏÔÏÒÙÅ ÎÅÔÒÁÎÚÁËÃÉÏÎÎÙÅ ÔÁÂÌÉÃÙ ÎÅ ÐÏÄÞÉÎÑÀÔÓÑ ROLLBACK", -"íÎÏÇÏÚÁÐÒÏÓÎÁÑ ÔÒÁÎÚÁËÃÉÑ ÔÒÅÂÕÅÔ Õ×ÅÌÉÞÅÎÉÑ 'max_binlog_cache_size' - Õ×ÅÌÉÞÔÅ ÜÔÕ ÐÅÒÅÍÅÎÎÕÀ É ÐÏÐÒÏÂÕÊÔÅ ÅÝÅ ÒÁÚ", -"üÔÁ ÏÐÅÒÁÃÉÑ ÎÅ×ÏÚÍÏÖÎÁ Ó ÁËÔÉ×ÎÙÍ slave, ÎÁÄÏ STOP SLAVE", -"üÔÁ ÏÐÅÒÁÃÉÑ ÎÅ×ÏÚÍÏÖÎÁ Ó ÐÁÓÓÉ×ÎÙÍ slave, ÎÁÄÏ START SLAVE", -"üÔÏÔ ÓÅÒ×ÅÒ ÎÅ slave, ÉÓÐÒÁ×ØÔÅ × ËÏÎÆÉÇÕÒÁÃÉÏÎÎÏÍ ÆÁÊÌÅ ÉÌÉ ËÏÍÍÁÎÄÏÊ CHANGE MASTER TO", -"îÅ ÐÏÌÕÞÉÌÏÓØ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÓÔÒÕËÔÕÒÕ master info, ÐÒÏ×ÅÒÔÅ persmissions ÎÁ ÆÁÊÌÅ master.info", -"îÅ ÍÏÇÕ ÓÏÚÄÁÔØ ÐÒÏÃÅÓÓ SLAVE, ÐÒÏ×ÅÒØÔÅ ÓÉÓÔÅÍÎÙÅ ÒÅÓÕÒÓÙ", +"ôÁÂÌÉÃÁ '%-.64s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÄÏÌÖÎÁ ÐÒÏÊÔÉ ÐÒÏ×ÅÒËÕ É ÒÅÍÏÎÔ", +"ôÁÂÌÉÃÁ '%-.64s' ÐÏÍÅÞÅÎÁ ËÁË ÉÓÐÏÒÞÅÎÎÁÑ É ÐÏÓÌÅÄÎÉÊ (Á×ÔÏÍÁÔÉÞÅÓËÉÊ?) ÒÅÍÏÎÔ ÎÅ ÂÙÌ ÕÓÐÅÛÎÙÍ", +"÷ÎÉÍÁÎÉÅ: ÐÏ ÎÅËÏÔÏÒÙÍ ÉÚÍÅÎÅÎÎÙÍ ÎÅÔÒÁÎÚÁËÃÉÏÎÎÙÍ ÔÁÂÌÉÃÁÍ ÎÅ×ÏÚÍÏÖÎÏ ÂÕÄÅÔ ÐÒÏÉÚ×ÅÓÔÉ ÏÔËÁÔ ÔÒÁÎÚÁËÃÉÉ", +"ôÒÁÎÚÁËÃÉÉ, ×ËÌÀÞÁÀÝÅÊ ÂÏÌØÛÏÅ ËÏÌÉÞÅÓÔ×Ï ËÏÍÁÎÄ, ÐÏÔÒÅÂÏ×ÁÌÏÓØ ÂÏÌÅÅ ÞÅÍ 'max_binlog_cache_size' ÂÁÊÔ. õ×ÅÌÉÞØÔÅ ÜÔÕ ÐÅÒÅÍÅÎÎÕÀ ÓÅÒ×ÅÒÁ mysqld É ÐÏÐÒÏÂÕÊÔÅ ÅÝÅ ÒÁÚ", +"üÔÕ ÏÐÅÒÁÃÉÀ ÎÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÐÒÉ ÒÁÂÏÔÁÀÝÅÍ ÐÏÔÏËÅ ÐÏÄÞÉÎÅÎÎÏÇÏ ÓÅÒ×ÅÒÁ. óÎÁÞÁÌÁ ×ÙÐÏÌÎÉÔÅ STOP SLAVE", +"äÌÑ ÜÔÏÊ ÏÐÅÒÁÃÉÉ ÔÒÅÂÕÅÔÓÑ ÒÁÂÏÔÁÀÝÉÊ ÐÏÄÞÉÎÅÎÎÙÊ ÓÅÒ×ÅÒ. óÎÁÞÁÌÁ ×ÙÐÏÌÎÉÔÅ START SLAVE", +"üÔÏÔ ÓÅÒ×ÅÒ ÎÅ ÎÁÓÔÒÏÅÎ ËÁË ÐÏÄÞÉÎÅÎÎÙÊ. ÷ÎÅÓÉÔÅ ÉÓÐÒÁ×ÌÅÎÉÑ × ËÏÎÆÉÇÕÒÁÃÉÏÎÎÏÍ ÆÁÊÌÅ ÉÌÉ Ó ÐÏÍÏÝØÀ CHANGE MASTER TO", +"îÅ×ÏÚÍÏÖÎÏ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÓÔÒÕËÔÕÒÕ ÄÌÑ ÉÎÆÏÒÍÁÃÉÉ Ï ÇÏÌÏ×ÎÏÍ ÓÅÒ×ÅÒÅ. ðÒÏ×ÅÒØÔÅ ÐÒÁ×Á ÎÁ ÆÁÊÌ master.info", +"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÐÏÔÏË ÐÏÄÞÉÎÅÎÎÏÇÏ ÓÅÒ×ÅÒÁ. ðÒÏ×ÅÒØÔÅ ÓÉÓÔÅÍÎÙÅ ÒÅÓÕÒÓÙ", "õ ÐÏÌØÚÏ×ÁÔÅÌÑ %-.64s ÕÖÅ ÂÏÌØÛÅ ÞÅÍ 'max_user_connections' ÁËÔÉ×ÎÙÈ ÓÏÅÄÉÎÅÎÉÊ", -"íÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÌØËÏ ×ÙÒÁÖÅÎÉÅ-ËÏÎÓÔÁÎÔÕ ÓÏ×ÍÅÓÔÎÏ Ó SET", -"ôÁÊÍÁÕÔ ÏÖÉÄÁÎÉÑ ÂÌÏËÉÒÏ×ËÉ", -"ïÂÝÅÅ ËÏÌÉÞÅÓÔ×Ï ÂÌÏËÉÒÏ×ÏË ÐÒÅ×ÙÓÉÌÏ ÒÁÚÍÅÒ ÔÁÂÌÉÃÙ ÂÌÏËÉÒÏ×ÏË", -"âÌÏËÉÒÏ×ËÁ ÉÚÍÅÎÅÎÉÑ ÎÅ ÍÏÖÅÔ ÂÙÔØ ÐÏÌÕÞÅÎÁ ×Ï ×ÒÅÍÑ READ UNCOMMITTED ÔÒÁÎÚÁËÃÉÉ", -"DROP DATABASE ÚÁÐÒÅÝÅÎ ×Ï ×ÒÅÍÑ ÇÌÏÂÁÌØÎÏÊ ÂÌÏËÉÒÏ×ËÉ ÞÔÅÎÉÑ", -"CREATE DATABASE ÚÁÐÒÅÝÅÎ ×Ï ×ÒÅÍÑ ÇÌÏÂÁÌØÎÏÊ ÂÌÏËÉÒÏ×ËÉ ÞÔÅÎÉÑ", -"îÅÐÒÁ×ÉÌØÎÙÅ ÁÒÇÕÍÅÔÎÙ Õ %s", -"%-.32s@%-.64s ÎÅ ÉÍÅÅÔ ÐÒÉ×ÉÌÅÇÉÊ ÓÏÚÄÁ×ÁÔØ ÎÏ×ÙÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ", -"îÅ×ÅÒÎÏÅ ÏÐÒÅÄÅÌÅÎÉÅ ÔÁÂÌÉÃÙ; ÷ÓÅ MERGE-ÔÁÂÌÉÃÙ ÄÏÌÖÎÙ ÂÙÔØ × ÏÄÎÏÊ ÂÁÚÅ ÄÁÎÎÙÈ", -"ïÂÎÁÒÕÖÅÎ deadlock ×Ï ×ÒÅÍÑ ÐÏÌÕÞÅÎÉÑ ÂÌÏËÉÒÏ×ËÉ; ðÏÐÒÏÂÕÊÔÅ ÐÅÒÅÚÁÐÕÓÔÉÔØ ÔÒÁÎÚÁËÃÉÀ", -"ôÁÂÌÉÃÁ ÄÁÎÎÏÇÏ ÔÉÐÁ ÎÅ ÍÏÖÅÔ ÉÍÅÔØ FULLTEXT ÉÎÄÅËÓÁ", -"Cannot add foreign key constraint", -"Cannot add a child row: a foreign key constraint fails", -"Cannot delete a parent row: a foreign key constraint fails", -"ïÛÉÂËÁ ÓÏÅÄÉÎÅÎÉÑ Ó master: %-.128s", -"ïÛÉÂËÁ ×Ù×ÏÌÎÅÎÉÑ ÚÁÐÒÏÓÁ ÎÁ master: %-.128s", -"ïÛÉÂËÁ ×ÙÐÏÌÎÅÎÉÑ ËÏÍÁÎÄÙ %s: %-.128s", -"îÅÐÒÁ×ÉÌØÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ %s É %s", -"éÓÐÏÌØÚÕÅÍÙÅ SELECT-×ÙÒÁÖÅÎÉÑ ÉÍÅÀÔ ÒÁÚÎÙÅ ËÏÌÉÞÅÓÔ×Á ÓÔÏÌÂÃÏ×", -"îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÚÁÐÒÏÓ ÉÚ-ÚÁ ËÏÎÆÌÉËÔÎÏÊ ÂÌÏËÉÒÏ×ËÉ ÞÔÅÎÉÑ", -"ïÄÎÏ×ÒÅÍÅÎÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ transactional É non-transactional ÔÁÂÌÉà ÏÔËÌÀÞÅÎÏ", -"ïÐÃÉÑ '%s' ÉÓÐÏÌØÚÏ×ÁÎÁ Ä×ÁÖÄÙ", -"User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", -"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", -"Variable '%-.64s' doesn't have a default value", -"Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", -"Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", -"This version of MySQL doesn't yet support '%s'", -"Got fatal error %d: '%-.128s' from master when reading data from binary log", +"÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ × SET ÔÏÌØËÏ ËÏÎÓÔÁÎÔÎÙÅ ×ÙÒÁÖÅÎÉÑ", +"ôÁÊÍÁÕÔ ÏÖÉÄÁÎÉÑ ÂÌÏËÉÒÏ×ËÉ ÉÓÔÅË; ÐÏÐÒÏÂÕÊÔÅ ÐÅÒÅÚÁÐÕÓÔÉÔØ ÔÒÁÎÚÁËÃÉÀ", +"ïÂÝÅÅ ËÏÌÉÞÅÓÔ×Ï ÂÌÏËÉÒÏ×ÏË ÐÒÅ×ÙÓÉÌÏ ÒÁÚÍÅÒÙ ÔÁÂÌÉÃÙ ÂÌÏËÉÒÏ×ÏË", +"âÌÏËÉÒÏ×ËÉ ÏÂÎÏ×ÌÅÎÉÊ ÎÅÌØÚÑ ÐÏÌÕÞÉÔØ × ÐÒÏÃÅÓÓÅ ÞÔÅÎÉÑ ÎÅ ÐÒÉÎÑÔÏÊ (× ÒÅÖÉÍÅ READ UNCOMMITTED) ÔÒÁÎÚÁËÃÉÉ", +"îÅ ÄÏÐÕÓËÁÅÔÓÑ DROP DATABASE, ÐÏËÁ ÐÏÔÏË ÄÅÒÖÉÔ ÇÌÏÂÁÌØÎÕÀ ÂÌÏËÉÒÏ×ËÕ ÞÔÅÎÉÑ", +"îÅ ÄÏÐÕÓËÁÅÔÓÑ CREATE DATABASE, ÐÏËÁ ÐÏÔÏË ÄÅÒÖÉÔ ÇÌÏÂÁÌØÎÕÀ ÂÌÏËÉÒÏ×ËÕ ÞÔÅÎÉÑ", +"îÅ×ÅÒÎÙÅ ÐÁÒÁÍÅÔÒÙ ÄÌÑ %s", +"%-.32s@%-.64s ÎÅ ÒÁÚÒÅÛÁÅÔÓÑ ÓÏÚÄÁ×ÁÔØ ÎÏ×ÙÈ ÐÏÌØÚÏ×ÁÔÅÌÅÊ", +"îÅ×ÅÒÎÏÅ ÏÐÒÅÄÅÌÅÎÉÅ ÔÁÂÌÉÃÙ; ÷ÓÅ ÔÁÂÌÉÃÙ × MERGE ÄÏÌÖÎÙ ÐÒÉÎÁÄÌÅÖÁÔØ ÏÄÎÏÊ É ÔÏÊ ÖÅ ÂÁÚÅ ÄÁÎÎÙÈ", +"÷ÏÚÎÉËÌÁ ÔÕÐÉËÏ×ÁÑ ÓÉÔÕÁÃÉÑ × ÐÒÏÃÅÓÓÅ ÐÏÌÕÞÅÎÉÑ ÂÌÏËÉÒÏ×ËÉ; ðÏÐÒÏÂÕÊÔÅ ÐÅÒÅÚÁÐÕÓÔÉÔØ ÔÒÁÎÚÁËÃÉÀ", +"éÓÐÏÌØÚÕÅÍÙÊ ÔÉÐ ÔÁÂÌÉà ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÐÏÌÎÏÔÅËÓÔÏ×ÙÈ ÉÎÄÅËÓÏ×", +"îÅ×ÏÚÍÏÖÎÏ ÄÏÂÁ×ÉÔØ ÏÇÒÁÎÉÞÅÎÉÑ ×ÎÅÛÎÅÇÏ ËÌÀÞÁ", +"îÅ×ÏÚÍÏÖÎÏ ÄÏÂÁ×ÉÔØ ÉÌÉ ÏÂÎÏ×ÉÔØ ÄÏÞÅÒÎÀÀ ÓÔÒÏËÕ: ÐÒÏ×ÅÒËÁ ÏÇÒÁÎÉÞÅÎÉÊ ×ÎÅÛÎÅÇÏ ËÌÀÞÁ ÎÅ ×ÙÐÏÌÎÑÅÔÓÑ", +"îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÉÌÉ ÏÂÎÏ×ÉÔØ ÒÏÄÉÔÅÌØÓËÕÀ ÓÔÒÏËÕ: ÐÒÏ×ÅÒËÁ ÏÇÒÁÎÉÞÅÎÉÊ ×ÎÅÛÎÅÇÏ ËÌÀÞÁ ÎÅ ×ÙÐÏÌÎÑÅÔÓÑ", +"ïÛÉÂËÁ ÓÏÅÄÉÎÅÎÉÑ Ó ÇÏÌÏ×ÎÙÍ ÓÅÒ×ÅÒÏÍ: %-.128s", +"ïÛÉÂËÁ ×ÙÐÏÌÎÅÎÉÑ ÚÁÐÒÏÓÁ ÎÁ ÇÏÌÏ×ÎÏÍ ÓÅÒ×ÅÒÅ: %-.128s", +"ïÛÉÂËÁ ÐÒÉ ×ÙÐÏÌÎÅÎÉÉ ËÏÍÁÎÄÙ %s: %-.128s", +"îÅ×ÅÒÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ %s É %s", +"éÓÐÏÌØÚÏ×ÁÎÎÙÅ ÏÐÅÒÁÔÏÒÙ ×ÙÂÏÒËÉ (SELECT) ÄÁÀÔ ÒÁÚÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÓÔÏÌÂÃÏ×", +"îÅ×ÏÚÍÏÖÎÏ ÉÓÐÏÌÎÉÔØ ÚÁÐÒÏÓ, ÐÏÓËÏÌØËÕ Õ ×ÁÓ ÕÓÔÁÎÏ×ÌÅÎÙ ËÏÎÆÌÉËÔÕÀÝÉÅ ÂÌÏËÉÒÏ×ËÉ ÞÔÅÎÉÑ", +"éÓÐÏÌØÚÏ×ÁÎÉÅ ÔÒÁÎÚÁËÃÉÏÎÎÙÈ ÔÁÂÌÉà ÎÁÒÑÄÕ Ó ÎÅÔÒÁÎÚÁËÃÉÏÎÎÙÍÉ ÚÁÐÒÅÝÅÎÏ", +"ïÐÃÉÑ '%s' Ä×ÁÖÄÙ ÉÓÐÏÌØÚÏ×ÁÎÁ × ×ÙÒÁÖÅÎÉÉ", +"ðÏÌØÚÏ×ÁÔÅÌØ '%-.64s' ÐÒÅ×ÙÓÉÌ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÒÅÓÕÒÓÁ '%s' (ÔÅËÕÝÅÅ ÚÎÁÞÅÎÉÅ: %ld)", +"÷ ÄÏÓÔÕÐÅ ÏÔËÁÚÁÎÏ. ÷ÁÍ ÎÕÖÎÙ ÐÒÉ×ÉÌÅÇÉÉ %-.128s ÄÌÑ ÜÔÏÊ ÏÐÅÒÁÃÉÉ", +"ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÐÏÔÏËÏ×ÏÊ (LOCAL) ÐÅÒÅÍÅÎÎÏÊ É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ Ó ÐÏÍÏÝØÀ SET GLOBAL", +"ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÇÌÏÂÁÌØÎÏÊ (GLOBAL) ÐÅÒÅÍÅÎÎÏÊ, É ÅÅ ÓÌÅÄÕÅÔ ÉÚÍÅÎÑÔØ Ó ÐÏÍÏÝØÀ SET GLOBAL", +"ðÅÒÅÍÅÎÎÁÑ '%-.64s' ÎÅ ÉÍÅÅÔ ÚÎÁÞÅÎÉÑ ÐÏ ÕÍÏÌÞÁÎÉÀ", +"ðÅÒÅÍÅÎÎÁÑ '%-.64s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÕÓÔÁÎÏ×ÌÅÎÁ × ÚÎÁÞÅÎÉÅ '%-.64s'", +"îÅ×ÅÒÎÙÊ ÔÉÐ ÁÒÇÕÍÅÎÔÁ ÄÌÑ ÐÅÒÅÍÅÎÎÏÊ '%-.64s'", +"ðÅÒÅÍÅÎÎÁÑ '%-.64s' ÍÏÖÅÔ ÂÙÔØ ÔÏÌØËÏ ÕÓÔÁÎÏ×ÌÅÎÁ, ÎÏ ÎÅ ÓÞÉÔÁÎÁ", +"îÅ×ÅÒÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÉÌÉ × ÎÅ×ÅÒÎÏÍ ÍÅÓÔÅ ÕËÁÚÁÎ '%s'", +"üÔÁ ×ÅÒÓÉÑ MySQL ÐÏËÁ ÅÝÅ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ '%s'", +"ðÏÌÕÞÅÎÁ ÎÅÉÓÐÒÁ×ÉÍÁÑ ÏÛÉÂËÁ %d: '%-.128s' ÏÔ ÇÏÌÏ×ÎÏÇÏ ÓÅÒ×ÅÒÁ × ÐÒÏÃÅÓÓÅ ×ÙÂÏÒËÉ ÄÁÎÎÙÈ ÉÚ Ä×ÏÉÞÎÏÇÏ ÖÕÒÎÁÌÁ", "Wrong foreign key definition for '%-.64s': %s", "Key reference and table reference doesn't match", "ïÛÉÂËÁ ÍÏÝØÎÏÓÔÉ ÍÎÏÖÅÓÔ×Á (ÂÏÌØÛÅ/ÍÅÎØÛÅ %d ËÏÌÏÎÏË)", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index e7142c65066..d2c099d38d0 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -238,23 +238,23 @@ "Fel använding/placering av '%s'", "Denna version av MySQL kan inte utföra '%s'", "Fick fatalt fel %d: '%-.128s' från master vid läsning av binär loggen", -"Felaktig FOREIGN KEY definition för '%-.64s': %s", -"Nyckel referensen och table referensen stämmer inte överens", -"Cardinality error (more/less than %d columns)", +"Felaktig FOREIGN KEY-definition för '%-.64s': %s", +"Nyckelreferensen och tabellreferensen stämmer inte överens", +"Kardinalitetsfel (fler/färre än %d kolumner)", "Subselect returnerade mer än 1 rad", "Okänd PREPARED STATEMENT id (%ld) var given till %s", -"Hjälp databasen finns inte eller är skadad", -"Syklisk referens i subselect", +"Hjälpdatabasen finns inte eller är skadad", +"Cyklisk referens i subselect", "Konvertar kolumn '%s' från %s till %s", -"Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias" -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s" -"Client does not support authentication protocol requested by server. Consider upgrading MySQL client" -"All parts of a SPATIAL KEY must be NOT NULL" -"COLLATION '%s' is not valid for CHARACTER SET '%s'" -"The slave was already running" -"The slave was already stopped" +"Referens '%-.64s' stöds inte (%s)", +"Varje 'derived table' måste ha sitt eget alias", +"Select %u reducerades vid optimiering", +"Tabell '%-.64s' från en SELECT kan inte användas i %-.32s" +"Klienten stöder inte autentiseringsprotokollet som begärts av servern. Överväg uppgradering av klientprogrammet." +"Alla delar av en SPATIAL KEY måste vara NOT NULL" +"COLLATION '%s' är inte tillåtet för CHARACTER SET '%s'" +"Slaven har redan startat" +"Slaven har redan stoppat" "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/slave.cc b/sql/slave.cc index b06895b1779..eea523a0260 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -235,8 +235,6 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log, DBUG_ENTER("init_relay_log_pos"); *errmsg=0; - if (rli->log_pos_current) // TODO: When can this happen ? - DBUG_RETURN(0); pthread_mutex_t *log_lock=rli->relay_log.get_log_lock(); pthread_mutex_lock(log_lock); if (need_data_lock) @@ -265,7 +263,7 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log, if (log) // If not first log { if (strcmp(log, rli->linfo.log_file_name)) - rli->skip_log_purge=1; // Different name; Don't purge + rli->skip_log_purge= 1; // Different name; Don't purge if (rli->relay_log.find_log_pos(&rli->linfo, log, 1)) { *errmsg="Could not find target log during relay log initialization"; @@ -298,9 +296,14 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log, } if (pos > BIN_LOG_HEADER_SIZE) my_b_seek(rli->cur_log,(off_t)pos); - rli->log_pos_current=1; err: + /* + If we don't purge, we can't honour relay_log_space_limit ; + silently discard it + */ + if (rli->skip_log_purge) + rli->log_space_limit= 0; pthread_cond_broadcast(&rli->data_cond); if (need_data_lock) pthread_mutex_unlock(&rli->data_lock); @@ -361,17 +364,37 @@ int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset, { int error=0; DBUG_ENTER("purge_relay_logs"); + + /* + Even if rli->inited==0, we still try to empty rli->master_log_* variables. + Indeed, rli->inited==0 does not imply that they already are empty. + It could be that slave's info initialization partly succeeded : + for example if relay-log.info existed but *relay-bin*.* + have been manually removed, init_relay_log_info reads the old + relay-log.info and fills rli->master_log_*, then init_relay_log_info + checks for the existence of the relay log, this fails and + init_relay_log_info leaves rli->inited to 0. + In that pathological case, rli->master_log_pos* will be properly reinited + at the next START SLAVE (as RESET SLAVE or CHANGE + MASTER, the callers of purge_relay_logs, will delete bogus *.info files + or replace them with correct files), however if the user does SHOW SLAVE + STATUS before START SLAVE, he will see old, confusing rli->master_log_*. + In other words, we reinit rli->master_log_* for SHOW SLAVE STATUS + to display fine in any case. + */ + + rli->master_log_name[0]= 0; + rli->master_log_pos= 0; + rli->pending= 0; + if (!rli->inited) - DBUG_RETURN(0); /* successfully do nothing */ + DBUG_RETURN(0); DBUG_ASSERT(rli->slave_running == 0); DBUG_ASSERT(rli->mi->slave_running == 0); rli->slave_skip_counter=0; pthread_mutex_lock(&rli->data_lock); - rli->pending=0; - rli->master_log_name[0]=0; - rli->master_log_pos=0; // 0 means uninitialized if (rli->relay_log.reset_logs(thd)) { *errmsg = "Failed during log reset"; @@ -385,7 +408,6 @@ int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset, rli->log_space_total= BIN_LOG_HEADER_SIZE; rli->relay_log_pos= BIN_LOG_HEADER_SIZE; rli->relay_log.reset_bytes_written(); - rli->log_pos_current=0; if (!just_reset) error= init_relay_log_pos(rli, rli->relay_log_name, rli->relay_log_pos, 0 /* do not need data lock */, errmsg); @@ -421,9 +443,9 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) DBUG_PRINT("info",("Terminating IO thread")); mi->abort_slave=1; if ((error=terminate_slave_thread(mi->io_thd,io_lock, - io_cond_lock, - &mi->stop_cond, - &mi->slave_running)) && + io_cond_lock, + &mi->stop_cond, + &mi->slave_running)) && !force_all) DBUG_RETURN(error); } @@ -463,12 +485,10 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, be referening freed memory trying to kick it */ THD_CHECK_SENTRY(thd); - if (*slave_running) + + while (*slave_running) // Should always be true { KICK_SLAVE(thd); - } - while (*slave_running) - { /* There is a small chance that slave thread might miss the first alarm. To protect againts it, resend the signal until it reacts @@ -476,10 +496,6 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, struct timespec abstime; set_timespec(abstime,2); pthread_cond_timedwait(term_cond, cond_lock, &abstime); - if (*slave_running) - { - KICK_SLAVE(thd); - } } if (term_lock) pthread_mutex_unlock(term_lock); @@ -1225,7 +1241,6 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname) rli->pending = 0; rli->cur_log_fd = -1; rli->slave_skip_counter=0; - rli->log_pos_current=0; rli->abort_pos_wait=0; rli->skip_log_purge=0; rli->log_space_limit = relay_log_space_limit; @@ -1270,8 +1285,9 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname) if (init_relay_log_pos(rli,NullS,BIN_LOG_HEADER_SIZE,0 /* no data lock */, &msg)) goto err; - rli->master_log_pos = 0; // uninitialized - rli->info_fd = info_fd; + rli->master_log_name[0]= 0; + rli->master_log_pos= 0; + rli->info_fd= info_fd; } else // file exists { @@ -1376,7 +1392,8 @@ static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli) thd->proc_info = "Waiting for relay log space to free"; while (rli->log_space_limit < rli->log_space_total && - !(slave_killed=io_slave_killed(thd,mi))) + !(slave_killed=io_slave_killed(thd,mi)) && + !rli->ignore_log_space_limit) { pthread_cond_wait(&rli->log_space_cond, &rli->log_space_lock); } @@ -1657,10 +1674,10 @@ bool flush_master_info(MASTER_INFO* mi) st_relay_log_info::st_relay_log_info() :info_fd(-1), cur_log_fd(-1), master_log_pos(0), save_temporary_tables(0), - cur_log_old_open_count(0), log_space_total(0), + cur_log_old_open_count(0), log_space_total(0), ignore_log_space_limit(0), slave_skip_counter(0), abort_pos_wait(0), slave_run_id(0), sql_thd(0), last_slave_errno(0), inited(0), abort_slave(0), - slave_running(0), log_pos_current(0), skip_log_purge(0), + slave_running(0), skip_log_purge(0), inside_transaction(0) /* the default is autocommit=1 */ { relay_log_name[0] = master_log_name[0] = 0; @@ -1882,7 +1899,8 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) if (init_thr_lock() || thd->store_globals()) { - end_thread(thd,0); + thd->cleanup(); + delete thd; DBUG_RETURN(-1); } @@ -2088,7 +2106,6 @@ point. If you are sure that your master is ok, run this query manually on the\ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) { - DBUG_ASSERT(rli->sql_thd==thd); Log_event * ev = next_event(rli); DBUG_ASSERT(rli->sql_thd==thd); if (sql_slave_killed(thd,rli)) @@ -2163,6 +2180,7 @@ extern "C" pthread_handler_decl(handle_slave_io,arg) // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff my_thread_init(); + DBUG_ENTER("handle_slave_io"); #ifndef DBUG_OFF slave_begin: @@ -2180,7 +2198,6 @@ slave_begin: #endif thd= new THD; // note that contructor of THD uses DBUG_ ! - DBUG_ENTER("handle_slave_io"); THD_CHECK_SENTRY(thd); pthread_detach_this_thread(); @@ -2240,7 +2257,7 @@ connected: on with life. */ thd->proc_info = "Registering slave on master"; - if (register_slave_on_master(mysql) || update_slave_list(mysql)) + if (register_slave_on_master(mysql) || update_slave_list(mysql, mi)) goto err; } @@ -2368,7 +2385,8 @@ reconnect done to recover from failed read"); } flush_master_info(mi); if (mi->rli.log_space_limit && mi->rli.log_space_limit < - mi->rli.log_space_total) + mi->rli.log_space_total && + !mi->rli.ignore_log_space_limit) if (wait_for_relay_log_space(&mi->rli)) { sql_print_error("Slave I/O thread aborted while waiting for relay \ @@ -2437,6 +2455,7 @@ extern "C" pthread_handler_decl(handle_slave_sql,arg) // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff my_thread_init(); + DBUG_ENTER("handle_slave_sql"); #ifndef DBUG_OFF slave_begin: @@ -2449,10 +2468,10 @@ slave_begin: #ifndef DBUG_OFF rli->events_till_abort = abort_slave_event_count; #endif - DBUG_ENTER("handle_slave_sql"); thd = new THD; // note that contructor of THD uses DBUG_ ! - THD_CHECK_SENTRY(thd); + thd->thread_stack = (char*)&thd; // remember where our stack is + /* Inform waiting threads that slave has started */ rli->slave_run_id++; @@ -2468,9 +2487,9 @@ slave_begin: sql_print_error("Failed during slave thread initialization"); goto err; } + thd->init_for_queries(); rli->sql_thd= thd; thd->temporary_tables = rli->save_temporary_tables; // restore temp tables - thd->thread_stack = (char*)&thd; // remember where our stack is pthread_mutex_lock(&LOCK_thread_count); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); @@ -2480,6 +2499,10 @@ slave_begin: pthread_cond_broadcast(&rli->start_cond); // This should always be set to 0 when the slave thread is started rli->pending = 0; + + //tell the I/O thread to take relay_log_space_limit into account from now on + rli->ignore_log_space_limit= 0; + if (init_relay_log_pos(rli, rli->relay_log_name, rli->relay_log_pos, @@ -2542,7 +2565,6 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ TODO: see if we can do this conditionally in next_event() instead to avoid unneeded position re-init */ - rli->log_pos_current=0; thd->temporary_tables = 0; // remove tempation from destructor to close them DBUG_ASSERT(thd->net.buff != 0); net_end(&thd->net); // destructor will not free it, because we are weird @@ -2889,7 +2911,6 @@ void end_relay_log_info(RELAY_LOG_INFO* rli) rli->cur_log_fd = -1; } rli->inited = 0; - rli->log_pos_current=0; rli->relay_log.close(1); DBUG_VOID_RETURN; } @@ -3190,11 +3211,41 @@ Log_event* next_event(RELAY_LOG_INFO* rli) update. If we do not, show slave status will block */ pthread_mutex_unlock(&rli->data_lock); - /* Note that wait_for_update unlocks lock_log ! */ - rli->relay_log.wait_for_update(rli->sql_thd); - - // re-acquire data lock since we released it earlier - pthread_mutex_lock(&rli->data_lock); + + /* + Possible deadlock : + - the I/O thread has reached log_space_limit + - the SQL thread has read all relay logs, but cannot purge for some + reason: + * it has already purged all logs except the current one + * there are other logs than the current one but they're involved in + a transaction that finishes in the current one (or is not finished) + Solution : + Wake up the possibly waiting I/O thread, and set a boolean asking + the I/O thread to temporarily ignore the log_space_limit + constraint, because we do not want the I/O thread to block because of + space (it's ok if it blocks for any other reason (e.g. because the + master does not send anything). Then the I/O thread stops waiting + and reads more events. + The SQL thread decides when the I/O thread should take log_space_limit + into account again : ignore_log_space_limit is reset to 0 + in purge_first_log (when the SQL thread purges the just-read relay + log), and also when the SQL thread starts. We should also reset + ignore_log_space_limit to 0 when the user does RESET SLAVE, but in + fact, no need as RESET SLAVE requires that the slave + be stopped, and when the SQL thread is later restarted + ignore_log_space_limit will be reset to 0. + */ + pthread_mutex_lock(&rli->log_space_lock); + // prevent the I/O thread from blocking next times + rli->ignore_log_space_limit= 1; + // If the I/O thread is blocked, unblock it + pthread_cond_broadcast(&rli->log_space_cond); + pthread_mutex_unlock(&rli->log_space_lock); + // Note that wait_for_update unlocks lock_log ! + rli->relay_log.wait_for_update(rli->sql_thd); + // re-acquire data lock since we released it earlier + pthread_mutex_lock(&rli->data_lock); continue; } /* diff --git a/sql/slave.h b/sql/slave.h index 4923eec3ae7..a4db7388be5 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -156,7 +156,14 @@ typedef struct st_relay_log_info extra offset to be added to the position. */ ulonglong relay_log_pos, pending; + + /* + Handling of the relay_log_space_limit optional constraint. + ignore_log_space_limit is used to resolve a deadlock between I/O and SQL + threads, it makes the I/O thread temporarily forget about the constraint + */ ulonglong log_space_limit,log_space_total; + bool ignore_log_space_limit; /* InnoDB internally stores the master log position it has processed @@ -186,7 +193,6 @@ typedef struct st_relay_log_info /* if not set, the value of other members of the structure are undefined */ bool inited; volatile bool abort_slave, slave_running; - bool log_pos_current; bool skip_log_purge; bool inside_transaction; diff --git a/sql/spatial.cc b/sql/spatial.cc index 3345c2756e7..df28733782f 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -78,17 +78,17 @@ int Geometry::create_from_wkb(const char *data, uint32 data_len) { uint32 geom_type; - if (data_len < 1+4) + if (data_len < 1 + 4) return 1; - data += sizeof(char); - + data++; //FIXME: check byte ordering - geom_type = uint4korr(data); - data += 4; - m_vmt = find_class(geom_type); - if (!m_vmt) return -1; - m_data = data; - m_data_end = data + data_len; + geom_type= uint4korr(data); + data+= 4; + m_vmt= find_class(geom_type); + if (!m_vmt) + return -1; + m_data= data; + m_data_end= data + data_len; return 0; } diff --git a/sql/spatial.h b/sql/spatial.h index 15e4f7353ed..d9c14afbe30 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -225,7 +225,6 @@ public: wkbNDR = 1 /* Little Endian */ }; - class GClassInfo { public: diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index d121a151011..9bcfff62ba0 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -240,14 +240,16 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len) } else return 0; -} //test_if_number +} -// Stores the biggest and the smallest value from current 'info' -// to ev_num_info -// If info contains an ulonglong number, which is bigger than -// biggest positive number able to be stored in a longlong variable -// and is marked as negative, function will return 0, else 1. +/* + Stores the biggest and the smallest value from current 'info' + to ev_num_info + If info contains an ulonglong number, which is bigger than + biggest positive number able to be stored in a longlong variable + and is marked as negative, function will return 0, else 1. +*/ bool get_ev_num_info(EV_NUM_INFO *ev_info, NUM_INFO *info, const char *num) { @@ -275,11 +277,13 @@ void free_string(String *s) s->free(); } + void field_str::add() { char buff[MAX_FIELD_WIDTH], *ptr; String s(buff, sizeof(buff),&my_charset_bin), *res; ulong length; + TREE_ELEMENT *element; if (!(res = item->val_str(&s))) { @@ -414,9 +418,11 @@ void field_real::add() room_in_tree = 0; // Remove tree, out of RAM ? delete_tree(&tree); } - // if element->count == 1, this element can be found only once from tree - // if element->count == 2, or more, this element is already in tree - else if (element->count == 1 && (tree_elements++) > pc->max_tree_elements) + /* + if element->count == 1, this element can be found only once from tree + if element->count == 2, or more, this element is already in tree + */ + else if (element->count == 1 && (tree_elements++) >= pc->max_tree_elements) { room_in_tree = 0; // Remove tree, too many elements delete_tree(&tree); @@ -445,6 +451,7 @@ void field_real::add() } } // field_real::add + void field_longlong::add() { char buff[MAX_FIELD_WIDTH]; @@ -467,9 +474,11 @@ void field_longlong::add() room_in_tree = 0; // Remove tree, out of RAM ? delete_tree(&tree); } - // if element->count == 1, this element can be found only once from tree - // if element->count == 2, or more, this element is already in tree - else if (element->count == 1 && (tree_elements++) > pc->max_tree_elements) + /* + if element->count == 1, this element can be found only once from tree + if element->count == 2, or more, this element is already in tree + */ + else if (element->count == 1 && (tree_elements++) >= pc->max_tree_elements) { room_in_tree = 0; // Remove tree, too many elements delete_tree(&tree); @@ -521,9 +530,11 @@ void field_ulonglong::add() room_in_tree = 0; // Remove tree, out of RAM ? delete_tree(&tree); } - // if element->count == 1, this element can be found only once from tree - // if element->count == 2, or more, this element is already in tree - else if (element->count == 1 && (tree_elements++) > pc->max_tree_elements) + /* + if element->count == 1, this element can be found only once from tree + if element->count == 2, or more, this element is already in tree + */ + else if (element->count == 1 && (tree_elements++) >= pc->max_tree_elements) { room_in_tree = 0; // Remove tree, too many elements delete_tree(&tree); @@ -604,14 +615,16 @@ bool analyse::end_of_records() func_items[8]->null_value = 1; else func_items[8]->set(res->ptr(), res->length(), res->charset()); - // count the dots, quotas, etc. in (ENUM("a","b","c"...)) - // if tree has been removed, don't suggest ENUM. - // treemem is used to measure the size of tree for strings, - // tree_elements is used to count the elements in tree in case of numbers. - // max_treemem tells how long the string starting from ENUM("... and - // ending to ..") shall at maximum be. If case is about numbers, - // max_tree_elements will tell the length of the above, now - // every number is considered as length 1 + /* + count the dots, quotas, etc. in (ENUM("a","b","c"...)) + If tree has been removed, don't suggest ENUM. + treemem is used to measure the size of tree for strings, + tree_elements is used to count the elements + max_treemem tells how long the string starting from ENUM("... and + ending to ..") shall at maximum be. If case is about numbers, + max_tree_elements will tell the length of the above, now + every number is considered as length 1 + */ if (((*f)->treemem || (*f)->tree_elements) && (*f)->tree.elements_in_tree && (((*f)->treemem ? max_treemem : max_tree_elements) > @@ -654,6 +667,7 @@ bool analyse::end_of_records() ans.append("DATETIME", 8); break; case FIELD_TYPE_DATE: + case FIELD_TYPE_NEWDATE: ans.append("DATE", 4); break; case FIELD_TYPE_SET: @@ -665,9 +679,6 @@ bool analyse::end_of_records() case FIELD_TYPE_TIME: ans.append("TIME", 4); break; - case FIELD_TYPE_NEWDATE: - ans.append("NEWDATE", 7); - break; case FIELD_TYPE_DECIMAL: ans.append("DECIMAL", 7); // if item is FIELD_ITEM, it _must_be_ Field_num in this case diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 79f0e7eb269..2063e8b3f08 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1239,25 +1239,44 @@ bool drop_locked_tables(THD *thd,const char *db, const char *table_name) } -/* lock table to force abort of any threads trying to use table */ +/* + If we have the table open, which only happens when a LOCK TABLE has been + done on the table, change the lock type to a lock that will abort all + other threads trying to get the lock. +*/ void abort_locked_tables(THD *thd,const char *db, const char *table_name) { TABLE *table; - for (table=thd->open_tables; table ; table=table->next) + for (table= thd->open_tables; table ; table= table->next) { if (!strcmp(table->real_name,table_name) && !strcmp(table->table_cache_key,db)) + { mysql_lock_abort(thd,table); + break; + } } } -/**************************************************************************** -** open_unireg_entry -** Purpose : Load a table definition from file and open unireg table -** Args : entry with DB and table given -** Returns : 0 if ok -** Note that the extra argument for open is taken from thd->open_options + +/* + Load a table definition from file and open unireg table + + SYNOPSIS + open_unireg_entry() + thd Thread handle + entry Store open table definition here + db Database name + name Table name + alias Alias name + + NOTES + Extra argument for open is taken from thd->open_options + + RETURN + 0 ok + # Error */ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, @@ -1618,6 +1637,8 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db, bool rm_temporary_table(enum db_type base, char *path) { bool error=0; + DBUG_ENTER("rm_temporary_table"); + fn_format(path, path,"",reg_ext,4); unpack_filename(path,path); if (my_delete(path,MYF(0))) @@ -1627,7 +1648,7 @@ bool rm_temporary_table(enum db_type base, char *path) if (file && file->delete_table(path)) error=1; delete file; - return error; + DBUG_RETURN(error); } @@ -1677,8 +1698,7 @@ Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length, else thd->dupp_field=field; } - if (check_grants && !thd->master_access && - check_grant_column(thd,table,name,length)) + if (check_grants && check_grant_column(thd,table,name,length)) return WRONG_GRANT; return field; } @@ -1728,7 +1748,9 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables, { found_table=1; Field *find=find_field_in_table(thd,tables->table,name,length, - grant_option && !thd->master_access,1); + grant_option && + tables->table->grant.want_privilege, + 1); if (find) { (*where)= tables; @@ -1785,7 +1807,8 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables, Field *field=find_field_in_table(thd,tables->table,name,length, grant_option && - !thd->master_access, allow_rowid); + tables->table->grant.want_privilege, + allow_rowid); if (field) { if (field == WRONG_GRANT) @@ -2400,6 +2423,17 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, } pthread_mutex_unlock(&in_use->mysys_var->mutex); } + /* + Now we must abort all tables locks used by this thread + as the thread may be waiting to get a lock for another table + */ + for (TABLE *thd_table= in_use->open_tables; + thd_table ; + thd_table= thd_table->next) + { + if (thd_table->db_stat) // If table is open + mysql_lock_abort_for_thread(thd, thd_table); + } } else result= result || return_if_owned_by_thd; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 90fd61ebeb7..bd6d7f83c95 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -778,11 +778,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) most significant bit - CLIENT_LONG_FLAG, other - charset number (0 no charset convertion) */ - if (thd->variables.convert_set != 0) - { - flags|= (byte) thd->variables.convert_set->number(); - DBUG_ASSERT(thd->variables.convert_set->number() < 128); - } + flags|= (byte) thd->charset()->number; + DBUG_ASSERT(thd->charset()->number < 128); tot_length=thd->query_length+thd->db_length+2; thd->query[tot_length-1] = (char) flags; @@ -935,11 +932,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) Other - charset number (0 no charset convertion) */ flags = (thd->client_capabilities & CLIENT_LONG_FLAG ? 0x80 : 0); - if (thd->variables.convert_set != 0) - { - flags |= (byte) thd->variables.convert_set->number(); - DBUG_ASSERT(thd->variables.convert_set->number() < 128); - } + flags |= (byte) thd->charset()->number; + DBUG_ASSERT(thd->charset()->number < 128); sql[tot_length-1] = (char) flags; query_block = (Query_cache_block *) hash_search(&queries, (byte*) sql, tot_length); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index cf790012c37..d5197b65071 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -187,7 +187,7 @@ THD::THD():user_time(0), is_fatal_error(0), */ { pthread_mutex_lock(&LOCK_thread_count); - ulong tmp=(ulong) (rnd(&sql_rand) * 0xffffffff); /* make all bits random */ + ulong tmp=(ulong) (my_rnd(&sql_rand) * 0xffffffff); /* make all bits random */ pthread_mutex_unlock(&LOCK_thread_count); randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id); } @@ -216,6 +216,21 @@ void THD::init(void) total_warn_count= 0; } + +/* + Init THD for query processing + + This has to be called once before we call mysql_parse() +*/ + +void THD::init_for_queries() +{ + init_sql_alloc(&mem_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); + init_sql_alloc(&transaction.mem_root, + TRANS_MEM_ROOT_BLOCK_SIZE, TRANS_MEM_ROOT_PREALLOC); +} + + /* Do what's needed when one invokes change user @@ -481,6 +496,7 @@ int THD::send_explain_fields(select_result *result) #ifdef SIGNAL_WITH_VIO_CLOSE void THD::close_active_vio() { + DBUG_ENTER("close_active_vio"); safe_mutex_assert_owner(&LOCK_delete); #ifndef EMBEDDED_LIBRARY if (active_vio) @@ -489,6 +505,7 @@ void THD::close_active_vio() active_vio = 0; } #endif + DBUG_VOID_RETURN; } #endif @@ -531,6 +548,16 @@ bool select_send::send_data(List<Item> &items) return 0; } +#ifdef HAVE_INNOBASE_DB + /* + We may be passing the control from mysqld to the client: release the + InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved + by thd + */ + if (thd->transaction.all.innobase_tid) + ha_release_temporary_latches(thd); +#endif + List_iterator_fast<Item> li(items); Protocol *protocol= thd->protocol; char buff[MAX_FIELD_WIDTH]; @@ -556,6 +583,14 @@ bool select_send::send_data(List<Item> &items) bool select_send::send_eof() { +#ifdef HAVE_INNOBASE_DB + /* We may be passing the control from mysqld to the client: release the + InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved + by thd */ + if (thd->transaction.all.innobase_tid) + ha_release_temporary_latches(thd); +#endif + /* Unlock tables before sending packet to gain some speed */ if (thd->lock) { diff --git a/sql/sql_class.h b/sql/sql_class.h index f07410770e3..59bef416ece 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -173,32 +173,6 @@ public: /* character conversion tables */ -class CONVERT; -CONVERT *get_convert_set(const char *name_ptr); - -class CONVERT -{ - const uchar *from_map,*to_map; - void convert_array(const uchar *mapping,uchar *buff,uint length); -public: - const char *name; - uint numb; - CONVERT(const char *name_par,uchar *from_par,uchar *to_par, uint number) - :from_map(from_par),to_map(to_par),name(name_par),numb(number) {} - friend CONVERT *get_convert_set(const char *name_ptr); - inline void convert(char *a,uint length) - { - convert_array(from_map, (uchar*) a,length); - } - char *store_dest(char *to, const char *from, uint length) - { - for (const char *end=from+length ; from != end ; from++) - *to++= to_map[(uchar) *from]; - return to; - } - bool store(String *, const char *,uint); - inline uint number() { return numb; } -}; typedef struct st_copy_info { ha_rows records; @@ -399,9 +373,10 @@ struct system_variables ulong pseudo_thread_id; my_bool log_warnings; - my_bool low_priority_updates; + my_bool low_priority_updates; + my_bool new_mode; + my_bool convert_result_charset; - CONVERT *convert_set; CHARSET_INFO *thd_charset; }; @@ -448,8 +423,9 @@ public: db - currently selected database ip - client IP */ - char *host,*user,*priv_user,*db,*ip; + /* remote (peer) port */ + uint16 peer_port; /* Points to info-string that will show in SHOW PROCESSLIST */ const char *proc_info; /* points to host if host is available, otherwise points to ip */ @@ -574,6 +550,7 @@ public: void init(void); void change_user(void); + void init_for_queries(); void cleanup(void); bool store_globals(); #ifdef SIGNAL_WITH_VIO_CLOSE @@ -681,6 +658,7 @@ public: { is_fatal_error= 1; net.report_error= 1; + DBUG_PRINT("error",("Fatal error set")); } inline CHARSET_INFO *charset() { return variables.thd_charset; } }; @@ -908,10 +886,11 @@ class Table_ident :public Sql_alloc LEX_STRING db; LEX_STRING table; SELECT_LEX_UNIT *sel; - inline Table_ident(LEX_STRING db_arg, LEX_STRING table_arg, bool force) + inline Table_ident(THD *thd, LEX_STRING db_arg, LEX_STRING table_arg, + bool force) :table(table_arg), sel((SELECT_LEX_UNIT *)0) { - if (!force && (current_thd->client_capabilities & CLIENT_NO_SCHEMA)) + if (!force && (thd->client_capabilities & CLIENT_NO_SCHEMA)) db.str=0; else db= db_arg; @@ -923,7 +902,8 @@ class Table_ident :public Sql_alloc } inline Table_ident(SELECT_LEX_UNIT *s) : sel(s) { - db.str=0; table.str=(char *)""; table.length=0; + /* We must have a table name here as this is used with add_table_to_list */ + db.str=0; table.str=(char *)"*"; table.length=1; } inline void change_db(char *db_name) { @@ -999,7 +979,7 @@ class multi_update : public select_result { TABLE_LIST *all_tables, *update_tables, *table_being_updated; THD *thd; - TABLE **tmp_tables, *main_table; + TABLE **tmp_tables, *main_table, *table_to_update; TMP_TABLE_PARAM *tmp_table_param; ha_rows updated, found; List <Item> *fields, *values; diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index f2e4a8934be..930ecfffef7 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -46,7 +46,7 @@ void SQL_CRYPT::crypt_init(ulong *rand_nr) for (i=0 ; i<= 255 ; i++) { - int idx= (uint) (rnd(&rand)*255.0); + int idx= (uint) (my_rnd(&rand)*255.0); char a= decode_buff[idx]; decode_buff[idx]= decode_buff[i]; decode_buff[+i]=a; @@ -62,7 +62,7 @@ void SQL_CRYPT::encode(char *str,uint length) { for (uint i=0; i < length; i++) { - shift^=(uint) (rnd(&rand)*255.0); + shift^=(uint) (my_rnd(&rand)*255.0); uint idx= (uint) (uchar) str[0]; *str++ = (char) ((uchar) encode_buff[idx] ^ shift); shift^= idx; @@ -74,7 +74,7 @@ void SQL_CRYPT::decode(char *str,uint length) { for (uint i=0; i < length; i++) { - shift^=(uint) (rnd(&rand)*255.0); + shift^=(uint) (my_rnd(&rand)*255.0); uint idx= (uint) ((unsigned char) str[0] ^ shift); *str = decode_buff[idx]; shift^= (uint) (uchar) *str++; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 03ccf88316c..ffa5416eaf5 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -615,7 +615,6 @@ int mysqld_show_create_db(THD *thd, char *dbname, uint db_access; bool found_libchar; HA_CREATE_INFO create; - CONVERT *convert=thd->variables.convert_set; uint create_options = create_info ? create_info->options : 0; Protocol *protocol=thd->protocol; DBUG_ENTER("mysql_show_create_db"); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index f2cddeead2f..ca761140955 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -167,11 +167,13 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, (TABLE_LIST*) select_cursor->table_list.first, select_cursor->with_wild, select_cursor->item_list, select_cursor->where, - select_cursor->order_list.elements+select_cursor->group_list.elements, + (select_cursor->order_list.elements+ + select_cursor->group_list.elements), (ORDER *) select_cursor->order_list.first, (ORDER *) select_cursor->group_list.first, select_cursor->having, (ORDER*) NULL, - select_cursor->options | thd->options | SELECT_NO_UNLOCK, + (select_cursor->options | thd->options | + SELECT_NO_UNLOCK), derived_result, unit, select_cursor, 1); if (!res) diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 00c80a654cb..c7b1814c1d7 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -12,8 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /********************************************************************** This file contains the implementation of error and warnings related @@ -60,6 +59,7 @@ This file contains the implementation of error and warnings related void mysql_reset_errors(THD *thd) { + DBUG_ENTER("mysql_reset_errors"); if (thd->query_id != thd->warn_id) { thd->warn_id= thd->query_id; @@ -67,6 +67,7 @@ void mysql_reset_errors(THD *thd) bzero((char*) thd->warn_count, sizeof(thd->warn_count)); thd->warn_list.empty(); } + DBUG_VOID_RETURN; } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 9ca51ebc053..dcb39f8526f 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -23,7 +23,7 @@ static int check_null_fields(THD *thd,TABLE *entry); static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list); static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, - char *query, uint query_length, bool log_on); + char *query, uint query_length, int log_on); static void end_delayed_insert(THD *thd); extern "C" pthread_handler_decl(handle_delayed_insert,arg); static void unlink_blobs(register TABLE *table); @@ -38,6 +38,8 @@ static void unlink_blobs(register TABLE *table); #define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0)) #endif +#define DELAYED_LOG_UPDATE 1 +#define DELAYED_LOG_BIN 2 /* Check if insert fields are correct @@ -107,8 +109,13 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, enum_duplicates duplic) { int error; - bool log_on= ((thd->options & OPTION_UPDATE_LOG) || - !(thd->master_access & SUPER_ACL)); + /* + log_on is about delayed inserts only. + By default, both logs are enabled (this won't cause problems if the server + runs without --log-update or --log-bin). + */ + int log_on= DELAYED_LOG_UPDATE | DELAYED_LOG_BIN ; + bool transactional_table, log_delayed, bulk_insert; uint value_count; ulong counter = 1; @@ -123,6 +130,14 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, thd->lex.select_lex.table_list.first; DBUG_ENTER("mysql_insert"); + if (thd->master_access & SUPER_ACL) + { + if (!(thd->options & OPTION_UPDATE_LOG)) + log_on&= ~(int) DELAYED_LOG_UPDATE; + if (!(thd->options & OPTION_BIN_LOG)) + log_on&= ~(int) DELAYED_LOG_BIN; + } + /* in safe mode or with skip-new change delayed insert to be regular if we are told to replace duplicates, the insert cannot be concurrent @@ -130,7 +145,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, */ if ((lock_type == TL_WRITE_DELAYED && ((specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) || - thd->slave_thread)) || + thd->slave_thread || !max_insert_delayed_threads)) || (lock_type == TL_WRITE_CONCURRENT_INSERT && duplic == DUP_REPLACE) || (duplic == DUP_UPDATE)) lock_type=TL_WRITE; @@ -547,12 +562,13 @@ public: char *record,*query; enum_duplicates dup; time_t start_time; - bool query_start_used,last_insert_id_used,insert_id_used,log_query; + bool query_start_used,last_insert_id_used,insert_id_used; + int log_query; ulonglong last_insert_id; ulong time_stamp; uint query_length; - delayed_row(enum_duplicates dup_arg, bool log_query_arg) + delayed_row(enum_duplicates dup_arg, int log_query_arg) :record(0),query(0),dup(dup_arg),log_query(log_query_arg) {} ~delayed_row() { @@ -855,7 +871,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) /* Put a question in queue */ static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, - char *query, uint query_length, bool log_on) + char *query, uint query_length, int log_on) { delayed_row *row=0; delayed_insert *di=thd->di; @@ -1242,13 +1258,14 @@ bool delayed_insert::handle_inserts(void) using_ignore=0; table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); } - if (row->query && row->log_query) + if (row->query) { - mysql_update_log.write(&thd,row->query, row->query_length); - if (using_bin_log) + if (row->log_query & DELAYED_LOG_UPDATE) + mysql_update_log.write(&thd,row->query, row->query_length); + if (row->log_query & DELAYED_LOG_BIN && using_bin_log) { - Query_log_event qinfo(&thd, row->query, row->query_length,0); - mysql_bin_log.write(&qinfo); + Query_log_event qinfo(&thd, row->query, row->query_length,0); + mysql_bin_log.write(&qinfo); } } if (table->blob_fields) @@ -1399,6 +1416,14 @@ bool select_insert::send_eof() if (!(error=table->file->extra(HA_EXTRA_NO_CACHE))) error=table->file->activate_all_index(thd); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); + + /* Write to binlog before commiting transaction */ + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query, thd->query_length, + table->file->has_transactions()); + mysql_bin_log.write(&qinfo); + } if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error) error=error2; if (info.copied || info.deleted) @@ -1425,12 +1450,6 @@ bool select_insert::send_eof() thd->insert_id(last_insert_id); // For update log ::send_ok(thd,info.copied,last_insert_id,buff); mysql_update_log.write(thd,thd->query,thd->query_length); - if (mysql_bin_log.is_open()) - { - Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); - mysql_bin_log.write(&qinfo); - } return 0; } } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 124715935a2..028dd02463c 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -109,6 +109,7 @@ void lex_free(void) LEX *lex_start(THD *thd, uchar *buf,uint length) { LEX *lex= &thd->lex; + lex->thd= thd; lex->next_state=MY_LEX_START; lex->buf= buf; lex->end_of_query=(lex->ptr=buf)+length; @@ -120,7 +121,6 @@ LEX *lex_start(THD *thd, uchar *buf,uint length) lex->select_lex.ftfunc_list_alloc.empty(); lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc; lex->current_select= &lex->select_lex; - lex->convert_set= (lex->thd= thd)->variables.convert_set; lex->thd_charset= lex->thd->variables.thd_charset; lex->yacc_yyss=lex->yacc_yyvs=0; lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE); @@ -480,6 +480,26 @@ int yylex(void *arg, void *yythd) lex->tok_start=lex->ptr; // Let tok_start point at next item return((int) c); + case MY_LEX_IDENT_OR_NCHAR: + if (yyPeek() != '\'') + { // Found x'hex-number' + state= MY_LEX_IDENT; + break; + } + yyGet(); // Skip ' + while ((c = yyGet()) && (c !='\'')) ; + length=(lex->ptr - lex->tok_start); // Length of hexnum+3 + if (c != '\'') + { + return(ABORT_SYM); // Illegal hex constant + } + yyGet(); // get_token makes an unget + yylval->lex_str=get_token(lex,length); + yylval->lex_str.str+=2; // Skip x' + yylval->lex_str.length-=3; // Don't count x' and last ' + lex->yytoklen-=3; + return (NCHAR_STRING); + case MY_LEX_IDENT_OR_HEX: if (yyPeek() == '\'') { // Found x'hex-number' @@ -537,8 +557,6 @@ int yylex(void *arg, void *yythd) yySkip(); // next state does a unget } yylval->lex_str=get_token(lex,length); - if (lex->convert_set) - lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen); /* Note: "SELECT _bla AS 'alias'" @@ -638,8 +656,6 @@ int yylex(void *arg, void *yythd) case MY_LEX_FOUND_IDENT: // Complete ident yylval->lex_str=get_token(lex,yyLength()); - if (lex->convert_set) - lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen); return(IDENT); case MY_LEX_USER_VARIABLE_DELIMITER: @@ -687,8 +703,6 @@ int yylex(void *arg, void *yythd) else yylval->lex_str=get_token(lex,yyLength()); } - if (lex->convert_set) - lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen); if (c == delim) yySkip(); // Skip end ` return(IDENT); @@ -819,8 +833,6 @@ int yylex(void *arg, void *yythd) break; } yylval->lex_str.length=lex->yytoklen; - if (lex->convert_set) - lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen); return(TEXT_STRING); case MY_LEX_COMMENT: // Comment @@ -957,8 +969,6 @@ int yylex(void *arg, void *yythd) return(tokval); // Was keyword } yylval->lex_str=get_token(lex,length); - if (lex->convert_set) - lex->convert_set->convert((char*) yylval->lex_str.str,lex->yytoklen); return(IDENT); } } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 90c742cff7f..32bb0633ae6 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -55,7 +55,7 @@ enum enum_sql_command { SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT, SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS, - SQLCOM_SHOW_CREATE_DB, + SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES, SQLCOM_GRANT, @@ -454,8 +454,8 @@ typedef struct st_lex TYPELIB *interval; create_field *last_field; Item *default_value, *comment; - CONVERT *convert_set; CHARSET_INFO *thd_charset; + uint uint_geom_type; LEX_USER *grant_user; gptr yacc_yyss,yacc_yyvs; THD *thd; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index dbd8dc5ce8d..f22e00a31bc 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -47,11 +47,6 @@ #define MIN_HANDSHAKE_SIZE 6 #endif /* HAVE_OPENSSL */ -#define MEM_ROOT_BLOCK_SIZE 8192 -#define MEM_ROOT_PREALLOC 8192 -#define TRANS_MEM_ROOT_BLOCK_SIZE 4096 -#define TRANS_MEM_ROOT_PREALLOC 4096 - /* Used in error handling only */ #define SP_TYPE_STRING(LP) \ ((LP)->sphead->m_type == TYPE_ENUM_FUNCTION ? "FUNCTION" : "PROCEDURE") @@ -562,7 +557,7 @@ check_connections(THD *thd) { char ip[30]; - if (vio_peer_addr(net->vio,ip)) + if (vio_peer_addr(net->vio, ip, &thd->peer_port)) return (ER_BAD_HOST_ERROR); if (!(thd->ip = my_strdup(ip,MYF(0)))) return (ER_OUT_OF_RESOURCES); @@ -580,7 +575,10 @@ check_connections(THD *thd) thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors); /* Cut very long hostnames to avoid possible overflows */ if (thd->host) + { thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0; + thd->host_or_ip= thd->host; + } if (connect_errors > max_connect_errors) return(ER_HOST_IS_BLOCKED); } @@ -594,8 +592,9 @@ check_connections(THD *thd) else /* Hostname given means that the connection was on a socket */ { DBUG_PRINT("info",("Host: %s",thd->host)); - thd->host_or_ip=thd->host; - thd->ip=0; + thd->host_or_ip= thd->host; + thd->ip= 0; + thd->peer_port= 0; bzero((char*) &thd->remote,sizeof(struct sockaddr)); } /* Ensure that wrong hostnames doesn't cause buffer overflows */ @@ -845,9 +844,7 @@ pthread_handler_decl(handle_one_connection,arg) thd->command=COM_SLEEP; thd->version=refresh_version; thd->set_time(); - init_sql_alloc(&thd->mem_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); - init_sql_alloc(&thd->transaction.mem_root, - TRANS_MEM_ROOT_BLOCK_SIZE, TRANS_MEM_ROOT_PREALLOC); + thd->init_for_queries(); while (!net->error && net->vio != 0 && !thd->killed) { if (do_command(thd)) @@ -918,9 +915,7 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) thd->priv_user=thd->user=(char*) my_strdup("boot", MYF(MY_WME)); buff= (char*) thd->net.buff; - init_sql_alloc(&thd->mem_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); - init_sql_alloc(&thd->transaction.mem_root, - TRANS_MEM_ROOT_BLOCK_SIZE, TRANS_MEM_ROOT_PREALLOC); + thd->init_for_queries(); while (fgets(buff, thd->net.max_packet, file)) { uint length=(uint) strlen(buff); @@ -1983,6 +1978,7 @@ mysql_execute_command(THD *thd) if (check_table_access(thd, SELECT_ACL, tables->next)) goto error; // Error message is given } + select_lex->options|= SELECT_NO_UNLOCK; unit->offset_limit_cnt= select_lex->offset_limit; unit->select_limit_cnt= select_lex->select_limit+ select_lex->offset_limit; @@ -2240,8 +2236,14 @@ mysql_execute_command(THD *thd) break; } case SQLCOM_UPDATE: - if (check_access(thd,UPDATE_ACL,tables->db,&tables->grant.privilege)) + TABLE_LIST *table; + if (check_db_used(thd,tables)) goto error; + for (table=tables ; table ; table=table->next) + { + if (check_access(thd,UPDATE_ACL,table->db,&table->grant.privilege)) + goto error; + } if (grant_option && check_grant(thd,UPDATE_ACL,tables)) goto error; if (select_lex->item_list.elements != lex->value_list.elements) @@ -2334,6 +2336,8 @@ mysql_execute_command(THD *thd) if ((res=check_table_access(thd, SELECT_ACL, save_next))) goto error; } + /* Don't unlock tables until command is written to binary log */ + select_lex->options|= SELECT_NO_UNLOCK; select_result *result; unit->offset_limit_cnt= select_lex->offset_limit; @@ -2364,6 +2368,8 @@ mysql_execute_command(THD *thd) case SQLCOM_TRUNCATE: if (check_access(thd,DELETE_ACL,tables->db,&tables->grant.privilege)) goto error; /* purecov: inspected */ + if (grant_option && check_grant(thd,DELETE_ACL,tables)) + goto error; /* Don't allow this within a transaction because we want to use re-generate table @@ -2583,6 +2589,9 @@ mysql_execute_command(THD *thd) case SQLCOM_SHOW_CHARSETS: res= mysqld_show_charsets(thd,(lex->wild ? lex->wild->ptr() : NullS)); break; + case SQLCOM_SHOW_COLLATIONS: + res= mysqld_show_collations(thd,(lex->wild ? lex->wild->ptr() : NullS)); + break; case SQLCOM_SHOW_FIELDS: #ifdef DONT_ALLOW_SHOW_COMMANDS send_error(thd,ER_NOT_ALLOWED_COMMAND); /* purecov: inspected */ @@ -3549,7 +3558,8 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, char *length, char *decimals, uint type_modifier, Item *default_value, Item *comment, - char *change, TYPELIB *interval, CHARSET_INFO *cs) + char *change, TYPELIB *interval, CHARSET_INFO *cs, + uint uint_geom_type) { register create_field *new_field; LEX *lex= &thd->lex; @@ -3603,6 +3613,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, new_field->interval=0; new_field->pack_length=0; new_field->charset=cs; + new_field->geom_type= (Field::geometry_type) uint_geom_type; if (!comment) { @@ -3960,9 +3971,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, if (!table) DBUG_RETURN(0); // End of memory alias_str= alias ? alias->str : table->table.str; - if (table->table.length > NAME_LEN || - (table->table.length && - check_table_name(table->table.str,table->table.length)) || + if (check_table_name(table->table.str,table->table.length) || table->db.str && check_db_name(table->db.str)) { net_printf(thd,ER_WRONG_TABLE_NAME,table->table.str); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index fc8959c6493..eea0d853132 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -12,8 +12,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /********************************************************************** This file contains the implementation of prepare and executes. diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 5b0ec2ec843..19b4d299e59 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -31,8 +31,8 @@ static TABLE_LIST *rename_tables(THD *thd, TABLE_LIST *table_list, bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) { - bool error=1,got_all_locks=1; - TABLE_LIST *lock_table,*ren_table=0; + bool error= 1; + TABLE_LIST *ren_table= 0; DBUG_ENTER("mysql_rename_tables"); /* @@ -47,23 +47,11 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) } VOID(pthread_mutex_lock(&LOCK_open)); - for (lock_table=table_list ; lock_table ; lock_table=lock_table->next) - { - int got_lock; - if ((got_lock=lock_table_name(thd,lock_table)) < 0) - goto end; - if (got_lock) - got_all_locks=0; - } - - if (!got_all_locks && wait_for_locked_table_names(thd,table_list)) - goto end; - - if (!(ren_table=rename_tables(thd,table_list,0))) - error=0; - -end: - if (ren_table) + if (lock_table_names(thd, table_list)) + goto err; + + error=0; + if ((ren_table=rename_tables(thd,table_list,0))) { /* Rename didn't succeed; rename back the tables in reverse order */ TABLE_LIST *prev=0,*table; @@ -85,7 +73,7 @@ end: table=table->next->next; // Skip error table /* Revert to old names */ rename_tables(thd, table, 1); - /* Note that lock_table == 0 here, so the unlock loop will work */ + error= 1; } /* Lets hope this doesn't fail as the result will be messy */ @@ -100,9 +88,9 @@ end: send_ok(thd); } - for (TABLE_LIST *table=table_list ; table != lock_table ; table=table->next) - unlock_table_name(thd,table); - pthread_cond_broadcast(&COND_refresh); + unlock_table_names(thd,table_list); + +err: pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(error); } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index fd6c9060079..7e9b6aea7b5 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -776,12 +776,18 @@ int reset_slave(THD *thd, MASTER_INFO* mi) error=1; goto err; } + //delete relay logs, clear relay log coordinates if ((error= purge_relay_logs(&mi->rli, thd, 1 /* just reset */, &errmsg))) goto err; + //Clear master's log coordinates (only for good display of SHOW SLAVE STATUS) + mi->master_log_name[0]= 0; + mi->master_log_pos= BIN_LOG_HEADER_SIZE; + //close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0 end_master_info(mi); + //and delete these two files fn_format(fname, master_info_file, mysql_data_home, "", 4+32); if (my_stat(fname, &stat_area, MYF(0)) && my_delete(fname, MYF(MY_WME))) { @@ -894,22 +900,21 @@ int change_master(THD* thd, MASTER_INFO* mi) if (lex_mi->relay_log_name) { - need_relay_log_purge = 0; - mi->rli.skip_log_purge=1; + need_relay_log_purge= 0; strmake(mi->rli.relay_log_name,lex_mi->relay_log_name, sizeof(mi->rli.relay_log_name)-1); } if (lex_mi->relay_log_pos) { - need_relay_log_purge=0; + need_relay_log_purge= 0; mi->rli.relay_log_pos=lex_mi->relay_log_pos; } flush_master_info(mi); if (need_relay_log_purge) { - mi->rli.skip_log_purge=0; + mi->rli.skip_log_purge= 0; thd->proc_info="purging old relay logs"; if (purge_relay_logs(&mi->rli, thd, 0 /* not only reset, but also reinit */, @@ -923,6 +928,7 @@ int change_master(THD* thd, MASTER_INFO* mi) else { const char* msg; + mi->rli.skip_log_purge= 1; /* Relay log is already initialized */ if (init_relay_log_pos(&mi->rli, mi->rli.relay_log_name, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0192d9f7ab2..5148a362eab 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -450,6 +450,7 @@ JOIN::optimize() // quick abort delete procedure; error= thd->is_fatal_error ? -1 : 1; + DBUG_PRINT("error",("Error from optimize_cond")); DBUG_RETURN(error); } @@ -457,6 +458,7 @@ JOIN::optimize() (!unit->select_limit_cnt && !(select_options & OPTION_FOUND_ROWS))) { /* Impossible cond */ zero_result_cause= "Impossible WHERE"; + error= 0; DBUG_RETURN(0); } @@ -469,16 +471,18 @@ JOIN::optimize() if (res < 0) { zero_result_cause= "No matching min/max row"; + error=0; DBUG_RETURN(0); } zero_result_cause= "Select tables optimized away"; tables_list= 0; // All tables resolved } } - if (!tables_list) + { + error= 0; DBUG_RETURN(0); - + } error= -1; // Error is sent to client sort_by_table= get_sort_by_table(order, group_list, tables_list); @@ -486,18 +490,24 @@ JOIN::optimize() thd->proc_info= "statistics"; if (make_join_statistics(this, tables_list, conds, &keyuse) || thd->is_fatal_error) + { + DBUG_PRINT("error",("Error: make_join_statistics() failed")); DBUG_RETURN(1); + } thd->proc_info= "preparing"; if (result->initialize_tables(this)) { - DBUG_RETURN(1); // error = -1 + DBUG_PRINT("error",("Error: initialize_tables() failed")); + DBUG_RETURN(1); // error == -1 } if (const_table_map != found_const_table_map && !(select_options & SELECT_DESCRIBE)) { zero_result_cause= "no matching row in const table"; + DBUG_PRINT("error",("Error: %s", zero_result_cause)); select_options= 0; //TODO why option in return_zero_rows was droped + error= 0; DBUG_RETURN(0); } if (!(thd->options & OPTION_BIG_SELECTS) && @@ -536,13 +546,14 @@ JOIN::optimize() if (error) { /* purecov: inspected */ error= -1; /* purecov: inspected */ + DBUG_PRINT("error",("Error: make_select() failed")); DBUG_RETURN(1); } if (make_join_select(this, select, conds)) { zero_result_cause= "Impossible WHERE noticed after reading const tables"; - DBUG_RETURN(0); + DBUG_RETURN(0); // error == 0 } error= -1; /* if goto err */ @@ -706,8 +717,10 @@ JOIN::optimize() } if (select_options & SELECT_DESCRIBE) + { + error= 0; DBUG_RETURN(0); - + } tmp_having= having; having= 0; @@ -807,10 +820,12 @@ JOIN::optimize() { if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN)))) DBUG_RETURN(-1); + error= 0; // Ensure that tmp_join.error= 0 restore_tmp(); } } + error= 0; DBUG_RETURN(0); } @@ -876,9 +891,9 @@ void JOIN::exec() { int tmp_error; - DBUG_ENTER("JOIN::exec"); + error= 0; if (procedure) { if (procedure->change_columns(fields_list) || @@ -888,7 +903,6 @@ JOIN::exec() if (!tables_list) { // Only test of functions - error=0; if (select_options & SELECT_DESCRIBE) select_describe(this, false, false, false, (zero_result_cause?zero_result_cause:"No tables used")); @@ -915,8 +929,6 @@ JOIN::exec() if (zero_result_cause) { - error=0; - (void) return_zero_rows(this, result, tables_list, fields_list, tmp_table_param.sum_func_count != 0 && !group_list, @@ -941,7 +953,6 @@ JOIN::exec() select_describe(this, need_tmp, order != 0 && !skip_sort_order, select_distinct); - error=0; DBUG_VOID_RETURN; } @@ -1253,6 +1264,7 @@ JOIN::exec() DBUG_VOID_RETURN; } + /* Clean up join. Return error that hold JOIN. */ @@ -1276,10 +1288,9 @@ JOIN::cleanup(THD *thd) } } tmp_join->tmp_join= 0; - return tmp_join->cleanup(thd); + DBUG_RETURN(tmp_join->cleanup(thd)); } - lock=0; // It's faster to unlock later join_free(this, 1); if (exec_tmp_table1) @@ -1298,6 +1309,7 @@ JOIN::cleanup(THD *thd) DBUG_RETURN(error); } + int mysql_select(THD *thd, Item ***rref_pointer_array, TABLE_LIST *tables, uint wild_num, List<Item> &fields, @@ -2926,6 +2938,12 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) { JOIN_TAB *tab=join->join_tab+i; table_map current_map= tab->table->map; + /* + Following force including random expression in last table condition. + It solve problem with select like SELECT * FROM t1 WHERE rand() > 0.5 + */ + if (i == join->tables-1) + current_map|= RAND_TABLE_BIT; bool use_quick_range=0; used_tables|=current_map; @@ -3759,6 +3777,7 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) == Item_func::COND_AND_FUNC; List_iterator<Item> li(*((Item_cond*) cond)->argument_list()); Item::cond_result tmp_cond_value; + bool should_fix_fields=0; *cond_value=Item::COND_UNDEF; Item *item; @@ -3778,6 +3797,7 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) delete item; // This may be shared #endif VOID(li.replace(new_item)); + should_fix_fields=1; } if (*cond_value == Item::COND_UNDEF) *cond_value=tmp_cond_value; @@ -3804,6 +3824,9 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) break; /* purecov: deadcode */ } } + if (should_fix_fields) + cond->fix_fields(current_thd,0, &cond); + if (!((Item_cond*) cond)->argument_list()->elements || *cond_value != Item::COND_OK) return (COND*) 0; @@ -4904,6 +4927,10 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) error=0; if (!table) // If sending data to client { + /* + The following will unlock all cursors if the command wasn't an + update command + */ join_free(join, 0); // Unlock all cursors if (join->result->send_eof()) error= 1; // Don't send error @@ -4915,17 +4942,25 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) int tmp; if ((tmp=table->file->extra(HA_EXTRA_NO_CACHE))) { - my_errno=tmp; + DBUG_PRINT("error",("extra(HA_EXTRA_NO_CACHE) failed")); + my_errno= tmp; error= -1; } if ((tmp=table->file->index_end())) { - my_errno=tmp; + DBUG_PRINT("error",("index_end() failed")); + my_errno= tmp; error= -1; } if (error == -1) table->file->print_error(my_errno,MYF(0)); } +#ifndef DBUG_OFF + if (error) + { + DBUG_PRINT("error",("Error: do_select() failed")); + } +#endif DBUG_RETURN(error || join->thd->net.report_error); } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 00df2c44fd6..fe4f1a0576d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -979,8 +979,8 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd) if (store_create_info(thd, table, packet)) DBUG_RETURN(-1); - if (protocol->convert) - protocol->convert->convert((char*) packet->ptr(), packet->length()); + //if (protocol->convert) + // protocol->convert->convert((char*) packet->ptr(), packet->length()); if (fd < 0) { if (protocol->write()) @@ -1023,6 +1023,7 @@ append_identifier(THD *thd, String *packet, const char *name) } } +#define LIST_PROCESS_HOST_LEN 64 static int store_create_info(THD *thd, TABLE *table, String *packet) @@ -1295,7 +1296,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) field_list.push_back(new Item_int("Id",0,11)); field_list.push_back(new Item_empty_string("User",16)); - field_list.push_back(new Item_empty_string("Host",64)); + field_list.push_back(new Item_empty_string("Host",LIST_PROCESS_HOST_LEN)); field_list.push_back(field=new Item_empty_string("db",NAME_LEN)); field->maybe_null=1; field_list.push_back(new Item_empty_string("Command",16)); @@ -1329,7 +1330,14 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thd_info->user=thd->strdup(tmp->user ? tmp->user : (tmp->system_thread ? "system user" : "unauthenticated user")); - thd_info->host= thd->strdup(tmp->host_or_ip); + if (tmp->peer_port && (tmp->host || tmp->ip)) + { + if ((thd_info->host= thd->alloc(LIST_PROCESS_HOST_LEN+1))) + my_snprintf((char *) thd_info->host, LIST_PROCESS_HOST_LEN, + "%s:%u", tmp->host_or_ip, tmp->peer_port); + } + else + thd_info->host= thd->strdup(tmp->host_or_ip); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; @@ -1406,7 +1414,19 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) Status functions *****************************************************************************/ -int mysqld_show_charsets(THD *thd, const char *wild) +static bool write_collation(Protocol *protocol, CHARSET_INFO *cs) +{ + protocol->prepare_for_resend(); + protocol->store(cs->csname, system_charset_info); + protocol->store(cs->name, system_charset_info); + protocol->store_short((longlong) cs->number); + protocol->store((cs->state & MY_CS_PRIMARY) ? "Y" : "",system_charset_info); + protocol->store((cs->state & MY_CS_COMPILED)? "Y" : "",system_charset_info); + protocol->store_short((longlong) cs->strxfrm_multiply); + return protocol->write(); +} + +int mysqld_show_collations(THD *thd, const char *wild) { char buff[8192]; String packet2(buff,sizeof(buff),thd->charset()); @@ -1417,32 +1437,72 @@ int mysqld_show_charsets(THD *thd, const char *wild) DBUG_ENTER("mysqld_show_charsets"); - field_list.push_back(new Item_empty_string("CS_Name",30)); - field_list.push_back(new Item_empty_string("COL_Name",30)); + field_list.push_back(new Item_empty_string("Charset",30)); + field_list.push_back(new Item_empty_string("Collation",30)); field_list.push_back(new Item_return_int("Id",11, FIELD_TYPE_SHORT)); - field_list.push_back(new Item_empty_string("Flags",30)); - field_list.push_back(new Item_return_int("strx_maxlen",3, FIELD_TYPE_TINY)); - field_list.push_back(new Item_return_int("mb_maxlen",3, FIELD_TYPE_TINY)); + field_list.push_back(new Item_empty_string("D",30)); + field_list.push_back(new Item_empty_string("C",30)); + field_list.push_back(new Item_return_int("Sortlen",3, FIELD_TYPE_SHORT)); if (protocol->send_fields(&field_list, 1)) DBUG_RETURN(1); - for (cs=all_charsets ; cs < all_charsets+255 ; cs++ ) + for ( cs= all_charsets ; cs < all_charsets+255 ; cs++ ) { - if (cs[0] && !(wild && wild[0] && - wild_case_compare(system_charset_info,cs[0]->name,wild))) + CHARSET_INFO **cl; + for ( cl= all_charsets; cl < all_charsets+255 ;cl ++) { - protocol->prepare_for_resend(); - protocol->store(cs[0]->csname, system_charset_info); - protocol->store(cs[0]->name, system_charset_info); - protocol->store_short((longlong) cs[0]->number); - flags[0]='\0'; - if (cs[0]->state & MY_CS_PRIMARY) - strcat(flags,"pri"); - protocol->store(flags, system_charset_info); - protocol->store_tiny((longlong) cs[0]->strxfrm_multiply); - protocol->store_tiny((longlong) cs[0]->mbmaxlen); - if (protocol->write()) + if (!cs[0] || !cl[0] || !my_charset_same(cs[0],cl[0]) || !(cs[0]->state & MY_CS_PRIMARY)) + continue; + if (cs[0] && !(wild && wild[0] && + wild_case_compare(system_charset_info,cl[0]->name,wild))) + { + if (write_collation(protocol, cl[0])) + goto err; + } + } + } + send_eof(thd); + DBUG_RETURN(0); +err: + DBUG_RETURN(1); +} + +static bool write_charset(Protocol *protocol, CHARSET_INFO *cs) +{ + protocol->prepare_for_resend(); + protocol->store(cs->csname, system_charset_info); + protocol->store(cs->comment ? cs->comment : "", system_charset_info); + protocol->store(cs->name, system_charset_info); + protocol->store_short((longlong) cs->mbmaxlen); + return protocol->write(); +} + +int mysqld_show_charsets(THD *thd, const char *wild) +{ + char buff[8192]; + String packet2(buff,sizeof(buff),thd->charset()); + List<Item> field_list; + CHARSET_INFO **cs; + Protocol *protocol= thd->protocol; + char flags[64]; + + DBUG_ENTER("mysqld_show_charsets"); + + field_list.push_back(new Item_empty_string("Charset",30)); + field_list.push_back(new Item_empty_string("Description",60)); + field_list.push_back(new Item_empty_string("Default collation",60)); + field_list.push_back(new Item_return_int("Maxlen",3, FIELD_TYPE_SHORT)); + + if (protocol->send_fields(&field_list, 1)) + DBUG_RETURN(1); + + for ( cs= all_charsets ; cs < all_charsets+255 ; cs++ ) + { + if (cs[0] && (cs[0]->state & MY_CS_PRIMARY) && !(wild && wild[0] && + wild_case_compare(system_charset_info,cs[0]->name,wild))) + { + if (write_charset(protocol, cs[0])) goto err; } } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 54a76319be7..e29883c190b 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -29,6 +29,9 @@ #endif CHARSET_INFO *system_charset_info= &my_charset_utf8; +CHARSET_INFO *files_charset_info= &my_charset_utf8; +CHARSET_INFO *national_charset_info= &my_charset_latin1; + extern gptr sql_alloc(unsigned size); extern void sql_element_free(void *ptr); static uint32 diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0033451a439..f4bcd6bd684 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000-2003 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,7 +65,7 @@ static int copy_data_between_tables(TABLE *from,TABLE *to, int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, my_bool drop_temporary) { - int error; + int error= 0; DBUG_ENTER("mysql_rm_table"); /* mark for close and remove all cached entries */ @@ -80,7 +80,7 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, { my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE,MYF(0), tables->real_name); - error = 1; + error= 1; goto err; } while (global_read_lock && ! thd->killed) @@ -93,7 +93,6 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, err: pthread_mutex_unlock(&LOCK_open); - VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; @@ -139,7 +138,6 @@ int mysql_rm_table_part2_with_lock(THD *thd, dont_log_query); pthread_mutex_unlock(&LOCK_open); - VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; @@ -188,9 +186,12 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, bool some_tables_deleted=0, tmp_table_deleted=0; DBUG_ENTER("mysql_rm_table_part2"); + if (lock_table_names(thd, tables)) + DBUG_RETURN(1); + for (table=tables ; table ; table=table->next) { - char *db=table->db ? table->db : thd->db; + char *db=table->db; mysql_ha_closeall(thd, table); if (!close_temporary_table(thd, db, table->real_name)) { @@ -266,11 +267,12 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, } } - error = 0; + unlock_table_names(thd, tables); + error= 0; if (wrong_tables.length()) { my_error(ER_BAD_TABLE_ERROR,MYF(0),wrong_tables.c_ptr()); - error=1; + error= 1; } DBUG_RETURN(error); } @@ -418,6 +420,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, if (!(sql_field->flags & NOT_NULL_FLAG)) null_fields++; + if (check_column_name(sql_field->field_name)) + { + my_error(ER_WRONG_COLUMN_NAME, MYF(0), sql_field->field_name); + DBUG_RETURN(-1); + } + /* Check if we have used the same field name before */ for (dup_no=0; (dup_field=it2++) != sql_field; dup_no++) { @@ -979,12 +987,6 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, while ((item=it++)) { create_field *cr_field; - if (strlen(item->name) > NAME_LEN || - check_column_name(item->name)) - { - my_error(ER_WRONG_COLUMN_NAME,MYF(0),item->name); - DBUG_RETURN(0); - } Field *field; if (item->type() == Item::FUNC_ITEM) field=item->tmp_table_field(&tmp_table); diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 88ed86732f1..d2f97640010 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -321,8 +321,8 @@ w_requests: %10lu\n\ writes: %10lu\n\ r_requests: %10lu\n\ reads: %10lu\n", - _my_blocks_used,_my_blocks_changed,_my_cache_w_requests, - _my_cache_write,_my_cache_r_requests,_my_cache_read); + my_blocks_used,my_blocks_changed,my_cache_w_requests, + my_cache_write,my_cache_r_requests,my_cache_read); pthread_mutex_unlock(&THR_LOCK_keycache); if (thd) diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 607f3007d1d..5f7a1e44bde 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -241,11 +241,13 @@ err: DBUG_RETURN(-1); } + int st_select_lex_unit::exec() { DBUG_ENTER("st_select_lex_unit::exec"); SELECT_LEX_NODE *lex_select_save= thd->lex.current_select; SELECT_LEX *select_cursor=first_select_in_union(), *last_select; + LINT_INIT(last_select); if (executed && !(dependent || uncacheable)) DBUG_RETURN(0); @@ -321,14 +323,9 @@ int st_select_lex_unit::exec() thd->lex.current_select = select_cursor; res =-1; { -#if 0 - List<Item_func_match> ftfunc_list; - ftfunc_list.empty(); -#else List<Item_func_match> empty_list; empty_list.empty(); thd->lex.select_lex.ftfunc_list= &empty_list; -#endif if (!thd->is_fatal_error) // Check if EOM { @@ -360,9 +357,8 @@ int st_select_lex_unit::exec() int st_select_lex_unit::cleanup() { - DBUG_ENTER("st_select_lex_unit::cleanup"); - int error= 0; + DBUG_ENTER("st_select_lex_unit::cleanup"); if (union_result) { diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 95128b2db3d..ec1183819dc 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -23,6 +23,8 @@ #include "sql_acl.h" #include "sql_select.h" +static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields); + /* Return 0 if row hasn't changed */ static bool compare_record(TABLE *table, ulong query_id) @@ -547,11 +549,12 @@ int multi_update::prepare(List<Item> ¬_used_values, SELECT_LEX_UNIT *unit) /* - Store first used table in main_table as this should be updated first - This is because we know that no row in this table will be read twice. + Initialize table for multi table - Create temporary tables to store changed values for all other tables - that are updated. + IMPLEMENTATION + - Update first table in join on the fly, if possible + - Create temporary tables to store changed values for all other tables + that are updated (and main_table if the above doesn't hold). */ bool @@ -565,52 +568,113 @@ multi_update::initialize_tables(JOIN *join) main_table=join->join_tab->table; trans_safe= transactional_tables= main_table->file->has_transactions(); log_delayed= trans_safe || main_table->tmp_table != NO_TMP_TABLE; + table_to_update= 0; - /* Create a temporary table for all tables after except main table */ + /* Create a temporary table for keys to all tables, except main table */ for (table_ref= update_tables; table_ref; table_ref=table_ref->next) { TABLE *table=table_ref->table; - if (table != main_table) - { - uint cnt= table_ref->shared; - ORDER group; - List<Item> temp_fields= *fields_for_table[cnt]; - TMP_TABLE_PARAM *tmp_param= tmp_table_param+cnt; - - /* - Create a temporary table to store all fields that are changed for this - table. The first field in the temporary table is a pointer to the - original row so that we can find and update it - */ - - /* ok to be on stack as this is not referenced outside of this func */ - Field_string offset(table->file->ref_length, 0, "offset", - table, &my_charset_bin); - if (temp_fields.push_front(new Item_field(((Field *) &offset)))) - DBUG_RETURN(1); + uint cnt= table_ref->shared; + List<Item> temp_fields= *fields_for_table[cnt]; + ORDER group; - /* Make an unique key over the first field to avoid duplicated updates */ - bzero((char*) &group, sizeof(group)); - group.asc= 1; - group.item= (Item**) temp_fields.head_ref(); - - tmp_param->quick_group=1; - tmp_param->field_count=temp_fields.elements; - tmp_param->group_parts=1; - tmp_param->group_length= table->file->ref_length; - if (!(tmp_tables[cnt]=create_tmp_table(thd, - tmp_param, - temp_fields, - (ORDER*) &group, 0, 0, - TMP_TABLE_ALL_COLUMNS, - HA_POS_ERROR))) - DBUG_RETURN(1); - tmp_tables[cnt]->file->extra(HA_EXTRA_WRITE_CACHE); + if (table == main_table) // First table in join + { + if (safe_update_on_fly(join->join_tab, &temp_fields)) + { + table_to_update= main_table; // Update table on the fly + continue; + } } + + TMP_TABLE_PARAM *tmp_param= tmp_table_param+cnt; + + /* + Create a temporary table to store all fields that are changed for this + table. The first field in the temporary table is a pointer to the + original row so that we can find and update it + */ + + /* ok to be on stack as this is not referenced outside of this func */ + Field_string offset(table->file->ref_length, 0, "offset", + table, &my_charset_bin); + if (temp_fields.push_front(new Item_field(((Field *) &offset)))) + DBUG_RETURN(1); + + /* Make an unique key over the first field to avoid duplicated updates */ + bzero((char*) &group, sizeof(group)); + group.asc= 1; + group.item= (Item**) temp_fields.head_ref(); + + tmp_param->quick_group=1; + tmp_param->field_count=temp_fields.elements; + tmp_param->group_parts=1; + tmp_param->group_length= table->file->ref_length; + if (!(tmp_tables[cnt]=create_tmp_table(thd, + tmp_param, + temp_fields, + (ORDER*) &group, 0, 0, + TMP_TABLE_ALL_COLUMNS, + HA_POS_ERROR))) + DBUG_RETURN(1); + tmp_tables[cnt]->file->extra(HA_EXTRA_WRITE_CACHE); } DBUG_RETURN(0); } +/* + Check if table is safe to update on fly + + SYNOPSIS + safe_update_on_fly + join_tab How table is used in join + fields Fields that are updated + + NOTES + We can update the first table in join on the fly if we know that + a row in this tabel will never be read twice. This is true under + the folloing conditions: + + - We are doing a table scan and the data is in a separate file (MyISAM) or + if we don't update a clustered key. + + - We are doing a range scan and we don't update the scan key or + the primary key for a clustered table handler. + + WARNING + This code is a bit dependent of how make_join_readinfo() works. + + RETURN + 0 Not safe to update + 1 Safe to update +*/ + +static bool safe_update_on_fly(JOIN_TAB *join_tab, List<Item> *fields) +{ + TABLE *table= join_tab->table; + switch (join_tab->type) { + case JT_SYSTEM: + case JT_CONST: + case JT_EQ_REF: + return 1; // At most one matching row + case JT_REF: + return !check_if_key_used(table, join_tab->ref.key, *fields); + case JT_ALL: + /* If range search on index */ + if (join_tab->quick) + return !check_if_key_used(table, join_tab->quick->index, + *fields); + /* If scanning in clustered key */ + if ((table->file->table_flags() & HA_PRIMARY_KEY_IN_READ_INDEX) && + table->primary_key < MAX_KEY) + return !check_if_key_used(table, table->primary_key, *fields); + return 1; + default: + break; // Avoid compler warning + } + return 0; +} + multi_update::~multi_update() { @@ -645,13 +709,24 @@ bool multi_update::send_data(List<Item> ¬_used_values) for (cur_table= update_tables; cur_table ; cur_table= cur_table->next) { TABLE *table= cur_table->table; - /* Check if we are using outer join and we didn't find the row */ + /* + Check if we are using outer join and we didn't find the row + or if we have already updated this row in the previous call to this + function. + + The same row may be presented here several times in a join of type + UPDATE t1 FROM t1,t2 SET t1.a=t2.a + + In this case we will do the update for the first found row combination. + The join algorithm guarantees that we will not find the a row in + t1 several times. + */ if (table->status & (STATUS_NULL_ROW | STATUS_UPDATED)) continue; uint offset= cur_table->shared; table->file->position(table->record[0]); - if (table == main_table) + if (table == table_to_update) { table->status|= STATUS_UPDATED; store_record(table,1); @@ -745,7 +820,7 @@ int multi_update::do_updates(bool from_send_error) for (cur_table= update_tables; cur_table ; cur_table= cur_table->next) { table = cur_table->table; - if (table == main_table) + if (table == table_to_update) continue; // Already updated org_updated= updated; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 133f2e18ac6..8aecb62f51c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -290,6 +290,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token MAX_UPDATES_PER_HOUR %token MEDIUM_SYM %token MERGE_SYM +%token MEMORY_SYM %token MIN_ROWS %token MYISAM_SYM %token NAMES_SYM @@ -297,6 +298,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token NATURAL %token NEW_SYM %token NCHAR_SYM +%token NCHAR_STRING %token NOT %token NO_SYM %token NULL_SYM @@ -468,6 +470,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token FROM_UNIXTIME %token GEOMCOLLFROMTEXT %token GEOMFROMTEXT +%token GEOMFROMWKB %token GEOMETRYCOLLECTION %token GROUP_UNIQUE_USERS %token HOUR_MINUTE_SYM @@ -582,6 +585,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); IDENT TEXT_STRING REAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text UNDERSCORE_CHARSET IDENT_sys TEXT_STRING_sys TEXT_STRING_db + NCHAR_STRING SP_FUNC ident_or_spfunc %type <lex_str_ptr> @@ -686,9 +690,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); when_list2 expr_list2 handler opt_precision opt_ignore opt_column opt_restrict grant revoke set lock unlock string_list field_options field_option - field_opt_list opt_binary table_lock_list table_lock varchar + field_opt_list opt_binary table_lock_list table_lock ref_list opt_on_delete opt_on_delete_list opt_on_delete_item use - opt_delete_options opt_delete_option + opt_delete_options opt_delete_option varchar nchar nvarchar opt_outer table_list table_name opt_option opt_place opt_attribute opt_attribute_list attribute column_list column_list_id opt_column_list grant_privileges opt_table user_list grant_option @@ -1533,6 +1537,7 @@ table_types: | MYISAM_SYM { $$= DB_TYPE_MYISAM; } | MERGE_SYM { $$= DB_TYPE_MRG_MYISAM; } | HEAP_SYM { $$= DB_TYPE_HEAP; } + | MEMORY_SYM { $$= DB_TYPE_HEAP; } | BERKELEY_DB_SYM { $$= DB_TYPE_BERKELEY_DB; } | INNOBASE_SYM { $$= DB_TYPE_INNODB; }; @@ -1632,7 +1637,8 @@ field_spec: (enum enum_field_types) $3, lex->length,lex->dec,lex->type, lex->default_value, lex->comment, - lex->change,lex->interval,lex->charset)) + lex->change,lex->interval,lex->charset, + lex->uint_geom_type)) YYABORT; }; @@ -1650,11 +1656,20 @@ type: $$=FIELD_TYPE_STRING; } | char opt_binary { Lex->length=(char*) "1"; $$=FIELD_TYPE_STRING; } + | nchar '(' NUM ')' { Lex->length=$3.str; + $$=FIELD_TYPE_STRING; + Lex->charset=national_charset_info; } + | nchar { Lex->length=(char*) "1"; + $$=FIELD_TYPE_STRING; + Lex->charset=national_charset_info; } | BINARY '(' NUM ')' { Lex->length=$3.str; Lex->charset=&my_charset_bin; $$=FIELD_TYPE_STRING; } | varchar '(' NUM ')' opt_binary { Lex->length=$3.str; $$=FIELD_TYPE_VAR_STRING; } + | nvarchar '(' NUM ')' { Lex->length=$3.str; + $$=FIELD_TYPE_VAR_STRING; + Lex->charset=national_charset_info; } | VARBINARY '(' NUM ')' { Lex->length=$3.str; Lex->charset=&my_charset_bin; $$=FIELD_TYPE_VAR_STRING; } @@ -1676,20 +1691,28 @@ type: | BLOB_SYM opt_len { Lex->charset=&my_charset_bin; $$=FIELD_TYPE_BLOB; } | GEOMETRY_SYM { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_GEOMETRY; $$=FIELD_TYPE_GEOMETRY; } | GEOMETRYCOLLECTION { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_GEOMETRYCOLLECTION; $$=FIELD_TYPE_GEOMETRY; } | POINT_SYM { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_POINT; $$=FIELD_TYPE_GEOMETRY; } | MULTIPOINT { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_MULTIPOINT; $$=FIELD_TYPE_GEOMETRY; } | LINESTRING { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_LINESTRING; $$=FIELD_TYPE_GEOMETRY; } | MULTILINESTRING { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_MULTILINESTRING; $$=FIELD_TYPE_GEOMETRY; } | POLYGON { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_POLYGON; $$=FIELD_TYPE_GEOMETRY; } | MULTIPOLYGON { Lex->charset=&my_charset_bin; + Lex->uint_geom_type= Field::GEOM_MULTIPOLYGON; $$=FIELD_TYPE_GEOMETRY; } | MEDIUMBLOB { Lex->charset=&my_charset_bin; $$=FIELD_TYPE_MEDIUM_BLOB; } @@ -1731,14 +1754,24 @@ type: char: CHAR_SYM {} - | NCHAR_SYM {} - | NATIONAL_SYM CHAR_SYM {}; + ; + +nchar: + NCHAR_SYM {} + | NATIONAL_SYM CHAR_SYM {} + ; varchar: char VARYING {} | VARCHAR {} - | NATIONAL_SYM VARCHAR {} - | NCHAR_SYM VARCHAR {}; + ; + +nvarchar: + NATIONAL_SYM VARCHAR {} + | NCHAR_SYM VARCHAR {} + | NATIONAL_SYM CHAR_SYM VARYING {} + | NCHAR_SYM VARYING {} + ; int_type: INT_SYM { $$=FIELD_TYPE_LONG; } @@ -2070,7 +2103,8 @@ alter_list_item: (enum enum_field_types) $5, lex->length,lex->dec,lex->type, lex->default_value, lex->comment, - $3.str, lex->interval, lex->charset)) + $3.str, lex->interval, lex->charset, + lex->uint_geom_type)) YYABORT; } opt_place @@ -2544,11 +2578,6 @@ expr_expr: { $$= new Item_date_add_interval($1,$3,$4,0); } | expr '-' interval_expr interval { $$= new Item_date_add_interval($1,$3,$4,1); } - | expr COLLATE_SYM ident_or_text - { - $$= new Item_func_set_collation($1,new Item_string($3.str,$3.length, - YYTHD->variables.thd_charset)); - } ; /* expressions that begin with 'expr' that do NOT follow IN_SYM */ @@ -2658,6 +2687,11 @@ interval_expr: simple_expr: simple_ident + | simple_expr COLLATE_SYM ident_or_text %prec NEG + { + $$= new Item_func_set_collation($1,new Item_string($3.str,$3.length, + YYTHD->variables.thd_charset)); + } | literal | param_marker | '@' ident_or_text SET_VAR expr @@ -2803,7 +2837,11 @@ simple_expr: | GEOMFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | GEOMFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } + | GEOMFROMWKB '(' expr ')' + { $$= new Item_func_geometry_from_wkb($3); } + | GEOMFROMWKB '(' expr ',' expr ')' + { $$= new Item_func_geometry_from_wkb($3, $5); } | GEOMETRYCOLLECTION '(' expr_list ')' { $$= new Item_func_spatial_collection(* $3, Geometry::wkbGeometryCollection, @@ -2849,7 +2887,7 @@ simple_expr: | GEOMCOLLFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | GEOMCOLLFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } | GREATEST_SYM '(' expr ',' expr_list ')' { $5->push_front($3); $$= new Item_func_max(*$5); } | LEAST_SYM '(' expr ',' expr_list ')' @@ -2861,7 +2899,7 @@ simple_expr: | LINEFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | LINEFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } | MASTER_POS_WAIT '(' expr ',' expr ')' { $$= new Item_master_pos_wait($3, $5); @@ -2884,15 +2922,15 @@ simple_expr: | MLINEFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | MLINEFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } | MPOINTFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | MPOINTFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } | MPOLYFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | MPOLYFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } | MULTIPOINT '(' expr_list ')' { $$= new Item_func_spatial_collection(* $3, Geometry::wkbMultiPoint, Geometry::wkbPoint); } @@ -2912,11 +2950,11 @@ simple_expr: | POINTFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | POINTFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } | POLYFROMTEXT '(' expr ')' { $$= new Item_func_geometry_from_text($3); } | POLYFROMTEXT '(' expr ',' expr ')' - { $$= new Item_func_geometry_from_text($3); } + { $$= new Item_func_geometry_from_text($3, $5); } | POLYGON '(' expr_list ')' { $$= new Item_func_spatial_collection(* $3, Geometry::wkbPolygon, Geometry::wkbLineString); } @@ -3987,7 +4025,8 @@ table_wild_one: } | ident '.' ident opt_wild opt_table_alias { - if (!Select->add_table_to_list(YYTHD, new Table_ident($1, $3, 0), + if (!Select->add_table_to_list(YYTHD, + new Table_ident(YYTHD, $1, $3, 0), $5, TL_OPTION_UPDATING, Lex->lock_option)) YYABORT; @@ -4133,6 +4172,8 @@ show_param: } | charset wild { Lex->sql_command= SQLCOM_SHOW_CHARSETS; } + | COLLATION_SYM wild + { Lex->sql_command= SQLCOM_SHOW_COLLATIONS; } | LOGS_SYM { Lex->sql_command= SQLCOM_SHOW_LOGS; } | GRANTS FOR_SYM user @@ -4419,10 +4460,13 @@ text_literal: thd->charset() : thd->db_charset; $$ = new Item_string($1.str,$1.length,cs); } + | NCHAR_STRING + { $$= new Item_string($1.str,$1.length,national_charset_info); } | UNDERSCORE_CHARSET TEXT_STRING - { $$ = new Item_string($2.str,$2.length,Lex->charset,Item::COER_IMPLICIT); } + { $$ = new Item_string($2.str,$2.length,Lex->charset); } | text_literal TEXT_STRING_db - { ((Item_string*) $1)->append($2.str,$2.length); }; + { ((Item_string*) $1)->append($2.str,$2.length); } + ; text_string: TEXT_STRING_db @@ -4461,6 +4505,13 @@ literal: | NULL_SYM { $$ = new Item_null(); Lex->next_state=MY_LEX_OPERATOR_OR_IDENT;} | HEX_NUM { $$ = new Item_varbinary($1.str,$1.length);} + | UNDERSCORE_CHARSET HEX_NUM + { + Item *tmp= new Item_varbinary($2.str,$2.length); + String *str= tmp ? tmp->val_str((String*) 0) : (String*) 0; + $$ = new Item_string(str ? str->ptr() : "", str ? str->length() : 0, + Lex->charset); + } | DATE_SYM text_literal { $$ = $2; } | TIME_SYM text_literal { $$ = $2; } | TIMESTAMP text_literal { $$ = $2; }; @@ -4562,7 +4613,7 @@ field_ident: table_ident: ident { $$=new Table_ident($1); } - | ident '.' ident { $$=new Table_ident($1,$3,0);} + | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);} | '.' ident { $$=new Table_ident($2);} /* For Delphi */; @@ -4751,6 +4802,7 @@ keyword: | MAX_UPDATES_PER_HOUR {} | MEDIUM_SYM {} | MERGE_SYM {} + | MEMORY_SYM {} | MINUTE_SYM {} | MIN_ROWS {} | MODIFY_SYM {} @@ -4897,12 +4949,18 @@ option_value: find_sys_var("tx_isolation"), new Item_int((int32) $4))); } - | charset opt_equal set_expr_or_default + | charset set_expr_or_default { - LEX *lex=Lex; + THD *thd= YYTHD; + LEX *lex= &thd->lex; + if (!$2) + { + CHARSET_INFO *cl= thd->db_charset; + $2= new Item_string(cl->name, strlen(cl->name), &my_charset_latin1); + } lex->var_list.push_back(new set_var(lex->option_type, - find_sys_var("convert_character_set"), - $3)); + find_sys_var("client_collation"), + $2)); } | NAMES_SYM charset_name_or_default opt_collate { diff --git a/sql/stacktrace.c b/sql/stacktrace.c index 762c45e7184..d0478052fb1 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -197,7 +197,7 @@ terribly wrong...\n"); fprintf(stderr, "Stack trace seems successful - bottom reached\n"); end: - fprintf(stderr, "Please read http://www.mysql.com/doc/U/s/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved\n\ + fprintf(stderr, "Please read http://www.mysql.com/doc/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved\n\ stack trace is much more helpful in diagnosing the problem, so please do \n\ resolve it\n"); } diff --git a/sql/table.cc b/sql/table.cc index 08f6e29489d..9bea4a09b05 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -371,6 +371,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, uint pack_flag, interval_nr, unireg_type, recpos, field_length; enum_field_types field_type; CHARSET_INFO *charset=NULL; + Field::geometry_type geom_type= Field::GEOM_GEOMETRY; LEX_STRING comment; if (new_frm_ver == 3) @@ -384,9 +385,19 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, uint comment_length=uint2korr(strpos+15); field_type=(enum_field_types) (uint) strpos[13]; - if (!(charset=get_charset((uint) strpos[14], MYF(0)))) - charset= (outparam->table_charset ? outparam->table_charset: + + // charset and geometry_type share the same byte in frm + if (field_type == FIELD_TYPE_GEOMETRY) + { + geom_type= (Field::geometry_type) strpos[14]; + charset= &my_charset_bin; + } + else + { + if (!(charset=get_charset((uint) strpos[14], MYF(0)))) + charset= (outparam->table_charset ? outparam->table_charset: default_charset_info); + } if (!comment_length) { comment.str= (char*) ""; @@ -420,6 +431,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, pack_flag, field_type, charset, + geom_type, (Field::utype) MTYP_TYPENR(unireg_type), (interval_nr ? outparam->intervals+interval_nr-1 : @@ -515,6 +527,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, keyinfo->key_length+= HA_KEY_NULL_LENGTH; } if (field->type() == FIELD_TYPE_BLOB || + field->type() == FIELD_TYPE_GEOMETRY || field->real_type() == FIELD_TYPE_VAR_STRING) { if (field->type() == FIELD_TYPE_BLOB) @@ -531,7 +544,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (i == 0) field->key_start|= ((key_map) 1 << key); if (field->key_length() == key_part->length && - field->type() != FIELD_TYPE_BLOB) + !(field->flags & BLOB_FLAG)) { if ((index_flags & HA_KEY_READ_ONLY) && (field->key_type() != HA_KEYTYPE_TEXT || @@ -560,7 +573,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (field->key_length() != key_part->length) { key_part->key_part_flag|= HA_PART_KEY; - if (field->type() != FIELD_TYPE_BLOB) + if (!(field->flags & BLOB_FLAG)) { // Create a new field field=key_part->field=field->new_field(&outparam->mem_root, outparam); @@ -1229,6 +1242,8 @@ bool check_db_name(char *name) bool check_table_name(const char *name, uint length) { const char *end= name+length; + if (!length || length > NAME_LEN) + return 1; while (name != end) { @@ -1243,7 +1258,7 @@ bool check_table_name(const char *name, uint length) } } #endif - if (*name == '/' || *name == FN_LIBCHAR || *name == FN_EXTCHAR) + if (*name == '/' || *name == '\\' || *name == FN_EXTCHAR) return 1; name++; } @@ -1252,6 +1267,8 @@ bool check_table_name(const char *name, uint length) bool check_column_name(const char *name) { + const char *start= name; + while (*name) { #if defined(USE_MB) && defined(USE_MB_IDENT) @@ -1270,7 +1287,8 @@ bool check_column_name(const char *name) return 1; name++; } - return 0; + /* Error if empty or too long column name */ + return (name == start || (uint) (name - start) > NAME_LEN); } /* diff --git a/sql/unireg.cc b/sql/unireg.cc index fa843fe5d1e..5e723281d3f 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -458,7 +458,10 @@ static bool pack_fields(File file,List<create_field> &create_fields) int2store(buff+10,field->unireg_check); buff[12]= (uchar) field->interval_id; buff[13]= (uchar) field->sql_type; - buff[14]= (uchar) field->charset->number; + if (field->sql_type == FIELD_TYPE_GEOMETRY) + buff[14]= (uchar) field->geom_type; + else + buff[14]= (uchar) field->charset->number; int2store(buff+15, field->comment.length); comment_length+= field->comment.length; set_if_bigger(int_count,field->interval_id); @@ -573,6 +576,7 @@ static bool make_empty_rec(File file,enum db_type table_type, field->pack_flag, field->sql_type, field->charset, + field->geom_type, field->unireg_check, field->interval, field->field_name, diff --git a/sql/unireg.h b/sql/unireg.h index 2dc84720b2d..9430329e67a 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -63,6 +63,13 @@ #define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD) #define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD) + +/* Memory allocated when parsing a statement / saving a statement */ +#define MEM_ROOT_BLOCK_SIZE 8192 +#define MEM_ROOT_PREALLOC 8192 +#define TRANS_MEM_ROOT_BLOCK_SIZE 4096 +#define TRANS_MEM_ROOT_PREALLOC 4096 + #define DEFAULT_ERROR_COUNT 64 #define DEFAULT_PREP_STMT_COUNT 64 #define EXTRA_RECORDS 10 /* Extra records in sort */ @@ -84,7 +91,7 @@ #define SPECIAL_USE_LOCKS 1 /* Lock used databases */ #define SPECIAL_NO_NEW_FUNC 2 /* Skip new functions */ -#define SPECIAL_NEW_FUNC 4 /* New nonstandard functions */ +#define SPECIAL_SKIP_SHOW_DB 4 /* Don't allow 'show db' */ #define SPECIAL_WAIT_IF_LOCKED 8 /* Wait if locked database */ #define SPECIAL_SAME_DB_NAME 16 /* form name = file name */ #define SPECIAL_ENGLISH 32 /* English error messages */ @@ -94,7 +101,6 @@ #define SPECIAL_NO_HOST_CACHE 512 /* Don't cache hosts */ #define SPECIAL_LONG_LOG_FORMAT 1024 #define SPECIAL_SAFE_MODE 2048 -#define SPECIAL_SKIP_SHOW_DB 4096 /* Don't allow 'show db' */ /* Extern defines */ #define store_record(A,B) bmove_allign((A)->record[B],(A)->record[0],(size_t) (A)->reclength) diff --git a/strings/Makefile.am b/strings/Makefile.am index ee1ce59d0d1..1db96f5fda5 100644 --- a/strings/Makefile.am +++ b/strings/Makefile.am @@ -22,19 +22,19 @@ pkglib_LIBRARIES = libmystrings.a # Exact one of ASSEMBLER_X if ASSEMBLER_x86 ASRCS = strings-x86.s longlong2str-x86.s -CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c +CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c else if ASSEMBLER_sparc32 # These file MUST all be on the same line!! Otherwise automake # generats a very broken makefile ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s -CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c +CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c else #no assembler ASRCS = # These file MUST all be on the same line!! Otherwise automake # generats a very broken makefile -CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c +CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c endif endif @@ -44,7 +44,7 @@ DISTCLEANFILES = ctype_autoconf.c # Default charset definitions EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-win1250ch.c \ ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \ - ctype-tis620.c ctype-ujis.c ctype-latin1_de.c \ + ctype-tis620.c ctype-ujis.c \ xml.c strto.c strings-x86.s \ longlong2str.c longlong2str-x86.s \ strxmov.c bmove_upp.c strappend.c strcont.c strend.c \ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 11e40dcf32f..d8f8a43ad34 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -607,11 +607,11 @@ int my_strnncollsp_czech(CHARSET_INFO * cs, CHARSET_INFO my_charset_czech = { - 2,0,0, /* number */ + 2,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ - "latin2", /* cs name */ - "czech", /* name */ - "", /* comment */ + "latin2", /* cs name */ + "latin2_czech_ci", /* name */ + "", /* comment */ ctype_czech, to_lower_czech, to_upper_czech, diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index b95228c9f65..9358b406f93 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -17,3973 +17,7 @@ #include <my_global.h> #include <m_ctype.h> - -#ifndef HAVE_CHARSET_latin1 -#define HAVE_CHARSET_latin1 -#endif - -#if defined(HAVE_CHARSET_latin1)||defined(HAVE_CHARSET_latin1_de)||\ -defined(HAVE_CHARSET_danish)||defined(HAVE_CHARSET_german1) - -static uint16 tab_8859_1_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, -0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, -0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, -0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, -0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, -0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, -0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, -0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, -0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF -}; - -static uchar tab_uni_8859_1_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}; - -static MY_UNI_IDX idx_uni_8859_1[]={ - {0x0000,0x00FF,tab_uni_8859_1_plane00}, - {0,0,NULL} -}; -#endif - -#if defined(HAVE_CHARSET_latin2)||defined(HAVE_CHARSET_croat)||\ -defined(HAVE_CHARSET_hungarian) - -static uint16 tab_8859_2_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, -0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, -0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, -0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; - - -/* 0000-00FD , 254 chars */ -static uchar tab_uni_8859_2_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0x00,0x00,0x00,0xA4,0x00,0x00,0xA7,0xA8,0x00,0x00,0x00,0x00,0xAD,0x00,0x00, -0xB0,0x00,0x00,0x00,0xB4,0x00,0x00,0x00,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0xC1,0xC2,0x00,0xC4,0x00,0x00,0xC7,0x00,0xC9,0x00,0xCB,0x00,0xCD,0xCE,0x00, -0x00,0x00,0x00,0xD3,0xD4,0x00,0xD6,0xD7,0x00,0x00,0xDA,0x00,0xDC,0xDD,0x00,0xDF, -0x00,0xE1,0xE2,0x00,0xE4,0x00,0x00,0xE7,0x00,0xE9,0x00,0xEB,0x00,0xED,0xEE,0x00, -0x00,0x00,0x00,0xF3,0xF4,0x00,0xF6,0xF7,0x00,0x00,0xFA,0x00,0xFC,0xFD}; - -/* 0102-017E , 125 chars */ -static uchar tab_uni_8859_2_plane01[]={ -0xC3,0xE3,0xA1,0xB1,0xC6,0xE6,0x00,0x00,0x00,0x00,0xC8,0xE8,0xCF,0xEF,0xD0,0xF0, -0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xEA,0xCC,0xEC,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC5,0xE5,0x00,0x00,0xA5,0xB5,0x00,0x00,0xA3, -0xB3,0xD1,0xF1,0x00,0x00,0xD2,0xF2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0xF5, -0x00,0x00,0xC0,0xE0,0x00,0x00,0xD8,0xF8,0xA6,0xB6,0x00,0x00,0xAA,0xBA,0xA9,0xB9, -0xDE,0xFE,0xAB,0xBB,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD9,0xF9,0xDB,0xFB, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xBC,0xAF,0xBF,0xAE,0xBE}; - -/* 02C7-02DD , 23 chars */ -static uchar tab_uni_8859_2_plane02[]={ -0xB7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0xA2,0xFF,0x00,0xB2,0x00,0xBD}; - -static MY_UNI_IDX idx_uni_8859_2[]={ - {0x0000,0x00FD,tab_uni_8859_2_plane00}, - {0x0102,0x017E,tab_uni_8859_2_plane01}, - {0x02C7,0x02DD,tab_uni_8859_2_plane02}, - {0,0,NULL} -}; -#endif - -#if defined(HAVE_CHARSET_cp1251) || defined(HAVE_CHARSET_win1251) || defined(HAVE_CHARSET_win1251ukr) -static uint16 tab_cp1251_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021, - 0,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F, -0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, - 0,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F, -0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7, -0x0401,0x00A9,0x0404,0x00AB,0x00AC,0x00AD,0x00AE,0x0407, -0x00B0,0x00B1,0x0406,0x0456,0x0491,0x00B5,0x00B6,0x00B7, -0x0451,0x2116,0x0454,0x00BB,0x0458,0x0405,0x0455,0x0457, -0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, -0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, -0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, -0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, -0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437, -0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E,0x043F, -0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447, -0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,0x044E,0x044F -}; - -/* 0000-00BB , 188 chars */ -static uchar tab_uni_cp1251_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0x00,0x00,0x00,0xA4,0x00,0xA6,0xA7,0x00,0xA9,0x00,0xAB,0xAC,0xAD,0xAE,0x00, -0xB0,0xB1,0x00,0x00,0x00,0xB5,0xB6,0xB7,0x00,0x00,0x00,0xBB}; - -/* 0401-0491 , 145 chars */ -static uchar tab_uni_cp1251_plane04[]={ -0xA8,0x80,0x81,0xAA,0xBD,0xB2,0xAF,0xA3,0x8A,0x8C,0x8E,0x8D,0x00,0xA1,0x8F,0xC0, -0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0, -0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0, -0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0, -0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,0x00, -0xB8,0x90,0x83,0xBA,0xBE,0xB3,0xBF,0xBC,0x9A,0x9C,0x9E,0x9D,0x00,0xA2,0x9F,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA5, -0xB4}; - -/* 2013-203A , 40 chars */ -static uchar tab_uni_cp1251_plane20[]={ -0x96,0x97,0x00,0x00,0x00,0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00,0x86,0x87,0x95, -0x00,0x00,0x00,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0x9B}; - -/* 2116-2122 , 13 chars */ -static uchar tab_uni_cp1251_plane21[]={ -0xB9,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x99}; - -static MY_UNI_IDX idx_uni_cp1251[]={ - {0x0000,0x00BB,tab_uni_cp1251_plane00}, - {0x0401,0x0491,tab_uni_cp1251_plane04}, - {0x2013,0x203A,tab_uni_cp1251_plane20}, - {0x2116,0x2122,tab_uni_cp1251_plane21}, - {0,0,NULL} -}; -#endif - - - -#ifdef HAVE_CHARSET_armscii8 -static uchar ctype_armscii8[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 16, 16 -}; - -static uchar to_lower_armscii8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,184,169,170,171,172,173,174,175, - 176,177,179,179,181,181,183,183,185,185,187,187,189,189,191,191, - 193,193,195,195,197,197,199,199,201,201,203,203,205,205,207,207, - 209,209,211,211,213,213,215,215,217,217,219,219,221,221,223,223, - 225,225,227,227,229,229,231,231,233,233,235,235,237,237,239,239, - 241,241,243,243,245,245,247,247,249,249,251,251,253,253,254,255 -}; - -static uchar to_upper_armscii8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,178,180,180,182,182,184,184,186,186,188,188,190,190, - 192,192,194,194,196,196,198,198,200,200,202,202,204,204,206,206, - 208,208,210,210,212,212,214,214,216,216,218,218,220,220,222,222, - 224,224,226,226,228,228,230,230,232,232,234,234,236,236,238,238, - 240,240,242,242,244,244,246,246,248,248,250,250,252,252,254,255 -}; - -static uchar sort_order_armscii8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uint16 tab_armscii_8_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, -0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, -0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, -0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, -0x00A0,0x2741,0x00A7,0x0589,0x0029,0x0028,0x00BB,0x00AB, -0x2014,0x002E,0x055D,0x002C,0x002D,0x055F,0x2026,0x055C, -0x055B,0x055E,0x0531,0x0561,0x0532,0x0562,0x0533,0x0563, -0x0534,0x0564,0x0535,0x0565,0x0536,0x0566,0x0537,0x0567, -0x0538,0x0568,0x0539,0x0569,0x053A,0x056A,0x053B,0x056B, -0x053C,0x056C,0x053D,0x056D,0x053E,0x056E,0x053F,0x056F, -0x0540,0x0570,0x0541,0x0571,0x0542,0x0572,0x0543,0x0573, -0x0544,0x0574,0x0545,0x0575,0x0546,0x0576,0x0547,0x0577, -0x0548,0x0578,0x0549,0x0579,0x054A,0x057A,0x054B,0x057B, -0x054C,0x057C,0x054D,0x057D,0x054E,0x057E,0x054F,0x057F, -0x0550,0x0580,0x0551,0x0581,0x0552,0x0582,0x0553,0x0583, -0x0554,0x0584,0x0555,0x0585,0x0556,0x0586,0x2019,0x0027 -}; - - -/* 0000-00BB , 188 chars */ -static uchar tab_uni_armscii_8_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0xFF,0xA5,0xA4,0x2A,0x2B,0xAB,0xAC,0xA9,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F, -0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, -0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0xA2,0x00,0x00,0x00,0xA7,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA6}; - -/* 0531-0589 , 89 chars */ -static uchar tab_uni_armscii_8_plane05[]={ -0xB2,0xB4,0xB6,0xB8,0xBA,0xBC,0xBE,0xC0,0xC2,0xC4,0xC6,0xC8,0xCA,0xCC,0xCE,0xD0, -0xD2,0xD4,0xD6,0xD8,0xDA,0xDC,0xDE,0xE0,0xE2,0xE4,0xE6,0xE8,0xEA,0xEC,0xEE,0xF0, -0xF2,0xF4,0xF6,0xF8,0xFA,0xFC,0x00,0x00,0x00,0x00,0xB0,0xAF,0xAA,0xB1,0xAD,0x00, -0xB3,0xB5,0xB7,0xB9,0xBB,0xBD,0xBF,0xC1,0xC3,0xC5,0xC7,0xC9,0xCB,0xCD,0xCF,0xD1, -0xD3,0xD5,0xD7,0xD9,0xDB,0xDD,0xDF,0xE1,0xE3,0xE5,0xE7,0xE9,0xEB,0xED,0xEF,0xF1, -0xF3,0xF5,0xF7,0xF9,0xFB,0xFD,0x00,0x00,0xA3}; - -/* 2014-2026 , 19 chars */ -static uchar tab_uni_armscii_8_plane20[]={ -0xA8,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0xAE}; - -/* 2741-2741 , 1 chars */ -static uchar tab_uni_armscii_8_plane27[]={ -0xA1}; - - -static MY_UNI_IDX idx_uni_armscii_8[]={ - {0x0000,0x00BB,tab_uni_armscii_8_plane00}, - {0x0531,0x0589,tab_uni_armscii_8_plane05}, - {0x2014,0x2026,tab_uni_armscii_8_plane20}, - {0x2741,0x2741,tab_uni_armscii_8_plane27}, - {0,0,NULL} -}; - -#endif - - -#ifdef HAVE_CHARSET_cp1251 - -/* The cp1251 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_cp1251[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_cp1251[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,184,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_cp1251[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,168,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 -}; - -static uchar sort_order_cp1251[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,124,125,126,127,128, - 129, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,130,131,132,133,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255, 97,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255, 97,255,255,255,255,255,255,255, - 91, 92, 93, 94, 95, 96, 98, 99,100,101,102,103,104,105,106,107, - 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123, - 91, 92, 93, 94, 95, 96, 98, 99,100,101,102,103,104,105,106,107, - 108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123 -}; - -#endif - - -#ifdef HAVE_CHARSET_cp1257 - -/* The cp1257 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_cp1257[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, - 2, 2, 0, 0, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0 -}; - -static uchar to_lower_cp1257[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,194,195,196,197,230,199,232,201,202,235,204,205,206,207, - 240,209,210,211,212,213,214,215,248,217,218,251,220,221,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_cp1257[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,226,227,228,229,198,231,200,233,234,203,236,237,238,239, - 208,241,242,243,244,245,246,247,216,249,250,219,252,253,222,255 -}; - -static uchar sort_order_cp1257[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 67, 68, 70, 71, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 91, 92, 95, 96, 97, 78,255, 98, 99,100,101,102, - 103, 65, 67, 68, 70, 71, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 91, 92, 95, 96, 97, 78,255,104,105,106,107,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 66, 79,255,255,255,255, 72,255, 69,255,255, 73,255,255,255,255, - 90,255,255,255,255,255,255,255, 94,255,255, 93,255,255,255,255, - 255, 79,255,255,255,255, 72,255, 69,255,255, 73,255,255,255,255, - 90,255,255,255,255,255,255,255, 94,255,255, 93,255,255,255,255 -}; - -static uint16 tab_cp1257_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC, 0,0x201A, 0,0x201E,0x2026,0x2020,0x2021, - 0,0x2030, 0,0x2039, 0,0x00A8,0x02C7,0x00B8, - 0,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, - 0,0x2122, 0,0x203A, 0,0x00AF,0x02DB, 0, -0x00A0, 0,0x00A2,0x00A3,0x00A4, 0,0x00A6,0x00A7, -0x00D8,0x00A9,0x0156,0x00AB,0x00AC,0x00AD,0x00AE,0x00C6, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00F8,0x00B9,0x0157,0x00BB,0x00BC,0x00BD,0x00BE,0x00E6, -0x0104,0x012E,0x0100,0x0106,0x00C4,0x00C5,0x0118,0x0112, -0x010C,0x00C9,0x0179,0x0116,0x0122,0x0136,0x012A,0x013B, -0x0160,0x0143,0x0145,0x00D3,0x014C,0x00D5,0x00D6,0x00D7, -0x0172,0x0141,0x015A,0x016A,0x00DC,0x017B,0x017D,0x00DF, -0x0105,0x012F,0x0101,0x0107,0x00E4,0x00E5,0x0119,0x0113, -0x010D,0x00E9,0x017A,0x0117,0x0123,0x0137,0x012B,0x013C, -0x0161,0x0144,0x0146,0x00F3,0x014D,0x00F5,0x00F6,0x00F7, -0x0173,0x0142,0x015B,0x016B,0x00FC,0x017C,0x017E,0x02D9 -}; - - -/* 0000-00FC , 253 chars */ -static uchar tab_uni_cp1257_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0x00,0xA2,0xA3,0xA4,0x00,0xA6,0xA7,0x8D,0xA9,0x00,0xAB,0xAC,0xAD,0xAE,0x9D, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0x8F,0xB9,0x00,0xBB,0xBC,0xBD,0xBE,0x00, -0x00,0x00,0x00,0x00,0xC4,0xC5,0xAF,0x00,0x00,0xC9,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0xD3,0x00,0xD5,0xD6,0xD7,0xA8,0x00,0x00,0x00,0xDC,0x00,0x00,0xDF, -0x00,0x00,0x00,0x00,0xE4,0xE5,0xBF,0x00,0x00,0xE9,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0xF3,0x00,0xF5,0xF6,0xF7,0xB8,0x00,0x00,0x00,0xFC}; - -/* 0100-017E , 127 chars */ -static uchar tab_uni_cp1257_plane01[]={ -0xC2,0xE2,0x00,0x00,0xC0,0xE0,0xC3,0xE3,0x00,0x00,0x00,0x00,0xC8,0xE8,0x00,0x00, -0x00,0x00,0xC7,0xE7,0x00,0x00,0xCB,0xEB,0xC6,0xE6,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0xCC,0xEC,0x00,0x00,0x00,0x00,0x00,0x00,0xCE,0xEE,0x00,0x00,0xC1,0xE1, -0x00,0x00,0x00,0x00,0x00,0x00,0xCD,0xED,0x00,0x00,0x00,0xCF,0xEF,0x00,0x00,0x00, -0x00,0xD9,0xF9,0xD1,0xF1,0xD2,0xF2,0x00,0x00,0x00,0x00,0x00,0xD4,0xF4,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xBA,0x00,0x00,0xDA,0xFA,0x00,0x00,0x00,0x00, -0xD0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xFB,0x00,0x00,0x00,0x00, -0x00,0x00,0xD8,0xF8,0x00,0x00,0x00,0x00,0x00,0xCA,0xEA,0xDD,0xFD,0xDE,0xFE}; - -/* 2013-20AC , 154 chars */ -static uchar tab_uni_cp1257_plane20[]={ -0x96,0x97,0x00,0x00,0x00,0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00,0x86,0x87,0x95, -0x00,0x00,0x00,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0x9B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80}; - -/* 02C7-02DB , 21 chars */ -static uchar tab_uni_cp1257_plane02[]={ -0x8E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0xFF,0x00,0x9E}; - -/* 2122-2122 , 1 chars */ -static uchar tab_uni_cp1257_plane21[]={ -0x99}; - -static MY_UNI_IDX idx_uni_cp1257[]={ - {0x0000,0x00FC,tab_uni_cp1257_plane00}, - {0x0100,0x017E,tab_uni_cp1257_plane01}, - {0x2013,0x20AC,tab_uni_cp1257_plane20}, - {0x02C7,0x02DB,tab_uni_cp1257_plane02}, - {0x2122,0x2122,tab_uni_cp1257_plane21}, - {0,0,NULL} -}; - -#endif - - -#ifdef HAVE_CHARSET_croat - -/* The croat character set. Generated by - * the ./conf_to_src program - */ - -static uchar ctype_croat[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_croat[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,154,139,140,141,158,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_croat[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,138,155,156,157,142,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_croat[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137, 87,139,140,141, 95,143, - 144,145,146,147,148,149,150,151,152,153, 87,155,156,157, 95,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 65, 65, 65, 65, 92, 91, 69, 67, 68, 69, 69, 69, 73, 73, 73, 73, - 71, 78, 79, 79, 79, 79, 93,215,216, 85, 85, 85, 89, 89,222,223, - 65, 65, 65, 65, 92, 91, 69, 67, 68, 69, 69, 69, 73, 73, 73, 73, - 71, 78, 79, 79, 79, 79, 93,247,216, 85, 85, 85, 89, 89,222,255 -}; -#endif - - -#ifdef HAVE_CHARSET_danish - -/* The danish character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_danish[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_danish[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_danish[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_danish[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 65, 65, 65, 65, 91, 93, 91, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79, 92,215, 92, 85, 85, 85, 89, 89,222,223, - 65, 65, 65, 65, 91, 93, 91, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79, 92,247, 92, 85, 85, 85, 89, 89,222,255 -}; -#endif - - - -#ifdef HAVE_CHARSET_dec8 - -/* The dec8 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_dec8[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_dec8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_dec8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_dec8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 65, 65, 65, 65, 92, 91, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79, 93,215,216, 85, 85, 85, 89, 89,222,223, - 65, 65, 65, 65, 92, 91, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79, 93,247,216, 85, 85, 85, 89, 89,222,255 -}; -#endif - - -#ifdef HAVE_CHARSET_dos - -/* The dos character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_dos[] = { - 0, - 32, 48, 48, 48, 48, 48, 48, 32, 32, 40, 40, 40, 40, 40, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 32, 48, 48, 48, 48, 48, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 48, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, - 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 1, 16, 16, 16, 16, 16, - 2, 2, 2, 2, 2, 1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 32 -}; - -static uchar to_lower_dos[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 135,129,130,131,132,133,134,135,136,137,138,139,140,141,132,134, - 130,145,145,147,148,149,150,151,152,148,129,155,156,157,158,159, - 160,161,162,163,164,164,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_dos[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,154,144, 65,142, 65,143,128, 69, 69, 69, 73, 73, 73,142,143, - 144,146,146, 79,153, 79, 85, 85, 89,153,154,155,156,157,158,159, - 65, 73, 79, 85,165,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_dos[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 67, 89, 69, 65, 92, 65, 91, 67, 69, 69, 69, 73, 73, 73, 92, 91, - 69, 92, 92, 79, 93, 79, 85, 85, 89, 93, 89, 36, 36, 36, 36, 36, - 65, 73, 79, 85, 78, 78,166,167, 63,169,170,171,172, 33, 34, 34, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; -#endif - -#ifdef HAVE_CHARSET_estonia - -/* The estonia character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_estonia[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_estonia[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,184,169,186,171,172,173,174,191, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_estonia[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,168,185,170,187,188,189,190,175, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_estonia[] = { - 0, 2, 3, 4, 5, 6, 7, 8, 9, 46, 47, 48, 49, 50, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 44, 51, 52, 53, 54, 55, 56, 39, 57, 58, 59, 93, 60, 40, 61, 62, - 118,122,124,126,128,129,130,131,132,133, 63, 64, 94, 95, 96, 65, - 66,134,144,146,152,154,164,166,170,172,178,180,184,190,192,198, - 206,208,210,214,229,232,238,240,250,252,221, 67, 68, 69, 70, 71, - 72,135,145,147,153,155,165,167,171,173,179,181,185,191,193,199, - 207,209,211,215,230,233,239,241,251,253,222, 73, 74, 75, 76, 28, - 1, 29, 87, 30, 90,116,113,114, 31,117, 32, 91, 33, 78, 82, 81, - 34, 85, 86, 88, 89,115, 42, 43, 35,231, 36, 92, 37, 79, 84, 38, - 45,254,102,103,104,255, 77,105,204,106,212, 98,107, 41,108,142, - 109, 97,125,127, 80,110,111,112,205,123,213, 99,119,120,121,143, - 140,176,136,148,244,138,162,160,150,156,223,158,168,182,174,186, - 219,194,196,200,202,242,246,100,236,188,216,234,248,225,227,218, - 141,177,137,149,245,139,163,161,151,157,224,159,169,183,175,187, - 220,195,197,201,203,243,247,101,237,189,217,235,249,226,228, 83 -}; -#endif - -#ifdef HAVE_CHARSET_german1 - -/* The german1 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_german1[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_german1[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_german1[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_german1[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 65, 65, 65, 65, 65, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 208, 78, 79, 79, 79, 79, 79,215, 79, 85, 85, 85, 85, 89,222, 83, - 65, 65, 65, 65, 65, 65, 65, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 208, 78, 79, 79, 79, 79, 79,247, 79, 85, 85, 85, 85, 89,222,255 -}; -#endif - -#ifdef HAVE_CHARSET_greek_bad - -/* The greek character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_greek[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 0, 0, 16, 16, 16, 16, 0, 16, 16, 16, 0, 16, - 16, 16, 16, 16, 16, 16, 1, 16, 1, 1, 1, 16, 1, 16, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0 -}; - -static uchar to_lower_greek[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,220,183,221,222,223,187,252,189,253,254, - 192,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,210,243,244,245,246,247,248,249,250,251,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_greek[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 218,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,193,197,199,201, - 219,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,211,211,212,213,214,215,216,217,218,219,207,213,217,255 -}; - -static uchar sort_order_greek[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,193,183,197,199,201,187,207,189,213,217, - 201,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,201,213,193,197,199,201, - 213,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,211,211,212,213,214,215,216,217,201,213,207,213,217,255 -}; -#endif - -#ifdef HAVE_CHARSET_hebrew - -/* The hebrew character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_hebrew[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0 -}; - -static uchar to_lower_hebrew[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_hebrew[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_hebrew[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; -#endif - -#ifdef HAVE_CHARSET_hp8 - -/* The hp8 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_hp8[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 32, 32, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 2, 16, 16, 16, 16, 16, 16, 2, 16, 2, 2, - 1, 16, 16, 1, 2, 16, 16, 2, 1, 16, 1, 1, 1, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 32, 32, 32, 32, 16, 16, 16, 16, 16, 16, 16, 16, 16, 32 -}; - -static uchar to_lower_hp8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,200,192,201,193,205,209,221,168,169,170,171,172,203,195,175, - 176,178,178,179,181,181,183,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 212,209,214,215,212,213,214,215,204,217,206,207,197,221,222,194, - 196,226,226,228,228,213,217,198,202,234,234,236,236,199,239,239, - 241,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_hp8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,177,179,180,180,182,182,184,185,186,187,188,189,190,191, - 162,164,223,174,224,220,231,237,161,163,232,173,216,165,218,219, - 208,166,210,211,208,229,210,211,216,230,218,219,220,167,222,223, - 224,225,225,227,227,229,230,231,232,233,233,235,235,237,238,238, - 240,240,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_hp8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 93, 91, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; -#endif - -#ifdef HAVE_CHARSET_hungarian - -/* The hungarian character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_hungarian[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 72, - 1, 16, 1, 16, 1, 1, 16, 0, 0, 1, 1, 1, 1, 16, 1, 1, - 16, 2, 16, 2, 16, 2, 2, 16, 16, 2, 2, 2, 2, 16, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 16, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 16, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 16 -}; - -static uchar to_lower_hungarian[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,139,139,161,161,142,160, - 130,145,146,147,148,162,150,163,150,148,129,155,156,157,158,159, - 160,161,162,163,181,182,166,147,168,185,186,187,188,173,190,191, - 176,177,178,179,180,225,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 208,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 162,225,226,227,228,229,230,231,232,233,234,150,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_hungarian[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,154,144,131,132,133,134,135,136,137,138,138,140,141,142,143, - 144,145,146,167,153,149,152,151,152,153,154,155,156,157,158,159, - 143,141,149,151,164,165,166,167,168,169,170,171,172,173,174,175, - 176,160,178,162,180,181,165,183,184,169,170,171,172,189,174,175, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,193,194,195,196,197,198,199,200,201,202,235,204,205,206,207, - 240,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_hungarian[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 71, 72, 76, 78, 83, 84, 85, 86, 90, 91, 92, 96, 97,100, - 105,106,107,110,114,117,122,123,124,125,127,131,132,133,134,135, - 136, 65, 71, 72, 76, 78, 83, 84, 85, 86, 90, 91, 92, 96, 97,100, - 105,106,107,110,114,117,122,123,124,125,127,137,138,139,140, 0, - 1,120, 78, 4, 5, 6, 7, 8, 9, 10,103,103, 86, 86, 15, 65, - 78, 18, 19,103,103,100,120,117,120,103,120, 28, 29, 30, 31,255, - 65, 86,100,117, 94,111,255,103,255,112,113,115,128,255,129,130, - 255, 66,255, 93,255, 65,111,255,255,112,113,115,128,255,129,130, - 108, 65, 68, 69, 70, 95, 73, 75, 74, 78, 81, 82, 80, 86, 87, 77, - 255, 98, 99,100,102,103,103,255,109,119,117,120,120,126,116,255, - 100, 65, 68, 69, 70, 95, 73, 75, 74, 78, 81,120, 80, 86, 88, 77, - 255, 98, 99,100,102,103,103,255,109,119,117,120,120,126,116,255 -}; -#endif - -#ifdef HAVE_CHARSET_koi8_ru - -/* The koi8_ru character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_koi8_ru[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 2, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -}; - -static uchar to_lower_koi8_ru[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,163,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 -}; - -static uchar to_upper_koi8_ru[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,179,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_koi8_ru[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,229,163,164,165,166,167,168,169,170,171,172,173,174, - 175,176,177,229,178,179,180,181,182,183,184,185,186,187,188,189, - 254,223,224,246,227,228,244,226,245,232,233,234,235,236,237,238, - 239,255,240,241,242,243,230,225,252,251,231,248,253,249,247,250, - 254,223,224,246,227,228,244,226,245,232,233,234,235,236,237,238, - 239,255,240,241,242,243,230,225,252,251,231,248,253,249,247,250 -}; - -static uint16 tab_koi8_r_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, -0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, -0x2591,0x2592,0x2593,0x2320,0x25A0,0x2219,0x221A,0x2248, -0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, -0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556, -0x2557,0x2558,0x2559,0x255A,0x255B,0x255C,0x255D,0x255E, -0x255F,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565, -0x2566,0x2567,0x2568,0x2569,0x256A,0x256B,0x256C,0x00A9, -0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, -0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, -0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, -0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, -0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, -0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, -0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, -0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A -}; - - -/* 0000-00F7 , 248 chars */ -static uchar tab_uni_koi8_r_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x9A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0x00,0x00,0x00,0x00,0x00,0x00, -0x9C,0x00,0x9D,0x00,0x00,0x00,0x00,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9F}; - -/* 0401-0451 , 81 chars */ -static uchar tab_uni_koi8_r_plane04[]={ -0xB3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE1, -0xE2,0xF7,0xE7,0xE4,0xE5,0xF6,0xFA,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF2, -0xF3,0xF4,0xF5,0xE6,0xE8,0xE3,0xFE,0xFB,0xFD,0xFF,0xF9,0xF8,0xFC,0xE0,0xF1,0xC1, -0xC2,0xD7,0xC7,0xC4,0xC5,0xD6,0xDA,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD2, -0xD3,0xD4,0xD5,0xC6,0xC8,0xC3,0xDE,0xDB,0xDD,0xDF,0xD9,0xD8,0xDC,0xC0,0xD1,0x00, -0xA3}; - -/* 2500-25A0 , 161 chars */ -static uchar tab_uni_koi8_r_plane25[]={ -0x80,0x00,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x00,0x00,0x00, -0x83,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x85,0x00,0x00,0x00,0x86,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0xA1,0xA2,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0, -0xB1,0xB2,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x8B,0x00,0x00,0x00,0x8C,0x00,0x00,0x00,0x8D,0x00,0x00,0x00,0x8E,0x00,0x00,0x00, -0x8F,0x90,0x91,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x94}; - -/* 2219-2265 , 77 chars */ -static uchar tab_uni_koi8_r_plane22[]={ -0x95,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x97, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x99}; - -/* 2320-2321 , 2 chars */ -static uchar tab_uni_koi8_r_plane23[]={ -0x93,0x9B}; - - -static MY_UNI_IDX idx_uni_koi8_r[]={ - {0x0000,0x00F7,tab_uni_koi8_r_plane00}, - {0x0401,0x0451,tab_uni_koi8_r_plane04}, - {0x2500,0x25A0,tab_uni_koi8_r_plane25}, - {0x2219,0x2265,tab_uni_koi8_r_plane22}, - {0x2320,0x2321,tab_uni_koi8_r_plane23}, - {0,0,NULL} -}; - -#endif - -#ifdef HAVE_CHARSET_koi8_ukr - -/* The koi8_ukr character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_koi8_ukr[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 2, 2, 16, 2, 2, 16, 16, 16, 16, 16, 2, 16, 16, - 16, 16, 16, 1, 1, 16, 1, 1, 16, 16, 16, 16, 16, 1, 16, 16, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -}; - -static uchar to_lower_koi8_ukr[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 32, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,163,164, 32,166,167, 32, 32, 32, 32, 32,173, 32, 32, - 32, 32, 32,163,164, 32,166,167, 32, 32, 32, 32, 32,173, 32, 32, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 -}; - -static uchar to_upper_koi8_ukr[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32,179,180, 32,182,183, 32, 32, 32, 32, 32,189, 32, 32, - 32, 32, 32,179,180, 32,182,183, 32, 32, 32, 32, 32,189, 32, 32, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_koi8_ukr[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180, - 181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196, - 197,198,199,136,135,200,140,141,201,202,203,204,205,132,206,207, - 208,209,210,136,135,211,140,141,212,213,214,215,216,132,217,218, - 163,128,129,155,133,134,153,131,154,139,142,143,144,145,146,147, - 148,164,149,150,151,152,137,130,161,160,138,157,162,158,156,159, - 163,128,129,155,133,134,153,131,154,139,142,143,144,145,146,147, - 148,164,149,150,151,152,137,130,161,160,138,157,162,158,156,159 -}; - -static uint16 tab_koi8_u_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, -0x2500,0x2502,0x250C,0x2510,0x2514,0x2518,0x251C,0x2524, -0x252C,0x2534,0x253C,0x2580,0x2584,0x2588,0x258C,0x2590, -0x2591,0x2592,0x2593,0x2320,0x25A0,0x2022,0x221A,0x2248, -0x2264,0x2265,0x00A0,0x2321,0x00B0,0x00B2,0x00B7,0x00F7, -0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457, -0x2557,0x2558,0x2559,0x255A,0x255B,0x0491,0x255D,0x255E, -0x255F,0x2560,0x2561,0x0401,0x0404,0x2563,0x0406,0x0407, -0x2566,0x2567,0x2568,0x2569,0x256A,0x0490,0x256C,0x00A9, -0x044E,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, -0x0445,0x0438,0x0439,0x043A,0x043B,0x043C,0x043D,0x043E, -0x043F,0x044F,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, -0x044C,0x044B,0x0437,0x0448,0x044D,0x0449,0x0447,0x044A, -0x042E,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, -0x0425,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, -0x041F,0x042F,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, -0x042C,0x042B,0x0417,0x0428,0x042D,0x0429,0x0427,0x042A -}; - - -/* 0000-00F7 , 248 chars */ -static uchar tab_uni_koi8_u_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x9A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0x00,0x00,0x00,0x00,0x00,0x00, -0x9C,0x00,0x9D,0x00,0x00,0x00,0x00,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9F}; - -/* 0401-0491 , 145 chars */ -static uchar tab_uni_koi8_u_plane04[]={ -0xB3,0x00,0x00,0xB4,0x00,0xB6,0xB7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE1, -0xE2,0xF7,0xE7,0xE4,0xE5,0xF6,0xFA,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF2, -0xF3,0xF4,0xF5,0xE6,0xE8,0xE3,0xFE,0xFB,0xFD,0xFF,0xF9,0xF8,0xFC,0xE0,0xF1,0xC1, -0xC2,0xD7,0xC7,0xC4,0xC5,0xD6,0xDA,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD2, -0xD3,0xD4,0xD5,0xC6,0xC8,0xC3,0xDE,0xDB,0xDD,0xDF,0xD9,0xD8,0xDC,0xC0,0xD1,0x00, -0xA3,0x00,0x00,0xA4,0x00,0xA6,0xA7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xBD, -0xAD}; - -/* 2500-25A0 , 161 chars */ -static uchar tab_uni_koi8_u_plane25[]={ -0x80,0x00,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x00,0x00,0x00, -0x83,0x00,0x00,0x00,0x84,0x00,0x00,0x00,0x85,0x00,0x00,0x00,0x86,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x87,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x89,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0xA1,0xA2,0x00,0xA5,0x00,0x00,0xA8,0xA9,0xAA,0xAB,0xAC,0x00,0xAE,0xAF,0xB0, -0xB1,0xB2,0x00,0xB5,0x00,0x00,0xB8,0xB9,0xBA,0xBB,0xBC,0x00,0xBE,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x8B,0x00,0x00,0x00,0x8C,0x00,0x00,0x00,0x8D,0x00,0x00,0x00,0x8E,0x00,0x00,0x00, -0x8F,0x90,0x91,0x92,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x94}; - -/* 221A-2265 , 76 chars */ -static uchar tab_uni_koi8_u_plane22[]={ -0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x97,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x99}; - -/* 2320-2321 , 2 chars */ -static uchar tab_uni_koi8_u_plane23[]={ -0x93,0x9B}; - -/* 2022-2022 , 1 chars */ -static uchar tab_uni_koi8_u_plane20[]={ -0x95}; - - -static MY_UNI_IDX idx_uni_koi8_u[]={ - {0x0000,0x00F7,tab_uni_koi8_u_plane00}, - {0x0401,0x0491,tab_uni_koi8_u_plane04}, - {0x2500,0x25A0,tab_uni_koi8_u_plane25}, - {0x221A,0x2265,tab_uni_koi8_u_plane22}, - {0x2320,0x2321,tab_uni_koi8_u_plane23}, - {0x2022,0x2022,tab_uni_koi8_u_plane20}, - {0,0,NULL} -}; - -#endif - -#ifdef HAVE_CHARSET_latin1 - -/* The latin1 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_latin1[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_latin1[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_latin1[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_latin1[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 65, 65, 65, 65, 92, 91, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79, 93,215,216, 85, 85, 85, 89, 89,222,223, - 65, 65, 65, 65, 92, 91, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79, 93,247,216, 85, 85, 85, 89, 89,222,255 -}; -#endif - -#ifdef HAVE_CHARSET_latin2 - -/* The latin2 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_latin2[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 1, 16, 1, 16, 1, 1, 16, 16, 1, 1, 1, 1, 16, 1, 1, - 16, 2, 16, 2, 16, 2, 2, 16, 16, 2, 2, 2, 2, 16, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 16, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 16, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 16 -}; - -static uchar to_lower_latin2[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,177,162,179,164,181,182,167,168,185,186,187,188,173,190,191, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 208,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_latin2[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,161,178,163,180,165,166,183,184,169,170,171,172,189,174,175, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 240,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_latin2[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 68, 69, 72, 73, 75, 76, 77, 78, 79, 80, 81, 83, 84, 86, - 88, 89, 90, 91, 94, 95, 96, 97, 98, 99,100,104,105,106,107,108, - 109, 65, 68, 69, 72, 73, 75, 76, 77, 78, 79, 80, 81, 83, 84, 86, - 88, 89, 90, 91, 94, 95, 96, 97, 98, 99,100,110,111,112,113,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255, 66,255, 82,255, 81, 92,255,255, 93, 91, 94,101,255,103,102, - 255, 66,255, 82,255, 81, 92,255,255, 93, 91, 94,101,255,103,102, - 90, 67, 67, 67, 67, 81, 70, 69, 71, 73, 74, 73, 73, 78, 78, 72, - 255, 85, 84, 87, 86, 86, 86,255, 90, 95, 95, 95, 95, 99, 94,255, - 90, 67, 67, 67, 67, 81, 70, 69, 71, 73, 74, 73, 73, 78, 78, 72, - 255, 85, 84, 87, 86, 86, 86,255, 90, 95, 95, 95, 95, 99, 94,255 -}; -#endif - -#ifdef HAVE_CHARSET_latin5 - -/* The latin5 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_latin5[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_latin5[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,253,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,105,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_latin5[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72,221, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220, 73,222,255 -}; - -static uchar sort_order_latin5[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 69, 70, 71, 72, 74, 75, 77, 78, 79, 80, 81, 82, - 84, 85, 86, 87, 89, 90, 92, 93, 94, 95, 96, 97, 98, 99,100,101, - 102, 65, 66, 67, 69, 70, 71, 72, 74, 76, 77, 78, 79, 80, 81, 82, - 84, 85, 86, 87, 89, 90, 92, 93, 94, 95, 96,135,136,137,138,139, - 140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155, - 156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171, - 172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187, - 188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203, - 204,205,206,207,208,209,210, 68,211,212,213,214,215,216,217,218, - 73,219,220,221,222,223, 83,224,225,226,227,228, 91, 76, 88,229, - 204,205,206,207,208,209,210, 68,211,212,213,214,215,216,217,218, - 73,219,220,221,222,223, 83,250,225,226,227,228, 91, 75, 88,255 -}; - -static uint16 tab_8859_9_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, -0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, -0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, -0x011E,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, -0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x0130,0x015E,0x00DF, -0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, -0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, -0x011F,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, -0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x0131,0x015F,0x00FF -}; - - -/* 0000-00FF , 256 chars */ -static uchar tab_uni_8859_9_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0x00,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0x00,0x00,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0x00,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0x00,0x00,0xFF}; - -/* 011E-015F , 66 chars */ -static uchar tab_uni_8859_9_plane01[]={ -0xD0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0xDD,0xFD,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xDE,0xFE}; - - -static MY_UNI_IDX idx_uni_8859_9[]={ - {0x0000,0x00FF,tab_uni_8859_9_plane00}, - {0x011E,0x015F,tab_uni_8859_9_plane01}, - {0,0,NULL} -}; - -#endif - -#ifdef HAVE_CHARSET_swe7 - -/* The swe7 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_swe7[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 1,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, - 1,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static uchar to_lower_swe7[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_swe7[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_swe7[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 69, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 93, 91, 89, 95, - 69, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 93, 91, 89,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; -#endif - -#ifdef HAVE_CHARSET_usa7 - -/* The usa7 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_usa7[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static uchar to_lower_usa7[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_usa7[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_usa7[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 93, 91, 94, 95, - 69, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125, 89,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uint16 tab_us_ascii_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - - -/* 0000-007E , 127 chars */ -static uchar tab_uni_us_ascii_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E}; - - -static MY_UNI_IDX idx_uni_us_ascii[]={ - {0x0000,0x007E,tab_uni_us_ascii_plane00}, - {0,0,NULL} -}; - -#endif - -#ifdef HAVE_CHARSET_win1250 - -/* The win1250 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_win1250[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 32, 32, 16, 32, 16, 16, 16, 16, 32, 16, 1, 16, 1, 1, 1, 1, - 32, 16, 16, 16, 16, 16, 16, 16, 32, 16, 2, 16, 2, 2, 2, 2, - 72, 16, 16, 1, 16, 1, 16, 1, 16, 16, 1, 16, 16, 16, 16, 1, - 16, 16, 16, 2, 16, 16, 16, 16, 16, 2, 2, 16, 1, 16, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 16 -}; - -static uchar to_lower_win1250[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,154,139,156,157,158,159, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,179,164,185,166,223,168,169,186,171,172,173,174,191, - 176,177,178,179,180,181,182,183,184,185,186,187,190,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_win1250[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,138,155,140,141,142,143, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,163,180,181,182,183,184,165,170,187,188,189,188,175, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,167, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -static uchar sort_order_win1250[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 70, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 85, - 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 99,100,101,102,103, - 104, 65, 66, 67, 70, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 85, - 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137, 90,139, 90, 91, 98, 98, - 144,145,146,147,148,149,150,151,152,153, 90,155, 90, 91, 98, 98, - 32,161,162, 80,164, 65,166, 89,168,169, 89,171,172,173,174, 98, - 176,177,178, 80,180,181,182,183,184, 65, 89,187, 80,189, 80, 98, - 88, 65, 65, 65, 65, 80, 69, 67, 68, 73, 73, 73, 73, 77, 77, 70, - 71, 83, 83, 85, 85, 85, 85,215, 88, 92, 92, 92, 92, 96, 91, 89, - 88, 65, 65, 65, 65, 80, 69, 67, 68, 73, 73, 73, 73, 77, 77, 70, - 71, 83, 83, 85, 85, 85, 85,247, 88, 92, 92, 92, 92, 96, 91,255 -}; -#endif - -#if defined(HAVE_CHARSET_win1250) - -static uint16 tab_cp1250_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, -0x20AC, 0,0x201A, 0,0x201E,0x2026,0x2020,0x2021, - 0,0x2030,0x0160,0x2039,0x015A,0x0164,0x017D,0x0179, - 0,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014, - 0,0x2122,0x0161,0x203A,0x015B,0x0165,0x017E,0x017A, -0x00A0,0x02C7,0x02D8,0x0141,0x00A4,0x0104,0x00A6,0x00A7, -0x00A8,0x00A9,0x015E,0x00AB,0x00AC,0x00AD,0x00AE,0x017B, -0x00B0,0x00B1,0x02DB,0x0142,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x0105,0x015F,0x00BB,0x013D,0x02DD,0x013E,0x017C, -0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, -0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, -0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, -0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, -0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, -0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, -0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, -0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 -}; - - -/* 0000-00FD , 254 chars */ -static uchar tab_uni_cp1250_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0x00,0x00,0x00,0xA4,0x00,0xA6,0xA7,0xA8,0xA9,0x00,0xAB,0xAC,0xAD,0xAE,0x00, -0xB0,0xB1,0x00,0x00,0xB4,0xB5,0xB6,0xB7,0xB8,0x00,0x00,0xBB,0x00,0x00,0x00,0x00, -0x00,0xC1,0xC2,0x00,0xC4,0x00,0x00,0xC7,0x00,0xC9,0x00,0xCB,0x00,0xCD,0xCE,0x00, -0x00,0x00,0x00,0xD3,0xD4,0x00,0xD6,0xD7,0x00,0x00,0xDA,0x00,0xDC,0xDD,0x00,0xDF, -0x00,0xE1,0xE2,0x00,0xE4,0x00,0x00,0xE7,0x00,0xE9,0x00,0xEB,0x00,0xED,0xEE,0x00, -0x00,0x00,0x00,0xF3,0xF4,0x00,0xF6,0xF7,0x00,0x00,0xFA,0x00,0xFC,0xFD}; - -/* 0102-017E , 125 chars */ -static uchar tab_uni_cp1250_plane01[]={ -0xC3,0xE3,0xA5,0xB9,0xC6,0xE6,0x00,0x00,0x00,0x00,0xC8,0xE8,0xCF,0xEF,0xD0,0xF0, -0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xEA,0xCC,0xEC,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC5,0xE5,0x00,0x00,0xBC,0xBE,0x00,0x00,0xA3, -0xB3,0xD1,0xF1,0x00,0x00,0xD2,0xF2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0xF5, -0x00,0x00,0xC0,0xE0,0x00,0x00,0xD8,0xF8,0x8C,0x9C,0x00,0x00,0xAA,0xBA,0x8A,0x9A, -0xDE,0xFE,0x8D,0x9D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD9,0xF9,0xDB,0xFB, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8F,0x9F,0xAF,0xBF,0x8E,0x9E}; - -/* 2013-20AC , 154 chars */ -static uchar tab_uni_cp1250_plane20[]={ -0x96,0x97,0x00,0x00,0x00,0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00,0x86,0x87,0x95, -0x00,0x00,0x00,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0x9B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80}; - -/* 02C7-02DD , 23 chars */ -static uchar tab_uni_cp1250_plane02[]={ -0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0xA2,0xFF,0x00,0xB2,0x00,0xBD}; - -/* 2122-2122 , 1 chars */ -static uchar tab_uni_cp1250_plane21[]={ -0x99}; - - -static MY_UNI_IDX idx_uni_cp1250[]={ - {0x0000,0x00FD,tab_uni_cp1250_plane00}, - {0x0102,0x017E,tab_uni_cp1250_plane01}, - {0x2013,0x20AC,tab_uni_cp1250_plane20}, - {0x02C7,0x02DD,tab_uni_cp1250_plane02}, - {0x2122,0x2122,tab_uni_cp1250_plane21}, - {0,0,NULL} -}; - -#endif - -#ifdef HAVE_CHARSET_win1251 - -/* The win1251 character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_win1251[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 1, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_win1251[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,184,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,245,247,248,249,250,251,252,253,254,255, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_win1251[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,168,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,213,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 -}; - -static uchar sort_order_win1251[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,198,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,198,185,186,187,188,189,190,191, - 192,193,194,195,196,197,199,200,201,202,203,204,205,206,207,208, - 209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224, - 192,193,194,195,196,197,199,200,201,202,203,204,205,206,207,208, - 209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224 -}; -#endif - -#ifdef HAVE_CHARSET_win1251ukr - -/* The win1251ukr character set. Generated automatically by - * the ./conf_to_src program - */ - -static uchar ctype_win1251ukr[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 1, 16, 1, 16, 16, 16, 16, 1, - 16, 16, 1, 2, 16, 16, 16, 16, 2, 16, 2, 16, 16, 16, 16, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_win1251ukr[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 32, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,165, 32, 32,168, 32,170, 32, 32, 32, 32,175, - 32, 32,178,178,165, 32, 32, 32,168, 32,170, 32, 32, 32, 32,175, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223 -}; - -static uchar to_upper_win1251ukr[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32,180, 32, 32,184, 32,186, 32, 32, 32, 32,191, - 32, 32,179,179,180, 32, 32, 32,184, 32,186, 32, 32, 32, 32,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar sort_order_win1251ukr[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180, - 181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196, - 197,198,199,200,201,132,202,203,136,204,135,205,206,207,208,141, - 209,210,140,140,132,211,212,213,136,214,135,215,216,217,218,141, - 128,129,130,131,133,134,137,138,139,142,143,144,145,146,147,148, - 149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164, - 128,129,130,131,133,134,137,138,139,142,143,144,145,146,147,148, - 149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164 -}; -#endif - - - CHARSET_INFO compiled_charsets[] = { - -#ifdef HAVE_CHARSET_latin1 - { - 8,0,0, /* number */ - MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ - "latin1", /* cs name */ - "latin1", /* name */ - "", /* comment */ - ctype_latin1, - to_lower_latin1, - to_upper_latin1, - sort_order_latin1, - tab_8859_1_uni, /* tab_to_uni */ - idx_uni_8859_1, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - - -#ifdef HAVE_CHARSET_cp1251 - { - 14,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "cp1251", /* cs name */ - "cp1251", /* name */ - "", /* comment */ - ctype_cp1251, - to_lower_cp1251, - to_upper_cp1251, - sort_order_cp1251, - tab_cp1251_uni, /* tab_to_uni */ - idx_uni_cp1251, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_cp1257 - { - 29,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "cp1257", /* cs name */ - "cp1257", /* name */ - "", /* comment */ - ctype_cp1257, - to_lower_cp1257, - to_upper_cp1257, - sort_order_cp1257, - tab_cp1257_uni, /* tab_to_uni */ - idx_uni_cp1257, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_croat - { - 27,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin2", /* cs name */ - "croat", /* name */ - "", /* comment */ - ctype_croat, - to_lower_croat, - to_upper_croat, - sort_order_croat, - tab_8859_2_uni, /* tab_to_uni */ - idx_uni_8859_2, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - - -#ifdef HAVE_CHARSET_danish - { - 15,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin1", /* cs name */ - "danish", /* name */ - "", /* comment */ - ctype_danish, - to_lower_danish, - to_upper_danish, - sort_order_danish, - tab_8859_1_uni, /* tab_to_uni */ - idx_uni_8859_1, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_dec8 - { - 3,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "dec8", /* cs name */ - "dec8", /* name */ - "", /* comment */ - ctype_dec8, - to_lower_dec8, - to_upper_dec8, - sort_order_dec8, - NULL, /* tab_to_uni */ - NULL, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_dos - { - 4,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "cp850", /* cs name */ - "dos", /* name */ - "", /* comment */ - ctype_dos, - to_lower_dos, - to_upper_dos, - sort_order_dos, - NULL, /* tab_to_uni */ - NULL, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_estonia - { - 20,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin7", /* cs name */ - "estonia", /* name */ - "", /* comment */ - ctype_estonia, - to_lower_estonia, - to_upper_estonia, - sort_order_estonia, - NULL, /* tab_to_uni */ - NULL, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - - -#ifdef HAVE_CHARSET_german1 - { - 5,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin1", /* cs name */ - "german1", /* name */ - "", /* comment */ - ctype_german1, - to_lower_german1, - to_upper_german1, - sort_order_german1, - tab_8859_1_uni, /* tab_to_uni */ - idx_uni_8859_1, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_greek_bad - { - 25,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "greek", /* cs name */ - "greek", /* name */ - "", /* comment */ - ctype_greek, - to_lower_greek, - to_upper_greek, - sort_order_greek, - NULL, /* tab_to_uni */ - NULL, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_hebrew - { - 16,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "hebrew", /* cs name */ - "hebrew", /* name */ - "", /* comment */ - ctype_hebrew, - to_lower_hebrew, - to_upper_hebrew, - sort_order_hebrew, - NULL, /* tab_to_uni */ - NULL, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_hp8 - { - 6,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "hp8", /* cs name */ - "hp8", /* name */ - "", /* comment */ - ctype_hp8, - to_lower_hp8, - to_upper_hp8, - sort_order_hp8, - NULL, /* tab_to_uni */ - NULL, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_hungarian - { - 21,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin2", /* cs name */ - "hungarian", /* name */ - "", /* comment */ - ctype_hungarian, - to_lower_hungarian, - to_upper_hungarian, - sort_order_hungarian, - tab_8859_2_uni, /* tab_to_uni */ - idx_uni_8859_2, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_koi8_ru - { - 7,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "koi8r", /* cs name */ - "koi8r", /* name */ - "", /* comment */ - ctype_koi8_ru, - to_lower_koi8_ru, - to_upper_koi8_ru, - sort_order_koi8_ru, - tab_koi8_r_uni, /* tab_to_uni */ - idx_uni_koi8_r, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_koi8_ukr - { - 22,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "koi8u", /* cs name */ - "koi8u", /* name */ - "", /* comment */ - ctype_koi8_ukr, - to_lower_koi8_ukr, - to_upper_koi8_ukr, - sort_order_koi8_ukr, - tab_koi8_u_uni, /* tab_to_uni */ - idx_uni_koi8_u, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - - -#ifdef HAVE_CHARSET_latin2 - { - 9,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin2", /* cs name */ - "latin2", /* name */ - "", /* comment */ - ctype_latin2, - to_lower_latin2, - to_upper_latin2, - sort_order_latin2, - tab_8859_2_uni, /* tab_to_uni */ - idx_uni_8859_2, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_latin5 - { - 30,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin5", /* cs name */ - "latin5", /* name */ - "", /* comment */ - ctype_latin5, - to_lower_latin5, - to_upper_latin5, - sort_order_latin5, - tab_8859_9_uni, /* tab_to_uni */ - idx_uni_8859_9, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - - -#ifdef HAVE_CHARSET_swe7 - { - 10,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "swe7", /* cs name */ - "swe7", /* name */ - "", /* comment */ - ctype_swe7, - to_lower_swe7, - to_upper_swe7, - sort_order_swe7, - NULL, /* tab_to_uni */ - NULL, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - - -#ifdef HAVE_CHARSET_usa7 - { - 11,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "ascii", /* cs name */ - "ascii", /* name */ - "", /* comment */ - ctype_usa7, - to_lower_usa7, - to_upper_usa7, - sort_order_usa7, - tab_us_ascii_uni, /* tab_to_uni */ - idx_uni_us_ascii, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_win1250 - { - 26,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "cp1250", /* cs name */ - "cp1250", /* name */ - "", /* comment */ - ctype_win1250, - to_lower_win1250, - to_upper_win1250, - sort_order_win1250, - tab_cp1250_uni, /* tab_to_uni */ - idx_uni_cp1250, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_win1251ukr - { - 23,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "cp1251", /* cs name */ - "win1251ukr", /* name */ - "", /* comment */ - ctype_win1251ukr, - to_lower_win1251ukr, - to_upper_win1251ukr, - sort_order_win1251ukr, - tab_cp1251_uni, /* tab_to_uni */ - idx_uni_cp1251, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_armscii8 - { - 32,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "armscii8", /* cs name */ - "armscii8", /* name */ - "", /* comment */ - ctype_armscii8, - to_lower_armscii8, - to_upper_armscii8, - sort_order_armscii8, - tab_armscii_8_uni, /* tab_to_uni */ - idx_uni_armscii_8, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - -#ifdef HAVE_CHARSET_win1251 - { - 17,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "cp1251", /* cs name */ - "win1251", /* name */ - "", /* comment */ - ctype_win1251, - to_lower_win1251, - to_upper_win1251, - sort_order_win1251, - tab_cp1251_uni, /* tab_to_uni */ - idx_uni_cp1251, /* tab_from_uni */ - "","", - 0, /* strxfrm_multiply */ - my_strnncoll_simple,/* strnncoll */ - my_strnncollsp_simple,/* strnncollsp */ - my_strnxfrm_simple, /* strnxfrm */ - my_like_range_simple,/* like_range */ - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - my_tosort_8bit, - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit - }, -#endif - { 0,0,0, /* end-of-list marker */ 0, /* state */ diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 7e721299692..5b5f650671c 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -19,7 +19,7 @@ #include "m_ctype.h" -static my_wc_t latin1_uni[256]={ +static uint16 latin1_uni[256]={ 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -177,19 +177,19 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), CHARSET_INFO my_charset_latin1 = { - 8,0,0, /* number */ - MY_CS_COMPILED, /* state */ - "latin1", /* cs name */ - "latin1", /* name */ - "", /* comment */ + 8,0,0, /* number */ + MY_CS_COMPILED | MY_CS_PRIMARY, /* state */ + "latin1", /* cs name */ + "latin1", /* name */ + "", /* comment */ ctype_latin1, to_lower_latin1, to_upper_latin1, sort_order_latin1, - NULL, /* tab_to_uni */ + latin1_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ "","", - 2, /* strxfrm_multiply */ + 0, /* strxfrm_multiply */ my_strnncoll_simple, my_strnncollsp_simple, my_strnxfrm_simple, @@ -207,7 +207,7 @@ CHARSET_INFO my_charset_latin1 = my_casedn_str_8bit, my_caseup_8bit, my_casedn_8bit, - NULL, /* tosort */ + my_tosort_8bit, /* tosort */ my_strcasecmp_8bit, my_strncasecmp_8bit, my_hash_caseup_simple, @@ -224,3 +224,261 @@ CHARSET_INFO my_charset_latin1 = my_strntod_8bit, my_scan_8bit }; + + + + +/* + * This file is the latin1 character set with German sorting + * + * The modern sort order is used, where: + * + * 'ä' -> "ae" + * 'ö' -> "oe" + * 'ü' -> "ue" + * 'ß' -> "ss" + */ + + +/* + * This is a simple latin1 mapping table, which maps all accented + * characters to their non-accented equivalents. Note: in this + * table, 'ä' is mapped to 'A', 'ÿ' is mapped to 'Y', etc. - all + * accented characters except the following are treated the same way. + * Ü, ü, Ö, ö, Ä, ä + */ + +static uchar sort_order_latin1_de[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79,214,215,216, 85, 85, 85,220, 89,222,223, + 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79,214,247,216, 85, 85, 85,220, 89,222, 89 +}; + +#define L1_AE 196 +#define L1_ae 228 +#define L1_OE 214 +#define L1_oe 246 +#define L1_UE 220 +#define L1_ue 252 +#define L1_ss 223 + + +/* + Some notes about the following comparison rules: + By definition, my_strnncoll_latin_de must works exactly as if had called + my_strnxfrm_latin_de() on both strings and compared the result strings. + + This means that: + Ä must also matches ÁE and Aè, because my_strxn_frm_latin_de() will convert + both to AE. + + The other option would be to not do any accent removal in + sort_order_latin_de[] at all +*/ + + +#define CHECK_S1_COMBO(ch1, ch2, str1, str1_end, res_if_str1_smaller, str2, fst, snd, accent) \ + /* Invariant: ch1 == fst == sort_order_latin1_de[accent] && ch1 != ch2 */ \ + if (ch2 != accent) \ + { \ + ch1= fst; \ + goto normal; \ + } \ + if (str1 == str1_end) \ + return res_if_str1_smaller; \ + { \ + int diff = (int) sort_order_latin1_de[*str1] - snd; \ + if (diff) \ + return diff*(-(res_if_str1_smaller)); \ + /* They are equal (e.g., "Ae" == 'ä') */ \ + str1++; \ + } + + +static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)), + const uchar * s1, uint len1, + const uchar * s2, uint len2) +{ + const uchar *e1 = s1 + len1; + const uchar *e2 = s2 + len2; + + while (s1 < e1 && s2 < e2) + { + /* + Because sort_order_latin1_de doesn't convert 'Ä', Ü or ß we + can use it here. + */ + uchar c1 = sort_order_latin1_de[*s1++]; + uchar c2 = sort_order_latin1_de[*s2++]; + if (c1 != c2) + { + switch (c1) { + case 'A': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'A', 'E', L1_AE); + break; + case 'O': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'O', 'E', L1_OE); + break; + case 'U': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'U', 'E', L1_UE); + break; + case 'S': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'S', 'S', L1_ss); + break; + case L1_AE: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'A', 'E', 'A'); + break; + case L1_OE: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'O', 'E', 'O'); + break; + case L1_UE: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'U', 'E', 'U'); + break; + case L1_ss: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'S', 'S', 'S'); + break; + default: + /* + Handle the case where 'c2' is a special character + If this is true, we know that c1 can't match this character. + */ + normal: + switch (c2) { + case L1_AE: + return (int) c1 - (int) 'A'; + case L1_OE: + return (int) c1 - (int) 'O'; + case L1_UE: + return (int) c1 - (int) 'U'; + case L1_ss: + return (int) c1 - (int) 'S'; + default: + { + int diff= (int) c1 - (int) c2; + if (diff) + return diff; + } + break; + } + } + } + } + /* A simple test of string lengths won't work -- we test to see + * which string ran out first */ + return s1 < e1 ? 1 : s2 < e2 ? -1 : 0; +} + +static +int my_strnncollsp_latin1_de(CHARSET_INFO * cs, + const uchar *s, uint slen, + const uchar *t, uint tlen) +{ + for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--); + for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--); + return my_strnncoll_latin1_de(cs,s,slen,t,tlen); +} + + +static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)), + uchar * dest, uint len, + const uchar * src, uint srclen) +{ + const uchar *dest_orig = dest; + const uchar *de = dest + len; + const uchar *se = src + srclen; + while (src < se && dest < de) + { + uchar chr=sort_order_latin1_de[*src]; + switch (chr) { + case L1_AE: + *dest++ = 'A'; + if (dest < de) + *dest++ = 'E'; + break; + case L1_OE: + *dest++ = 'O'; + if (dest < de) + *dest++ = 'E'; + break; + case L1_UE: + *dest++ = 'U'; + if (dest < de) + *dest++ = 'E'; + break; + case L1_ss: + *dest++ = 'S'; + if (dest < de) + *dest++ = 'S'; + break; + default: + *dest++= chr; + break; + } + ++src; + } + return dest - dest_orig; +} + +CHARSET_INFO my_charset_latin1_de = +{ + 31,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ + "latin1", /* cs name */ + "latin1_german2_ci", /* name */ + "", /* comment */ + ctype_latin1, + to_lower_latin1, + to_upper_latin1, + sort_order_latin1_de, + latin1_uni, /* tab_to_uni */ + NULL, /* tab_from_uni */ + "","", + 2, /* strxfrm_multiply */ + my_strnncoll_latin1_de, + my_strnncollsp_latin1_de, + my_strnxfrm_latin1_de, + my_like_range_simple, + my_wildcmp_8bit, /* wildcmp */ + 1, /* mbmaxlen */ + NULL, /* ismbchar */ + NULL, /* ismbhead */ + NULL, /* mbcharlen */ + my_numchars_8bit, + my_charpos_8bit, + my_mb_wc_latin1, /* mb_wc */ + my_wc_mb_latin1, /* wc_mb */ + my_caseup_str_8bit, + my_casedn_str_8bit, + my_caseup_8bit, + my_casedn_8bit, + NULL, /* tosort */ + my_strcasecmp_8bit, + my_strncasecmp_8bit, + my_hash_caseup_simple, + my_hash_sort_simple, + 0, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_scan_8bit +}; + diff --git a/strings/ctype-latin1_de.c b/strings/ctype-latin1_de.c deleted file mode 100644 index e07bc6e9a70..00000000000 --- a/strings/ctype-latin1_de.c +++ /dev/null @@ -1,399 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - * This file is the latin1 character set with German sorting - * - * The modern sort order is used, where: - * - * 'ä' -> "ae" - * 'ö' -> "oe" - * 'ü' -> "ue" - * 'ß' -> "ss" - */ - -/* - * This comment is parsed by configure to create ctype.c, - * so don't change it unless you know what you are doing. - * - * .configure. strxfrm_multiply_latin1_de=2 - */ - -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" - -#ifdef HAVE_CHARSET_latin1_de - -static uint16 tab_8859_1_uni[256]={ - 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, -0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, -0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, -0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, -0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, -0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, -0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, -0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, -0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, -0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, -0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, -0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, -0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, -0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, -0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, -0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, -0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, -0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, -0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, -0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, -0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, -0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, -0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, -0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, -0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, -0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, -0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF -}; - -static uchar tab_uni_8859_1_plane00[]={ -0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, -0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, -0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, -0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, -0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, -0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, -0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, -0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF, -0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, -0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF, -0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, -0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF, -0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}; - -static MY_UNI_IDX idx_uni_8859_1[]={ - {0x0000,0x00FF,tab_uni_8859_1_plane00}, - {0,0,NULL} -}; - -static uchar ctype_latin1_de[] = { - 0, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, - 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, - 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static uchar to_lower_latin1_de[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, - 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, - 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, - 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 -}; - -static uchar to_upper_latin1_de[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, - 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 -}; - -/* - * This is a simple latin1 mapping table, which maps all accented - * characters to their non-accented equivalents. Note: in this - * table, 'ä' is mapped to 'A', 'ÿ' is mapped to 'Y', etc. - all - * accented characters except the following are treated the same way. - * Ü, ü, Ö, ö, Ä, ä - */ - -static uchar sort_order_latin1_de[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, - 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, - 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, - 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, - 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79,214,215,216, 85, 85, 85,220, 89,222,223, - 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, - 68, 78, 79, 79, 79, 79,214,247,216, 85, 85, 85,220, 89,222, 89 -}; - -#define L1_AE 196 -#define L1_ae 228 -#define L1_OE 214 -#define L1_oe 246 -#define L1_UE 220 -#define L1_ue 252 -#define L1_ss 223 - - -/* - Some notes about the following comparison rules: - By definition, my_strnncoll_latin_de must works exactly as if had called - my_strnxfrm_latin_de() on both strings and compared the result strings. - - This means that: - Ä must also matches ÁE and Aè, because my_strxn_frm_latin_de() will convert - both to AE. - - The other option would be to not do any accent removal in - sort_order_latin_de[] at all -*/ - - -#define CHECK_S1_COMBO(ch1, ch2, str1, str1_end, res_if_str1_smaller, str2, fst, snd, accent) \ - /* Invariant: ch1 == fst == sort_order_latin1_de[accent] && ch1 != ch2 */ \ - if (ch2 != accent) \ - { \ - ch1= fst; \ - goto normal; \ - } \ - if (str1 == str1_end) \ - return res_if_str1_smaller; \ - { \ - int diff = (int) sort_order_latin1_de[*str1] - snd; \ - if (diff) \ - return diff*(-(res_if_str1_smaller)); \ - /* They are equal (e.g., "Ae" == 'ä') */ \ - str1++; \ - } - - -static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)), - const uchar * s1, uint len1, - const uchar * s2, uint len2) -{ - const uchar *e1 = s1 + len1; - const uchar *e2 = s2 + len2; - - while (s1 < e1 && s2 < e2) - { - /* - Because sort_order_latin1_de doesn't convert 'Ä', Ü or ß we - can use it here. - */ - uchar c1 = sort_order_latin1_de[*s1++]; - uchar c2 = sort_order_latin1_de[*s2++]; - if (c1 != c2) - { - switch (c1) { - case 'A': - CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'A', 'E', L1_AE); - break; - case 'O': - CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'O', 'E', L1_OE); - break; - case 'U': - CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'U', 'E', L1_UE); - break; - case 'S': - CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'S', 'S', L1_ss); - break; - case L1_AE: - CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'A', 'E', 'A'); - break; - case L1_OE: - CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'O', 'E', 'O'); - break; - case L1_UE: - CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'U', 'E', 'U'); - break; - case L1_ss: - CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'S', 'S', 'S'); - break; - default: - /* - Handle the case where 'c2' is a special character - If this is true, we know that c1 can't match this character. - */ - normal: - switch (c2) { - case L1_AE: - return (int) c1 - (int) 'A'; - case L1_OE: - return (int) c1 - (int) 'O'; - case L1_UE: - return (int) c1 - (int) 'U'; - case L1_ss: - return (int) c1 - (int) 'S'; - default: - { - int diff= (int) c1 - (int) c2; - if (diff) - return diff; - } - break; - } - } - } - } - /* A simple test of string lengths won't work -- we test to see - * which string ran out first */ - return s1 < e1 ? 1 : s2 < e2 ? -1 : 0; -} - -static -int my_strnncollsp_latin1_de(CHARSET_INFO * cs, - const uchar *s, uint slen, - const uchar *t, uint tlen) -{ - for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--); - for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--); - return my_strnncoll_latin1_de(cs,s,slen,t,tlen); -} - - -static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)), - uchar * dest, uint len, - const uchar * src, uint srclen) -{ - const uchar *dest_orig = dest; - const uchar *de = dest + len; - const uchar *se = src + srclen; - while (src < se && dest < de) - { - uchar chr=sort_order_latin1_de[*src]; - switch (chr) { - case L1_AE: - *dest++ = 'A'; - if (dest < de) - *dest++ = 'E'; - break; - case L1_OE: - *dest++ = 'O'; - if (dest < de) - *dest++ = 'E'; - break; - case L1_UE: - *dest++ = 'U'; - if (dest < de) - *dest++ = 'E'; - break; - case L1_ss: - *dest++ = 'S'; - if (dest < de) - *dest++ = 'S'; - break; - default: - *dest++= chr; - break; - } - ++src; - } - return dest - dest_orig; -} - -CHARSET_INFO my_charset_latin1_de = -{ - 31,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ - "latin1", /* cs name */ - "latin1_de", /* name */ - "", /* comment */ - ctype_latin1_de, - to_lower_latin1_de, - to_upper_latin1_de, - sort_order_latin1_de, - tab_8859_1_uni, /* tab_to_uni */ - idx_uni_8859_1, /* tab_from_uni */ - "","", - 2, /* strxfrm_multiply */ - my_strnncoll_latin1_de, - my_strnncollsp_latin1_de, - my_strnxfrm_latin1_de, - my_like_range_simple, - my_wildcmp_8bit, /* wildcmp */ - 1, /* mbmaxlen */ - NULL, /* ismbchar */ - NULL, /* ismbhead */ - NULL, /* mbcharlen */ - my_numchars_8bit, - my_charpos_8bit, - my_mb_wc_8bit, /* mb_wc */ - my_wc_mb_8bit, /* wc_mb */ - my_caseup_str_8bit, - my_casedn_str_8bit, - my_caseup_8bit, - my_casedn_8bit, - NULL, /* tosort */ - my_strcasecmp_8bit, - my_strncasecmp_8bit, - my_hash_caseup_simple, - my_hash_sort_simple, - 0, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_scan_8bit -}; - -#endif diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 5fb62d3056f..3bca6c6b54f 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -732,7 +732,17 @@ double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)), double result; errno= 0; /* Safety */ + + /* + The following define is to avoid warnings from valgrind as str[length] + may not be defined (which is not fatal in real life) + */ + +#ifdef HAVE_purify + if (length == INT_MAX32) +#else if (length == INT_MAX32 || str[length] == 0) +#endif result= strtod(str, end); else { diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 897e2846659..702a34fde84 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1585,14 +1585,15 @@ static uchar to_upper_utf8[] = { }; -static int my_utf8_uni (CHARSET_INFO *cs __attribute__((unused)) , - my_wc_t * pwc, const uchar *s, const uchar *e) +static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t * pwc, const uchar *s, const uchar *e) { - unsigned char c = s[0]; + unsigned char c; if (s >= e) return MY_CS_TOOFEW(0); + c= s[0]; if (c < 0x80) { *pwc = c; @@ -1624,10 +1625,8 @@ static int my_utf8_uni (CHARSET_INFO *cs __attribute__((unused)) , (my_wc_t) (s[2] ^ 0x80); return 3; - -#ifdef UNICODE_32BIT - } +#ifdef UNICODE_32BIT else if (c < 0xf8 && sizeof(my_wc_t)*8 >= 32) { if (s+4 > e) /* We need 4 characters */ @@ -1685,9 +1684,9 @@ static int my_utf8_uni (CHARSET_INFO *cs __attribute__((unused)) , | ((my_wc_t) (s[4] ^ 0x80) << 6) | (my_wc_t) (s[5] ^ 0x80); return 6; + } #endif - } else - return MY_CS_ILSEQ; + return MY_CS_ILSEQ; } static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)) , diff --git a/strings/ctype.c b/strings/ctype.c index 45bc2589f76..68d9a30048f 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -54,6 +54,7 @@ struct my_cs_file_section_st #define _CS_CTYPEMAP 14 #define _CS_PRIMARY_ID 15 #define _CS_BINARY_ID 16 +#define _CS_CSDESCRIPT 17 static struct my_cs_file_section_st sec[] = { @@ -62,12 +63,12 @@ static struct my_cs_file_section_st sec[] = {_CS_MISC, "xml.encoding"}, {_CS_MISC, "charsets"}, {_CS_MISC, "charsets.max-id"}, - {_CS_MISC, "charsets.description"}, {_CS_CHARSET, "charsets.charset"}, {_CS_PRIMARY_ID, "charsets.charset.primary-id"}, {_CS_BINARY_ID, "charsets.charset.binary-id"}, {_CS_CSNAME, "charsets.charset.name"}, {_CS_FAMILY, "charsets.charset.family"}, + {_CS_CSDESCRIPT, "charsets.charset.description"}, {_CS_MISC, "charsets.charset.alias"}, {_CS_MISC, "charsets.charset.ctype"}, {_CS_CTYPEMAP, "charsets.charset.ctype.map"}, @@ -97,6 +98,8 @@ static struct my_cs_file_section_st * cs_file_sec(const char *attr, uint len) return NULL; } +#define MY_CS_CSDESCR_SIZE 64 + typedef struct my_cs_file_info { char csname[MY_CS_NAME_SIZE]; @@ -106,6 +109,7 @@ typedef struct my_cs_file_info uchar to_upper[MY_CS_TO_UPPER_TABLE_SIZE]; uchar sort_order[MY_CS_SORT_ORDER_TABLE_SIZE]; uint16 tab_to_uni[MY_CS_TO_UNI_TABLE_SIZE]; + char comment[MY_CS_CSDESCR_SIZE]; CHARSET_INFO cs; int (*add_collation)(CHARSET_INFO *cs); } MY_CHARSET_LOADER; @@ -208,6 +212,9 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len) case _CS_CSNAME: i->cs.csname=mstr(i->csname,attr,len,MY_CS_NAME_SIZE-1); break; + case _CS_CSDESCRIPT: + i->cs.comment=mstr(i->comment,attr,len,MY_CS_CSDESCR_SIZE-1); + break; case _CS_FLAG: if (!strncmp("primary",attr,len)) i->cs.state|= MY_CS_PRIMARY; diff --git a/strings/strto.c b/strings/strto.c index 6f12656cb20..0c215ff270c 100644 --- a/strings/strto.c +++ b/strings/strto.c @@ -35,6 +35,8 @@ it can be compiled with the UNSIGNED and/or LONGLONG flag set */ +#define strtoll glob_strtoll /* Fix for True64 */ + #include <my_global.h> #include "m_string.h" #include "m_ctype.h" diff --git a/support-files/MacOSX/Info.plist.sh b/support-files/MacOSX/Info.plist.sh index c8e4eb1c2d4..f14902ff379 100644 --- a/support-files/MacOSX/Info.plist.sh +++ b/support-files/MacOSX/Info.plist.sh @@ -29,7 +29,7 @@ <key>IFPkgFlagRestartAction</key> <string>NoRestart</string> <key>IFPkgFlagRootVolumeOnly</key> - <false/> + <true/> <key>IFPkgFlagUpdateInstalledLanguages</key> <false/> <key>IFPkgFormatVersion</key> diff --git a/support-files/Makefile.am b/support-files/Makefile.am index 4aadd98bd1b..ec88972c821 100644 --- a/support-files/Makefile.am +++ b/support-files/Makefile.am @@ -34,8 +34,7 @@ pkgdata_DATA = my-small.cnf \ my-large.cnf \ my-huge.cnf \ mysql-log-rotate \ - mysql-@VERSION@.spec \ - binary-configure + mysql-@VERSION@.spec pkgdata_SCRIPTS = mysql.server @@ -48,7 +47,6 @@ CLEANFILES = my-small.cnf \ mysql-log-rotate \ mysql.server \ binary-configure - mysql-@VERSION@.spec: mysql.spec rm -f $@ @@ -98,5 +96,7 @@ SUFFIXES = .sh $< > $@-t @MV@ $@-t $@ +all: binary-configure + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/support-files/binary-configure.sh b/support-files/binary-configure.sh index 107f468bffc..884a8363e22 100644 --- a/support-files/binary-configure.sh +++ b/support-files/binary-configure.sh @@ -14,11 +14,11 @@ echo "and start the MySQL server for you. If you run into any trouble, please" echo "consult the MySQL manual, that you can find in the Docs directory." echo "" -./scripts/mysql_install_db +./scripts/mysql_install_db --no-defaults if [ $? = 0 ] then echo "Starting the mysqld server. You can test that it is up and running" echo "with the command:" echo "./bin/mysqladmin version" - ./bin/mysqld_safe & + ./bin/mysqld_safe --no-defaults & fi diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index de1ccfe1df7..53912eb2af6 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -446,6 +446,7 @@ fi %attr(755, root, root) /usr/bin/mysql_explain_log %attr(755, root, root) /usr/bin/mysql_fix_privilege_tables %attr(755, root, root) /usr/bin/mysql_install_db +%attr(755, root, root) /usr/bin/mysql_secure_installation %attr(755, root, root) /usr/bin/mysql_setpermission %attr(755, root, root) /usr/bin/mysql_zap %attr(755, root, root) /usr/bin/mysqlbug @@ -535,6 +536,11 @@ fi %changelog +* Mon Mar 10 2003 Lenz Grimmer <lenz@mysql.com> + +- added missing file mysql_secure_installation to server subpackage + (bug #141) + * Tue Feb 11 2003 Lenz Grimmer <lenz@mysql.com> - re-added missing pre- and post(un)install scripts to server subpackage diff --git a/tests/grant.pl b/tests/grant.pl index 9212c610ac1..5a24127d79d 100644 --- a/tests/grant.pl +++ b/tests/grant.pl @@ -11,10 +11,10 @@ use strict; use vars qw($dbh $user_dbh $opt_help $opt_Information $opt_force $opt_debug $opt_verbose $opt_server $opt_root_user $opt_password $opt_user $opt_database $opt_host $version $user $tables_cols $columns_cols - $tmp_table); + $tmp_table $opt_silent); -$version="1.0"; -$opt_help=$opt_Information=$opt_force=$opt_debug=$opt_verbose=0; +$version="1.1"; +$opt_help=$opt_Information=$opt_force=$opt_debug=$opt_verbose=$opt_silent=0; $opt_host="localhost", $opt_server="mysql"; $opt_root_user="root"; @@ -22,7 +22,7 @@ $opt_password=""; $opt_user="grant_user"; $opt_database="grant_test"; -GetOptions("Information","help","server=s","root-user=s","password=s","user","database=s","force","host=s","debug","verbose") || usage(); +GetOptions("Information","help","server=s","root-user=s","password=s","user","database=s","force","host=s","debug","verbose","silent") || usage(); usage() if ($opt_help || $opt_Information); $user="$opt_user\@$opt_host"; @@ -210,6 +210,16 @@ user_query("delete from $opt_database.test where a=1",1); user_query("update $opt_database.test set b=3 where b=1",1); user_query("update $opt_database.test set b=b+1",1); +# +# Test global SELECT privilege combined with table level privileges +# + +safe_query("grant SELECT on *.* to $user"); +user_connect(0); +user_query("update $opt_database.test set b=b+1"); +safe_query("revoke SELECT on *.* from $user"); +user_connect(0); + # Add one privilege at a time until the user has all privileges user_query("select * from test",1); safe_query("grant select on $opt_database.test to $user"); @@ -543,7 +553,10 @@ sub user_connect $password, { PrintError => 0}); if (!$user_dbh) { - print "$DBI::errstr\n"; + if ($opt_verbose || !$ignore_error) + { + print "Error on connect: $DBI::errstr\n"; + } if (!$ignore_error) { die "The above should not have failed!"; @@ -558,7 +571,7 @@ sub user_connect sub safe_query { my ($query,$ignore_error)=@_; - if (do_query($dbh,$query)) + if (do_query($dbh,$query, $ignore_error)) { if (!defined($ignore_error)) { @@ -575,7 +588,7 @@ sub safe_query sub user_query { my ($query,$ignore_error)=@_; - if (do_query($user_dbh,$query)) + if (do_query($user_dbh,$query, $ignore_error)) { if (!defined($ignore_error)) { @@ -591,8 +604,8 @@ sub user_query sub do_query { - my ($my_dbh, $query)=@_; - my ($sth,$row,$tab,$col,$found); + my ($my_dbh, $query, $ignore_error)=@_; + my ($sth, $row, $tab, $col, $found, $fatal_error); print "$query\n" if ($opt_debug || $opt_verbose); if (!($sth= $my_dbh->prepare($query))) @@ -602,25 +615,32 @@ sub do_query } if (!$sth->execute) { - print "Error in execute: $DBI::errstr\n"; - die if ($DBI::errstr =~ /parse error/); + $fatal_error= ($DBI::errstr =~ /parse error/); + if (!$ignore_error || $opt_verbose || $fatal_error) + { + print "Error in execute: $DBI::errstr\n"; + } + die if ($fatal_error); $sth->finish; return 1; } $found=0; - while (($row=$sth->fetchrow_arrayref)) + if (!$opt_silent) { - $found=1; - $tab=""; - foreach $col (@$row) + while (($row=$sth->fetchrow_arrayref)) { - print $tab; - print defined($col) ? $col : "NULL"; - $tab="\t"; + $found=1; + $tab=""; + foreach $col (@$row) + { + print $tab; + print defined($col) ? $col : "NULL"; + $tab="\t"; + } + print "\n"; } - print "\n"; + print "\n" if ($found); } - print "\n" if ($found); $sth->finish; return 0; } diff --git a/tests/grant.res b/tests/grant.res index 15aad01c888..adb4494eb28 100644 --- a/tests/grant.res +++ b/tests/grant.res @@ -9,13 +9,13 @@ drop database grant_test Error in execute: Can't drop database 'grant_test'. Database doesn't exist create database grant_test Connecting grant_user -Access denied for user: '@localhost' to database 'grant_test' +Error on connect: Access denied for user: '@localhost' to database 'grant_test' grant select on *.* to grant_user@localhost set password FOR grant_user2@localhost = password('test') Error in execute: Can't find any matching row in the user table set password FOR grant_user=password('test') Connecting grant_user -Access denied for user: 'grant_user@localhost' (Using password: NO) +Error on connect: Access denied for user: 'grant_user@localhost' (Using password: NO) set password FOR grant_user='' Connecting grant_user select * from mysql.user where user = 'grant_user' @@ -89,7 +89,7 @@ select count(*) from grant_test.test revoke ALL PRIVILEGES on *.* from grant_user@localhost Connecting grant_user -Access denied for user: 'grant_user@localhost' to database 'grant_test' +Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test' delete from user where user='grant_user' flush privileges delete from user where user='grant_user' @@ -136,7 +136,7 @@ insert into grant_test.test values (6,0) Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test' REVOKE GRANT OPTION on grant_test.* from grant_user@localhost Connecting grant_user -Access denied for user: 'grant_user@localhost' to database 'grant_test' +Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test' grant ALL PRIVILEGES on grant_test.* to grant_user@localhost Connecting grant_user select * from mysql.user where user = 'grant_user' @@ -159,7 +159,7 @@ localhost grant_user N N N N N N N N N N N N N N N N N N N N N 0 0 0 select * from mysql.db where user = 'grant_user' Connecting grant_user -Access denied for user: 'grant_user@localhost' to database 'grant_test' +Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test' grant create on grant_test.test2 to grant_user@localhost Connecting grant_user create table grant_test.test2 (a int not null) @@ -195,7 +195,12 @@ update grant_test.test set b=3 where b=1 Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test' update grant_test.test set b=b+1 Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test' -select * from test +grant SELECT on *.* to grant_user@localhost +Connecting grant_user +update grant_test.test set b=b+1 +revoke SELECT on *.* from grant_user@localhost +Connecting grant_user +lect * from test Error in execute: select command denied to user: 'grant_user@localhost' for table 'test' grant select on grant_test.test to grant_user@localhost delete from grant_test.test where a=1 diff --git a/vio/viosocket.c b/vio/viosocket.c index 76056704ec2..5f7e48f8e8b 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -251,13 +251,14 @@ my_socket vio_fd(Vio* vio) } -my_bool vio_peer_addr(Vio * vio, char *buf) +my_bool vio_peer_addr(Vio * vio, char *buf, uint16 *port) { DBUG_ENTER("vio_peer_addr"); DBUG_PRINT("enter", ("sd: %d", vio->sd)); if (vio->localhost) { strmov(buf,"127.0.0.1"); + *port= 0; } else { @@ -269,6 +270,7 @@ my_bool vio_peer_addr(Vio * vio, char *buf) DBUG_RETURN(1); } my_inet_ntoa(vio->remote.sin_addr,buf); + *port= ntohs(vio->remote.sin_port); } DBUG_PRINT("exit", ("addr: %s", buf)); DBUG_RETURN(0); |