diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 8fc5509547c..b00af7095d7 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -65,6 +65,7 @@ monty@work.mysql.com mwagner@cash.mwagner.org mwagner@evoq.mwagner.org mwagner@work.mysql.com +mysql@home.(none) nick@mysql.com nick@nick.leippe.com papa@gbichot.local @@ -73,10 +74,12 @@ 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) ranger@regul.home.lan +root@home.(none) root@x3.internalnet salle@banica.(none) salle@geopard.(none) @@ -107,6 +110,7 @@ vva@eagle.mysql.r18.ru vva@genie.(none) walrus@kishkin.ru walrus@mysql.com +wax@kishkin.ru wax@mysql.com worm@altair.is.lan zak@balfor.local 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 @@ -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= The package suffix (e.g. "-standard" or "-pro) --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: @* +/// +@* + +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 +@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/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= +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= +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= +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= +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= +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 @@ +[\] +DISPLAYTEXT=Common Files Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[\] +DISPLAYTEXT=Windows System Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[USERDEFINED] +DISPLAYTEXT=Script-defined Folders +TYPE=USERSTART +fulldirectory= + +[] +DISPLAYTEXT=Program Files Folder +SubDir0=\ +TYPE=TEXTSUBFIXED +fulldirectory= + +[] +DISPLAYTEXT=General Application Destination +TYPE=TEXTSUBFIXED +fulldirectory= + +[] +DISPLAYTEXT=Windows Operating System +SubDir0=\ +TYPE=TEXTSUBFIXED +fulldirectory= + +[TopDir] +SubDir0= +SubDir1= +SubDir2= +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 new file mode 100755 index 00000000000..0c6d4e6b708 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.dbg differ 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 new file mode 100755 index 00000000000..204d8ea0f36 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ino differ 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 new file mode 100755 index 00000000000..759009b5c84 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ins differ 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 new file mode 100755 index 00000000000..5fcfcb62c4e Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.obs differ 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 new file mode 100755 index 00000000000..3229d50c9bf Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp differ 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= +Group0=Main +Group1=Startup +Folder0= +Folder1= +Folder2= + +[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 @@ +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[Data] +Key0= +Key1= +Key2= +Key3= +Key4= +Key5= +Key6= +Key7= +Key8= +Key9= + +[General] +Type=TEXTSUB +Version=1.00.000 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +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 @@ +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[Data] +Key0= +Key1= +Key2= +Key3= +Key4= +Key5= +Key10= +Key6= +Key11= +Key7= +Key12= +Key8= +Key13= +Key9= + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[General] +Type=TEXTSUB +Version=1.00.000 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +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= +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= +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= +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= +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= +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 @@ +[\] +DISPLAYTEXT=Common Files Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[\] +DISPLAYTEXT=Windows System Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[USERDEFINED] +DISPLAYTEXT=Script-defined Folders +TYPE=USERSTART +fulldirectory= + +[] +DISPLAYTEXT=Program Files Folder +SubDir0=\ +TYPE=TEXTSUBFIXED +fulldirectory= + +[] +DISPLAYTEXT=General Application Destination +TYPE=TEXTSUBFIXED +fulldirectory= + +[] +DISPLAYTEXT=Windows Operating System +SubDir0=\ +TYPE=TEXTSUBFIXED +fulldirectory= + +[TopDir] +SubDir0= +SubDir1= +SubDir2= +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 new file mode 100755 index 00000000000..0c6d4e6b708 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.dbg differ 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 new file mode 100755 index 00000000000..204d8ea0f36 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ino differ 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 new file mode 100755 index 00000000000..759009b5c84 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ins differ 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 new file mode 100755 index 00000000000..5fcfcb62c4e Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.obs differ 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 new file mode 100755 index 00000000000..3229d50c9bf Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp differ 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= +Group0=Main +Group1=Startup +Folder0= +Folder1= +Folder2= + +[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 @@ +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[Data] +Key0= +Key1= +Key2= +Key3= +Key4= +Key5= +Key6= +Key7= +Key8= +Key9= + +[General] +Type=TEXTSUB +Version=1.00.000 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +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 @@ +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[Data] +Key0= +Key1= +Key2= +Key3= +Key4= +Key5= +Key10= +Key6= +Key11= +Key7= +Key12= +Key8= +Key13= +Key9= + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[General] +Type=TEXTSUB +Version=1.00.000 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +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= +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= +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= +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= +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= +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 @@ +[\] +DISPLAYTEXT=Common Files Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[\] +DISPLAYTEXT=Windows System Folder +TYPE=TEXTSUBFIXED +fulldirectory= + +[USERDEFINED] +DISPLAYTEXT=Script-defined Folders +TYPE=USERSTART +fulldirectory= + +[] +DISPLAYTEXT=Program Files Folder +SubDir0=\ +TYPE=TEXTSUBFIXED +fulldirectory= + +[] +DISPLAYTEXT=General Application Destination +TYPE=TEXTSUBFIXED +fulldirectory= + +[] +DISPLAYTEXT=Windows Operating System +SubDir0=\ +TYPE=TEXTSUBFIXED +fulldirectory= + +[TopDir] +SubDir0= +SubDir1= +SubDir2= +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 new file mode 100755 index 00000000000..0c6d4e6b708 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.dbg differ 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 new file mode 100755 index 00000000000..204d8ea0f36 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ino differ 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 new file mode 100755 index 00000000000..759009b5c84 Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ins differ 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 new file mode 100755 index 00000000000..5fcfcb62c4e Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.obs differ 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 new file mode 100755 index 00000000000..3229d50c9bf Binary files /dev/null and b/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp differ 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= +Group0=Main +Group1=Startup +Folder0= +Folder1= +Folder2= + +[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 @@ +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[Data] +Key0= +Key1= +Key2= +Key3= +Key4= +Key5= +Key6= +Key7= +Key8= +Key9= + +[General] +Type=TEXTSUB +Version=1.00.000 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +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 @@ +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[Data] +Key0= +Key1= +Key2= +Key3= +Key4= +Key5= +Key10= +Key6= +Key11= +Key7= +Key12= +Key8= +Key13= +Key9= + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[General] +Type=TEXTSUB +Version=1.00.000 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +Value= +KeyType=4 + +[] +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 e87fbaf8a41..32655d1ccd9 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -40,7 +40,7 @@ #include #include -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 @@ -92,9 +92,9 @@ extern "C" { #endif #ifdef FN_NO_CASE_SENCE -#define cmp_database(A,B) my_strcasecmp(system_charset_info, (A), (B)) +#define cmp_database(cs,A,B) my_strcasecmp((cs), (A), (B)) #else -#define cmp_database(A,B) strcmp((A),(B)) +#define cmp_database(cs,A,B) strcmp((A),(B)) #endif #if !defined( __WIN__) && !defined( OS2) && !defined(__NETWARE__) && (!defined(HAVE_mit_thread) || !defined(THREAD)) @@ -133,7 +133,8 @@ static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0; static my_string opt_mysql_unix_port=0; static int connect_flag=CLIENT_INTERACTIVE; static char *current_host,*current_db,*current_user=0,*opt_password=0, - *current_prompt=0, *default_charset; + *current_prompt=0, + *default_charset= (char*) MYSQL_CHARSET; static char *histfile; static String glob_buffer,old_buffer; static String processed_prompt; @@ -160,6 +161,7 @@ static uint prompt_counter; static char *shared_memory_base_name=0; #endif static uint opt_protocol=0; +static CHARSET_INFO *charset_info= &my_charset_latin1; #include "sslopt-vars.h" @@ -788,11 +790,8 @@ static int get_options(int argc, char **argv) opt_reconnect= 0; connect_flag= 0; /* Not in interactive mode */ } - if (default_charset) - { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) - exit(1); - } + if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) + exit(1); if (argc > 1) { usage(0); @@ -800,6 +799,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)); } @@ -919,14 +919,14 @@ static COMMANDS *find_command (char *name,char cmd_char) } else { - while (my_isspace(system_charset_info,*name)) + while (my_isspace(charset_info,*name)) name++; if (strchr(name,';') || strstr(name,"\\g")) return ((COMMANDS *) 0); if ((end=strcont(name," \t"))) { len=(uint) (end - name); - while (my_isspace(system_charset_info,*end)) + while (my_isspace(charset_info,*end)) end++; if (!*end) end=0; // no arguments to function @@ -939,7 +939,7 @@ static COMMANDS *find_command (char *name,char cmd_char) { if (commands[i].func && ((name && - !my_strncasecmp(system_charset_info,name,commands[i].name,len) && + !my_strncasecmp(charset_info,name,commands[i].name,len) && !commands[i].name[len] && (!end || (end && commands[i].takes_params))) || !name && commands[i].cmd_char == cmd_char)) @@ -968,13 +968,13 @@ static bool add_line(String &buffer,char *line,char *in_string, for (pos=out=line ; (inchar= (uchar) *pos) ; pos++) { - if (my_isspace(system_charset_info,inchar) && out == line && + if (my_isspace(charset_info,inchar) && out == line && buffer.is_empty()) continue; #ifdef USE_MB int l; - if (use_mb(system_charset_info) && - (l = my_ismbchar(system_charset_info, pos, strend))) { + if (use_mb(charset_info) && + (l = my_ismbchar(charset_info, pos, strend))) { while (l--) *out++ = *pos++; pos--; @@ -993,7 +993,7 @@ static bool add_line(String &buffer,char *line,char *in_string, } if ((com=find_command(NullS,(char) inchar))) { - const String tmp(line,(uint) (out-line), system_charset_info); + const String tmp(line,(uint) (out-line), charset_info); buffer.append(tmp); if ((*com->func)(&buffer,pos-1) > 0) return 1; // Quit @@ -1037,7 +1037,7 @@ static bool add_line(String &buffer,char *line,char *in_string, } else if (!*ml_comment && (!*in_string && (inchar == '#' || inchar == '-' && pos[1] == '-' && - my_isspace(system_charset_info,pos[2])))) + my_isspace(charset_info,pos[2])))) break; // comment to end of line else if (!*in_string && inchar == '/' && *(pos+1) == '*' && *(pos+2) != '!') { @@ -1593,7 +1593,7 @@ com_go(String *buffer,char *line __attribute__((unused))) (void) com_print(buffer,0); if (skip_updates && - (buffer->length() < 4 || my_strnncoll(system_charset_info, + (buffer->length() < 4 || my_strnncoll(charset_info, (const uchar*)buffer->ptr(),4, (const uchar*)"SET ",4))) { @@ -1784,7 +1784,7 @@ print_table_data(MYSQL_RES *result) print_field_types(result); mysql_field_seek(result,0); } - separator.copy("+",1,system_charset_info); + separator.copy("+",1,charset_info); while ((field = mysql_fetch_field(result))) { uint length= column_names ? field->name_length : 0; @@ -2001,8 +2001,8 @@ safe_put_field(const char *pos,ulong length) { #ifdef USE_MB int l; - if (use_mb(system_charset_info) && - (l = my_ismbchar(system_charset_info, pos, end))) + if (use_mb(charset_info) && + (l = my_ismbchar(charset_info, pos, end))) { while (l--) tee_putc(*pos++, PAGER); @@ -2063,7 +2063,7 @@ com_tee(String *buffer, char *line __attribute__((unused))) if (status.batch) return 0; - while (my_isspace(system_charset_info,*line)) + while (my_isspace(charset_info,*line)) line++; if (!(param = strchr(line, ' '))) // if outfile wasn't given, use the default { @@ -2082,12 +2082,12 @@ com_tee(String *buffer, char *line __attribute__((unused))) } /* eliminate the spaces before the parameters */ - while (my_isspace(system_charset_info,*param)) + while (my_isspace(charset_info,*param)) param++; end= strmake(file_name, param, sizeof(file_name) - 1); /* remove end space from command line */ - while (end > file_name && (my_isspace(system_charset_info,end[-1]) || - my_iscntrl(system_charset_info,end[-1]))) + while (end > file_name && (my_isspace(charset_info,end[-1]) || + my_iscntrl(charset_info,end[-1]))) end--; end[0]= 0; if (end == file_name) @@ -2123,7 +2123,7 @@ com_pager(String *buffer, char *line __attribute__((unused))) if (status.batch) return 0; /* Skip space from file name */ - while (my_isspace(system_charset_info,*line)) + while (my_isspace(charset_info,*line)) line++; if (!(param= strchr(line, ' '))) // if pager was not given, use the default { @@ -2139,11 +2139,11 @@ com_pager(String *buffer, char *line __attribute__((unused))) } else { - while (my_isspace(system_charset_info,*param)) + while (my_isspace(charset_info,*param)) param++; end=strmake(pager_name, param, sizeof(pager_name)-1); - while (end > pager_name && (my_isspace(system_charset_info,end[-1]) || - my_iscntrl(system_charset_info,end[-1]))) + while (end > pager_name && (my_isspace(charset_info,end[-1]) || + my_iscntrl(charset_info,end[-1]))) end--; end[0]=0; strmov(pager, pager_name); @@ -2327,16 +2327,16 @@ static int com_source(String *buffer, char *line) FILE *sql_file; /* Skip space from file name */ - while (my_isspace(system_charset_info,*line)) + while (my_isspace(charset_info,*line)) line++; if (!(param = strchr(line, ' '))) // Skip command name return put_info("Usage: \\. | source ", INFO_ERROR, 0); - while (my_isspace(system_charset_info,*param)) + while (my_isspace(charset_info,*param)) param++; end=strmake(source_name,param,sizeof(source_name)-1); - while (end > source_name && (my_isspace(system_charset_info,end[-1]) || - my_iscntrl(system_charset_info,end[-1]))) + while (end > source_name && (my_isspace(charset_info,end[-1]) || + my_iscntrl(charset_info,end[-1]))) end--; end[0]=0; unpack_filename(source_name,source_name); @@ -2385,7 +2385,7 @@ com_use(String *buffer __attribute__((unused)), char *line) put_info("USE must be followed by a database name", INFO_ERROR); return 0; } - if (!current_db || cmp_database(current_db, tmp)) + if (!current_db || cmp_database(charset_info, current_db, tmp)) { if (one_database) skip_updates= 1; @@ -2448,14 +2448,16 @@ char *get_arg(char *line, my_bool get_next_arg) else { /* skip leading white spaces */ - while (my_isspace(system_charset_info, *ptr)) + while (my_isspace(charset_info, *ptr)) ptr++; if (*ptr == '\\') // short command was used ptr+= 2; - while (!my_isspace(system_charset_info, *ptr)) // skip command + while (*ptr &&!my_isspace(charset_info, *ptr)) // skip command ptr++; } - while (my_isspace(system_charset_info, *ptr)) + if (!*ptr) + return NullS; + while (my_isspace(charset_info, *ptr)) ptr++; if (*ptr == '\'' || *ptr == '\"' || *ptr == '`') { @@ -2483,7 +2485,7 @@ char *get_arg(char *line, my_bool get_next_arg) } } for (ptr-= count; ptr && *ptr; ptr++) - if (!my_isspace(system_charset_info, *ptr)) + if (!my_isspace(charset_info, *ptr)) valid_arg= 1; return valid_arg ? ptr - count : '\0'; } @@ -2634,7 +2636,7 @@ com_status(String *buffer __attribute__((unused)), tee_fprintf(stdout, "Protocol version:\t%d\n", mysql_get_proto_info(&mysql)); tee_fprintf(stdout, "Connection:\t\t%s\n", mysql_get_host_info(&mysql)); tee_fprintf(stdout, "Client characterset:\t%s\n", - system_charset_info->name); + charset_info->name); tee_fprintf(stdout, "Server characterset:\t%s\n", mysql.charset->name); #ifndef EMBEDDED_LIBRARY if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! mysql.unix_socket) @@ -2745,7 +2747,7 @@ static void remove_cntrl(String &buffer) { char *start,*end; end=(start=(char*) buffer.ptr())+buffer.length(); - while (start < end && !my_isgraph(system_charset_info,end[-1])) + while (start < end && !my_isgraph(charset_info,end[-1])) end--; buffer.length((uint) (end-start)); } 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/mysqlcheck.c b/client/mysqlcheck.c index cd67a2c7522..cd8cd0ef82e 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -37,14 +37,15 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, tty_password = 0, opt_frm = 0; static uint verbose = 0, opt_mysql_port=0; static my_string opt_mysql_unix_port = 0; -static char *opt_password = 0, *current_user = 0, *default_charset = 0, - *current_host = 0; +static char *opt_password = 0, *current_user = 0, + *default_charset = (char *)MYSQL_CHARSET, *current_host = 0; static int first_error = 0; DYNAMIC_ARRAY tables4repair; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; #endif static uint opt_protocol=0; +static CHARSET_INFO *charset_info= &my_charset_latin1; enum operations {DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE}; @@ -307,11 +308,8 @@ static int get_options(int *argc, char ***argv) else what_to_do = DO_CHECK; } - if (default_charset) - { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) + if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) exit(1); - } if (*argc > 0 && opt_alldbs) { printf("You should give only options, no arguments at all, with option\n"); diff --git a/client/mysqldump.c b/client/mysqldump.c index 49bc56890fb..72d9200a6f6 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -84,7 +84,8 @@ static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *current_host=0,*path=0,*fields_terminated=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, - *where=0, *default_charset, *opt_compatible_mode_str= 0, + *where=0, *default_charset= (char *)MYSQL_CHARSET, + *opt_compatible_mode_str= 0, *err_ptr= 0; static ulong opt_compatible_mode= 0; static uint opt_mysql_port= 0, err_len= 0; @@ -98,6 +99,7 @@ FILE *md_result_file; static char *shared_memory_base_name=0; #endif static uint opt_protocol= 0; +static CHARSET_INFO *charset_info= &my_charset_latin1; const char *compatible_mode_names[]= { @@ -481,11 +483,8 @@ static int get_options(int *argc, char ***argv) my_progname); return(1); } - if (default_charset) - { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) - exit(1); - } + if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) + exit(1); if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs)) { short_usage(); @@ -592,7 +591,7 @@ static my_bool test_if_special_chars(const char *str) { #if MYSQL_VERSION_ID >= 32300 for ( ; *str ; str++) - if (!my_isvar(system_charset_info,*str) && *str != '$') + if (!my_isvar(charset_info,*str) && *str != '$') return 1; #endif return 0; @@ -1138,7 +1137,7 @@ static void dumpTable(uint numFields, char *table) /* change any strings ("inf","nan",..) into NULL */ char *ptr = row[i]; dynstr_append(&extended_row, - (!my_isalpha(system_charset_info,*ptr)) ? + (!my_isalpha(charset_info,*ptr)) ? ptr : "NULL"); } } @@ -1172,9 +1171,9 @@ static void dumpTable(uint numFields, char *table) if (opt_xml) fprintf(md_result_file, "\t\t%s\n", field->name, - !my_isalpha(system_charset_info, *ptr) ? ptr: "NULL"); + !my_isalpha(charset_info, *ptr) ? ptr: "NULL"); else - fputs((!my_isalpha(system_charset_info,*ptr)) ? + fputs((!my_isalpha(charset_info,*ptr)) ? ptr : "NULL", md_result_file); } } @@ -1481,7 +1480,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length, char buff[255]; *err_pos= 0; /* No error yet */ - while (end > x && my_isspace(system_charset_info, end[-1])) + while (end > x && my_isspace(charset_info, end[-1])) end--; *err_len= 0; diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 408a5873589..efb117280c4 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -43,10 +43,12 @@ static MYSQL mysql_connection; static char *opt_password=0, *current_user=0, *current_host=0, *current_db=0, *fields_terminated=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, - *escaped=0, *opt_columns=0, *default_charset; + *escaped=0, *opt_columns=0, + *default_charset= (char*) MYSQL_CHARSET; static uint opt_mysql_port=0; static my_string opt_mysql_unix_port=0; static my_string opt_ignore_lines=0; +static CHARSET_INFO *charset_info= &my_charset_latin1; #include #ifdef HAVE_SMEM @@ -237,11 +239,8 @@ static int get_options(int *argc, char ***argv) fprintf(stderr, "You can't use --ignore (-i) and --replace (-r) at the same time.\n"); return(1); } - if (default_charset) - { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) - exit(1); - } + if (!(charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) + exit(1); if (*argc < 2) { usage(); diff --git a/client/mysqltest.c b/client/mysqltest.c index 7894b6cd2cf..fb2104f43f4 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -91,7 +91,9 @@ 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; @@ -123,8 +125,11 @@ static int block_stack[BLOCK_STACK_DEPTH]; static int block_ok_stack[BLOCK_STACK_DEPTH]; static uint global_expected_errno[MAX_EXPECTED_ERRORS], global_expected_errors; +static CHARSET_INFO *charset_info= &my_charset_latin1; DYNAMIC_ARRAY q_lines; +#include "sslopt-vars.h" + typedef struct { char file[FN_REFLEN]; @@ -489,9 +494,9 @@ void init_parser() int hex_val(int c) { - if (my_isdigit(system_charset_info,c)) + if (my_isdigit(charset_info,c)) return c - '0'; - else if ((c = my_tolower(system_charset_info,c)) >= 'a' && c <= 'f') + else if ((c = my_tolower(charset_info,c)) >= 'a' && c <= 'f') return c - 'a' + 10; else return -1; @@ -601,7 +606,7 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw, { const char* save_var_name = var_name, *end; end = (var_name_end) ? *var_name_end : 0; - while (my_isvar(system_charset_info,*var_name) && var_name != end) + while (my_isvar(charset_info,*var_name) && var_name != end) ++var_name; if (var_name == save_var_name) { @@ -752,7 +757,7 @@ int do_server_op(struct st_query* q,const char* op) com_p=strmov(com_p,"_exec "); if (!*p) die("Missing server name in server_%s\n",op); - while (*p && !my_isspace(system_charset_info,*p)) + while (*p && !my_isspace(charset_info,*p)) { *com_p++=*p++; } @@ -785,7 +790,7 @@ int do_require_version(struct st_query* q) if (!*p) die("Missing version argument in require_version\n"); ver_arg = p; - while (*p && !my_isspace(system_charset_info,*p)) + while (*p && !my_isspace(charset_info,*p)) p++; *p = 0; ver_arg_len = p - ver_arg; @@ -815,7 +820,7 @@ int do_source(struct st_query* q) if (!*p) die("Missing file name in source\n"); name = p; - while (*p && !my_isspace(system_charset_info,*p)) + while (*p && !my_isspace(charset_info,*p)) p++; *p = 0; @@ -1002,13 +1007,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; } @@ -1055,11 +1053,11 @@ int do_let(struct st_query* q) if (!*p) die("Missing variable name in let\n"); var_name = p; - while (*p && (*p != '=' || my_isspace(system_charset_info,*p))) + while (*p && (*p != '=' || my_isspace(charset_info,*p))) p++; var_name_end = p; if (*p == '=') p++; - while (*p && my_isspace(system_charset_info,*p)) + while (*p && my_isspace(charset_info,*p)) p++; var_val_start = p; return var_set(var_name, var_name_end, var_val_start, q->end); @@ -1089,7 +1087,7 @@ int do_disable_rpl_parse(struct st_query* q __attribute__((unused))) int do_sleep(struct st_query* q, my_bool real_sleep) { char *p=q->first_argument; - while (*p && my_isspace(system_charset_info,*p)) + while (*p && my_isspace(charset_info,*p)) p++; if (!*p) die("Missing argument in sleep\n"); @@ -1105,7 +1103,7 @@ static void get_file_name(char *filename, struct st_query* q) char* p=q->first_argument; strnmov(filename, p, FN_REFLEN); /* Remove end space */ - while (p > filename && my_isspace(system_charset_info,p[-1])) + while (p > filename && my_isspace(charset_info,p[-1])) p--; p[0]=0; } @@ -1191,7 +1189,7 @@ static char *get_string(char **to_ptr, char **from_ptr, if (*from != ' ' && *from) die("Wrong string argument in %s\n", q->query); - while (my_isspace(system_charset_info,*from)) /* Point to next string */ + while (my_isspace(charset_info,*from)) /* Point to next string */ from++; *to =0; /* End of string marker */ @@ -1248,7 +1246,7 @@ static void get_replace(struct st_query *q) insert_pointer_name(&to_array,to); } for (i=1,pos=word_end_chars ; i < 256 ; i++) - if (my_isspace(system_charset_info,i)) + if (my_isspace(charset_info,i)) *pos++= i; *pos=0; /* End pointer */ if (!(glob_replace=init_replace((char**) from_array.typelib.type_names, @@ -1285,7 +1283,7 @@ int select_connection(char *p) if (!*p) die("Missing connection name in connect\n"); name = p; - while (*p && !my_isspace(system_charset_info,*p)) + while (*p && !my_isspace(charset_info,*p)) p++; *p = 0; @@ -1311,7 +1309,7 @@ int close_connection(struct st_query* q) if (!*p) die("Missing connection name in connect\n"); name = p; - while (*p && !my_isspace(system_charset_info,*p)) + while (*p && !my_isspace(charset_info,*p)) p++; *p = 0; @@ -1348,12 +1346,12 @@ int close_connection(struct st_query* q) char* safe_get_param(char* str, char** arg, const char* msg) { DBUG_ENTER("safe_get_param"); - while (*str && my_isspace(system_charset_info,*str)) + while (*str && my_isspace(charset_info,*str)) str++; *arg = str; for (; *str && *str != ',' && *str != ')' ; str++) { - if (my_isspace(system_charset_info,*str)) + if (my_isspace(charset_info,*str)) *str = 0; } if (!*str) @@ -1455,6 +1453,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]) @@ -1636,7 +1639,7 @@ int read_line(char* buf, int size) { state = R_COMMENT; } - else if (my_isspace(system_charset_info,c)) + else if (my_isspace(charset_info,c)) { if (c == '\n') start_lineno= ++*lineno; /* Query hasn't started yet */ @@ -1762,7 +1765,7 @@ int read_query(struct st_query** q_ptr) { expected_errno = 0; p++; - for (;my_isdigit(system_charset_info,*p);p++) + for (;my_isdigit(charset_info,*p);p++) expected_errno = expected_errno * 10 + *p - '0'; q->expected_errno[0] = expected_errno; q->expected_errno[1] = 0; @@ -1770,27 +1773,27 @@ int read_query(struct st_query** q_ptr) } } - while (*p && my_isspace(system_charset_info,*p)) + while (*p && my_isspace(charset_info,*p)) p++ ; if (*p == '@') { p++; p1 = q->record_file; - while (!my_isspace(system_charset_info,*p) && + while (!my_isspace(charset_info,*p) && p1 < q->record_file + sizeof(q->record_file) - 1) *p1++ = *p++; *p1 = 0; } } - while (*p && my_isspace(system_charset_info,*p)) + while (*p && my_isspace(charset_info,*p)) p++; if (!(q->query_buf=q->query=my_strdup(p,MYF(MY_WME)))) die(NullS); /* Calculate first word and first argument */ - for (p=q->query; *p && !my_isspace(system_charset_info,*p) ; p++) ; + for (p=q->query; *p && !my_isspace(charset_info,*p) ; p++) ; q->first_word_len = (uint) (p - q->query); - while (*p && my_isspace(system_charset_info,*p)) + while (*p && my_isspace(charset_info,*p)) p++; q->first_argument=p; q->end = strend(q->query); @@ -1856,6 +1859,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", @@ -1930,6 +1934,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else tty_password= 1; break; +#include case 't': strnmov(TMPDIR, argument, sizeof(TMPDIR)); break; @@ -2346,7 +2351,7 @@ static void init_var_hash() { VAR* v; DBUG_ENTER("init_var_hash"); - if (hash_init(&var_hash, system_charset_info, + if (hash_init(&var_hash, charset_info, 1024, 0, 0, get_var_key, var_free, MYF(0))) die("Variable hash initialization failed"); var_from_env("MASTER_MYPORT", "9306"); @@ -2410,6 +2415,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) @@ -2537,6 +2547,7 @@ int main(int argc, char** argv) } 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 -#include -#include -#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/client/sql_string.h b/client/sql_string.h index 42f9e446981..33f34a43b7f 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -39,12 +39,12 @@ public: String() { Ptr=0; str_length=Alloced_length=0; alloced=0; - str_charset=default_charset_info; + str_charset= &my_charset_latin1; } String(uint32 length_arg) { alloced=0; Alloced_length=0; (void) real_alloc(length_arg); - str_charset=default_charset_info; + str_charset= &my_charset_latin1; } String(const char *str, CHARSET_INFO *cs) { diff --git a/cmd-line-utils/libedit/el.c b/cmd-line-utils/libedit/el.c index d436d113419..76b17aba0cf 100644 --- a/cmd-line-utils/libedit/el.c +++ b/cmd-line-utils/libedit/el.c @@ -369,6 +369,14 @@ el_line(EditLine *el) static const char elpath[] = "/.editrc"; +#if defined(MAXPATHLEN) +#define LIBEDIT_MAXPATHLEN MAXPATHLEN +#elif defined(PATH_MAX) +#define LIBEDIT_MAXPATHLEN PATH_MAX +#else +#define LIBEDIT_MAXPATHLEN 1024 +#endif + /* el_source(): * Source a file */ @@ -377,7 +385,7 @@ el_source(EditLine *el, const char *fname) { FILE *fp; size_t len; - char *ptr, path[MAXPATHLEN]; + char *ptr, path[LIBEDIT_MAXPATHLEN]; fp = NULL; if (fname == NULL) { diff --git a/configure.in b/configure.in index 7a694db2b69..7c0505cb6ac 100644 --- a/configure.in +++ b/configure.in @@ -701,11 +701,8 @@ AC_SUBST(MYSQLD_USER) # If we should allow LOAD DATA LOCAL AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default) AC_ARG_ENABLE(local-infile, - Enable LOAD DATA LOCAL INFILE (default: disabled)], - [ - ENABLED_LOCAL_INFILE=$enableval - AC_DEFINE(ENABLED_LOCAL_INFILE) - ], + [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)], + [ ENABLED_LOCAL_INFILE=$enableval ], [ ENABLED_LOCAL_INFILE=no ] ) if test "$ENABLED_LOCAL_INFILE" = "yes" @@ -1734,26 +1731,14 @@ MYSQL_PTHREAD_YIELD # For readline/libedit (We simply move the mimimum amount of stuff from # the readline/libedit configure.in here) -dnl Checks for programs. -AC_PROG_CC -AC_PROG_AWK -AC_PROG_INSTALL - dnl Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(limits.h malloc.h sys/ioctl.h unistd.h sys/cdefs.h sys/types.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T +AC_CHECK_HEADERS(malloc.h sys/cdefs.h) dnl Checks for library functions. AC_FUNC_ALLOCA AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL -AC_CHECK_FUNCS(re_comp regcomp strdup strerror strstr strtol) +AC_CHECK_FUNCS(re_comp regcomp strdup) AC_CHECK_HEADERS(vis.h) AC_CHECK_FUNCS(strlcat strlcpy) @@ -2416,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) @@ -2601,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/extra/mysql_install.c b/extra/mysql_install.c index 3f3da8cfb51..11f33028ce1 100644 --- a/extra/mysql_install.c +++ b/extra/mysql_install.c @@ -157,7 +157,7 @@ static int get_answer(QUESTION_WIDGET* w) char c; if (!fgets(buf,sizeof(buf),w->in)) die("Failed fgets on input stream"); - switch ((c=my_tolower(system_charset_info,*buf))) + switch ((c=my_tolower(&my_charset_latin1,*buf))) { case '\n': return w->default_ind; diff --git a/extra/replace.c b/extra/replace.c index 5826586988a..8e007e3a971 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -113,7 +113,7 @@ char *argv[]; exit(1); for (i=1,pos=word_end_chars ; i < 256 ; i++) - if (my_isspace(system_charset_info,i)) + if (my_isspace(&my_charset_latin1,i)) *pos++=i; *pos=0; if (!(replace=init_replace((char**) from.typelib.type_names, diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index f19ef467b5c..06a670b935d 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -175,9 +175,9 @@ trace dump and specify the path to it with -s or --symbols-file"); static uchar hex_val(char c) { uchar l; - if (my_isdigit(system_charset_info,c)) + if (my_isdigit(&my_charset_latin1,c)) return c - '0'; - l = my_tolower(system_charset_info,c); + l = my_tolower(&my_charset_latin1,c); if (l < 'a' || l > 'f') return HEX_INVALID; return (uchar)10 + ((uchar)c - (uchar)'a'); @@ -203,10 +203,10 @@ static int init_sym_entry(SYM_ENTRY* se, char* buf) if (!se->addr) return -1; - while (my_isspace(system_charset_info,*buf++)) + while (my_isspace(&my_charset_latin1,*buf++)) /* empty */; - while (my_isspace(system_charset_info,*buf++)) + while (my_isspace(&my_charset_latin1,*buf++)) /* empty - skip more space */; --buf; /* now we are on the symbol */ @@ -288,7 +288,7 @@ static void do_resolve() { p = buf; /* skip space */ - while (my_isspace(system_charset_info,*p)) + while (my_isspace(&my_charset_latin1,*p)) ++p; if (*p++ == '0' && *p++ == 'x') diff --git a/extra/resolveip.c b/extra/resolveip.c index c9446b0fdf2..95861bca2bc 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -122,7 +122,7 @@ int main(int argc, char **argv) { ip = *argv++; - if (my_isdigit(system_charset_info,ip[0])) + if (my_isdigit(&my_charset_latin1,ip[0])) { taddr = inet_addr(ip); if (taddr == htonl(INADDR_BROADCAST)) diff --git a/heap/hp_test1.c b/heap/hp_test1.c index 2e0a57a12d3..96399fe4f2e 100644 --- a/heap/hp_test1.c +++ b/heap/hp_test1.c @@ -51,7 +51,7 @@ int main(int argc, char **argv) keyinfo[0].seg[0].type=HA_KEYTYPE_BINARY; keyinfo[0].seg[0].start=1; keyinfo[0].seg[0].length=6; - keyinfo[0].seg[0].charset=default_charset_info; + keyinfo[0].seg[0].charset= &my_charset_latin1; keyinfo[0].flag = HA_NOSAME; deleted=0; diff --git a/heap/hp_test2.c b/heap/hp_test2.c index 73e8039d125..09ade212fa6 100644 --- a/heap/hp_test2.c +++ b/heap/hp_test2.c @@ -64,6 +64,7 @@ int main(int argc, char *argv[]) HA_KEYSEG keyseg[MAX_KEYS*5]; HEAP_PTR position; HP_CREATE_INFO hp_create_info; + CHARSET_INFO *cs= &my_charset_latin1; MY_INIT(argv[0]); /* init my_sys library & pthreads */ LINT_INIT(position); @@ -85,7 +86,7 @@ int main(int argc, char *argv[]) keyinfo[0].seg[0].start=0; keyinfo[0].seg[0].length=6; keyinfo[0].seg[0].null_bit=0; - keyinfo[0].seg[0].charset=default_charset_info; + keyinfo[0].seg[0].charset=cs; keyinfo[1].seg=keyseg+1; keyinfo[1].keysegs=2; keyinfo[1].flag=0; @@ -94,12 +95,12 @@ int main(int argc, char *argv[]) keyinfo[1].seg[0].start=7; keyinfo[1].seg[0].length=6; keyinfo[1].seg[0].null_bit=0; - keyinfo[1].seg[0].charset=default_charset_info; + keyinfo[1].seg[0].charset=cs; keyinfo[1].seg[1].type=HA_KEYTYPE_TEXT; keyinfo[1].seg[1].start=0; /* key in two parts */ keyinfo[1].seg[1].length=6; keyinfo[1].seg[1].null_bit=0; - keyinfo[1].seg[1].charset=default_charset_info; + keyinfo[1].seg[1].charset=cs; keyinfo[2].seg=keyseg+3; keyinfo[2].keysegs=1; keyinfo[2].flag=HA_NOSAME; @@ -108,7 +109,7 @@ int main(int argc, char *argv[]) keyinfo[2].seg[0].start=12; keyinfo[2].seg[0].length=8; keyinfo[2].seg[0].null_bit=0; - keyinfo[2].seg[0].charset=default_charset_info; + keyinfo[2].seg[0].charset=cs; keyinfo[3].seg=keyseg+4; keyinfo[3].keysegs=1; keyinfo[3].flag=HA_NOSAME; @@ -118,7 +119,7 @@ int main(int argc, char *argv[]) keyinfo[3].seg[0].length=1; keyinfo[3].seg[0].null_bit=1; keyinfo[3].seg[0].null_pos=38; - keyinfo[3].seg[0].charset=default_charset_info; + keyinfo[3].seg[0].charset=cs; bzero((char*) key1,sizeof(key1)); bzero((char*) key3,sizeof(key3)); 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 19c7d315f4a..29ea40eaf33 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -74,6 +74,23 @@ typedef struct my_uni_idx_st } MY_UNI_IDX; +enum my_lex_states +{ + MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, + MY_LEX_IDENT_SEP, MY_LEX_IDENT_START, + MY_LEX_FOUND_IDENT, MY_LEX_SIGNED_NUMBER, MY_LEX_REAL, MY_LEX_HEX_NUMBER, + MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END, + MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL, + MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, + 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_NCHAR, + MY_LEX_STRING_OR_DELIMITER +}; + + typedef struct charset_info_st { uint number; @@ -89,6 +106,8 @@ typedef struct charset_info_st uchar *sort_order; uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; + uchar state_map[256]; + uchar ident_map[256]; /* Collation routines */ uint strxfrm_multiply; @@ -181,6 +200,7 @@ extern CHARSET_INFO my_charset_latin1_de; extern CHARSET_INFO my_charset_sjis; extern CHARSET_INFO my_charset_tis620; extern CHARSET_INFO my_charset_ucs2; +extern CHARSET_INFO my_charset_ucse; extern CHARSET_INFO my_charset_ujis; extern CHARSET_INFO my_charset_utf8; extern CHARSET_INFO my_charset_win1250ch; diff --git a/include/dbug.h b/include/my_dbug.h similarity index 100% rename from include/dbug.h rename to 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 #endif +#include /* 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 +#include #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 b23de114ede..03a0ae70d6a 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,21 +203,19 @@ 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[]; extern uint get_charset_number(const char *cs_name); extern const char *get_charset_name(uint cs_number); extern CHARSET_INFO *get_charset(uint cs_number, myf flags); -extern my_bool set_default_charset(uint cs, myf flags); extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint cs_flags, myf my_flags); -extern my_bool set_default_charset_by_name(const char *cs_name, myf flags); extern void free_charsets(void); extern char *list_charsets(myf want_flags); /* my_free() this string... */ extern char *get_charsets_dir(char *buf); +extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); /* statistics */ 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. */ + /* 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. */ - 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); - } + 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/isam/isamchk.c b/isam/isamchk.c index 35b4e881962..dc772290e13 100644 --- a/isam/isamchk.c +++ b/isam/isamchk.c @@ -681,7 +681,7 @@ static void get_options(register int *argc, register char ***argv) } if (default_charset) { - if (set_default_charset_by_name(default_charset, MYF(MY_WME))) + if (!(default_charset_info= get_charset_by_name(default_charset, MYF(MY_WME)))) exit(1); } return; 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/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 #include -#include #if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE) #undef HAVE_GETPASS diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 6fe199bb45e..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 } @@ -1693,9 +1697,9 @@ STDCALL mysql_rpl_query_type(const char* q, int len) for (; q < q_end; ++q) { char c; - if (my_isalpha(system_charset_info, (c= *q))) + if (my_isalpha(&my_charset_latin1, (c= *q))) { - switch (my_tolower(system_charset_info,c)) { + switch (my_tolower(&my_charset_latin1,c)) { case 'i': /* insert */ case 'u': /* update or unlock tables */ case 'l': /* lock tables or load data infile */ @@ -1703,10 +1707,10 @@ STDCALL mysql_rpl_query_type(const char* q, int len) case 'a': /* alter */ return MYSQL_RPL_MASTER; case 'c': /* create or check */ - return my_tolower(system_charset_info,q[1]) == 'h' ? MYSQL_RPL_ADMIN : + return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN : MYSQL_RPL_MASTER; case 's': /* select or show */ - return my_tolower(system_charset_info,q[1]) == 'h' ? MYSQL_RPL_ADMIN : + return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN : MYSQL_RPL_SLAVE; case 'f': /* flush */ case 'r': /* repair */ @@ -4842,40 +4846,40 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length) switch(param->buffer_type) { case MYSQL_TYPE_TINY: { - uchar data= (uchar)my_strntol(system_charset_info,value,length,10,NULL, + uchar data= (uchar)my_strntol(&my_charset_latin1,value,length,10,NULL, &err); *buffer= data; break; } case MYSQL_TYPE_SHORT: { - short data= (short)my_strntol(system_charset_info,value,length,10,NULL, + short data= (short)my_strntol(&my_charset_latin1,value,length,10,NULL, &err); int2store(buffer, data); break; } case MYSQL_TYPE_LONG: { - int32 data= (int32)my_strntol(system_charset_info,value,length,10,NULL, + int32 data= (int32)my_strntol(&my_charset_latin1,value,length,10,NULL, &err); int4store(buffer, data); break; } case MYSQL_TYPE_LONGLONG: { - longlong data= my_strntoll(system_charset_info,value,length,10,NULL,&err); + longlong data= my_strntoll(&my_charset_latin1,value,length,10,NULL,&err); int8store(buffer, data); break; } case MYSQL_TYPE_FLOAT: { - float data = (float)my_strntod(system_charset_info,value,length,NULL,&err); + float data = (float)my_strntod(&my_charset_latin1,value,length,NULL,&err); float4store(buffer, data); break; } case MYSQL_TYPE_DOUBLE: { - double data= my_strntod(system_charset_info,value,length,NULL,&err); + double data= my_strntod(&my_charset_latin1,value,length,NULL,&err); float8store(buffer, data); break; } diff --git a/libmysql/password.c b/libmysql/password.c deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index daf65cb2f80..b36f8d92490 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 #include #include -#include #include #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 c938dd41a58..a55096dd061 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -3824,8 +3824,8 @@ 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) && ! mi_too_big_key_for_sort(key,rows) && - info->s->base.auto_key != i+1) + 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); info->update|= HA_STATE_CHANGED; 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/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/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/binary.result b/mysql-test/r/binary.result index 4d5eb62cc71..5da627a30b9 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -45,29 +45,30 @@ name drop table t1,t2; create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b)); insert into t1 values ("hello ","hello "),("hello2 ","hello2 "); -select * from t1 where a="hello"; -a b -hello hello -select * from t1 where a="hello "; -a b -hello hello -select * from t1 ignore index (a) where a="hello "; -a b -hello hello -select * from t1 where b="hello"; -a b -hello hello -select * from t1 where b="hello "; -a b -hello hello -select * from t1 ignore index (b) where b="hello "; -a b +select concat("-",a,"-",b,"-") from t1 where a="hello"; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 where a="hello "; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 ignore index (a) where a="hello "; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 where b="hello"; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 where b="hello "; +concat("-",a,"-",b,"-") +-hello-hello- +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; +concat("-",a,"-",b,"-") +-hello-hello- alter table t1 modify b tinytext not null, drop key b, add key (b(100)); -select * from t1 where b="hello "; -a b -select * from t1 ignore index (b) where b="hello "; -a b -hello hello +select concat("-",a,"-",b,"-") from t1 where b="hello "; +concat("-",a,"-",b,"-") +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; +concat("-",a,"-",b,"-") +-hello-hello- drop table t1; create table t1 (b char(8)); insert into t1 values(NULL); 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 4e48a94bb57..07da8c8c75f 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -511,19 +511,62 @@ SHOW FIELDS FROM t1; Field Type Collation Null Key Default Extra latin1_f char(32) latin1_bin YES NULL SET NAMES 'latin1'; +SHOW VARIABLES LIKE 'client_collation'; +Variable_name Value +client_collation latin1 SET NAMES latin1; +SHOW VARIABLES LIKE 'client_collation'; +Variable_name Value +client_collation latin1 +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 latin1_bin; +SHOW VARIABLES LIKE 'client_collation'; +Variable_name Value +client_collation latin1_bin +SET NAMES LATIN1 COLLATE Latin1_Bin; +SHOW VARIABLES LIKE 'client_collation'; +Variable_name Value +client_collation latin1_bin SET NAMES 'latin1' COLLATE 'latin1_bin'; +SHOW VARIABLES LIKE 'client_collation'; +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 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 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 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 0bbb0073420..4d31ab6c274 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1; +SET NAMES latin1; CREATE TABLE t1 ( comment CHAR(32) ASCII NOT NULL, koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL @@ -157,8 +158,9 @@ INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r' INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ü','CYR CAPIT E'); INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'à','CYR CAPIT YU'); INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ñ','CYR CAPIT YA'); -SELECT CONVERT(koi8_ru_f USING utf8),MIN(comment),COUNT(*) FROM t1 GROUP BY 1; -CONVERT(koi8_ru_f USING utf8) MIN(comment) COUNT(*) +SET NAMES utf8; +SELECT koi8_ru_f,MIN(comment),COUNT(*) FROM t1 GROUP BY 1; +koi8_ru_f MIN(comment) COUNT(*) a LAT CAPIT A 2 b LAT CAPIT B 2 c LAT CAPIT C 2 @@ -190,7 +192,8 @@ z LAT CAPIT Z 2 в CYR CAPIT VE 2 г CYR CAPIT GE 2 д CYR CAPIT DE 2 -е CYR CAPIT IE 4 +е CYR CAPIT IE 2 +Ñ‘ CYR CAPIT IO 2 ж CYR CAPIT ZHE 2 з CYR CAPIT ZE 2 и CYR CAPIT I 2 @@ -218,6 +221,7 @@ z LAT CAPIT Z 2 Ñ CYR CAPIT YA 2 ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL; UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8); +SET NAMES koi8r; SELECT * FROM t1; comment koi8_ru_f utf8_f LAT SMALL A a a @@ -272,70 +276,70 @@ LAT CAPIT W W W LAT CAPIT X X X LAT CAPIT Y Y Y LAT CAPIT Z Z Z -CYR SMALL A Á а -CYR SMALL BE  б -CYR SMALL VE × Ð² -CYR SMALL GE Ç Ð³ -CYR SMALL DE Ä Ð´ -CYR SMALL IE Šе -CYR SMALL IO £ Ñ‘ -CYR SMALL ZHE Ö Ð¶ -CYR SMALL ZE Ú Ð· -CYR SMALL I É Ð¸ -CYR SMALL KA Ë Ðº -CYR SMALL EL Ì Ð» -CYR SMALL EM Í Ð¼ -CYR SMALL EN Πн -CYR SMALL O Ï Ð¾ -CYR SMALL PE Рп -CYR SMALL ER Ò Ñ€ -CYR SMALL ES Ó Ñ -CYR SMALL TE Ô Ñ‚ -CYR SMALL U Õ Ñƒ -CYR SMALL EF Æ Ñ„ -CYR SMALL HA È Ñ… -CYR SMALL TSE à ц -CYR SMALL CHE Þ Ñ‡ -CYR SMALL SHA Û Ñˆ -CYR SMALL SCHA Ý Ñ‰ -CYR SMALL HARD SIGN ß ÑŠ -CYR SMALL YERU Ù Ñ‹ -CYR SMALL SOFT SIGN Ø ÑŒ -CYR SMALL E Ü Ñ -CYR SMALL YU À ÑŽ -CYR SMALL YA Ñ Ñ -CYR CAPIT A á Ð -CYR CAPIT BE â Б -CYR CAPIT VE ÷ Ð’ -CYR CAPIT GE ç Г -CYR CAPIT DE ä Д -CYR CAPIT IE å Е -CYR CAPIT IO ³ Ð -CYR CAPIT ZHE ö Ж -CYR CAPIT ZE ú З -CYR CAPIT I é И -CYR CAPIT KA ë К -CYR CAPIT EL ì Л -CYR CAPIT EM í Ðœ -CYR CAPIT EN î Ð -CYR CAPIT O ï О -CYR CAPIT PE ð П -CYR CAPIT ER ò Р -CYR CAPIT ES ó С -CYR CAPIT TE ô Т -CYR CAPIT U õ У -CYR CAPIT EF æ Ф -CYR CAPIT HA è Ð¥ -CYR CAPIT TSE ã Ц -CYR CAPIT CHE þ Ч -CYR CAPIT SHA û Ш -CYR CAPIT SCHA ý Щ -CYR CAPIT HARD SIGN ÿ Ъ -CYR CAPIT YERU ù Ы -CYR CAPIT SOFT SIGN ø Ь -CYR CAPIT E ü Э -CYR CAPIT YU à Ю -CYR CAPIT YA ñ Я +CYR SMALL A Á Á +CYR SMALL BE   +CYR SMALL VE × × +CYR SMALL GE Ç Ç +CYR SMALL DE Ä Ä +CYR SMALL IE Å Å +CYR SMALL IO £ £ +CYR SMALL ZHE Ö Ö +CYR SMALL ZE Ú Ú +CYR SMALL I É É +CYR SMALL KA Ë Ë +CYR SMALL EL Ì Ì +CYR SMALL EM Í Í +CYR SMALL EN Î Î +CYR SMALL O Ï Ï +CYR SMALL PE Ð Ð +CYR SMALL ER Ò Ò +CYR SMALL ES Ó Ó +CYR SMALL TE Ô Ô +CYR SMALL U Õ Õ +CYR SMALL EF Æ Æ +CYR SMALL HA È È +CYR SMALL TSE à à +CYR SMALL CHE Þ Þ +CYR SMALL SHA Û Û +CYR SMALL SCHA Ý Ý +CYR SMALL HARD SIGN ß ß +CYR SMALL YERU Ù Ù +CYR SMALL SOFT SIGN Ø Ø +CYR SMALL E Ü Ü +CYR SMALL YU À À +CYR SMALL YA Ñ Ñ +CYR CAPIT A á á +CYR CAPIT BE â â +CYR CAPIT VE ÷ ÷ +CYR CAPIT GE ç ç +CYR CAPIT DE ä ä +CYR CAPIT IE å å +CYR CAPIT IO ³ ³ +CYR CAPIT ZHE ö ö +CYR CAPIT ZE ú ú +CYR CAPIT I é é +CYR CAPIT KA ë ë +CYR CAPIT EL ì ì +CYR CAPIT EM í í +CYR CAPIT EN î î +CYR CAPIT O ï ï +CYR CAPIT PE ð ð +CYR CAPIT ER ò ò +CYR CAPIT ES ó ó +CYR CAPIT TE ô ô +CYR CAPIT U õ õ +CYR CAPIT EF æ æ +CYR CAPIT HA è è +CYR CAPIT TSE ã ã +CYR CAPIT CHE þ þ +CYR CAPIT SHA û û +CYR CAPIT SCHA ý ý +CYR CAPIT HARD SIGN ÿ ÿ +CYR CAPIT YERU ù ù +CYR CAPIT SOFT SIGN ø ø +CYR CAPIT E ü ü +CYR CAPIT YU à à +CYR CAPIT YA ñ ñ ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL; UPDATE t1 SET bin_f=koi8_ru_f; SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1; @@ -429,37 +433,37 @@ w LAT CAPIT W x LAT CAPIT X y LAT CAPIT Y z LAT CAPIT Z -а CYR CAPIT A -б CYR CAPIT BE -в CYR CAPIT VE -г CYR CAPIT GE -д CYR CAPIT DE -е CYR CAPIT IE -ж CYR CAPIT ZHE -з CYR CAPIT ZE -и CYR CAPIT I -к CYR CAPIT KA -л CYR CAPIT EL -м CYR CAPIT EM -н CYR CAPIT EN -о CYR CAPIT O -п CYR CAPIT PE -Ñ€ CYR CAPIT ER -Ñ CYR CAPIT ES -Ñ‚ CYR CAPIT TE -у CYR CAPIT U -Ñ„ CYR CAPIT EF -Ñ… CYR CAPIT HA -ц CYR CAPIT TSE -ч CYR CAPIT CHE -ш CYR CAPIT SHA -щ CYR CAPIT SCHA -ÑŠ CYR CAPIT HARD SIGN -Ñ‹ CYR CAPIT YERU -ÑŒ CYR CAPIT SOFT SIGN -Ñ CYR CAPIT E -ÑŽ CYR CAPIT YU -Ñ CYR CAPIT YA +Á CYR CAPIT A + CYR CAPIT BE +× CYR CAPIT VE +Ç CYR CAPIT GE +Ä CYR CAPIT DE +Å CYR CAPIT IE +Ö CYR CAPIT ZHE +Ú CYR CAPIT ZE +É CYR CAPIT I +Ë CYR CAPIT KA +Ì CYR CAPIT EL +Í CYR CAPIT EM +Î CYR CAPIT EN +Ï CYR CAPIT O +Ð CYR CAPIT PE +Ò CYR CAPIT ER +Ó CYR CAPIT ES +Ô CYR CAPIT TE +Õ CYR CAPIT U +Æ CYR CAPIT EF +È CYR CAPIT HA +à CYR CAPIT TSE +Þ CYR CAPIT CHE +Û CYR CAPIT SHA +Ý CYR CAPIT SCHA +ß CYR CAPIT HARD SIGN +Ù CYR CAPIT YERU +Ø CYR CAPIT SOFT SIGN +Ü CYR CAPIT E +À CYR CAPIT YU +Ñ CYR CAPIT YA SELECT DISTINCT koi8_ru_f FROM t1; koi8_ru_f a @@ -548,37 +552,37 @@ w x y z -а -б -в -г -д -е -ж -з -и -к -л -м -н -о -п -Ñ€ -Ñ -Ñ‚ -у -Ñ„ -Ñ… -ц -ч -ш -щ -ÑŠ -Ñ‹ -ÑŒ -Ñ -ÑŽ -Ñ +Á + +× +Ç +Ä +Å +Ö +Ú +É +Ë +Ì +Í +Î +Ï +Ð +Ò +Ó +Ô +Õ +Æ +È +à +Þ +Û +Ý +ß +Ù +Ø +Ü +À +Ñ SELECT lower(koi8_ru_f) FROM t1 ORDER BY 1 DESC; lower(koi8_ru_f) Ñ @@ -699,70 +703,70 @@ a a SELECT lower(utf8_f) FROM t1 ORDER BY 1 DESC; lower(utf8_f) -Ñ -Ñ -ÑŽ -ÑŽ -Ñ -Ñ -ÑŒ -ÑŒ -Ñ‹ -Ñ‹ -ÑŠ -ÑŠ -щ -щ -ш -ш -ч -ч -ц -ц -Ñ… -Ñ… -Ñ„ -Ñ„ -у -у -Ñ‚ -Ñ‚ -Ñ -Ñ -Ñ€ -Ñ€ -п -п -о -о -н -н -м -м -л -л -к -к -и -и -з -з -ж -ж -е -Ñ‘ -е -Ñ‘ -д -д -г -г -в -в -б -б -а -а +Ñ +Ñ +À +À +Ü +Ü +Ø +Ø +Ù +Ù +ß +ß +Ý +Ý +Û +Û +Þ +Þ +à +à +È +È +Æ +Æ +Õ +Õ +Ô +Ô +Ó +Ó +Ò +Ò +Ð +Ð +Ï +Ï +Î +Î +Í +Í +Ì +Ì +Ë +Ë +É +É +Ú +Ú +Ö +Ö +Å +£ +Å +£ +Ä +Ä +Ç +Ç +× +× + + +Á +Á z z y @@ -1296,6 +1300,7 @@ CYR CAPIT YA CYR CAPIT YA CYR CAPIT YA CYR SMALL YA CYR SMALL YA CYR CAPIT YA CYR SMALL YA CYR SMALL YA +SET NAMES utf8; ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2; ALTER TABLE t1 CHANGE ucs2_f ucs2_f CHAR(32) UNICODE NOT NULL; INSERT INTO t1 (ucs2_f,comment) VALUES (0x0391,'GREEK CAPIT ALPHA'); @@ -1322,10 +1327,291 @@ 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 +LAT SMALL B b b b b +LAT SMALL C c c c c +LAT SMALL D d d d d +LAT SMALL E e e e e +LAT SMALL F f f f f +LAT SMALL G g g g g +LAT SMALL H h h h h +LAT SMALL I i i i i +LAT SMALL J j j j j +LAT SMALL K k k k k +LAT SMALL L l l l l +LAT SMALL M m m m m +LAT SMALL N n n n n +LAT SMALL O o o o o +LAT SMALL P p p p p +LAT SMALL Q q q q q +LAT SMALL R r r r r +LAT SMALL S s s s s +LAT SMALL T t t t t +LAT SMALL U u u u u +LAT SMALL V v v v v +LAT SMALL W w w w w +LAT SMALL X x x x x +LAT SMALL Y y y y y +LAT SMALL Z z z z z +LAT CAPIT A A A A A +LAT CAPIT B B B B B +LAT CAPIT C C C C C +LAT CAPIT D D D D D +LAT CAPIT E E E E E +LAT CAPIT F F F F F +LAT CAPIT G G G G G +LAT CAPIT H H H H H +LAT CAPIT I I I I I +LAT CAPIT J J J J J +LAT CAPIT K K K K K +LAT CAPIT L L L L L +LAT CAPIT M M M M M +LAT CAPIT N N N N N +LAT CAPIT O O O O O +LAT CAPIT P P P P P +LAT CAPIT Q Q Q Q Q +LAT CAPIT R R R R R +LAT CAPIT S S S S S +LAT CAPIT T T T T T +LAT CAPIT U U U U U +LAT CAPIT V V V V V +LAT CAPIT W W W W W +LAT CAPIT X X X X X +LAT CAPIT Y Y Y Y Y +LAT CAPIT Z Z Z Z Z +CYR SMALL A а а Á а +CYR SMALL BE б б  б +CYR SMALL VE в в × Ð² +CYR SMALL GE г г Ç Ð³ +CYR SMALL DE д д Ä Ð´ +CYR SMALL IE е е Šе +CYR SMALL IO Ñ‘ Ñ‘ £ Ñ‘ +CYR SMALL ZHE ж ж Ö Ð¶ +CYR SMALL ZE з з Ú Ð· +CYR SMALL I и и É Ð¸ +CYR SMALL KA к к Ë Ðº +CYR SMALL EL л л Ì Ð» +CYR SMALL EM м м Í Ð¼ +CYR SMALL EN н н Πн +CYR SMALL O о о Ï Ð¾ +CYR SMALL PE п п Рп +CYR SMALL ER Ñ€ Ñ€ Ò Ñ€ +CYR SMALL ES Ñ Ñ Ó Ñ +CYR SMALL TE Ñ‚ Ñ‚ Ô Ñ‚ +CYR SMALL U у у Õ Ñƒ +CYR SMALL EF Ñ„ Ñ„ Æ Ñ„ +CYR SMALL HA Ñ… Ñ… È Ñ… +CYR SMALL TSE ц ц à ц +CYR SMALL CHE ч ч Þ Ñ‡ +CYR SMALL SHA ш ш Û Ñˆ +CYR SMALL SCHA щ щ Ý Ñ‰ +CYR SMALL HARD SIGN ÑŠ ÑŠ ß ÑŠ +CYR SMALL YERU Ñ‹ Ñ‹ Ù Ñ‹ +CYR SMALL SOFT SIGN ÑŒ ÑŒ Ø ÑŒ +CYR SMALL E Ñ Ñ Ü Ñ +CYR SMALL YU ÑŽ ÑŽ À ÑŽ +CYR SMALL YA Ñ Ñ Ñ Ñ +CYR CAPIT A Ð Ð á Ð +CYR CAPIT BE Б Б â Б +CYR CAPIT VE Ð’ Ð’ ÷ Ð’ +CYR CAPIT GE Г Г ç Г +CYR CAPIT DE Д Д ä Д +CYR CAPIT IE Е Е å Е +CYR CAPIT IO Ð Ð ³ Ð +CYR CAPIT ZHE Ж Ж ö Ж +CYR CAPIT ZE З З ú З +CYR CAPIT I И И é И +CYR CAPIT KA К К ë К +CYR CAPIT EL Л Л ì Л +CYR CAPIT EM Ðœ Ðœ í Ðœ +CYR CAPIT EN Ð Ð î Ð +CYR CAPIT O О О ï О +CYR CAPIT PE П П ð П +CYR CAPIT ER Р Р ò +CYR CAPIT ES С С ó С +CYR CAPIT TE Т Т ô Т +CYR CAPIT U У У õ У +CYR CAPIT EF Ф Ф æ Ф +CYR CAPIT HA Ð¥ Ð¥ è Ð¥ +CYR CAPIT TSE Ц Ц ã Ц +CYR CAPIT CHE Ч Ч þ Ч +CYR CAPIT SHA Ш Ш û Ш +CYR CAPIT SCHA Щ Щ ý Щ +CYR CAPIT HARD SIGN Ъ Ъ ÿ Ъ +CYR CAPIT YERU Ы Ы ù Ы +CYR CAPIT SOFT SIGN Ь Ь ø Ь +CYR CAPIT E Э Э ü Э +CYR CAPIT YU Ю Ю à Ю +CYR CAPIT YA Я Я ñ Я +GREEK CAPIT ALPHA Α Α Α +GREEK CAPIT BETA Î’ Î’ Î’ +GREEK CAPIT GAMMA Γ Γ Γ +GREEK CAPIT DELTA Δ Δ Δ +GREEK CAPIT EPSILON Ε Ε Ε +GREEK SMALL ALPHA α α α +GREEK SMALL BETA β β β +GREEK SMALL GAMMA γ γ γ +GREEK SMALL DELTA δ δ δ +GREEK SMALL EPSILON ε ε ε +ARMENIAN CAPIT AYB Ô± Ô± Ô± +ARMENIAN CAPIT BEN Ô² Ô² Ô² +ARMENIAN CAPIT GIM Ô³ Ô³ Ô³ +ARMENIAN CAPIT DA Ô´ Ô´ Ô´ +ARMENIAN CAPIT ECH Ôµ Ôµ Ôµ +ARMENIAN CAPIT ZA Ô¶ Ô¶ Ô¶ +ARMENIAN SMALL YAB Õ¡ Õ¡ Õ¡ +ARMENIAN SMALL BEN Õ¢ Õ¢ Õ¢ +ARMENIAN SMALL GIM Õ£ Õ£ Õ£ +ARMENIAN SMALL DA Õ¤ Õ¤ Õ¤ +ARMENIAN SMALL ECH Õ¥ Õ¥ Õ¥ +ARMENIAN SMALL ZA Õ¦ Õ¦ Õ¦ +SET NAMES 'binary'; +SELECT * FROM t1; +comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f +LAT SMALL A a a a a +LAT SMALL B b b b b +LAT SMALL C c c c c +LAT SMALL D d d d d +LAT SMALL E e e e e +LAT SMALL F f f f f +LAT SMALL G g g g g +LAT SMALL H h h h h +LAT SMALL I i i i i +LAT SMALL J j j j j +LAT SMALL K k k k k +LAT SMALL L l l l l +LAT SMALL M m m m m +LAT SMALL N n n n n +LAT SMALL O o o o o +LAT SMALL P p p p p +LAT SMALL Q q q q q +LAT SMALL R r r r r +LAT SMALL S s s s s +LAT SMALL T t t t t +LAT SMALL U u u u u +LAT SMALL V v v v v +LAT SMALL W w w w w +LAT SMALL X x x x x +LAT SMALL Y y y y y +LAT SMALL Z z z z z +LAT CAPIT A A A A A +LAT CAPIT B B B B B +LAT CAPIT C C C C C +LAT CAPIT D D D D D +LAT CAPIT E E E E E +LAT CAPIT F F F F F +LAT CAPIT G G G G G +LAT CAPIT H H H H H +LAT CAPIT I I I I I +LAT CAPIT J J J J J +LAT CAPIT K K K K K +LAT CAPIT L L L L L +LAT CAPIT M M M M M +LAT CAPIT N N N N N +LAT CAPIT O O O O O +LAT CAPIT P P P P P +LAT CAPIT Q Q Q Q Q +LAT CAPIT R R R R R +LAT CAPIT S S S S S +LAT CAPIT T T T T T +LAT CAPIT U U U U U +LAT CAPIT V V V V V +LAT CAPIT W W W W W +LAT CAPIT X X X X X +LAT CAPIT Y Y Y Y Y +LAT CAPIT Z Z Z Z Z +CYR SMALL A Á а Á 0 +CYR SMALL BE  б  1 +CYR SMALL VE × Ð² × 2 +CYR SMALL GE Ç Ð³ Ç 3 +CYR SMALL DE Ä Ð´ Ä 4 +CYR SMALL IE Šе Å 5 +CYR SMALL IO £ Ñ‘ £ Q +CYR SMALL ZHE Ö Ð¶ Ö 6 +CYR SMALL ZE Ú Ð· Ú 7 +CYR SMALL I É Ð¸ É 8 +CYR SMALL KA Ë Ðº Ë : +CYR SMALL EL Ì Ð» Ì ; +CYR SMALL EM Í Ð¼ Í < +CYR SMALL EN Πн Î = +CYR SMALL O Ï Ð¾ Ï > +CYR SMALL PE Рп Ð ? +CYR SMALL ER Ò Ñ€ Ò @ +CYR SMALL ES Ó Ñ Ó A +CYR SMALL TE Ô Ñ‚ Ô B +CYR SMALL U Õ Ñƒ Õ C +CYR SMALL EF Æ Ñ„ Æ D +CYR SMALL HA È Ñ… È E +CYR SMALL TSE à ц à F +CYR SMALL CHE Þ Ñ‡ Þ G +CYR SMALL SHA Û Ñˆ Û H +CYR SMALL SCHA Ý Ñ‰ Ý I +CYR SMALL HARD SIGN ß ÑŠ ß J +CYR SMALL YERU Ù Ñ‹ Ù K +CYR SMALL SOFT SIGN Ø ÑŒ Ø L +CYR SMALL E Ü Ñ Ü M +CYR SMALL YU À ÑŽ À N +CYR SMALL YA Ñ Ñ Ñ O +CYR CAPIT A á Ð á  +CYR CAPIT BE â Б â  +CYR CAPIT VE ÷ Ð’ ÷  +CYR CAPIT GE ç Г ç  +CYR CAPIT DE ä Д ä  +CYR CAPIT IE å Е å  +CYR CAPIT IO ³ Ð ³  +CYR CAPIT ZHE ö Ж ö  +CYR CAPIT ZE ú З ú  +CYR CAPIT I é И é  +CYR CAPIT KA ë К ë  +CYR CAPIT EL ì Л ì  +CYR CAPIT EM í Ðœ í  +CYR CAPIT EN î Ð î  +CYR CAPIT O ï О ï  +CYR CAPIT PE ð П ð  +CYR CAPIT ER ò Р ò  +CYR CAPIT ES ó С ó ! +CYR CAPIT TE ô Т ô " +CYR CAPIT U õ У õ # +CYR CAPIT EF æ Ф æ $ +CYR CAPIT HA è Ð¥ è % +CYR CAPIT TSE ã Ц ã & +CYR CAPIT CHE þ Ч þ ' +CYR CAPIT SHA û Ш û ( +CYR CAPIT SCHA ý Щ ý ) +CYR CAPIT HARD SIGN ÿ Ъ ÿ * +CYR CAPIT YERU ù Ы ù + +CYR CAPIT SOFT SIGN ø Ь ø , +CYR CAPIT E ü Э ü - +CYR CAPIT YU à Ю à . +CYR CAPIT YA ñ Я ñ / +GREEK CAPIT ALPHA Α ‘ Á +GREEK CAPIT BETA Î’ ’  +GREEK CAPIT GAMMA Γ “ à +GREEK CAPIT DELTA Δ ” Ä +GREEK CAPIT EPSILON Ε • Å +GREEK SMALL ALPHA α ± á +GREEK SMALL BETA β ² â +GREEK SMALL GAMMA γ ³ ã +GREEK SMALL DELTA δ ´ ä +GREEK SMALL EPSILON ε µ å +ARMENIAN CAPIT AYB Ô± 1 ² +ARMENIAN CAPIT BEN Ô² 2 ´ +ARMENIAN CAPIT GIM Ô³ 3 ¶ +ARMENIAN CAPIT DA Ô´ 4 ¸ +ARMENIAN CAPIT ECH Ôµ 5 º +ARMENIAN CAPIT ZA Ô¶ 6 ¼ +ARMENIAN SMALL YAB Õ¡ a ³ +ARMENIAN SMALL BEN Õ¢ b µ +ARMENIAN SMALL GIM Õ£ c · +ARMENIAN SMALL DA Õ¤ d ¹ +ARMENIAN SMALL ECH Õ¥ e » +ARMENIAN SMALL ZA Õ¦ f ½ SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; min(comment) count(*) LAT CAPIT A 2 diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result new file mode 100644 index 00000000000..3422595c71f --- /dev/null +++ b/mysql-test/r/ctype_recoding.result @@ -0,0 +1,43 @@ +SET NAMES koi8r; +DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ; +CREATE TABLE ÔÁÂÌÉÃÁ +( +ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL +); +SHOW TABLES; +Tables_in_test +ÔÁÂÌÉÃÁ +SHOW CREATE TABLE ÔÁÂÌÉÃÁ; +Table Create Table +ÔÁÂÌÉÃÁ CREATE TABLE `ÔÁÂÌÉÃÁ` ( + `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' +) TYPE=MyISAM CHARSET=latin1 +SHOW FIELDS FROM ÔÁÂÌÉÃÁ; +Field Type Collation Null Key Default Extra +ÐÏÌÅ char(32) character set koi8r koi8r +SET NAMES cp1251; +SHOW TABLES; +Tables_in_test +òàáëèöà +SHOW CREATE TABLE òàáëèöà; +Table Create Table +òàáëèöà CREATE TABLE `òàáëèöà` ( + `ïîëå` char(32) character set koi8r NOT NULL default '' +) TYPE=MyISAM CHARSET=latin1 +SHOW FIELDS FROM òàáëèöà; +Field Type Collation Null Key Default Extra +ïîëå char(32) character set koi8r koi8r +SET NAMES utf8; +SHOW TABLES; +Tables_in_test +таблица +SHOW CREATE TABLE таблица; +Table Create Table +таблица CREATE TABLE `таблица` ( + `поле` char(32) character set koi8r NOT NULL default '' +) TYPE=MyISAM CHARSET=latin1 +SHOW FIELDS FROM таблица; +Field Type Collation Null Key Default Extra +поле char(32) character set koi8r koi8r +SET NAMES koi8r; +DROP TABLE ÔÁÂÌÉÃÁ; 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/derived.result b/mysql-test/r/derived.result index e1e823350d3..e335e316170 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -146,3 +146,5 @@ SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; Unknown column 'a' in 'field list' SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; Unknown column 'a' in 'field list' +select 1 from (select 2) a order by 0; +Unknown column '0' in 'order clause' 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..9118fa8cfed 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -15,26 +15,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 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/row.result b/mysql-test/r/row.result index 40beeb4d3a5..79eb6cc7e59 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -159,3 +159,9 @@ a MAX(b) (1, MAX(b)) = (1, 4) 1 4 1 10 43 0 drop table t1; +SELECT ROW(2,10) <=> ROW(3,4); +ROW(2,10) <=> ROW(3,4) +0 +SELECT ROW(NULL,10) <=> ROW(3,NULL); +ROW(NULL,10) <=> ROW(3,NULL) +0 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/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 5275ef26b5c..c4023832921 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -40,7 +40,12 @@ set insert_id=1234; insert into t2 values(NULL); set global sql_slave_skip_counter=1; start slave; -purge master logs to 'master-bin.000003'; +purge master logs to 'master-bin.000002'; +show binary logs; +Log_name +master-bin.000002 +master-bin.000003 +purge logs before now(); show binary logs; Log_name master-bin.000003 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/subselect.result b/mysql-test/r/subselect.result index 47f24a340cd..795348f1897 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1012,3 +1012,73 @@ id select_type table type possible_keys key key_len ref rows Extra 2 UNCACHEABLE SUBSELECT t1 ALL NULL NULL NULL NULL 3 3 UNCACHEABLE SUBSELECT t1 ALL NULL NULL NULL NULL 3 drop table t1; +select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent); +Table 'test.t1' doesn't exist +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +name char(35) NOT NULL default '', +t2 char(3) NOT NULL default '', +District char(20) NOT NULL default '', +Population int(11) NOT NULL default '0', +PRIMARY KEY (ID) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (130,'Sydney','AUS','New South Wales',3276207); +INSERT INTO t1 VALUES (131,'Melbourne','AUS','Victoria',2865329); +INSERT INTO t1 VALUES (132,'Brisbane','AUS','Queensland',1291117); +CREATE TABLE t2 ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', +Region char(26) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +IndepYear smallint(6) default NULL, +Population int(11) NOT NULL default '0', +LifeExpectancy float(3,1) default NULL, +GNP float(10,2) default NULL, +GNPOld float(10,2) default NULL, +LocalName char(45) NOT NULL default '', +GovernmentForm char(45) NOT NULL default '', +HeadOfState char(60) default NULL, +Capital int(11) default NULL, +Code2 char(2) NOT NULL default '', +PRIMARY KEY (Code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); +select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); +Continent Name Population +Oceania Sydney 3276207 +drop table t1, t2; +CREATE TABLE `t1` ( +`id` mediumint(8) unsigned NOT NULL auto_increment, +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `pseudo` (`pseudo`), +) TYPE=MyISAM PACK_KEYS=1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (pseudo) VALUES ('test'); +SELECT 0 IN (SELECT 1 FROM t1 a); +0 IN (SELECT 1 FROM t1 a) +0 +EXPLAIN SELECT 0 IN (SELECT 1 FROM t1 a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 DEPENDENT SUBSELECT NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 0 IN (SELECT 1 FROM t1 a); +0 IN (SELECT 1 FROM t1 a) +0 +EXPLAIN SELECT 0 IN (SELECT 1 FROM t1 a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 DEPENDENT SUBSELECT NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +drop table t1; +CREATE TABLE `t1` ( +`i` int(11) NOT NULL default '0', +PRIMARY KEY (`i`) +) TYPE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1); +UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); +Invalid use of group function +UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +Invalid use of group function +drop table t1; 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/union.result b/mysql-test/r/union.result index 44d75e54771..0edf5df7ae1 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -230,6 +230,10 @@ id_master id text1 text2 1 3 NULL bar3 1 4 foo4 bar4 drop table if exists t1,t2; +(SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2); +1 3 +1 3 +2 1 create table t1 (a int not null primary key auto_increment, b int, key(b)); create table t2 (a int not null primary key auto_increment, b int); insert into t1 (b) values (1),(2),(2),(3); @@ -263,3 +267,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 2 UNION t1 ref b b 5 const 1 Using where drop table t1,t2; +(select 1) union (select 2) order by 0; +Unknown column '0' in 'order clause' +SELECT @a:=1 UNION SELECT @a:=@a+1; +@a:=1 +1 +2 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/binary.test b/mysql-test/t/binary.test index 4f9ac7581d2..48912a390ed 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -30,16 +30,16 @@ drop table t1,t2; create table t1 (a char(10) not null, b char(10) binary not null,key (a), key(b)); insert into t1 values ("hello ","hello "),("hello2 ","hello2 "); -select * from t1 where a="hello"; -select * from t1 where a="hello "; -select * from t1 ignore index (a) where a="hello "; -select * from t1 where b="hello"; -select * from t1 where b="hello "; -select * from t1 ignore index (b) where b="hello "; +select concat("-",a,"-",b,"-") from t1 where a="hello"; +select concat("-",a,"-",b,"-") from t1 where a="hello "; +select concat("-",a,"-",b,"-") from t1 ignore index (a) where a="hello "; +select concat("-",a,"-",b,"-") from t1 where b="hello"; +select concat("-",a,"-",b,"-") from t1 where b="hello "; +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; # blob test alter table t1 modify b tinytext not null, drop key b, add key (b(100)); -select * from t1 where b="hello "; -select * from t1 ignore index (b) where b="hello "; +select concat("-",a,"-",b,"-") from t1 where b="hello "; +select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello "; drop table t1; # 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 3dc6d3a2dfe..c2ebf39170e 100644 --- a/mysql-test/t/ctype_collate.test +++ b/mysql-test/t/ctype_collate.test @@ -128,12 +128,29 @@ SHOW CREATE TABLE t1; SHOW FIELDS FROM t1; SET NAMES 'latin1'; +SHOW VARIABLES LIKE 'client_collation'; SET NAMES latin1; +SHOW VARIABLES LIKE 'client_collation'; +SHOW VARIABLES LIKE 'client_collation'; SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; SET NAMES latin1 COLLATE latin1_bin; +SHOW VARIABLES LIKE 'client_collation'; +SET NAMES LATIN1 COLLATE Latin1_Bin; +SHOW VARIABLES LIKE 'client_collation'; SET NAMES 'latin1' COLLATE 'latin1_bin'; +SHOW VARIABLES LIKE 'client_collation'; +SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; +SET NAMES koi8r; +SHOW VARIABLES LIKE 'client_collation'; +SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; +SET COLLATION koi8r_bin; +SHOW VARIABLES LIKE 'client_collation'; +SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; +SET COLLATION DEFAULT; +SHOW VARIABLES LIKE 'client_collation'; SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; SET NAMES DEFAULT; +SHOW VARIABLES LIKE 'client_collation'; SELECT charset('a'),collation('a'),coercibility('a'),'a'='A'; --error 1251 SET NAMES latin1 COLLATE koi8r; 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 1f9f9cf99cc..05f3687d330 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -2,6 +2,8 @@ DROP TABLE IF EXISTS t1; --enable_warnings +SET NAMES latin1; + CREATE TABLE t1 ( comment CHAR(32) ASCII NOT NULL, koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL @@ -135,10 +137,12 @@ INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r' INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'à','CYR CAPIT YU'); INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'ñ','CYR CAPIT YA'); -SELECT CONVERT(koi8_ru_f USING utf8),MIN(comment),COUNT(*) FROM t1 GROUP BY 1; +SET NAMES utf8; +SELECT koi8_ru_f,MIN(comment),COUNT(*) FROM t1 GROUP BY 1; ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL; UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8); +SET NAMES koi8r; SELECT * FROM t1; ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL; @@ -161,6 +165,7 @@ FROM t1 t11,t1 t12 WHERE t11.koi8_ru_f=CONVERT(t12.utf8_f USING koi8r) ORDER BY t12.utf8_f,t11.comment,t12.comment; +SET NAMES utf8; ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2; ALTER TABLE t1 CHANGE ucs2_f ucs2_f CHAR(32) UNICODE NOT NULL; @@ -189,9 +194,12 @@ 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; SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; DROP TABLE t1; diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test new file mode 100644 index 00000000000..c0b7139c791 --- /dev/null +++ b/mysql-test/t/ctype_recoding.test @@ -0,0 +1,28 @@ +SET NAMES koi8r; + +--disable_warnings +DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ; +--enable_warnings + +CREATE TABLE ÔÁÂÌÉÃÁ +( + ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL +); + +SHOW TABLES; +SHOW CREATE TABLE ÔÁÂÌÉÃÁ; +SHOW FIELDS FROM ÔÁÂÌÉÃÁ; + +SET NAMES cp1251; +SHOW TABLES; +SHOW CREATE TABLE òàáëèöà; +SHOW FIELDS FROM òàáëèöà; + + +SET NAMES utf8; +SHOW TABLES; +SHOW CREATE TABLE таблица; +SHOW FIELDS FROM таблица; + +SET NAMES koi8r; +DROP TABLE ÔÁÂÌÉÃÁ; 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/derived.test b/mysql-test/t/derived.test index 1dbdd6e0ae8..8b8d9e4d1a2 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -62,3 +62,5 @@ SELECT * FROM (SELECT 1 UNION SELECT a) b; SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; --error 1054 SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; +--error 1054 +select 1 from (select 2) a order by 0; 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..f4b6138c86f 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -24,32 +24,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 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/row.test b/mysql-test/t/row.test index 9d69e56f9ee..fb5fff86b11 100644 --- a/mysql-test/t/row.test +++ b/mysql-test/t/row.test @@ -79,3 +79,5 @@ insert into t1 values (10, 43); insert into t1 values (1, 4); select a, MAX(b), (1, MAX(b)) = (1, 4) from t1 group by a; drop table t1; +SELECT ROW(2,10) <=> ROW(3,4); +SELECT ROW(NULL,10) <=> ROW(3,NULL); 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 52c7bc290bb..8ad5109d2c6 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -89,7 +89,10 @@ connection master; #let slave catch up sync_slave_with_master; connection master; -purge master logs to 'master-bin.000003'; +purge master logs to 'master-bin.000002'; +show binary logs; +--sleep 1; +purge logs before now(); show binary logs; insert into t2 values (65); sync_slave_with_master; 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,10 +1722,26 @@ 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/subselect.test b/mysql-test/t/subselect.test index 1841e9f109a..39dfd4c72e6 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -595,3 +595,81 @@ insert into t1 values (1), (2), (3); explain select a,(select (select rand() from t1 limit 1) from t1 limit 1) from t1; drop table t1; + +# +# error in IN +# +-- error 1146 +select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent); + +# +# complex subquery +# + +CREATE TABLE t1 ( + ID int(11) NOT NULL auto_increment, + name char(35) NOT NULL default '', + t2 char(3) NOT NULL default '', + District char(20) NOT NULL default '', + Population int(11) NOT NULL default '0', + PRIMARY KEY (ID) +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (130,'Sydney','AUS','New South Wales',3276207); +INSERT INTO t1 VALUES (131,'Melbourne','AUS','Victoria',2865329); +INSERT INTO t1 VALUES (132,'Brisbane','AUS','Queensland',1291117); + +CREATE TABLE t2 ( + Code char(3) NOT NULL default '', + Name char(52) NOT NULL default '', + Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', + Region char(26) NOT NULL default '', + SurfaceArea float(10,2) NOT NULL default '0.00', + IndepYear smallint(6) default NULL, + Population int(11) NOT NULL default '0', + LifeExpectancy float(3,1) default NULL, + GNP float(10,2) default NULL, + GNPOld float(10,2) default NULL, + LocalName char(45) NOT NULL default '', + GovernmentForm char(45) NOT NULL default '', + HeadOfState char(60) default NULL, + Capital int(11) default NULL, + Code2 char(2) NOT NULL default '', + PRIMARY KEY (Code) +) TYPE=MyISAM; + +INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); + +select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); + +drop table t1, t2; + +# +# constants in IN +# +CREATE TABLE `t1` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `pseudo` varchar(35) character set latin1 NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `pseudo` (`pseudo`), +) TYPE=MyISAM PACK_KEYS=1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (pseudo) VALUES ('test'); +SELECT 0 IN (SELECT 1 FROM t1 a); +EXPLAIN SELECT 0 IN (SELECT 1 FROM t1 a); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 0 IN (SELECT 1 FROM t1 a); +EXPLAIN SELECT 0 IN (SELECT 1 FROM t1 a); +drop table t1; + +CREATE TABLE `t1` ( + `i` int(11) NOT NULL default '0', + PRIMARY KEY (`i`) +) TYPE=MyISAM CHARSET=latin1; + +INSERT INTO t1 VALUES (1); +-- error 1111 +UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); +-- error 1111 +UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +drop table t1; 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/union.test b/mysql-test/t/union.test index b73d9b5fdfc..d2f35b59f54 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -124,6 +124,7 @@ INSERT INTO t2 (id, id_master, text1, text2) VALUES("4", "1", SELECT 1 AS id_master, 1 AS id, NULL AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master; SELECT 1 AS id_master, 1 AS id, 'ABCDE' AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master; drop table if exists t1,t2; +(SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2); # # Test of bug when using the same table multiple times @@ -141,3 +142,7 @@ explain (select * from t1 where a=1) union (select * from t2 where a=1); explain (select * from t1 where a=1 and b=10) union (select t1.a,t2.a from t1,t2 where t1.a=t2.a); explain (select * from t1 where a=1) union (select * from t1 where b=1); drop table t1,t2; +--error 1054 +(select 1) union (select 2) order by 0; + +SELECT @a:=1 UNION SELECT @a:=@a+1; 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 b1abd460c2e..899acf46fac 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -29,10 +29,14 @@ - Initializing charset related structures - Loading dynamic charsets - Searching for a proper CHARSET_INFO - using charset name, collation name or collatio ID + using charset name, collation name or collation ID - Setting server default character set */ +my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2) +{ + return ((cs1 == cs2) || !strcmp(cs1->csname,cs2->csname)); +} static void set_max_sort_char(CHARSET_INFO *cs) { @@ -54,6 +58,63 @@ static void set_max_sort_char(CHARSET_INFO *cs) } +static void init_state_maps(CHARSET_INFO *cs) +{ + uint i; + uchar *state_map= cs->state_map; + uchar *ident_map= cs->ident_map; + + /* Fill state_map with states to get a faster parser */ + for (i=0; i < 256 ; i++) + { + if (my_isalpha(cs,i)) + state_map[i]=(uchar) MY_LEX_IDENT; + else if (my_isdigit(cs,i)) + state_map[i]=(uchar) MY_LEX_NUMBER_IDENT; +#if defined(USE_MB) && defined(USE_MB_IDENT) + else if (use_mb(cs) && my_ismbhead(cs, i)) + state_map[i]=(uchar) MY_LEX_IDENT; +#endif + else if (!my_isgraph(cs,i)) + state_map[i]=(uchar) MY_LEX_SKIP; + else + state_map[i]=(uchar) MY_LEX_CHAR; + } + state_map[(uchar)'_']=state_map[(uchar)'$']=(uchar) MY_LEX_IDENT; + state_map[(uchar)'\'']=(uchar) MY_LEX_STRING; + state_map[(uchar)'-']=state_map[(uchar)'+']=(uchar) MY_LEX_SIGNED_NUMBER; + state_map[(uchar)'.']=(uchar) MY_LEX_REAL_OR_POINT; + state_map[(uchar)'>']=state_map[(uchar)'=']=state_map[(uchar)'!']= (uchar) MY_LEX_CMP_OP; + state_map[(uchar)'<']= (uchar) MY_LEX_LONG_CMP_OP; + state_map[(uchar)'&']=state_map[(uchar)'|']=(uchar) MY_LEX_BOOL; + state_map[(uchar)'#']=(uchar) MY_LEX_COMMENT; + state_map[(uchar)';']=(uchar) MY_LEX_COLON; + state_map[(uchar)':']=(uchar) MY_LEX_SET_VAR; + state_map[0]=(uchar) MY_LEX_EOL; + state_map[(uchar)'\\']= (uchar) MY_LEX_ESCAPE; + state_map[(uchar)'/']= (uchar) MY_LEX_LONG_COMMENT; + state_map[(uchar)'*']= (uchar) MY_LEX_END_LONG_COMMENT; + state_map[(uchar)'@']= (uchar) MY_LEX_USER_END; + state_map[(uchar) '`']= (uchar) MY_LEX_USER_VARIABLE_DELIMITER; + state_map[(uchar)'"']= (uchar) MY_LEX_STRING_OR_DELIMITER; + + /* + Create a second map to make it faster to find identifiers + */ + for (i=0; i < 256 ; i++) + { + ident_map[i]= (uchar) (state_map[i] == MY_LEX_IDENT || + state_map[i] == MY_LEX_NUMBER_IDENT); + } + + /* 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; + + +} + static void simple_cs_init_functions(CHARSET_INFO *cs) { @@ -211,8 +272,11 @@ static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) to->name= my_once_strdup(from->name,MYF(MY_WME)); if (from->ctype) + { to->ctype= (uchar*) my_once_memdup((char*) from->ctype, MY_CS_CTYPE_TABLE_SIZE, MYF(MY_WME)); + init_state_maps(to); + } if (from->to_lower) to->to_lower= (uchar*) my_once_memdup((char*) from->to_lower, MY_CS_TO_LOWER_TABLE_SIZE, MYF(MY_WME)); @@ -261,7 +325,7 @@ static int add_collation(CHARSET_INFO *cs) if (cs->primary_number == cs->number) cs->state |= MY_CS_PRIMARY; - if (cs->primary_number == cs->number) + if (cs->binary_number == cs->number) cs->state |= MY_CS_BINSORT; if (!(all_charsets[cs->number]->state & MY_CS_COMPILED)) @@ -278,6 +342,8 @@ static int add_collation(CHARSET_INFO *cs) all_charsets[cs->number]->state |= cs->state; } cs->number= 0; + cs->primary_number= 0; + cs->binary_number= 0; cs->name= NULL; cs->state= 0; cs->sort_order= NULL; @@ -349,7 +415,6 @@ char *get_charsets_dir(char *buf) CHARSET_INFO *all_charsets[256]; CHARSET_INFO *default_charset_info = &my_charset_latin1; -CHARSET_INFO *system_charset_info = &my_charset_latin1; #define MY_ADD_CHARSET(x) all_charsets[(x)->number]=(x) @@ -447,7 +512,10 @@ static my_bool init_available_charsets(myf myflags) for (cs=all_charsets; cs < all_charsets+255 ; cs++) { if (*cs) + { set_max_sort_char(*cs); + init_state_maps(*cs); + } } strmov(get_charsets_dir(fname), MY_CHARSET_INDEX); @@ -479,7 +547,7 @@ uint get_charset_number(const char *charset_name) for (cs= all_charsets; cs < all_charsets+255; ++cs) { - if ( cs[0] && cs[0]->name && !strcmp(cs[0]->name, charset_name)) + if ( cs[0] && cs[0]->name && !strcasecmp(cs[0]->name, charset_name)) return cs[0]->number; } return 0; /* this mimics find_type() */ @@ -544,24 +612,6 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags) return cs; } -my_bool set_default_charset(uint cs, myf flags) -{ - CHARSET_INFO *new_charset; - DBUG_ENTER("set_default_charset"); - DBUG_PRINT("enter",("character set: %d",(int) cs)); - - new_charset= get_charset(cs, flags); - if (!new_charset) - { - DBUG_PRINT("error",("Couldn't set default character set")); - DBUG_RETURN(TRUE); /* error */ - } - default_charset_info= new_charset; - system_charset_info= new_charset; - - DBUG_RETURN(FALSE); -} - CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags) { uint cs_number; @@ -593,7 +643,7 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, for (css= all_charsets; css < all_charsets+255; ++css) { if ( css[0] && (css[0]->state & cs_flags) && - css[0]->csname && !strcmp(css[0]->csname, cs_name)) + css[0]->csname && !strcasecmp(css[0]->csname, cs_name)) { cs= css[0]->number ? get_internal_charset(css[0]->number,flags) : NULL; break; @@ -611,25 +661,6 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, } -my_bool set_default_charset_by_name(const char *cs_name, myf flags) -{ - CHARSET_INFO *new_charset; - DBUG_ENTER("set_default_charset_by_name"); - DBUG_PRINT("enter",("character set: %s", cs_name)); - - new_charset= get_charset_by_name(cs_name, flags); - if (!new_charset) - { - DBUG_PRINT("error",("Couldn't set default character set")); - DBUG_RETURN(TRUE); /* error */ - } - - default_charset_info= new_charset; - system_charset_info= new_charset; - DBUG_RETURN(FALSE); -} - - /* Only append name if it doesn't exist from before */ static my_bool charset_in_string(const char *name, DYNAMIC_STRING *s) diff --git a/mysys/charset2html.c b/mysys/charset2html.c index 0d6450a8116..3da24232ad4 100644 --- a/mysys/charset2html.c +++ b/mysys/charset2html.c @@ -108,6 +108,7 @@ static void print_cs(CHARSET_INFO *cs) int main(int argc, char **argv) { const char *the_set = MYSQL_CHARSET; int argcnt = 1; + CHARSET_INFO *cs; my_init(); @@ -120,10 +121,10 @@ int main(int argc, char **argv) { if (argc > argcnt) charsets_dir = argv[argcnt++]; - if (set_default_charset_by_name(the_set, MYF(MY_WME))) + if (!(cs= get_charset_by_name(the_set, MYF(MY_WME)))) return 1; - print_cs(default_charset_info); + print_cs(cs); return 0; } diff --git a/mysys/default.c b/mysys/default.c index 06557f73d06..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 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 #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 */ @@ -249,7 +264,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, { line++; /* Ignore comment and empty lines */ - for (ptr=buff ; my_isspace(system_charset_info,*ptr) ; ptr++ ) ; + for (ptr=buff ; my_isspace(&my_charset_latin1,*ptr) ; ptr++ ) ; if (*ptr == '#' || *ptr == ';' || !*ptr) continue; if (*ptr == '[') /* Group name */ @@ -262,7 +277,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, name,line); goto err; } - for ( ; my_isspace(system_charset_info,end[-1]) ; end--) ;/* Remove end space */ + for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;/* Remove end space */ end[0]=0; read_values=find_type(ptr,group,3) > 0; continue; @@ -278,7 +293,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, continue; if (!(end=value=strchr(ptr,'='))) end=strend(ptr); /* Option without argument */ - for ( ; my_isspace(system_charset_info,end[-1]) ; end--) ; + for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ; if (!value) { if (!(tmp=alloc_root(alloc,(uint) (end-ptr)+3))) @@ -291,9 +306,9 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, { /* Remove pre- and end space */ char *value_end; - for (value++ ; my_isspace(system_charset_info,*value); value++) ; + for (value++ ; my_isspace(&my_charset_latin1,*value); value++) ; value_end=strend(value); - for ( ; my_isspace(system_charset_info,value_end[-1]) ; value_end--) ; + for ( ; my_isspace(&my_charset_latin1,value_end[-1]) ; value_end--) ; if (value_end < value) /* Empty string */ value_end=value; if (!(tmp=alloc_root(alloc,(uint) (end-ptr)+3 + diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 8a7dfc7be09..bce08b9795b 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -267,7 +267,7 @@ uint my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) /* Found one '%' */ } /* Skipp if max size is used (to be compatible with printf) */ - while (my_isdigit(system_charset_info, *fmt) || *fmt == '.' || *fmt == '-') + while (my_isdigit(&my_charset_latin1, *fmt) || *fmt == '.' || *fmt == '-') fmt++; if (*fmt == 's') /* String parameter */ { 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_error.c b/mysys/my_error.c index cd41589f366..6fd346c89f7 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -69,7 +69,7 @@ int my_error(int nr,myf MyFlags, ...) else { /* Skipp if max size is used (to be compatible with printf) */ - while (my_isdigit(system_charset_info, *tpos) || *tpos == '.' || *tpos == '-') + while (my_isdigit(&my_charset_latin1, *tpos) || *tpos == '.' || *tpos == '-') tpos++; if (*tpos == 'l') /* Skipp 'l' argument */ tpos++; 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_getwd.c b/mysys/my_getwd.c index adf131c5fd0..a08d28d8545 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -109,7 +109,7 @@ int my_setwd(const char *dir, myf MyFlags) uint drive,drives; pos++; /* Skipp FN_DEVCHAR */ - drive=(uint) (my_toupper(system_charset_info,dir[0])-'A'+1); + drive=(uint) (my_toupper(&my_charset_latin1,dir[0])-'A'+1); drives= (uint) -1; if ((pos-(byte*) dir) == 2 && drive > 0 && drive < 32) { diff --git a/mysys/my_init.c b/mysys/my_init.c index ec7cae46d53..fa1beaa3e35 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -52,7 +52,7 @@ my_bool my_init_done=0; static ulong atoi_octal(const char *str) { long int tmp; - while (*str && my_isspace(system_charset_info, *str)) + while (*str && my_isspace(&my_charset_latin1, *str)) str++; str2int(str, (*str == '0' ? 8 : 10), /* Octalt or decimalt */ 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/test_charset.c b/mysys/test_charset.c index d031007a1da..6b0f728593a 100644 --- a/mysys/test_charset.c +++ b/mysys/test_charset.c @@ -58,6 +58,7 @@ int main(int argc, char **argv) { const char *the_set = MYSQL_CHARSET; char *cs_list; int argcnt = 1; + CHARSET_INFO *cs; my_init(); @@ -70,11 +71,11 @@ int main(int argc, char **argv) { if (argc > argcnt) charsets_dir = argv[argcnt++]; - if (set_default_charset_by_name(the_set, MYF(MY_WME))) + if (!(cs= get_charset_by_name(the_set, MYF(MY_WME)))) return 1; puts("CHARSET INFO:"); - _print_csinfo(default_charset_info); + _print_csinfo(cs); fflush(stdout); cs_list = list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG)); 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/mysys/typelib.c b/mysys/typelib.c index e524f903b5d..e32fad8742f 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -48,8 +48,8 @@ int find_type(my_string x, TYPELIB *typelib, uint full_name) for (pos=0 ; (j=typelib->type_names[pos]) ; pos++) { for (i=x ; - *i && my_toupper(system_charset_info,*i) == - my_toupper(system_charset_info,*j) ; i++, j++) ; + *i && my_toupper(&my_charset_latin1,*i) == + my_toupper(&my_charset_latin1,*j) ; i++, j++) ; if (! *j) { while (*i == ' ') 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 = ; +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= Send the MySQL daemon error output to .\n\ +\n\ +--help Show this help information.\n\ +\n\ +--mysqld= Use the 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/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 17df384522d..9a787080c3e 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -11,7 +11,6 @@ CP="cp -p" DEBUG=0 SILENT=0 -TMP=/tmp SUFFIX="" OUTTAR=0 @@ -34,33 +33,33 @@ if [ ! -f sql/sql_yacc.cc ]; then exit 1 fi - # -# Assign the tmp directory if it was set from the environment variables +# Debug print of the status # -for i in $TMPDIR $TEMPDIR $TEMP -do - if [ $i ]; then - TMP=$i - break - fi -done +print_debug() +{ + for statement + do + if [ "$DEBUG" = "1" ] ; then + echo $statement + fi + done +} - # # Usage of the script # -show_usage() { - +show_usage() +{ echo "MySQL utility script to create a Windows src package, and it takes" echo "the following arguments:" echo "" echo " --debug Debug, without creating the package" echo " --tmp Specify the temporary location" echo " --silent Do not list verbosely files processed" - echo " --tar Create a tar.gz package instead of .zip" + echo " --tar Create tar.gz package instead of .zip" echo " --help Show this help message" exit 0 @@ -89,6 +88,22 @@ parse_arguments() { parse_arguments "$@" +# +# Assign the tmp directory if it was set from the environment variables +# + +for i in $TMP $TMPDIR $TEMPDIR $TEMP /tmp +do + if [ "$i" ]; then + print_debug "Setting TMP to '$i'" + TMP=$i + break + fi +done + + +# + # # Create a tmp dest directory to copy files # @@ -96,30 +111,23 @@ parse_arguments "$@" BASE=$TMP/my_win_dist$SUFFIX if [ -d $BASE ] ; then - if [ x$DEBUG = x1 ]; then - echo "Destination directory '$BASE' already exists, deleting it" - fi + print_debug "Destination directory '$BASE' already exists, deleting it" rm -r -f $BASE fi $CP -r $SOURCE/VC++Files $BASE - ( find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print )|( -while read v -do - if [ x$DEBUG = x1 ]; then - echo "Replacing LF -> CRLF from '$v'" - fi + while read v + do + print_debug "Replacing LF -> CRLF from '$v'" - # ^M -> type CTRL V + CTRL M - cat $v | sed 's/ //' | sed 's/$/ /' > $v.tmp - rm $v - mv $v.tmp $v - - # awk '!/r\r$/ {print $0"\r"} /r\r$/ {print $0}' $v > $v -done + # ^M -> type CTRL V + CTRL M + cat $v | sed 's/ //' | sed 's/$/ /' > $v.tmp + rm $v + mv $v.tmp $v + done ) # @@ -127,6 +135,9 @@ done # $CP -r $SOURCE/sql/share $BASE/ +rm -r -f "$BASE/share/Makefile" +rm -r -f "$BASE/share/Makefile.in" +rm -r -f "$BASE/share/Makefile.am" # # Clean up if we did this from a bk tree @@ -135,7 +146,7 @@ $CP -r $SOURCE/sql/share $BASE/ if [ -d $BASE/SCCS ] then find $BASE/ -name SCCS -print | xargs rm -r -f - rm -rf "$BASE/InstallShield/Script Files/SCCS" + rm -r -f "$BASE/InstallShield/Script Files/SCCS" fi mkdir $BASE/Docs $BASE/extra $BASE/include @@ -148,9 +159,7 @@ mkdir $BASE/Docs $BASE/extra $BASE/include copy_dir_files() { for arg do - if [ x$DEBUG = x1 ]; then - echo "Copying files from directory '$arg'" - fi + print_debug "Copying files from directory '$arg'" cd $SOURCE/$arg/ for i in *.c *.h *.ih *.i *.ic *.asm \ README INSTALL* LICENSE @@ -183,7 +192,8 @@ copy_dir_dirs() { if [ ! -d $BASE/$arg ]; then mkdir $BASE/$arg - fi + fi + copy_dir_files $arg cd $SOURCE/$arg/ @@ -242,9 +252,7 @@ for i in COPYING ChangeLog README \ Docs/mysqld_error.txt Docs/INSTALL-BINARY do - if [ x$DEBUG = x1 ]; then - echo "Copying file '$i'" - fi + print_debug "Copying file '$i'" if [ -f $i ] then $CP $i $BASE/$i @@ -256,10 +264,8 @@ done # if [ -f scripts/mysql_install_db ]; then - if [ x$DEBUG = x1 ]; then - echo "Initializing the 'data' directory" - fi - scripts/mysql_install_db -WINDOWS --datadir=$BASE/data + print_debug "Initializing the 'data' directory" + scripts/mysql_install_db --windows --datadir=$BASE/data fi @@ -267,8 +273,10 @@ fi # Specify the distribution package name and copy it # -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX-win-src -BASE2=$TMP/$NEW_NAME +NEW_DIR_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX +NEW_NAME=$NEW_DIR_NAME-win-src + +BASE2=$TMP/$NEW_DIR_NAME rm -r -f $BASE2 mv $BASE $BASE2 BASE=$BASE2 @@ -277,7 +285,7 @@ BASE=$BASE2 # If debugging, don't create a zip/tar/gz # -if [ x$DEBUG = x1 ] ; then +if [ "$DEBUG" = "1" ] ; then echo "Please check the distribution files from $BASE" echo "Exiting (without creating the package).." exit @@ -316,13 +324,13 @@ set_tarzip_options() { for arg do - if [ x$arg = x"tar" ]; then + if [ "$arg" = "tar" ]; then ZIPFILE1=gnutar ZIPFILE2=gtar OPT=cvf EXT=".tar" NEED_COMPRESS=1 - if [ x$SILENT = x1 ] ; then + if [ "$SILENT" = "1" ] ; then OPT=cf fi else @@ -331,14 +339,14 @@ set_tarzip_options() OPT="-vr" EXT=".zip" NEED_COMPRESS=0 - if [ x$SILENT = x1 ] ; then + if [ "$SILENT" = "1" ] ; then OPT="-r" fi fi done } -if [ x$OUTTAR = x1 ]; then +if [ "$OUTTAR" = "1" ]; then set_tarzip_options 'tar' else set_tarzip_options 'zip' @@ -347,6 +355,7 @@ fi tar=`which_1 $ZIPFILE1 $ZIPFILE2` if test "$?" = "1" -o "$tar" = "" then + print_debug "Search failed for '$ZIPFILE1', '$ZIPFILE2', using default 'tar'" tar=tar set_tarzip_options 'tar' fi @@ -355,27 +364,21 @@ fi # Create the archive # -if [ xDEBUG = x1 ]; then - echo "Using $tar to create archive" -fi +print_debug "Using $tar to create archive" cd $TMP -$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_NAME +$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME cd $SOURCE -if [ x$NEED_COMPRESS = x1 ] +if [ "$NEED_COMPRESS" = "1" ] then - if [ xDEBUG = x1 ]; then - echo "Compressing archive" - fi + print_debug "Compressing archive" gzip -9 $NEW_NAME$EXT EXT="$EXT.gz" fi -if [ xDEBUG = x1 ]; then - echo "Removing temporary directory" -fi +print_debug "Removing temporary directory" rm -r -f $BASE echo "$NEW_NAME$EXT created successfully !!" diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f108eb8b7dc..1a969895f7f 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, @@ -7,15 +7,15 @@ # # All unrecognized arguments to this script are passed to mysqld. -IN_RPM=0 +in_rpm=0 case "$1" in - -IN-RPM) - IN_RPM="1"; shift + --rpm) + in_rpm="1"; shift ;; esac windows=0 case "$1" in - -WINDOWS) + --windows) windows="1"; shift ;; esac @@ -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,24 +88,44 @@ 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" -then - execdir="@libexecdir@" -else - execdir="$basedir/bin" + 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 + fill_help_tables=$pkgdatadir/fill_help_tables.sql +else + if test $verbose -eq 1 + then + echo "Could not find help file 'fill_help_tables.sql'". + fi fi mdata=$ldata/mysql if test "$windows" -eq 0 -a ! -x $execdir/mysqld then - if test "$IN_RPM" -eq 1 + if test "$in_rpm" -eq 1 then echo "FATAL ERROR $execdir/mysqld not found!" exit 1 @@ -116,7 +139,7 @@ fi hostname=`@HOSTNAME@` # Install this too in the user table # Check if hostname is valid -if test "$windows" -eq 0 -a "$IN_RPM" -eq 0 -a $force -eq 0 +if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a $force -eq 0 then resolved=`$bindir/resolveip $hostname 2>&1` if [ $? -ne 0 ] @@ -140,7 +163,7 @@ then fi # Create database directories mysql & test -if test "$IN_RPM" -eq 0 || "$windows" -eq 0 +if test "$in_rpm" -eq 0 || "$windows" -eq 0 then if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi @@ -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," @@ -318,7 +353,7 @@ then c_c="$c_c comment='Column privileges';" fi -echo "Installing all prepared tables" +echo "Installing privilege tables" if ( cat << END_OF_DATA use mysql; @@ -337,12 +372,15 @@ $i_f $c_t $c_c 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 echo "" - if test "$IN_RPM" -eq 0 || "$windows" -eq 0 + if test "$in_rpm" -eq 0 || "$windows" -eq 0 then echo "To start mysqld at boot time you have to copy support-files/mysql.server" echo "to the right place for your system" @@ -363,7 +401,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$IN_RPM" -eq 0 -a "$windows" -eq 0 + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "You can start the MySQL daemon with:" echo "cd @prefix@ ; $bindir/mysqld_safe &" @@ -377,7 +415,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=; - unless ($answer =~ /^\s*y\s*$/i) + if ( !~ /^\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 5a8cbdfbb1c..6b403b85aae 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -204,7 +204,7 @@ bool Field::send_binary(Protocol *protocol) char buff[MAX_FIELD_WIDTH]; String tmp(buff,sizeof(buff),charset()); val_str(&tmp,&tmp); - return protocol->store(tmp.ptr(), tmp.length()); + return protocol->store(tmp.ptr(), tmp.length(), tmp.charset()); } @@ -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,64 @@ 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 +{ + res.set("geometry", 8, &my_charset_latin1); +} + + +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. @@ -5163,7 +5192,7 @@ void Field_set::sql_type(String &res) const bool Field::eq_def(Field *field) { - if (real_type() != field->real_type() || binary() != field->binary() || + if (real_type() != field->real_type() || charset() != field->charset() || pack_length() != field->pack_length()) return 0; return 1; diff --git a/sql/field.h b/sql/field.h index 37d194ac372..aad13508323 100644 --- a/sql/field.h +++ b/sql/field.h @@ -71,7 +71,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 +843,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 +856,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; } @@ -940,8 +941,11 @@ public: :Field_blob(len_arg, maybe_null_arg, field_name_arg, table_arg, &my_charset_bin) {} 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); diff --git a/sql/filesort.cc b/sql/filesort.cc index 6bc0fc957a9..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); @@ -507,8 +508,7 @@ static void make_sortkey(register SORTPARAM *param, if (res->ptr() != (char*) to) memcpy(to,res->ptr(),length); bzero((char *)to+length,diff); - if (!item->binary()) - my_tosort(cs, (char*) to,length); + my_tosort(cs, (char*) to,length); } break; } @@ -918,6 +918,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) { reg2 uint length; THD *thd= current_thd; + CHARSET_INFO *cs; *multi_byte_charset= 0; length=0; @@ -926,20 +927,17 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) sortorder->need_strxnfrm= 0; if (sortorder->field) { + if (sortorder->field->type() == FIELD_TYPE_BLOB) sortorder->length= thd->variables.max_sort_length; else { sortorder->length=sortorder->field->pack_length(); - if (!sortorder->field->binary()) + if (use_strnxfrm((cs=sortorder->field->charset()))) { - CHARSET_INFO *cs=sortorder->field->charset(); - if (use_strnxfrm(cs)) - { - sortorder->need_strxnfrm= 1; - *multi_byte_charset= 1; - sortorder->length= sortorder->length*cs->strxfrm_multiply; - } + sortorder->need_strxnfrm= 1; + *multi_byte_charset= 1; + sortorder->length= sortorder->length*cs->strxfrm_multiply; } } if (sortorder->field->maybe_null()) @@ -950,15 +948,11 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) switch ((sortorder->result_type=sortorder->item->result_type())) { case STRING_RESULT: sortorder->length=sortorder->item->max_length; - if (!sortorder->item->binary()) - { - CHARSET_INFO *cs=sortorder->item->charset(); - if (use_strnxfrm(cs)) - { - sortorder->length= sortorder->length*cs->strxfrm_multiply; - sortorder->need_strxnfrm= 1; - *multi_byte_charset= 1; - } + if (use_strnxfrm((cs=sortorder->item->charset()))) + { + sortorder->length= sortorder->length*cs->strxfrm_multiply; + sortorder->need_strxnfrm= 1; + *multi_byte_charset= 1; } break; case INT_RESULT: diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index cdb5a8c1219..dbed955c0a9 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -257,15 +257,15 @@ int berkeley_show_logs(Protocol *protocol) for (a = all_logs, f = free_logs; *a; ++a) { protocol->prepare_for_resend(); - protocol->store(*a); - protocol->store("BDB", 3); + protocol->store(*a, system_charset_info); + protocol->store("BDB", 3, system_charset_info); if (f && *f && strcmp(*a, *f) == 0) { f++; - protocol->store(SHOW_LOG_STATUS_FREE); + protocol->store(SHOW_LOG_STATUS_FREE, system_charset_info); } else - protocol->store(SHOW_LOG_STATUS_INUSE); + protocol->store(SHOW_LOG_STATUS_INUSE, system_charset_info); if (protocol->write()) { diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 31f9ba483a3..ce26ee705dd 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -150,6 +150,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 @@ -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); } @@ -4123,7 +4147,7 @@ innodb_show_status( } protocol->prepare_for_resend(); - protocol->store(buf, strlen(buf)); + protocol->store(buf, strlen(buf), system_charset_info); ut_free(buf); if (protocol->write()) 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 7cd5927bd24..7e8dab5daed 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -77,10 +77,10 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type, length=(uint) (strxmov(name, param->db_name,".",param->table_name,NullS) - name); protocol->prepare_for_resend(); - protocol->store(name, length); - protocol->store(param->op_name); - protocol->store(msg_type); - protocol->store(msgbuf, msg_length); + protocol->store(name, length, system_charset_info); + protocol->store(param->op_name, system_charset_info); + protocol->store(msg_type, system_charset_info); + protocol->store(msgbuf, msg_length, system_charset_info); if (protocol->write()) sql_print_error("Failed on my_net_write, writing to stderr instead: %s\n", msgbuf); @@ -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/hash_filo.h b/sql/hash_filo.h index f7384cc6e32..92cd2658967 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -42,6 +42,7 @@ class hash_filo const hash_get_key get_key; hash_free_key free_element; bool init; + CHARSET_INFO *hash_charset; hash_filo_element *first_link,*last_link; public: @@ -49,9 +50,11 @@ public: HASH cache; hash_filo(uint size_arg, uint key_offset_arg , uint key_length_arg, - hash_get_key get_key_arg, hash_free_key free_element_arg) + hash_get_key get_key_arg, hash_free_key free_element_arg, + CHARSET_INFO *hash_charset_arg) :size(size_arg), key_offset(key_offset_arg), key_length(key_length_arg), - get_key(get_key_arg), free_element(free_element_arg),init(0) + get_key(get_key_arg), free_element(free_element_arg),init(0), + hash_charset(hash_charset_arg) { bzero((char*) &cache,sizeof(cache)); } @@ -75,7 +78,7 @@ public: if (!locked) (void) pthread_mutex_lock(&lock); (void) hash_free(&cache); - (void) hash_init(&cache,system_charset_info,size,key_offset, + (void) hash_init(&cache,hash_charset,size,key_offset, key_length, get_key, free_element,0); if (!locked) (void) pthread_mutex_unlock(&lock); diff --git a/sql/hostname.cc b/sql/hostname.cc index 2905320cc15..5c4bde99256 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -65,7 +65,8 @@ bool hostname_cache_init() if (!(hostname_cache=new hash_filo(HOST_CACHE_SIZE, offset, sizeof(struct in_addr),NULL, - (hash_free_key) free))) + (hash_free_key) free, + &my_charset_latin1))) return 1; hostname_cache->clear(); return 0; diff --git a/sql/item.cc b/sql/item.cc index 3c6b85e933b..b4d2d0670d8 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -39,7 +39,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; @@ -90,18 +90,25 @@ bool Item::check_cols(uint c) return 0; } -void Item::set_name(const char *str,uint length) +void Item::set_name(const char *str,uint length, CHARSET_INFO *cs) { if (!length) - name= (char*) str; // Used by AS + name= (char*) str; // Empty string, used by AS else { - while (length && !my_isgraph(system_charset_info,*str)) + while (length && !my_isgraph(cs,*str)) { // Fix problem with yacc length--; str++; } - name=sql_strmake(str,min(length,MAX_FIELD_WIDTH)); + 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)); } } @@ -168,6 +175,48 @@ CHARSET_INFO * Item::default_charset() const return current_thd->db_charset; } +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) { set_field(f); @@ -191,8 +240,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 @@ -257,6 +305,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)) @@ -935,6 +994,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() @@ -1001,7 +1061,7 @@ bool Item::send(Protocol *protocol, String *buffer) { String *res; if ((res=val_str(buffer))) - result= protocol->store(res->ptr(),res->length()); + result= protocol->store(res->ptr(),res->length(),res->charset()); break; } case MYSQL_TYPE_TINY: diff --git a/sql/item.h b/sql/item.h index e262a9cb4e6..1b5fafc180f 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 */ @@ -63,7 +63,7 @@ public: */ Item(THD *thd, Item &item); virtual ~Item() { name=0; } /*lint -e1509 */ - void set_name(const char *str,uint length=0); + void set_name(const char *str,uint length, CHARSET_INFO *cs); void init_make_field(Send_field *tmp_field,enum enum_field_types type); virtual void make_field(Send_field *field); virtual bool fix_fields(THD *, struct st_table_list *, Item **); @@ -98,6 +98,8 @@ public: virtual void split_sum_func(Item **ref_pointer_array, List &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() {} // Row emulation @@ -186,8 +195,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; @@ -359,7 +369,7 @@ public: str_value.set(str,length,cs); coercibility= coer; max_length=length; - name=(char*) str_value.ptr(); + set_name(str, length, cs); decimals=NOT_FIXED_DEC; } Item_string(const char *name_par, const char *str, uint length, @@ -368,7 +378,7 @@ public: str_value.set(str,length,cs); coercibility= coer; max_length=length; - name=(char*) name_par; + set_name(name_par,0,cs); decimals=NOT_FIXED_DEC; } ~Item_string() {} @@ -393,8 +403,7 @@ public: bool eq(const Item *item, bool binary_cmp) const; Item *new_item() { - return new Item_string(name, str_value.ptr(), max_length, - default_charset_info); + return new Item_string(name, str_value.ptr(), max_length, &my_charset_bin); } String *const_string() { return &str_value; } inline void append(char *str, uint length) { str_value.append(str, length); } @@ -406,7 +415,8 @@ public: class Item_datetime :public Item_string { public: - Item_datetime(const char *item_name): Item_string(item_name,"",0,default_charset_info) + Item_datetime(const char *item_name): Item_string(item_name,"",0, + &my_charset_bin) { max_length=19;} enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } }; @@ -414,7 +424,8 @@ public: class Item_empty_string :public Item_string { public: - Item_empty_string(const char *header,uint length) :Item_string("",0,default_charset_info) + Item_empty_string(const char *header,uint length) :Item_string("",0, + &my_charset_bin) { name=(char*) header; max_length=length;} }; @@ -486,7 +497,7 @@ public: enum Type type() const { return REF_ITEM; } bool eq(const Item *item, bool binary_cmp) const { return ref && (*ref)->eq(item, binary_cmp); } - ~Item_ref() { if (ref && (*ref) != this) delete *ref; } + ~Item_ref() { if (ref && (*ref) && (*ref) != this) delete *ref; } double val() { double tmp=(*ref)->val_result(); @@ -511,8 +522,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); } @@ -523,7 +534,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 3ca3a556658..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,10 +167,13 @@ void Item_bool_func2::fix_length_and_dec() } } } + 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(); - /* QQ: COERCIBILITY */ - cmp_charset= (args[0]->binary() || args[1]->binary()) ? - &my_charset_bin : args[0]->charset(); } @@ -266,8 +312,8 @@ int Arg_comparator::compare_e_row() uint n= (*a)->cols(); for (uint i= 0; isetup(args[0]); if (cache->cols() == 1) - cache->set_used_tables(RAND_TABLE_BIT); + { + if (args[0]->used_tables()) + cache->set_used_tables(RAND_TABLE_BIT); + else + cache->set_used_tables(0); + } else { uint n= cache->cols(); for (uint i= 0; i < n; i++) - ((Item_cache *)cache->el(i))->set_used_tables(RAND_TABLE_BIT); + { + if (args[0]->el(i)->used_tables()) + ((Item_cache *)cache->el(i))->set_used_tables(RAND_TABLE_BIT); + else + ((Item_cache *)cache->el(i))->set_used_tables(0); + } } if (args[1]->fix_fields(thd, tables, args)) return 1; @@ -352,7 +408,6 @@ void Item_func_equal::fix_length_and_dec() { Item_bool_func2::fix_length_and_dec(); maybe_null=null_value=0; - set_cmp_func(); } longlong Item_func_equal::val_int() @@ -595,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()); } @@ -635,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; } @@ -668,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 { @@ -705,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; } @@ -1114,7 +1179,7 @@ int in_vector::find(Item *item) in_string::in_string(uint elements,qsort_cmp cmp_func) :in_vector(elements, sizeof(String), cmp_func), - tmp(buff, sizeof(buff), default_charset_info) + tmp(buff, sizeof(buff), &my_charset_bin) {} in_string::~in_string() @@ -1137,7 +1202,7 @@ void in_string::set(uint pos,Item *item) { CHARSET_INFO *cs; if (!(cs= item->charset())) - cs= default_charset_info; // Should never happen for STR items + cs= &my_charset_bin; // Should never happen for STR items str->set_charset(cs); } } @@ -1739,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; @@ -1750,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; } } @@ -1768,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 @@ -1840,7 +1907,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) if (!regex_compiled && args[1]->const_item()) { char buff[MAX_FIELD_WIDTH]; - String tmp(buff,sizeof(buff),default_charset_info); + String tmp(buff,sizeof(buff),&my_charset_bin); String *res=args[1]->val_str(&tmp); if (args[1]->null_value) { // Will always return NULL @@ -1870,7 +1937,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) longlong Item_func_regex::val_int() { char buff[MAX_FIELD_WIDTH]; - String *res, tmp(buff,sizeof(buff),default_charset_info); + String *res, tmp(buff,sizeof(buff),&my_charset_bin); res=args[0]->val_str(&tmp); if (args[0]->null_value) @@ -1881,7 +1948,7 @@ longlong Item_func_regex::val_int() if (!regex_is_const) { char buff2[MAX_FIELD_WIDTH]; - String *res2, tmp2(buff2,sizeof(buff2),default_charset_info); + String *res2, tmp2(buff2,sizeof(buff2),&my_charset_bin); res2= args[1]->val_str(&tmp2); if (args[1]->null_value) @@ -2191,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; + 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)))) + 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) @@ -2251,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 cc0ce455019..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; } @@ -482,7 +484,7 @@ public: int cmp(Item *arg) { char buff[80]; - String tmp(buff, sizeof(buff), default_charset_info), *res; + String tmp(buff, sizeof(buff), cmp_charset), *res; if (!(res= arg->val_str(&tmp))) return 1; /* Can't be right */ return sortcmp(value_res, res, cmp_charset); 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) -{ - return new Item_func_geometry_from_text(a); -} - -Item *create_func_as_text(Item* a) +Item *create_func_as_text(Item *a) { return new Item_func_as_text(a); } -Item *create_func_startpoint(Item* a) +Item *create_func_srid(Item *a) +{ + return new Item_func_srid(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 53d15e838b2..5bbb6003e4f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -107,7 +107,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) || @@ -116,38 +115,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 (strcmp(charset()->csname,(*arg)->charset()->csname)) - { - 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(); @@ -499,12 +466,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; } @@ -791,20 +761,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; } @@ -840,7 +818,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() @@ -877,9 +855,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; + } } } @@ -931,6 +913,7 @@ String *Item_func_min_max::val_str(String *str) } } } + res->set_charset(charset()); return res; } case ROW_RESULT: @@ -1024,7 +1007,7 @@ longlong Item_func_char_length::val_int() return 0; /* purecov: inspected */ } null_value=0; - return (longlong) (!args[0]->binary()) ? res->numchars() : res->length(); + return (longlong) res->numchars(); } longlong Item_func_coercibility::val_int() @@ -1156,7 +1139,7 @@ longlong Item_func_ord::val_int() null_value=0; if (!res->length()) return 0; #ifdef USE_MB - if (use_mb(res->charset()) && !args[0]->binary()) + if (use_mb(res->charset())) { register const char *str=res->ptr(); register uint32 n=0, l=my_ismbchar(res->charset(),str,str+res->length()); @@ -1545,7 +1528,7 @@ String *udf_handler::val_str(String *str,String *save_str) str->length(res_length); return str; } - save_str->set(res, res_length, default_charset_info); + save_str->set(res, res_length, str->charset()); return save_str; } @@ -1632,8 +1615,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); @@ -1837,7 +1822,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; @@ -2641,7 +2626,7 @@ Item *get_system_var(enum_var_type var_type, LEX_STRING name) pos=strmov(pos,"global."); memcpy(pos, var->name, var->name_length+1); // set_name() will allocate the name - item->set_name(buff,(uint) (pos-buff)+var->name_length); + item->set_name(buff,(uint) (pos-buff)+var->name_length, system_charset_info); return item; } @@ -2656,9 +2641,9 @@ Item *get_system_var(enum_var_type var_type, const char *var_name, uint length, var= find_sys_var(var_name, length); DBUG_ASSERT(var != 0); if (!(item=var->item(thd, var_type))) - return 0; // Impossible + return 0; // Impossible thd->lex.uncacheable(); - item->set_name(item_name); // Will use original name + item->set_name(item_name, 0, system_charset_info); // Will use original name return item; } @@ -2698,6 +2683,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 @@ -2706,115 +2713,129 @@ 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; +} diff --git a/sql/item_func.h b/sql/item_func.h index 860ddbbbadf..0429e650071 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 5738f217063..76d05cae009 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -321,9 +321,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; @@ -650,7 +662,7 @@ String *Item_func_reverse::val_str(String *str) ptr = (char *) res->ptr(); end=ptr+res->length(); #ifdef USE_MB - if (use_mb(res->charset()) && !binary()) + if (use_mb(res->charset())) { String tmpstr; tmpstr.copy(*res); @@ -978,6 +990,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; @@ -1015,7 +1028,7 @@ String *Item_func_substr_index::val_str(String *str) return &empty_string; // Wrong parameters #ifdef USE_MB - if (use_mb(res->charset()) && !binary()) + if (use_mb(res->charset())) { const char *ptr=res->ptr(); const char *strend = ptr+res->length(); @@ -1169,7 +1182,7 @@ String *Item_func_rtrim::val_str(String *str) { char chr=(*remove_str)[0]; #ifdef USE_MB - if (use_mb(res->charset()) && !binary()) + if (use_mb(res->charset())) { while (ptr < end) { @@ -1186,7 +1199,7 @@ String *Item_func_rtrim::val_str(String *str) { const char *r_ptr=remove_str->ptr(); #ifdef USE_MB - if (use_mb(res->charset()) && !binary()) + if (use_mb(res->charset())) { loop: while (ptr + remove_length < end) @@ -1237,7 +1250,7 @@ String *Item_func_trim::val_str(String *str) while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length)) ptr+=remove_length; #ifdef USE_MB - if (use_mb(res->charset()) && !binary()) + if (use_mb(res->charset())) { char *p=ptr; register uint32 l; @@ -1791,6 +1804,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()); @@ -2015,72 +2029,21 @@ String *Item_func_conv::val_str(String *str) String *Item_func_conv_charset::val_str(String *str) { - my_wc_t wc; - int cnvres; - const uchar *s, *se; - uchar *d, *d0, *de; - uint32 dmaxlen; String *arg= args[0]->val_str(str); - CHARSET_INFO *from,*to; - if (!arg) { null_value=1; return 0; } - null_value=0; - - from=arg->charset(); - to=conv_charset; - - s=(const uchar*)arg->ptr(); - se=s+arg->length(); - - dmaxlen=arg->length()*to->mbmaxlen+1; - str->alloc(dmaxlen); - d0=d=(unsigned char*)str->ptr(); - de=d+dmaxlen; - - while (1) - { - cnvres=from->mb_wc(from,&wc,s,se); - if (cnvres>0) - { - s+=cnvres; - } - else if (cnvres==MY_CS_ILSEQ) - { - s++; - wc='?'; - } - else - break; - -outp: - cnvres=to->wc_mb(to,wc,d,de); - if (cnvres>0) - { - d+=cnvres; - } - else if (cnvres==MY_CS_ILUNI && wc!='?') - { - wc='?'; - goto outp; - } - else - break; - }; - - str->length((uint32) (d-d0)); - str->set_charset(to); - return str; + null_value= str->copy(arg->ptr(),arg->length(),arg->charset(),conv_charset); + return null_value ? 0 : 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); } @@ -2152,25 +2115,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; @@ -2185,24 +2129,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, @@ -2213,26 +2144,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 (strcmp(args[0]->charset()->csname,set_collation->csname)) + 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 */ @@ -2560,10 +2485,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; @@ -2576,19 +2510,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; @@ -2601,11 +2567,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), @@ -2616,14 +2583,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; } @@ -2631,15 +2603,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; - return null_value ? 0: str; + if (str->reserve(SRID_SIZE, 512)) + return 0; + str->length(0); + uint32 srid= uint4korr(swkb->ptr()); + str->q_append(srid); + + return (null_value= geom.centroid(str)) ? 0 : str; } @@ -2650,15 +2629,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: @@ -2679,7 +2663,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; @@ -2689,28 +2673,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; @@ -2723,7 +2709,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; @@ -2746,9 +2732,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); @@ -2775,19 +2761,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; @@ -2798,16 +2784,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 @@ -2818,8 +2804,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; @@ -2830,17 +2816,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: @@ -2851,25 +2837,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/item_subselect.cc b/sql/item_subselect.cc index a29cf57b4e1..76451680b59 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -88,7 +88,14 @@ bool Item_subselect::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) if (have_to_be_excluded) engine->exclude(); substitution= 0; - return (*ref)->fix_fields(thd, tables, ref); + int ret= (*ref)->fix_fields(thd, tables, ref); + // We can't substitute aggregate functions (like (SELECT (max(i))) + if ((*ref)->with_sum_func) + { + my_error(ER_INVALID_GROUP_FUNC_USE, MYF(0)); + return 1; + } + return ret; } char const *save_where= thd->where; @@ -487,6 +494,8 @@ void Item_in_subselect::single_value_transformer(THD *thd, setup_ref_array(thd, &sl->ref_pointer_array, 1 + sl->with_sum_func + sl->order_list.elements + sl->group_list.elements); + // To prevent crash on Item_ref_null_helper destruction in case of error + sl->ref_pointer_array[0]= 0; item= (*func)(expr, new Item_ref_null_helper(this, sl->ref_pointer_array, (char *)"", @@ -684,7 +693,7 @@ int subselect_single_select_engine::prepare() (ORDER*) select_lex->group_list.first, select_lex->having, (ORDER*) 0, select_lex, - select_lex->master_unit(), 0, 0)) + select_lex->master_unit(), 0)) return 1; thd->lex.current_select= save_select; return 0; diff --git a/sql/key.cc b/sql/key.cc index 38ab596e213..37ef6339f20 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -67,7 +67,7 @@ int find_ref_key(TABLE *table,Field *field, uint *key_length) /* Copy a key from record to some buffer */ - /* if length == 0 then copy hole key */ + /* if length == 0 then copy whole key */ void key_copy(byte *key,TABLE *table,uint idx,uint key_length) { @@ -271,5 +271,13 @@ bool check_if_key_used(TABLE *table, uint idx, List &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 c5dfae3921a..3bc5820ee66 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -64,6 +64,7 @@ static SYMBOL symbols[] = { { "AVG_ROW_LENGTH", SYM(AVG_ROW_LENGTH),0,0}, { "AUTO_INCREMENT", SYM(AUTO_INC),0,0}, { "BACKUP", SYM(BACKUP_SYM),0,0}, + { "BEFORE", SYM(BEFORE_SYM),0,0}, { "BEGIN", SYM(BEGIN_SYM),0,0}, { "BERKELEYDB", SYM(BERKELEY_DB_SYM),0,0}, { "BDB", SYM(BERKELEY_DB_SYM),0,0}, @@ -256,6 +257,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}, @@ -494,7 +496,9 @@ static SYMBOL sql_functions[] = { { "GEOMCOLLFROMTEXT", 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)}, @@ -508,6 +512,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)}, @@ -577,6 +582,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 6b06bd781ce..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); @@ -687,6 +689,19 @@ err: DBUG_RETURN(error); } +/* + Update log index_file +*/ + +int MYSQL_LOG::update_log_index(LOG_INFO* log_info) +{ + if (copy_up_file_and_fill(&index_file, log_info->index_file_start_offset)) + return LOG_INFO_IO; + + // now update offsets in index file for running threads + adjust_linfo_offsets(log_info->index_file_start_offset); + return 0; +} /* Remove all logs before the given log from disk and from the index file. @@ -739,21 +754,76 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) If we get killed -9 here, the sysadmin would have to edit the log index file after restart - otherwise, this should be safe */ - - if (copy_up_file_and_fill(&index_file, log_info.index_file_start_offset)) - { - error= LOG_INFO_IO; - goto err; - } - - // now update offsets in index file for running threads - adjust_linfo_offsets(log_info.index_file_start_offset); + error= update_log_index(&log_info); err: pthread_mutex_unlock(&LOCK_index); DBUG_RETURN(error); } +/* + Remove all logs before the given file date from disk and from the + index file. + + SYNOPSIS + purge_logs_before_date() + thd Thread pointer + before_date Delete all log files before given date. + + NOTES + If any of the logs before the deleted one is in use, + only purge logs up to this one. + + RETURN VALUES + 0 ok + LOG_INFO_PURGE_NO_ROTATE Binary file that can't be rotated +*/ + +int MYSQL_LOG::purge_logs_before_date(THD* thd, time_t purge_time) +{ + int error; + LOG_INFO log_info; + MY_STAT stat_area; + + DBUG_ENTER("purge_logs_before_date"); + + if (no_rotate) + DBUG_RETURN(LOG_INFO_PURGE_NO_ROTATE); + + pthread_mutex_lock(&LOCK_index); + + /* + Delete until we find curren file + or a file that is used or a file + that is older than purge_time. + */ + if ((error=find_log_pos(&log_info, NullS, 0 /*no mutex*/))) + goto err; + + while (strcmp(log_file_name, log_info.log_file_name) && + !log_in_use(log_info.log_file_name)) + { + /* It's not fatal even if we can't delete a log file */ + if (!my_stat(log_info.log_file_name, &stat_area, MYF(0)) || + stat_area.st_mtime >= purge_time) + break; + my_delete(log_info.log_file_name, MYF(0)); + if (find_next_log(&log_info, 0)) + break; + } + + /* + If we get killed -9 here, the sysadmin would have to edit + the log index file after restart - otherwise, this should be safe + */ + error= update_log_index(&log_info); + +err: + pthread_mutex_unlock(&LOCK_index); + DBUG_RETURN(error); +} + + #endif /* HAVE_REPLICATION */ @@ -1043,6 +1113,7 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command, bool MYSQL_LOG::write(Log_event* event_info) { bool error=0; + bool should_rotate = 0; DBUG_ENTER("MYSQL_LOG::write(event)"); if (!inited) // Can't use mutex if not init @@ -1055,7 +1126,6 @@ bool MYSQL_LOG::write(Log_event* event_info) /* In most cases this is only called if 'is_open()' is true */ if (is_open()) { - bool should_rotate = 0; THD *thd=event_info->thd; const char *local_db = event_info->get_db(); #ifdef USING_TRANSACTIONS @@ -1126,6 +1196,7 @@ bool MYSQL_LOG::write(Log_event* event_info) goto err; } } +#if 0 if (thd->variables.convert_set) { char buf[256], *p; @@ -1136,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) || @@ -1192,6 +1264,15 @@ err: } pthread_mutex_unlock(&LOCK_log); +#ifdef HAVE_REPLICATION + if (should_rotate && expire_logs_days) + { + long purge_time= time(0) - expire_logs_days*24*60*60; + if (purge_time >= 0) + error= purge_logs_before_date(current_thd, purge_time); + } + +#endif DBUG_RETURN(error); } @@ -1244,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; } @@ -1266,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 12921eb0c01..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); } @@ -348,10 +348,10 @@ int Log_event::net_send(Protocol *protocol, const char* log_name, my_off_t pos) log_name = p + 1; protocol->prepare_for_resend(); - protocol->store(log_name); + protocol->store(log_name, &my_charset_bin); protocol->store((ulonglong) pos); event_type = get_type_str(); - protocol->store(event_type, strlen(event_type)); + protocol->store(event_type, strlen(event_type), &my_charset_bin); protocol->store((uint32) server_id); protocol->store((ulonglong) log_pos); pack_info(protocol); @@ -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; } @@ -722,7 +731,7 @@ void Query_log_event::pack_info(Protocol *protocol) memcpy(pos, query, q_len); pos+= q_len; } - protocol->store(buf, pos-buf); + protocol->store(buf, pos-buf, &my_charset_bin); my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); } #endif @@ -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) @@ -992,7 +1000,7 @@ void Start_log_event::pack_info(Protocol *protocol) pos= strmov(pos, server_version); pos= strmov(pos, ", Binlog ver: "); pos=int10_to_str(binlog_version, pos, 10); - protocol->store(buf, pos-buf); + protocol->store(buf, pos-buf, &my_charset_bin); } #endif @@ -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 @@ -1191,7 +1200,7 @@ void Load_log_event::pack_info(Protocol *protocol) *pos++= ')'; } - protocol->store(buf, pos-buf); + protocol->store(buf, pos-buf, &my_charset_bin); my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); } #endif @@ -1526,7 +1535,6 @@ void Load_log_event::set_fields(List &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)) { @@ -1665,7 +1674,7 @@ void Rotate_log_event::pack_info(Protocol *protocol) b_pos=longlong10_to_str(pos, b_pos, 10); if (flags & LOG_EVENT_FORCED_ROTATE_F) b_pos= strmov(b_pos ,"; forced by master"); - protocol->store(buf, b_pos-buf); + protocol->store(buf, b_pos-buf, &my_charset_bin); my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); } #endif @@ -1800,7 +1809,7 @@ void Intvar_log_event::pack_info(Protocol *protocol) pos= strmov(buf, get_var_type_name()); *(pos++)='='; pos= longlong10_to_str(val, pos, -10); - protocol->store(buf, pos-buf); + protocol->store(buf, pos-buf, &my_charset_bin); } #endif @@ -1911,7 +1920,7 @@ void Rand_log_event::pack_info(Protocol *protocol) pos= int10_to_str((long) seed1, pos, 10); pos= strmov(pos, ",rand_seed2="); pos= int10_to_str((long) seed2, pos, 10); - protocol->store(buf1, (uint) (pos-buf1)); + protocol->store(buf1, (uint) (pos-buf1), &my_charset_bin); } #endif @@ -2013,7 +2022,7 @@ void User_var_log_event::pack_info(Protocol* protocol) buf[0]= '@'; buf[1+name_len]= '='; memcpy(buf+1, name, name_len); - protocol->store(buf, event_len); + protocol->store(buf, event_len, &my_charset_bin); my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); } #endif // !MYSQL_CLIENT @@ -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(); @@ -2213,7 +2219,7 @@ void Slave_log_event::pack_info(Protocol *protocol) pos= strmov(pos, master_log); pos= strmov(pos, ",pos="); pos= longlong10_to_str(master_pos, pos, 10); - protocol->store(buf, pos-buf); + protocol->store(buf, pos-buf, &my_charset_bin); } #endif // !MYSQL_CLIENT @@ -2547,7 +2553,7 @@ void Create_file_log_event::pack_info(Protocol *protocol) pos= int10_to_str((long) file_id, pos, 10); pos= strmov(pos, ";block_len="); pos= int10_to_str((long) block_len, pos, 10); - protocol->store(buf, pos-buf); + protocol->store(buf, pos-buf, &my_charset_bin); } #endif @@ -2698,7 +2704,7 @@ void Append_block_log_event::pack_info(Protocol *protocol) length= (uint) my_sprintf(buf, (buf, ";file_id=%u;block_len=%u", file_id, block_len)); - protocol->store(buf, (int32) length); + protocol->store(buf, (int32) length, &my_charset_bin); } #endif @@ -2811,7 +2817,7 @@ void Delete_file_log_event::pack_info(Protocol *protocol) char buf[64]; uint length; length= (uint) my_sprintf(buf, (buf, ";file_id=%u", (uint) file_id)); - protocol->store(buf, (int32) length); + protocol->store(buf, (int32) length, &my_charset_bin); } #endif @@ -2910,7 +2916,7 @@ void Execute_load_log_event::pack_info(Protocol *protocol) char buf[64]; uint length; length= (uint) my_sprintf(buf, (buf, ";file_id=%u", (uint) file_id)); - protocol->store(buf, (int32) length); + protocol->store(buf, (int32) length, &my_charset_bin); } /***************************************************************************** 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 5bf7e6e6951..f68de23034a 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -62,8 +62,9 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); #endif #endif -#define my_thd_charset default_charset_info -#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 @@ -405,8 +406,7 @@ int mysql_select(THD *thd, Item ***rref_pointer_array, COND *conds, uint og_num, ORDER *order, ORDER *group, Item *having, ORDER *proc_param, ulong select_type, select_result *result, SELECT_LEX_UNIT *unit, - SELECT_LEX *select_lex, bool fake_select_lex, - bool tables_and_fields_initied); + SELECT_LEX *select_lex, bool tables_and_fields_initied); void free_underlaid_joins(THD *thd, SELECT_LEX *select); void fix_tables_pointers(SELECT_LEX *select_lex); void fix_tables_pointers(SELECT_LEX_UNIT *select_lex); @@ -715,6 +715,7 @@ extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit; extern ulong max_binlog_size, rpl_recovery_rank, thread_cache_size; extern ulong com_stat[(uint) SQLCOM_END], com_other, back_log; extern ulong specialflag, current_pid; +extern ulong expire_logs_days; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version,dropping_tables; @@ -781,6 +782,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); @@ -792,6 +794,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 85cde682c58..ddaf8e538c6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -413,6 +413,7 @@ ulong max_connections,max_insert_delayed_threads,max_used_connections, max_connect_errors, max_user_connections = 0; ulong thread_id=1L,current_pid; ulong slow_launch_threads = 0; +ulong expire_logs_days = 0; char mysql_real_data_home[FN_REFLEN], language[LIBLEN],reg_ext[FN_EXTLEN], @@ -893,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(); @@ -2039,6 +2040,20 @@ static int init_common_variables(const char *conf_file_name, int argc, DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname, server_version, SYSTEM_TYPE,MACHINE_TYPE)); +#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE + { + /* Retrieve used stack size; Needed for checking stack overflows */ + size_t stack_size; + pthread_attr_getstacksize(&connection_attrib, &stack_size); + if (global_system_variables.log_warnings && stack_size != thread_stack) + { + sql_print_error("Warning: Asked for %ld thread stack, but got %ld", + thread_stack, stack_size); + thread_stack= stack_size; + } + } +#endif + #if defined( SET_RLIMIT_NOFILE) || defined( OS2) /* connections and databases needs lots of files */ { @@ -2067,7 +2082,7 @@ static int init_common_variables(const char *conf_file_name, int argc, #ifdef USE_REGEX regex_init(&my_charset_latin1); #endif - if (set_default_charset_by_name(sys_charset.value, MYF(MY_WME))) + if (!(default_charset_info= get_charset_by_name(sys_charset.value, MYF(MY_WME)))) return 1; charsets_list= list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG)); @@ -2175,6 +2190,14 @@ static int init_server_components() open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin", opt_binlog_index_name,LOG_BIN); using_update_log=1; +#ifdef HAVE_REPLICATION + if (expire_logs_days) + { + long purge_time= time(0) - expire_logs_days*24*60*60; + if (purge_time >= 0) + mysql_bin_log.purge_logs_before_date(current_thd, purge_time); + } +#endif } if (opt_error_log) @@ -2349,19 +2372,6 @@ int main(int argc, char **argv) if (!(opt_specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(),CONNECT_PRIOR); pthread_attr_setstacksize(&connection_attrib,thread_stack); -#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE - { - /* Retrieve used stack size; Needed for checking stack overflows */ - size_t stack_size; - pthread_attr_getstacksize(&connection_attrib, &stack_size); - if (global_system_variables.log_warnings && stack_size != thread_stack) - { - sql_print_error("Warning: Asked for %ld thread stack, but got %ld", - thread_stack, stack_size); - thread_stack= stack_size; - } - } -#endif (void) thr_setconcurrency(concurrency); // 10 by default select_thread=pthread_self(); @@ -2750,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); @@ -3344,7 +3354,9 @@ error: if (!event_connect_answer) CloseHandle(event_connect_answer); if (!event_connect_request) CloseHandle(event_connect_request); pthread_mutex_lock(&LOCK_thread_count); + handler_count--; pthread_mutex_unlock(&LOCK_thread_count); + pthread_cond_signal(&COND_handler_count); DBUG_RETURN(0); } #endif /* HAVE_SMEM */ @@ -3467,6 +3479,7 @@ enum options OPT_ENABLE_SHARED_MEMORY, OPT_SHARED_MEMORY_BASE_NAME, OPT_OLD_PASSWORDS, + OPT_EXPIRE_LOGS_DAYS, OPT_DEFAULT_WEEK_FORMAT }; @@ -3741,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, @@ -3930,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, @@ -4107,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, @@ -4284,6 +4299,11 @@ struct my_option my_long_options[] = (gptr*) &global_system_variables.net_wait_timeout, (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, + {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS, + "Logs will be rotated after expire-log-days days. ", + (gptr*) &expire_logs_days, + (gptr*) &expire_logs_days, 0, GET_ULONG, + REQUIRED_ARG, 0, 0, 99, 0, 1, 0}, { "default-week-format", OPT_DEFAULT_WEEK_FORMAT, "The default week format used by WEEK() functions.", (gptr*) &global_system_variables.default_week_format, @@ -4334,6 +4354,7 @@ struct show_var_st status_vars[]= { {"Com_lock_tables", (char*) (com_stat+(uint) SQLCOM_LOCK_TABLES),SHOW_LONG}, {"Com_optimize", (char*) (com_stat+(uint) SQLCOM_OPTIMIZE),SHOW_LONG}, {"Com_purge", (char*) (com_stat+(uint) SQLCOM_PURGE),SHOW_LONG}, + {"Com_purge_before_date", (char*) (com_stat+(uint) SQLCOM_PURGE_BEFORE),SHOW_LONG}, {"Com_rename_table", (char*) (com_stat+(uint) SQLCOM_RENAME_TABLE),SHOW_LONG}, {"Com_repair", (char*) (com_stat+(uint) SQLCOM_REPAIR),SHOW_LONG}, {"Com_replace", (char*) (com_stat+(uint) SQLCOM_REPLACE),SHOW_LONG}, @@ -4530,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; @@ -4587,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; @@ -4788,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= '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 6bd5c4534e9..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 @@ -528,18 +519,20 @@ bool Protocol::send_fields(List *list, uint flag) while ((item=it++)) { char *pos; + CHARSET_INFO *cs= system_charset_info; Send_field field; item->make_field(&field); prot.prepare_for_resend(); if (thd->client_capabilities & CLIENT_PROTOCOL_41) { - if (prot.store(field.db_name, (uint) strlen(field.db_name)) || - prot.store(field.table_name, (uint) strlen(field.table_name)) || + if (prot.store(field.db_name, (uint) strlen(field.db_name), cs) || + prot.store(field.table_name, (uint) strlen(field.table_name), cs) || prot.store(field.org_table_name, - (uint) strlen(field.org_table_name)) || - prot.store(field.col_name, (uint) strlen(field.col_name)) || - prot.store(field.org_col_name, (uint) strlen(field.org_col_name)) || + (uint) strlen(field.org_table_name), cs) || + prot.store(field.col_name, (uint) strlen(field.col_name), cs) || + prot.store(field.org_col_name, + (uint) strlen(field.org_col_name), cs) || packet->realloc(packet->length()+12)) goto err; /* Store fixed length fields */ @@ -556,8 +549,8 @@ bool Protocol::send_fields(List *list, uint flag) } else { - if (prot.store(field.table_name, (uint) strlen(field.table_name)) || - prot.store(field.col_name, (uint) strlen(field.col_name)) || + if (prot.store(field.table_name, (uint) strlen(field.table_name), cs) || + prot.store(field.col_name, (uint) strlen(field.col_name), cs) || packet->realloc(packet->length()+10)) goto err; pos= (char*) packet->ptr()+packet->length(); @@ -639,12 +632,12 @@ bool Protocol::write() 1 error */ -bool Protocol::store(const char *from) +bool Protocol::store(const char *from, CHARSET_INFO *cs) { if (!from) return store_null(); uint length= strlen(from); - return store(from, length); + return store(from, length, cs); } @@ -668,7 +661,7 @@ bool Protocol::store(I_List* str_list) } if ((len= tmp.length())) len--; // Remove last ',' - return store((char*) tmp.ptr(), len); + return store((char*) tmp.ptr(), len, tmp.charset()); } @@ -701,7 +694,7 @@ bool Protocol_simple::store_null() #endif -bool Protocol_simple::store(const char *from, uint length) +bool Protocol_simple::store(const char *from, uint length, CHARSET_INFO *cs) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -710,16 +703,24 @@ bool Protocol_simple::store(const char *from, uint length) field_types[field_pos] <= MYSQL_TYPE_GEOMETRY)); field_pos++; #endif - if (convert) - return convert_str(from, length); - return net_store_data(from, length); + if (!my_charset_same(cs, this->thd->charset()) && + (cs != &my_charset_bin) && + (this->thd->charset() != &my_charset_bin) && + (this->thd->variables.convert_result_charset)) + { + convert.copy(from, length, cs, this->thd->charset()); + return net_store_data(convert.ptr(), convert.length()); + } + else + return net_store_data(from, length); } bool Protocol_simple::store_tiny(longlong from) { #ifndef DEBUG_OFF - DBUG_ASSERT(field_types == 0 || field_types[field_pos++] == MYSQL_TYPE_TINY); + DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_TINY); + field_pos++; #endif char buff[20]; return net_store_data((char*) buff, @@ -731,7 +732,8 @@ bool Protocol_simple::store_short(longlong from) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || - field_types[field_pos++] == MYSQL_TYPE_SHORT); + field_types[field_pos] == MYSQL_TYPE_SHORT); + field_pos++; #endif char buff[20]; return net_store_data((char*) buff, @@ -742,7 +744,10 @@ bool Protocol_simple::store_short(longlong from) bool Protocol_simple::store_long(longlong from) { #ifndef DEBUG_OFF - DBUG_ASSERT(field_types == 0 || field_types[field_pos++] == MYSQL_TYPE_LONG); + DBUG_ASSERT(field_types == 0 || + field_types[field_pos] == MYSQL_TYPE_INT24 || + field_types[field_pos] == MYSQL_TYPE_LONG); + field_pos++; #endif char buff[20]; return net_store_data((char*) buff, @@ -754,7 +759,8 @@ bool Protocol_simple::store_longlong(longlong from, bool unsigned_flag) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || - field_types[field_pos++] == MYSQL_TYPE_LONGLONG); + field_types[field_pos] == MYSQL_TYPE_LONGLONG); + field_pos++; #endif char buff[22]; return net_store_data((char*) buff, @@ -768,7 +774,8 @@ bool Protocol_simple::store(float from, uint32 decimals, String *buffer) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || - field_types[field_pos++] == MYSQL_TYPE_FLOAT); + field_types[field_pos] == MYSQL_TYPE_FLOAT); + field_pos++; #endif buffer->set((double) from, decimals, thd->variables.thd_charset); return net_store_data((char*) buffer->ptr(), buffer->length()); @@ -779,7 +786,8 @@ bool Protocol_simple::store(double from, uint32 decimals, String *buffer) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || - field_types[field_pos++] == MYSQL_TYPE_DOUBLE); + field_types[field_pos] == MYSQL_TYPE_DOUBLE); + field_pos++; #endif buffer->set(from, decimals, thd->variables.thd_charset); return net_store_data((char*) buffer->ptr(), buffer->length()); @@ -794,11 +802,18 @@ bool Protocol_simple::store(Field *field) field_pos++; #endif char buff[MAX_FIELD_WIDTH]; - String tmp(buff,sizeof(buff), &my_charset_bin); - field->val_str(&tmp,&tmp); - if (convert) - return convert_str(tmp.ptr(), tmp.length()); - return net_store_data(tmp.ptr(), tmp.length()); + 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)) + { + convert.copy(str.ptr(), str.length(), str.charset(), this->thd->charset()); + return net_store_data(convert.ptr(), convert.length()); + } + else + return net_store_data(str.ptr(), str.length()); } @@ -827,7 +842,8 @@ bool Protocol_simple::store_date(TIME *tm) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || - field_types[field_pos++] == MYSQL_TYPE_DATE); + field_types[field_pos] == MYSQL_TYPE_DATE); + field_pos++; #endif char buff[40]; uint length; @@ -843,7 +859,8 @@ bool Protocol_simple::store_time(TIME *tm) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || - field_types[field_pos++] == MYSQL_TYPE_TIME); + field_types[field_pos] == MYSQL_TYPE_TIME); + field_pos++; #endif char buff[40]; uint length; @@ -894,7 +911,7 @@ void Protocol_prep::prepare_for_resend() } -bool Protocol_prep::store(const char *from,uint length) +bool Protocol_prep::store(const char *from,uint length, CHARSET_INFO *cs) { #ifndef DEBUG_OFF DBUG_ASSERT(field_types == 0 || @@ -903,8 +920,6 @@ bool Protocol_prep::store(const char *from,uint length) field_types[field_pos] <= MYSQL_TYPE_GEOMETRY)); #endif field_pos++; - if (convert) - return convert_str(from, length); return net_store_data(from, length); } @@ -1033,7 +1048,7 @@ bool Protocol_prep::store(TIME *tm) uint length; field_pos++; pos= buff+1; - + int2store(pos, tm->year); pos[2]= (uchar) tm->month; pos[3]= (uchar) tm->day; @@ -1072,7 +1087,7 @@ bool Protocol_prep::store_time(TIME *tm) field_pos++; pos= buff+1; pos[0]= tm->neg ? 1 : 0; - int4store(pos+1, tm->day); + int4store(pos+1, tm->day); pos[5]= (uchar) tm->hour; pos[6]= (uchar) tm->minute; pos[7]= (uchar) tm->second; diff --git a/sql/protocol.h b/sql/protocol.h index f57652af670..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,28 +30,27 @@ 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 *list, uint flag); bool send_records_num(List *list, ulonglong records); bool store(I_List *str_list); - bool store(const char *from); + bool store(const char *from, CHARSET_INFO *cs); String *storage_packet() { return packet; } inline void free() { packet->free(); } bool write(); @@ -75,7 +73,7 @@ public: virtual bool store_short(longlong from)=0; virtual bool store_long(longlong from)=0; virtual bool store_longlong(longlong from, bool unsigned_flag)=0; - virtual bool store(const char *from, uint length)=0; + virtual bool store(const char *from, uint length, CHARSET_INFO *cs)=0; virtual bool store(float from, uint32 decimals, String *buffer)=0; virtual bool store(double from, uint32 decimals, String *buffer)=0; virtual bool store(TIME *time)=0; @@ -98,7 +96,7 @@ public: virtual bool store_short(longlong from); virtual bool store_long(longlong from); virtual bool store_longlong(longlong from, bool unsigned_flag); - virtual bool store(const char *from, uint length); + virtual bool store(const char *from, uint length, CHARSET_INFO *cs); virtual bool store(TIME *time); virtual bool store_date(TIME *time); virtual bool store_time(TIME *time); @@ -122,7 +120,7 @@ public: virtual bool store_short(longlong from); virtual bool store_long(longlong from); virtual bool store_longlong(longlong from, bool unsigned_flag); - virtual bool store(const char *from,uint length); + virtual bool store(const char *from,uint length, CHARSET_INFO *cs); virtual bool store(TIME *time); virtual bool store_date(TIME *time); virtual bool store_time(TIME *time); diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 3991d9f21f1..46791c13219 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -440,7 +440,7 @@ int show_new_master(THD* thd) if (protocol->send_fields(&field_list, 1)) DBUG_RETURN(-1); protocol->prepare_for_resend(); - protocol->store(lex_mi->log_file_name); + protocol->store(lex_mi->log_file_name, &my_charset_bin); protocol->store((ulonglong) lex_mi->pos); if (protocol->write()) DBUG_RETURN(-1); @@ -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. -int update_slave_list(MYSQL* mysql) + 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, 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); @@ -610,11 +638,11 @@ int show_slave_hosts(THD* thd) SLAVE_INFO* si = (SLAVE_INFO*) hash_element(&slave_list, i); protocol->prepare_for_resend(); protocol->store((uint32) si->server_id); - protocol->store(si->host); + protocol->store(si->host, &my_charset_bin); if (opt_show_slave_auth_info) { - protocol->store(si->user); - protocol->store(si->password); + protocol->store(si->user, &my_charset_bin); + protocol->store(si->password, &my_charset_bin); } protocol->store((uint32) si->port); protocol->store((uint32) si->rpl_recovery_rank); 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 0c73da992e1..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, @@ -120,6 +121,8 @@ sys_var_long_ptr sys_delayed_insert_timeout("delayed_insert_timeout", &delayed_insert_timeout); sys_var_long_ptr sys_delayed_queue_size("delayed_queue_size", &delayed_queue_size); +sys_var_long_ptr sys_expire_logs_days("expire_logs_days", + &expire_logs_days); sys_var_bool_ptr sys_flush("flush", &myisam_flush); sys_var_long_ptr sys_flush_time("flush_time", &flush_time); sys_var_thd_ulong sys_interactive_timeout("interactive_timeout", @@ -192,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", @@ -335,13 +339,14 @@ 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, &sys_delayed_insert_timeout, &sys_delayed_queue_size, &sys_error_count, + &sys_expire_logs_days, &sys_flush, &sys_flush_time, &sys_foreign_key_checks, @@ -380,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 @@ -442,13 +448,14 @@ 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}, {sys_delayed_insert_limit.name, (char*) &sys_delayed_insert_limit,SHOW_SYS}, {sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS}, {sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS}, + {sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS}, {sys_flush.name, (char*) &sys_flush, SHOW_SYS}, {sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS}, {"ft_boolean_syntax", (char*) ft_boolean_syntax, SHOW_CHAR}, @@ -535,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}, @@ -1093,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()); } @@ -1127,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) +typedef struct old_names_map_st { + const char *old_name; + const char *new_name; +} my_old_conv; + +static my_old_conv old_conv[]= { - CONVERT *tmp; - char buff[80]; - String str(buff,sizeof(buff), system_charset_info), *res; + { "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 } +}; - 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; -} - - -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; @@ -1194,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; @@ -1468,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/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 7ffec4b6519..2d07b362257 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 666f8e01232..b5d1a0a7e07 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" */ -/* Additional translation by "Alexander I. Barkov" */ /* 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 517232fe2a9..6d34b5a93b3 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -238,20 +238,20 @@ "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" diff --git a/sql/slave.cc b/sql/slave.cc index a5761f7b74e..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); } @@ -1608,22 +1625,22 @@ int show_master_info(THD* thd, MASTER_INFO* mi) pthread_mutex_lock(&mi->data_lock); pthread_mutex_lock(&mi->rli.data_lock); - protocol->store(mi->host); - protocol->store(mi->user); + protocol->store(mi->host, &my_charset_bin); + protocol->store(mi->user, &my_charset_bin); protocol->store((uint32) mi->port); protocol->store((uint32) mi->connect_retry); - protocol->store(mi->master_log_name); + protocol->store(mi->master_log_name, &my_charset_bin); protocol->store((ulonglong) mi->master_log_pos); protocol->store(mi->rli.relay_log_name + - dirname_length(mi->rli.relay_log_name)); + dirname_length(mi->rli.relay_log_name), &my_charset_bin); protocol->store((ulonglong) mi->rli.relay_log_pos); - protocol->store(mi->rli.master_log_name); - protocol->store(mi->slave_running ? "Yes":"No"); - protocol->store(mi->rli.slave_running ? "Yes":"No"); + protocol->store(mi->rli.master_log_name, &my_charset_bin); + protocol->store(mi->slave_running ? "Yes":"No", &my_charset_bin); + protocol->store(mi->rli.slave_running ? "Yes":"No", &my_charset_bin); protocol->store(&replicate_do_db); protocol->store(&replicate_ignore_db); protocol->store((uint32) mi->rli.last_slave_errno); - protocol->store(mi->rli.last_slave_error); + protocol->store(mi->rli.last_slave_error, &my_charset_bin); protocol->store((uint32) mi->rli.slave_skip_counter); protocol->store((ulonglong) mi->rli.master_log_pos); protocol->store((ulonglong) mi->rli.log_space_total); @@ -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_acl.cc b/sql/sql_acl.cc index 41b825e3322..5f8f71e1bd4 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -97,7 +97,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) if (!acl_cache) acl_cache=new hash_filo(ACL_CACHE_SIZE,0,0, (hash_get_key) acl_entry_get_key, - (hash_free_key) free); + (hash_free_key) free, system_charset_info); if (dont_read_acl_tables) { DBUG_RETURN(0); /* purecov: tested */ @@ -2954,7 +2954,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) } } protocol->prepare_for_resend(); - protocol->store(global.ptr(),global.length()); + protocol->store(global.ptr(),global.length(),global.charset()); if (protocol->write()) { error=-1; @@ -3012,7 +3012,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) if (want_access & GRANT_ACL) db.append(" WITH GRANT OPTION",18); protocol->prepare_for_resend(); - protocol->store(db.ptr(),db.length()); + protocol->store(db.ptr(),db.length(),db.charset()); if (protocol->write()) { error=-1; @@ -3100,7 +3100,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) if (want_access & GRANT_ACL) global.append(" WITH GRANT OPTION",18); protocol->prepare_for_resend(); - protocol->store(global.ptr(),global.length()); + protocol->store(global.ptr(),global.length(),global.charset()); if (protocol->write()) { error= -1; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 36464126ae5..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 @@ -732,7 +743,7 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows) { if (must_be_blob) { - if (item->binary()) + if (item->charset() == &my_charset_bin) answer->append("TINYBLOB", 8); else answer->append("TINYTEXT", 8); @@ -750,21 +761,21 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows) } else if (max_length < (1L << 16)) { - if (item->binary()) + if (item->charset() == &my_charset_bin) answer->append("BLOB", 4); else answer->append("TEXT", 4); } else if (max_length < (1L << 24)) { - if (item->binary()) + if (item->charset() == &my_charset_bin) answer->append("MEDIUMBLOB", 10); else answer->append("MEDIUMTEXT", 10); } else { - if (item->binary()) + if (item->charset() == &my_charset_bin) answer->append("LONGBLOB", 8); else answer->append("LONGTEXT", 8); diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index d40811a2911..2087e6b2b75 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -21,6 +21,8 @@ #pragma interface /* gcc class implementation */ #endif +#define my_thd_charset default_charset_info + #define DEC_IN_AVG 4 typedef struct st_number_info diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d3a049a11da..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) @@ -2292,8 +2315,7 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List &keys) DBUG_ENTER("mysql_create_index"); bzero((char*) &create_info,sizeof(create_info)); create_info.db_type=DB_TYPE_DEFAULT; - /* TODO: Fix to use database character set */ - create_info.table_charset=default_charset_info; + create_info.table_charset= thd->db_charset; DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, fields, keys, drop, alter, 0, (ORDER*)0, FALSE, @@ -2310,7 +2332,7 @@ int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List &drop) DBUG_ENTER("mysql_drop_index"); bzero((char*) &create_info,sizeof(create_info)); create_info.db_type=DB_TYPE_DEFAULT; - create_info.table_charset=default_charset_info; + create_info.table_charset= thd->db_charset; DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, fields, keys, drop, alter, 0, (ORDER*)0, FALSE, @@ -2401,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 d215db8736a..3a66e906837 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -186,7 +186,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); } @@ -215,6 +215,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 @@ -480,6 +495,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) @@ -488,6 +504,7 @@ void THD::close_active_vio() active_vio = 0; } #endif + DBUG_VOID_RETURN; } #endif @@ -530,6 +547,16 @@ bool select_send::send_data(List &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 li(items); Protocol *protocol= thd->protocol; char buff[MAX_FIELD_WIDTH]; @@ -555,6 +582,14 @@ bool select_send::send_data(List &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 1a613f987f6..8284a2b1ea3 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -143,7 +143,9 @@ public: int generate_new_name(char *new_name,const char *old_name); void make_log_name(char* buf, const char* log_ident); bool is_active(const char* log_file_name); + int update_log_index(LOG_INFO* linfo); int purge_logs(THD* thd, const char* to_log); + int purge_logs_before_date(THD* thd, time_t purge_time); int purge_first_log(struct st_relay_log_info* rli); bool reset_logs(THD* thd); // if we are exiting, we also want to close the index file @@ -170,32 +172,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; @@ -396,9 +372,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; }; @@ -445,8 +422,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 */ @@ -569,6 +547,7 @@ public: void init(void); void change_user(void); + void init_for_queries(); void cleanup(void); bool store_globals(); #ifdef SIGNAL_WITH_VIO_CLOSE @@ -676,6 +655,7 @@ public: { is_fatal_error= 1; net.report_error= 1; + DBUG_PRINT("error",("Fatal error set")); } inline CHARSET_INFO *charset() { return variables.thd_charset; } }; @@ -903,10 +883,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; @@ -918,7 +899,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) { @@ -994,7 +976,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 *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 517438d9203..ffa5416eaf5 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -108,7 +108,7 @@ static bool load_db_opt(const char *path, HA_CREATE_INFO *create) { char *pos= buf+nbytes-1; /* Remove end space and control characters */ - while (pos > buf && !my_isgraph(system_charset_info, pos[-1])) + while (pos > buf && !my_isgraph(&my_charset_latin1, pos[-1])) pos--; *pos=0; if ((pos= strchr(buf, '='))) @@ -414,8 +414,8 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, DBUG_PRINT("info",("Examining: %s", file->name)); /* Check if file is a raid directory */ - if (my_isdigit(system_charset_info,file->name[0]) && - my_isdigit(system_charset_info,file->name[1]) && + if (my_isdigit(&my_charset_latin1,file->name[0]) && + my_isdigit(&my_charset_latin1,file->name[1]) && !file->name[2] && !level) { char newpath[FN_REFLEN]; @@ -440,7 +440,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, continue; } strxmov(filePath,org_path,"/",file->name,NullS); - if (db && !my_strcasecmp(system_charset_info, + if (db && !my_strcasecmp(&my_charset_latin1, fn_ext(file->name), reg_ext)) { /* Drop the table nicely */ @@ -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"); @@ -671,7 +670,7 @@ int mysqld_show_create_db(THD *thd, char *dbname, DBUG_RETURN(1); protocol->prepare_for_resend(); - protocol->store(dbname, strlen(dbname)); + protocol->store(dbname, strlen(dbname), system_charset_info); to= strxmov(path, "CREATE DATABASE ", NullS); if (create_options & HA_LEX_CREATE_IF_NOT_EXISTS) to= strxmov(to,"/*!32312 IF NOT EXISTS*/ ", NullS); @@ -685,7 +684,7 @@ int mysqld_show_create_db(THD *thd, char *dbname, cl ? " COLLATE " : "", cl ? create.table_charset->name : "", " */",NullS); } - protocol->store(path, (uint) (to-path)); + protocol->store(path, (uint) (to-path), system_charset_info); if (protocol->write()) DBUG_RETURN(1); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index c0a4436a059..ca761140955 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -167,12 +167,14 @@ 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, - derived_result, unit, select_cursor, 0, 1); + (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 5508be5167a..8d3bb3ca49b 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -60,6 +60,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 +68,7 @@ void mysql_reset_errors(THD *thd) bzero((char*) thd->warn_count, sizeof(thd->warn_count)); thd->warn_list.empty(); } + DBUG_VOID_RETURN; } @@ -180,9 +182,9 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show) } protocol->prepare_for_resend(); protocol->store(warning_level_names[err->level], - warning_level_length[err->level]); + warning_level_length[err->level], system_charset_info); protocol->store((uint32) err->code); - protocol->store(err->msg, strlen(err->msg)); + protocol->store(err->msg, strlen(err->msg), system_charset_info); if (protocol->write()) DBUG_RETURN(1); if (!--limit) diff --git a/sql/sql_help.cc b/sql/sql_help.cc index def36665fb5..36c7ef87b17 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -201,8 +201,8 @@ int send_variant_2_list(Protocol *protocol, List *names, while ((cur_name= it++)) { protocol->prepare_for_resend(); - protocol->store(cur_name); - protocol->store(cat); + protocol->store(cur_name, system_charset_info); + protocol->store(cat, system_charset_info); if (protocol->write()) DBUG_RETURN(-1); } @@ -317,10 +317,10 @@ int send_answer_1(Protocol *protocol, const char *s1, const char *s2, DBUG_RETURN(1); protocol->prepare_for_resend(); - protocol->store(s1); - protocol->store(s2); - protocol->store(s3); - protocol->store(s4); + protocol->store(s1, system_charset_info); + protocol->store(s2, system_charset_info); + protocol->store(s3, system_charset_info); + protocol->store(s4, system_charset_info); if (protocol->write()) DBUG_RETURN(-1); DBUG_RETURN(0); 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 94c06d41634..a5bed692293 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -75,8 +75,6 @@ inline int lex_casecmp(const char *s, const char *t, uint len) #include "lex_hash.h" -static uchar state_map[256], ident_map[256]; - void lex_init(void) { @@ -89,53 +87,6 @@ void lex_init(void) VOID(pthread_key_create(&THR_LEX,NULL)); - /* Fill state_map with states to get a faster parser */ - for (i=0; i < sizeof(state_map) ; i++) - { - if (my_isalpha(system_charset_info,i)) - state_map[i]=(uchar) STATE_IDENT; - else if (my_isdigit(system_charset_info,i)) - state_map[i]=(uchar) STATE_NUMBER_IDENT; -#if defined(USE_MB) && defined(USE_MB_IDENT) - else if (use_mb(system_charset_info) && my_ismbhead(system_charset_info, i)) - state_map[i]=(uchar) STATE_IDENT; -#endif - else if (!my_isgraph(system_charset_info,i)) - state_map[i]=(uchar) STATE_SKIP; - else - state_map[i]=(uchar) STATE_CHAR; - } - state_map[(uchar)'_']=state_map[(uchar)'$']=(uchar) STATE_IDENT; - state_map[(uchar)'\'']=(uchar) STATE_STRING; - state_map[(uchar)'-']=state_map[(uchar)'+']=(uchar) STATE_SIGNED_NUMBER; - state_map[(uchar)'.']=(uchar) STATE_REAL_OR_POINT; - state_map[(uchar)'>']=state_map[(uchar)'=']=state_map[(uchar)'!']= (uchar) STATE_CMP_OP; - state_map[(uchar)'<']= (uchar) STATE_LONG_CMP_OP; - state_map[(uchar)'&']=state_map[(uchar)'|']=(uchar) STATE_BOOL; - state_map[(uchar)'#']=(uchar) STATE_COMMENT; - state_map[(uchar)';']=(uchar) STATE_COLON; - state_map[(uchar)':']=(uchar) STATE_SET_VAR; - state_map[0]=(uchar) STATE_EOL; - state_map[(uchar)'\\']= (uchar) STATE_ESCAPE; - state_map[(uchar)'/']= (uchar) STATE_LONG_COMMENT; - state_map[(uchar)'*']= (uchar) STATE_END_LONG_COMMENT; - state_map[(uchar)'@']= (uchar) STATE_USER_END; - state_map[(uchar) '`']= (uchar) STATE_USER_VARIABLE_DELIMITER; - state_map[(uchar)'"']= (uchar) STAT_STRING_OR_DELIMITER; - - /* - Create a second map to make it faster to find identifiers - */ - for (i=0; i < sizeof(ident_map) ; i++) - { - ident_map[i]= (uchar) (state_map[i] == STATE_IDENT || - state_map[i] == STATE_NUMBER_IDENT); - } - - /* Special handling of hex and binary strings */ - state_map[(uchar)'x']= state_map[(uchar)'X']= (uchar) STATE_IDENT_OR_HEX; - state_map[(uchar)'b']= state_map[(uchar)'b']= (uchar) STATE_IDENT_OR_BIN; - DBUG_VOID_RETURN; } @@ -156,7 +107,8 @@ void lex_free(void) LEX *lex_start(THD *thd, uchar *buf,uint length) { LEX *lex= &thd->lex; - lex->next_state=STATE_START; + lex->thd= thd; + lex->next_state=MY_LEX_START; lex->end_of_query=(lex->ptr=buf)+length; lex->yylineno = 1; lex->select_lex.create_refs=lex->in_comment=0; @@ -166,7 +118,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); @@ -258,6 +209,7 @@ static char *get_text(LEX *lex) { reg1 uchar c,sep; uint found_escape=0; + CHARSET_INFO *cs= lex->thd->variables.thd_charset; sep= yyGetLast(); // String should end with this //lex->tok_start=lex->ptr-1; // Remember ' @@ -266,8 +218,8 @@ static char *get_text(LEX *lex) c = yyGet(); #ifdef USE_MB int l; - if (use_mb(system_charset_info) && - (l = my_ismbchar(system_charset_info, + if (use_mb(cs) && + (l = my_ismbchar(cs, (const char *)lex->ptr-1, (const char *)lex->end_of_query))) { lex->ptr += l-1; @@ -311,8 +263,8 @@ static char *get_text(LEX *lex) { #ifdef USE_MB int l; - if (use_mb(system_charset_info) && - (l = my_ismbchar(system_charset_info, + if (use_mb(cs) && + (l = my_ismbchar(cs, (const char *)str, (const char *)end))) { while (l--) *to++ = *str++; @@ -359,8 +311,6 @@ static char *get_text(LEX *lex) *to=0; lex->yytoklen=(uint) (to-start); } - if (lex->convert_set) - lex->convert_set->convert((char*) start,lex->yytoklen); return (char*) start; } } @@ -460,8 +410,8 @@ inline static uint int_token(const char *str,uint length) // yylex remember the following states from the following yylex() -// STATE_EOQ ; found end of query -// STATE_OPERATOR_OR_IDENT ; last state was an ident, text or number +// MY_LEX_EOQ ; found end of query +// MY_LEX_OPERATOR_OR_IDENT ; last state was an ident, text or number // (which can't be followed by a signed number) int yylex(void *arg, void *yythd) @@ -469,76 +419,99 @@ int yylex(void *arg, void *yythd) reg1 uchar c; int tokval; uint length; - enum lex_states state,prev_state; + enum my_lex_states state,prev_state; LEX *lex= &(((THD *)yythd)->lex); YYSTYPE *yylval=(YYSTYPE*) arg; + CHARSET_INFO *cs= ((THD *) yythd)->variables.thd_charset; + uchar *state_map= cs->state_map; + uchar *ident_map= cs->ident_map; lex->yylval=yylval; // The global state lex->tok_start=lex->tok_end=lex->ptr; prev_state=state=lex->next_state; - lex->next_state=STATE_OPERATOR_OR_IDENT; + lex->next_state=MY_LEX_OPERATOR_OR_IDENT; LINT_INIT(c); for (;;) { switch (state) { - case STATE_OPERATOR_OR_IDENT: // Next is operator or keyword - case STATE_START: // Start of token + case MY_LEX_OPERATOR_OR_IDENT: // Next is operator or keyword + case MY_LEX_START: // Start of token // Skip startspace - for (c=yyGet() ; (state_map[c] == STATE_SKIP) ; c= yyGet()) + for (c=yyGet() ; (state_map[c] == MY_LEX_SKIP) ; c= yyGet()) { if (c == '\n') lex->yylineno++; } lex->tok_start=lex->ptr-1; // Start of real token - state= (enum lex_states) state_map[c]; + state= (enum my_lex_states) state_map[c]; break; - case STATE_ESCAPE: + case MY_LEX_ESCAPE: if (yyGet() == 'N') { // Allow \N as shortcut for NULL yylval->lex_str.str=(char*) "\\N"; yylval->lex_str.length=2; return NULL_SYM; } - case STATE_CHAR: // Unknown or single char token - case STATE_SKIP: // This should not happen + case MY_LEX_CHAR: // Unknown or single char token + case MY_LEX_SKIP: // This should not happen yylval->lex_str.str=(char*) (lex->ptr=lex->tok_start);// Set to first chr yylval->lex_str.length=1; c=yyGet(); if (c != ')') - lex->next_state= STATE_START; // Allow signed numbers + lex->next_state= MY_LEX_START; // Allow signed numbers if (c == ',') lex->tok_start=lex->ptr; // Let tok_start point at next item return((int) c); - case STATE_IDENT_OR_HEX: + 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' - state= STATE_HEX_NUMBER; + state= MY_LEX_HEX_NUMBER; break; } /* Fall through */ - case STATE_IDENT_OR_BIN: // TODO: Add binary string handling - case STATE_IDENT: + case MY_LEX_IDENT_OR_BIN: // TODO: Add binary string handling + case MY_LEX_IDENT: #if defined(USE_MB) && defined(USE_MB_IDENT) - if (use_mb(system_charset_info)) + if (use_mb(cs)) { - if (my_ismbhead(system_charset_info, yyGetLast())) + if (my_ismbhead(cs, yyGetLast())) { - int l = my_ismbchar(system_charset_info, + int l = my_ismbchar(cs, (const char *)lex->ptr-1, (const char *)lex->end_of_query); if (l == 0) { - state = STATE_CHAR; + state = MY_LEX_CHAR; continue; } lex->ptr += l - 1; } while (ident_map[c=yyGet()]) { - if (my_ismbhead(system_charset_info, c)) + if (my_ismbhead(cs, c)) { int l; - if ((l = my_ismbchar(system_charset_info, + if ((l = my_ismbchar(cs, (const char *)lex->ptr-1, (const char *)lex->end_of_query)) == 0) break; @@ -552,23 +525,21 @@ int yylex(void *arg, void *yythd) length= (uint) (lex->ptr - lex->tok_start)-1; if (lex->ignore_space) { - for (; state_map[c] == STATE_SKIP ; c= yyGet()); + for (; state_map[c] == MY_LEX_SKIP ; c= yyGet()); } if (c == '.' && ident_map[yyPeek()]) - lex->next_state=STATE_IDENT_SEP; + lex->next_state=MY_LEX_IDENT_SEP; else { // '(' must follow directly if function yyUnget(); if ((tokval = find_keyword(lex,length,c == '('))) { - lex->next_state= STATE_START; // Allow signed numbers + lex->next_state= MY_LEX_START; // Allow signed numbers return(tokval); // Was keyword } 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'" @@ -584,30 +555,30 @@ int yylex(void *arg, void *yythd) else return(IDENT); - case STATE_IDENT_SEP: // Found ident and now '.' - lex->next_state=STATE_IDENT_START;// Next is an ident (not a keyword) + case MY_LEX_IDENT_SEP: // Found ident and now '.' + lex->next_state=MY_LEX_IDENT_START;// Next is an ident (not a keyword) yylval->lex_str.str=(char*) lex->ptr; yylval->lex_str.length=1; c=yyGet(); // should be '.' return((int) c); - case STATE_NUMBER_IDENT: // number or ident which num-start - while (my_isdigit(system_charset_info,(c = yyGet()))) ; + case MY_LEX_NUMBER_IDENT: // number or ident which num-start + while (my_isdigit(cs,(c = yyGet()))) ; if (!ident_map[c]) { // Can't be identifier - state=STATE_INT_OR_REAL; + state=MY_LEX_INT_OR_REAL; break; } if (c == 'e' || c == 'E') { // The following test is written this way to allow numbers of type 1e1 - if (my_isdigit(system_charset_info,yyPeek()) || + if (my_isdigit(cs,yyPeek()) || (c=(yyGet())) == '+' || c == '-') { // Allow 1E+10 - if (my_isdigit(system_charset_info,yyPeek())) // Number must have digit after sign + if (my_isdigit(cs,yyPeek())) // Number must have digit after sign { yySkip(); - while (my_isdigit(system_charset_info,yyGet())) ; + while (my_isdigit(cs,yyGet())) ; yylval->lex_str=get_token(lex,yyLength()); return(FLOAT_NUM); } @@ -617,7 +588,7 @@ int yylex(void *arg, void *yythd) else if (c == 'x' && (lex->ptr - lex->tok_start) == 2 && lex->tok_start[0] == '0' ) { // Varbinary - while (my_isxdigit(system_charset_info,(c = yyGet()))) ; + while (my_isxdigit(cs,(c = yyGet()))) ; if ((lex->ptr - lex->tok_start) >= 4 && !ident_map[c]) { yylval->lex_str=get_token(lex,yyLength()); @@ -629,28 +600,28 @@ int yylex(void *arg, void *yythd) yyUnget(); } // fall through - case STATE_IDENT_START: // Incomplete ident + case MY_LEX_IDENT_START: // Incomplete ident #if defined(USE_MB) && defined(USE_MB_IDENT) - if (use_mb(system_charset_info)) + if (use_mb(cs)) { - if (my_ismbhead(system_charset_info, yyGetLast())) + if (my_ismbhead(cs, yyGetLast())) { - int l = my_ismbchar(system_charset_info, + int l = my_ismbchar(cs, (const char *)lex->ptr-1, (const char *)lex->end_of_query); if (l == 0) { - state = STATE_CHAR; + state = MY_LEX_CHAR; continue; } lex->ptr += l - 1; } while (ident_map[c=yyGet()]) { - if (my_ismbhead(system_charset_info, c)) + if (my_ismbhead(cs, c)) { int l; - if ((l = my_ismbchar(system_charset_info, + if ((l = my_ismbchar(cs, (const char *)lex->ptr-1, (const char *)lex->end_of_query)) == 0) break; @@ -663,28 +634,26 @@ int yylex(void *arg, void *yythd) while (ident_map[c = yyGet()]) ; if (c == '.' && ident_map[yyPeek()]) - lex->next_state=STATE_IDENT_SEP;// Next is '.' + lex->next_state=MY_LEX_IDENT_SEP;// Next is '.' // fall through - case STATE_FOUND_IDENT: // Complete ident + 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 STATE_USER_VARIABLE_DELIMITER: + case MY_LEX_USER_VARIABLE_DELIMITER: { char delim= c; // Used char lex->tok_start=lex->ptr; // Skip first ` #ifdef USE_MB - if (use_mb(system_charset_info)) + if (use_mb(cs)) { while ((c=yyGet()) && c != delim && c != (uchar) NAMES_SEP_CHAR) { - if (my_ismbhead(system_charset_info, c)) + if (my_ismbhead(cs, c)) { int l; - if ((l = my_ismbchar(system_charset_info, + if ((l = my_ismbchar(cs, (const char *)lex->ptr-1, (const char *)lex->end_of_query)) == 0) break; @@ -717,73 +686,71 @@ 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); } - case STATE_SIGNED_NUMBER: // Incomplete signed number - if (prev_state == STATE_OPERATOR_OR_IDENT) + case MY_LEX_SIGNED_NUMBER: // Incomplete signed number + if (prev_state == MY_LEX_OPERATOR_OR_IDENT) { if (c == '-' && yyPeek() == '-' && - (my_isspace(system_charset_info,yyPeek2()) || - my_iscntrl(system_charset_info,yyPeek2()))) - state=STATE_COMMENT; + (my_isspace(cs,yyPeek2()) || + my_iscntrl(cs,yyPeek2()))) + state=MY_LEX_COMMENT; else - state= STATE_CHAR; // Must be operator + state= MY_LEX_CHAR; // Must be operator break; } - if (!my_isdigit(system_charset_info,c=yyGet()) || yyPeek() == 'x') + if (!my_isdigit(cs,c=yyGet()) || yyPeek() == 'x') { if (c != '.') { - if (c == '-' && my_isspace(system_charset_info,yyPeek())) - state=STATE_COMMENT; + if (c == '-' && my_isspace(cs,yyPeek())) + state=MY_LEX_COMMENT; else - state = STATE_CHAR; // Return sign as single char + state = MY_LEX_CHAR; // Return sign as single char break; } yyUnget(); // Fix for next loop } - while (my_isdigit(system_charset_info,c=yyGet())) ; // Incomplete real or int number + while (my_isdigit(cs,c=yyGet())) ; // Incomplete real or int number if ((c == 'e' || c == 'E') && - (yyPeek() == '+' || yyPeek() == '-' || my_isdigit(system_charset_info,yyPeek()))) + (yyPeek() == '+' || yyPeek() == '-' || my_isdigit(cs,yyPeek()))) { // Real number yyUnget(); c= '.'; // Fool next test } // fall through - case STATE_INT_OR_REAL: // Compleat int or incompleat real + case MY_LEX_INT_OR_REAL: // Compleat int or incompleat real if (c != '.') { // Found complete integer number. yylval->lex_str=get_token(lex,yyLength()); return int_token(yylval->lex_str.str,yylval->lex_str.length); } // fall through - case STATE_REAL: // Incomplete real number - while (my_isdigit(system_charset_info,c = yyGet())) ; + case MY_LEX_REAL: // Incomplete real number + while (my_isdigit(cs,c = yyGet())) ; if (c == 'e' || c == 'E') { c = yyGet(); if (c == '-' || c == '+') c = yyGet(); // Skip sign - if (!my_isdigit(system_charset_info,c)) + if (!my_isdigit(cs,c)) { // No digit after sign - state= STATE_CHAR; + state= MY_LEX_CHAR; break; } - while (my_isdigit(system_charset_info,yyGet())) ; + while (my_isdigit(cs,yyGet())) ; yylval->lex_str=get_token(lex,yyLength()); return(FLOAT_NUM); } yylval->lex_str=get_token(lex,yyLength()); return(REAL_NUM); - case STATE_HEX_NUMBER: // Found x'hexstring' + case MY_LEX_HEX_NUMBER: // Found x'hexstring' yyGet(); // Skip ' - while (my_isxdigit(system_charset_info,(c = yyGet()))) ; + while (my_isxdigit(cs,(c = yyGet()))) ; length=(lex->ptr - lex->tok_start); // Length of hexnum+3 if (!(length & 1) || c != '\'') { @@ -796,71 +763,71 @@ int yylex(void *arg, void *yythd) lex->yytoklen-=3; return (HEX_NUM); - case STATE_CMP_OP: // Incomplete comparison operator - if (state_map[yyPeek()] == STATE_CMP_OP || - state_map[yyPeek()] == STATE_LONG_CMP_OP) + case MY_LEX_CMP_OP: // Incomplete comparison operator + if (state_map[yyPeek()] == MY_LEX_CMP_OP || + state_map[yyPeek()] == MY_LEX_LONG_CMP_OP) yySkip(); if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0))) { - lex->next_state= STATE_START; // Allow signed numbers + lex->next_state= MY_LEX_START; // Allow signed numbers return(tokval); } - state = STATE_CHAR; // Something fishy found + state = MY_LEX_CHAR; // Something fishy found break; - case STATE_LONG_CMP_OP: // Incomplete comparison operator - if (state_map[yyPeek()] == STATE_CMP_OP || - state_map[yyPeek()] == STATE_LONG_CMP_OP) + case MY_LEX_LONG_CMP_OP: // Incomplete comparison operator + if (state_map[yyPeek()] == MY_LEX_CMP_OP || + state_map[yyPeek()] == MY_LEX_LONG_CMP_OP) { yySkip(); - if (state_map[yyPeek()] == STATE_CMP_OP) + if (state_map[yyPeek()] == MY_LEX_CMP_OP) yySkip(); } if ((tokval = find_keyword(lex,(uint) (lex->ptr - lex->tok_start),0))) { - lex->next_state= STATE_START; // Found long op + lex->next_state= MY_LEX_START; // Found long op return(tokval); } - state = STATE_CHAR; // Something fishy found + state = MY_LEX_CHAR; // Something fishy found break; - case STATE_BOOL: + case MY_LEX_BOOL: if (c != yyPeek()) { - state=STATE_CHAR; + state=MY_LEX_CHAR; break; } yySkip(); tokval = find_keyword(lex,2,0); // Is a bool operator - lex->next_state= STATE_START; // Allow signed numbers + lex->next_state= MY_LEX_START; // Allow signed numbers return(tokval); - case STAT_STRING_OR_DELIMITER: + case MY_LEX_STRING_OR_DELIMITER: if (((THD *) yythd)->variables.sql_mode & MODE_ANSI_QUOTES) { - state= STATE_USER_VARIABLE_DELIMITER; + state= MY_LEX_USER_VARIABLE_DELIMITER; break; } /* " used for strings */ - case STATE_STRING: // Incomplete text string + case MY_LEX_STRING: // Incomplete text string if (!(yylval->lex_str.str = get_text(lex))) { - state= STATE_CHAR; // Read char by char + state= MY_LEX_CHAR; // Read char by char break; } yylval->lex_str.length=lex->yytoklen; return(TEXT_STRING); - case STATE_COMMENT: // Comment + case MY_LEX_COMMENT: // Comment lex->select_lex.options|= OPTION_FOUND_COMMENT; while ((c = yyGet()) != '\n' && c) ; yyUnget(); // Safety against eof - state = STATE_START; // Try again + state = MY_LEX_START; // Try again break; - case STATE_LONG_COMMENT: /* Long C comment? */ + case MY_LEX_LONG_COMMENT: /* Long C comment? */ if (yyPeek() != '*') { - state=STATE_CHAR; // Probable division + state=MY_LEX_CHAR; // Probable division break; } yySkip(); // Skip '*' @@ -869,8 +836,8 @@ int yylex(void *arg, void *yythd) { ulong version=MYSQL_VERSION_ID; yySkip(); - state=STATE_START; - if (my_isdigit(system_charset_info,yyPeek())) + state=MY_LEX_START; + if (my_isdigit(cs,yyPeek())) { // Version number version=strtol((char*) lex->ptr,(char**) &lex->ptr,10); } @@ -888,88 +855,87 @@ int yylex(void *arg, void *yythd) } if (lex->ptr != lex->end_of_query) yySkip(); // remove last '/' - state = STATE_START; // Try again + state = MY_LEX_START; // Try again break; - case STATE_END_LONG_COMMENT: + case MY_LEX_END_LONG_COMMENT: if (lex->in_comment && yyPeek() == '/') { yySkip(); lex->in_comment=0; - state=STATE_START; + state=MY_LEX_START; } else - state=STATE_CHAR; // Return '*' + state=MY_LEX_CHAR; // Return '*' break; - case STATE_SET_VAR: // Check if ':=' + case MY_LEX_SET_VAR: // Check if ':=' if (yyPeek() != '=') { - state=STATE_CHAR; // Return ':' + state=MY_LEX_CHAR; // Return ':' break; } yySkip(); return (SET_VAR); - case STATE_COLON: // optional line terminator + case MY_LEX_COLON: // optional line terminator if (yyPeek()) { if (((THD *)yythd)->client_capabilities & CLIENT_MULTI_QUERIES) { lex->found_colon=(char*)lex->ptr; ((THD *)yythd)->server_status |= SERVER_MORE_RESULTS_EXISTS; - lex->next_state=STATE_END; + lex->next_state=MY_LEX_END; return(END_OF_INPUT); } else - state=STATE_CHAR; // Return ';' + state=MY_LEX_CHAR; // Return ';' break; } /* fall true */ - case STATE_EOL: - lex->next_state=STATE_END; // Mark for next loop + case MY_LEX_EOL: + lex->next_state=MY_LEX_END; // Mark for next loop return(END_OF_INPUT); - case STATE_END: - lex->next_state=STATE_END; + case MY_LEX_END: + lex->next_state=MY_LEX_END; return(0); // We found end of input last time /* Actually real shouldn't start with . but allow them anyhow */ - case STATE_REAL_OR_POINT: - if (my_isdigit(system_charset_info,yyPeek())) - state = STATE_REAL; // Real + case MY_LEX_REAL_OR_POINT: + if (my_isdigit(cs,yyPeek())) + state = MY_LEX_REAL; // Real else { - state = STATE_CHAR; // return '.' - lex->next_state=STATE_IDENT_START;// Next is an ident (not a keyword) + state = MY_LEX_CHAR; // return '.' + lex->next_state=MY_LEX_IDENT_START;// Next is an ident (not a keyword) } break; - case STATE_USER_END: // end '@' of user@hostname + case MY_LEX_USER_END: // end '@' of user@hostname switch (state_map[yyPeek()]) { - case STATE_STRING: - case STATE_USER_VARIABLE_DELIMITER: - case STAT_STRING_OR_DELIMITER: + case MY_LEX_STRING: + case MY_LEX_USER_VARIABLE_DELIMITER: + case MY_LEX_STRING_OR_DELIMITER: break; - case STATE_USER_END: - lex->next_state=STATE_SYSTEM_VAR; + case MY_LEX_USER_END: + lex->next_state=MY_LEX_SYSTEM_VAR; break; default: - lex->next_state=STATE_HOSTNAME; + lex->next_state=MY_LEX_HOSTNAME; break; } yylval->lex_str.str=(char*) lex->ptr; yylval->lex_str.length=1; return((int) '@'); - case STATE_HOSTNAME: // end '@' of user@hostname - for (c=yyGet() ; - my_isalnum(system_charset_info,c) || c == '.' || c == '_' || - c == '$'; + case MY_LEX_HOSTNAME: // end '@' of user@hostname + for (c=yyGet() ; + my_isalnum(cs,c) || c == '.' || c == '_' || c == '$'; c= yyGet()) ; yylval->lex_str=get_token(lex,yyLength()); return(LEX_HOSTNAME); - case STATE_SYSTEM_VAR: + case MY_LEX_SYSTEM_VAR: yylval->lex_str.str=(char*) lex->ptr; yylval->lex_str.length=1; - lex->next_state=STATE_IDENT_OR_KEYWORD; + lex->next_state=MY_LEX_IDENT_OR_KEYWORD; yySkip(); // Skip '@' return((int) '@'); - case STATE_IDENT_OR_KEYWORD: + case MY_LEX_IDENT_OR_KEYWORD: /* We come here when we have found two '@' in a row. We should now be able to handle: @@ -978,7 +944,7 @@ int yylex(void *arg, void *yythd) while (ident_map[c=yyGet()]) ; if (c == '.') - lex->next_state=STATE_IDENT_SEP; + lex->next_state=MY_LEX_IDENT_SEP; length= (uint) (lex->ptr - lex->tok_start)-1; if ((tokval= find_keyword(lex,length,0))) { @@ -986,8 +952,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 aff3485dbe4..d8045dcc556 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -64,7 +64,7 @@ enum enum_sql_command { SQLCOM_ROLLBACK, SQLCOM_COMMIT, SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP, SQLCOM_BEGIN, SQLCOM_LOAD_MASTER_TABLE, SQLCOM_CHANGE_MASTER, SQLCOM_RENAME_TABLE, SQLCOM_BACKUP_TABLE, SQLCOM_RESTORE_TABLE, - SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_SHOW_BINLOGS, + SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS, SQLCOM_SHOW_OPEN_TABLES, SQLCOM_LOAD_MASTER_DATA, SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ, SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI, @@ -77,19 +77,6 @@ enum enum_sql_command { SQLCOM_END }; -enum lex_states -{ - STATE_START, STATE_CHAR, STATE_IDENT, STATE_IDENT_SEP, STATE_IDENT_START, - STATE_FOUND_IDENT, STATE_SIGNED_NUMBER, STATE_REAL, STATE_HEX_NUMBER, - STATE_CMP_OP, STATE_LONG_CMP_OP, STATE_STRING, STATE_COMMENT, STATE_END, - STATE_OPERATOR_OR_IDENT, STATE_NUMBER_IDENT, STATE_INT_OR_REAL, - STATE_REAL_OR_POINT, STATE_BOOL, STATE_EOL, STATE_ESCAPE, STATE_LONG_COMMENT, - STATE_END_LONG_COMMENT, STATE_COLON, STATE_SET_VAR, STATE_USER_END, - STATE_HOSTNAME, STATE_SKIP, STATE_USER_VARIABLE_DELIMITER, STATE_SYSTEM_VAR, - STATE_IDENT_OR_KEYWORD, STATE_IDENT_OR_HEX, STATE_IDENT_OR_BIN, - STAT_STRING_OR_DELIMITER -}; - typedef List List_item; @@ -311,6 +298,11 @@ public: st_select_lex_unit* master_unit(); st_select_lex* outer_select(); st_select_lex* first_select() { return (st_select_lex*) slave; } + st_select_lex* first_select_in_union() + { + return (slave && slave->linkage == GLOBAL_OPTIONS_TYPE) ? + (st_select_lex*) slave->next : (st_select_lex*) slave; + } st_select_lex_unit* next_unit() { return (st_select_lex_unit*) next; } void exclude_level(); @@ -404,6 +396,13 @@ public: } friend void mysql_init_query(THD *thd); + void make_empty_select(st_select_lex *last_select) + { + select_number=INT_MAX; + init_query(); + init_select(); + include_neighbour(last_select); + } }; typedef class st_select_lex SELECT_LEX; @@ -424,6 +423,7 @@ typedef struct st_lex char *length,*dec,*change,*name; char *backup_dir; /* For RESTORE/BACKUP */ char* to_log; /* For PURGE MASTER LOGS TO */ + time_t purge_time; /* For PURGE MASTER LOGS BEFORE */ char* x509_subject,*x509_issuer,*ssl_cipher; char* found_colon; /* For multi queries - next query */ enum SSL_type ssl_type; /* defined in violite.h */ @@ -448,7 +448,6 @@ typedef struct st_lex TYPELIB *interval; create_field *last_field; Item *default_value, *comment; - CONVERT *convert_set; CHARSET_INFO *thd_charset; LEX_USER *grant_user; gptr yacc_yyss,yacc_yyvs; @@ -461,7 +460,7 @@ typedef struct st_lex ulong thread_id,type; enum_sql_command sql_command; thr_lock_type lock_option; - enum lex_states next_state; + enum my_lex_states next_state; enum enum_duplicates duplicates; enum enum_tx_isolation tx_isolation; enum enum_ha_read_modes ha_read_mode; @@ -488,11 +487,13 @@ typedef struct st_lex but we should merk all subselects as uncacheable from current till most upper */ - for (SELECT_LEX_NODE *sl= current_select; - sl != &select_lex; - sl= sl->outer_select()) + SELECT_LEX_NODE *sl; + SELECT_LEX_UNIT *un; + for (sl= current_select, un= sl->master_unit(); + un != &unit; + sl= sl->outer_select(), un= sl->master_unit()) { - sl->uncacheable = sl->master_unit()->uncacheable= 1; + sl->uncacheable = un->uncacheable= 1; } } } LEX; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index d387ebe27ae..4f5b19e6f49 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -41,8 +41,9 @@ public: bool error,line_cuted,found_null,enclosed; byte *row_start, /* Found row starts here */ *row_end; /* Found row ends here */ + CHARSET_INFO *read_charset; - READ_INFO(File file,uint tot_length, + READ_INFO(File file,uint tot_length,CHARSET_INFO *cs, String &field_term,String &line_start,String &line_term, String &enclosed,int escape,bool get_it_from_net, bool is_fifo); ~READ_INFO(); @@ -214,8 +215,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, info.handle_duplicates=handle_duplicates; info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX; - READ_INFO read_info(file,tot_length,*field_term, - *ex->line_start, *ex->line_term, *enclosed, + READ_INFO read_info(file,tot_length,thd->db_charset, + *field_term,*ex->line_start, *ex->line_term, *enclosed, info.escape_char, read_file_from_client, is_fifo); if (read_info.error) { @@ -402,7 +403,7 @@ read_fixed_length(THD *thd,COPY_INFO &info,TABLE *table,List &fields, field->field_length) length=field->field_length; save_chr=pos[length]; pos[length]='\0'; // Safeguard aganst malloc - field->store((char*) pos,length,default_charset_info); + field->store((char*) pos,length,read_info.read_charset); pos[length]=save_chr; if ((pos+=length) > read_info.row_end) pos= read_info.row_end; /* Fills rest with space */ @@ -483,7 +484,7 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, } field->set_notnull(); read_info.row_end[0]=0; // Safe to change end marker - field->store((char*) read_info.row_start,length,default_charset_info); + field->store((char*) read_info.row_start,length,read_info.read_charset); } if (read_info.error) break; @@ -547,12 +548,13 @@ READ_INFO::unescape(char chr) */ -READ_INFO::READ_INFO(File file_par, uint tot_length, String &field_term, - String &line_start, String &line_term, +READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs, + String &field_term, String &line_start, String &line_term, String &enclosed_par, int escape, bool get_it_from_net, bool is_fifo) :file(file_par),escape_char(escape) { + read_charset= cs; field_term_ptr=(char*) field_term.ptr(); field_term_length= field_term.length(); line_term_ptr=(char*) line_term.ptr(); @@ -699,13 +701,13 @@ int READ_INFO::read_field() { chr = GET; #ifdef USE_MB - if (use_mb(default_charset_info) && - my_ismbhead(default_charset_info, chr) && - to+my_mbcharlen(default_charset_info, chr) <= end_of_buff) + if (use_mb(read_charset) && + my_ismbhead(read_charset, chr) && + to+my_mbcharlen(read_charset, chr) <= end_of_buff) { uchar* p = (uchar*)to; *to++ = chr; - int ml = my_mbcharlen(default_charset_info, chr); + int ml = my_mbcharlen(read_charset, chr); int i; for (i=1; ivio,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); @@ -568,7 +563,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); } @@ -582,8 +580,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 */ @@ -833,9 +832,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)) @@ -906,13 +903,11 @@ 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); - while (length && (my_isspace(system_charset_info, buff[length-1]) || + while (length && (my_isspace(thd->charset(), buff[length-1]) || buff[length-1] == ';')) length--; buff[length]=0; @@ -1265,7 +1260,7 @@ restore_user: ulong length= thd->query_length-(ulong)(thd->lex.found_colon-thd->query); /* Remove garbage at start of query */ - while (my_isspace(system_charset_info, *packet) && length > 0) + while (my_isspace(thd->charset(), *packet) && length > 0) { packet++; length--; @@ -1539,14 +1534,14 @@ bool alloc_query(THD *thd, char *packet, ulong packet_length) { packet_length--; // Remove end null /* Remove garbage at start and end of query */ - while (my_isspace(system_charset_info,packet[0]) && packet_length > 0) + while (my_isspace(thd->charset(),packet[0]) && packet_length > 0) { packet++; packet_length--; } char *pos=packet+packet_length; // Point at end null while (packet_length > 0 && - (pos[-1] == ';' || my_isspace(system_charset_info,pos[-1]))) + (pos[-1] == ';' || my_isspace(thd->charset() ,pos[-1]))) { pos--; packet_length--; @@ -1744,9 +1739,18 @@ mysql_execute_command(THD *thd) { if (check_global_access(thd, SUPER_ACL)) goto error; + // PURGE MASTER LOGS TO 'file' res = purge_master_logs(thd, lex->to_log); break; } + case SQLCOM_PURGE_BEFORE: + { + if (check_global_access(thd, SUPER_ACL)) + goto error; + // PURGE MASTER LOGS BEFORE 'data' + res = purge_master_logs_before_date(thd, lex->purge_time); + break; + } #endif case SQLCOM_SHOW_WARNS: @@ -1950,6 +1954,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; @@ -2207,8 +2212,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) @@ -2301,6 +2312,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; @@ -2332,6 +2345,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 @@ -2431,7 +2446,7 @@ mysql_execute_command(THD *thd) (ORDER *)NULL, select_lex->options | thd->options | SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK, - result, unit, select_lex, 0, 0); + result, unit, select_lex, 0); if (thd->net.report_error) res= -1; delete result; @@ -2866,7 +2881,7 @@ mysql_execute_command(THD *thd) if (check_global_access(thd,RELOAD_ACL) || check_db_used(thd, tables)) goto error; /* error sending is deferred to reload_acl_and_cache */ - reload_acl_and_cache(thd, lex->type, tables) ; + reload_acl_and_cache(thd, lex->type, tables); break; case SQLCOM_KILL: kill_one_thread(thd,lex->thread_id); @@ -3275,7 +3290,6 @@ mysql_new_select(LEX *lex, bool move_down) select_lex->include_neighbour(lex->current_select); select_lex->master_unit()->global_parameters= select_lex; - DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE); select_lex->include_global((st_select_lex_node**)&lex->all_selects_list); lex->current_select= select_lex; return 0; @@ -3785,9 +3799,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); @@ -3932,6 +3944,14 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) mysql_log.new_file(1); mysql_update_log.new_file(1); mysql_bin_log.new_file(1); +#ifdef HAVE_REPLICATION + if (expire_logs_days) + { + long purge_time= time(0) - expire_logs_days*24*60*60; + if (purge_time >= 0) + mysql_bin_log.purge_logs_before_date(thd, purge_time); + } +#endif mysql_slow_log.new_file(1); if (ha_flush_logs()) result=1; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 3d85a46f3fd..fc8959c6493 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -592,11 +592,10 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables, JOIN *join= new JOIN(thd, fields, select_options, result); thd->used_tables= 0; // Updated by setup_fields - if (join->prepare(&select_lex->ref_pointer_array, tables, - wild_num, conds, og_num, order, group, having, proc, - select_lex, unit, 0, 0)) - DBUG_RETURN(1); - + if (join->prepare(&select_lex->ref_pointer_array, tables, + wild_num, conds, og_num, order, group, having, proc, + select_lex, unit, 0)) + DBUG_RETURN(1); if (send_prep_stmt(stmt, fields.elements) || thd->protocol_simple.send_fields(&fields, 0) || send_item_params(stmt)) 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 90beb89bb37..7e9b6aea7b5 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -257,15 +257,10 @@ bool log_in_use(const char* log_name) return result; } - -int purge_master_logs(THD* thd, const char* to_log) +int purge_error_message(THD* thd, int res) { - char search_file_name[FN_REFLEN]; const char* errmsg = 0; - mysql_bin_log.make_log_name(search_file_name, to_log); - int res = mysql_bin_log.purge_logs(thd, search_file_name); - switch(res) { case 0: break; case LOG_INFO_EOF: errmsg = "Target log not found in binlog index"; break; @@ -289,10 +284,26 @@ binlog purge"; break; } else send_ok(thd); - return 0; } +int purge_master_logs(THD* thd, const char* to_log) +{ + char search_file_name[FN_REFLEN]; + + mysql_bin_log.make_log_name(search_file_name, to_log); + int res = mysql_bin_log.purge_logs(thd, search_file_name); + + return purge_error_message(thd, res); +} + + +int purge_master_logs_before_date(THD* thd, time_t purge_time) +{ + int res = mysql_bin_log.purge_logs_before_date(thd, purge_time); + return purge_error_message(thd ,res); +} + /* TODO: Clean up loop to only have one call to send_file() */ @@ -373,7 +384,7 @@ impossible position"; We need to start a packet with something other than 255 to distiquish it from error */ - packet->set("\0", 1, system_charset_info); + packet->set("\0", 1, &my_charset_bin); // if we are at the start of the log if (pos == BIN_LOG_HEADER_SIZE) @@ -384,7 +395,7 @@ impossible position"; my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG; goto err; } - packet->set("\0", 1, system_charset_info); + packet->set("\0", 1, &my_charset_bin); } while (!net->error && net->vio != 0 && !thd->killed) @@ -419,7 +430,7 @@ impossible position"; goto err; } } - packet->set("\0", 1, system_charset_info); + packet->set("\0", 1, &my_charset_bin); } /* TODO: now that we are logging the offset, check to make sure @@ -539,7 +550,7 @@ Increase max_allowed_packet on master"; goto err; } } - packet->set("\0", 1, system_charset_info); + packet->set("\0", 1, &my_charset_bin); /* No need to net_flush because we will get to flush later when we hit EOF pretty quick @@ -765,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))) { @@ -883,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 */, @@ -912,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, @@ -1092,7 +1109,7 @@ int show_binlog_info(THD* thd) LOG_INFO li; mysql_bin_log.get_current_log(&li); int dir_len = dirname_length(li.log_file_name); - protocol->store(li.log_file_name + dir_len); + protocol->store(li.log_file_name + dir_len, &my_charset_bin); protocol->store((ulonglong) li.pos); protocol->store(&binlog_do_db); protocol->store(&binlog_ignore_db); @@ -1149,7 +1166,7 @@ int show_binlogs(THD* thd) protocol->prepare_for_resend(); int dir_len = dirname_length(fname); /* The -1 is for removing newline from fname */ - protocol->store(fname + dir_len, length-1-dir_len); + protocol->store(fname + dir_len, length-1-dir_len, &my_charset_bin); if (protocol->write()) goto err; } diff --git a/sql/sql_repl.h b/sql/sql_repl.h index f1fda45fe4b..e3d600b9798 100644 --- a/sql/sql_repl.h +++ b/sql/sql_repl.h @@ -34,6 +34,7 @@ int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1, int reset_slave(THD *thd, MASTER_INFO* mi); int reset_master(THD* thd); int purge_master_logs(THD* thd, const char* to_log); +int purge_master_logs_before_date(THD* thd, time_t purge_time); bool log_in_use(const char* log_name); void adjust_linfo_offsets(my_off_t purge_offset); int show_binlogs(THD* thd); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5408fd1e17f..0126b900b9a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -182,7 +182,7 @@ int handle_select(THD *thd, LEX *lex, select_result *result) select_lex->having, (ORDER*) lex->proc_list.first, select_lex->options | thd->options, - result, &(lex->unit), &(lex->select_lex), 0, 0); + result, &(lex->unit), &(lex->select_lex), 0); if (res && result) result->abort(); @@ -268,7 +268,7 @@ JOIN::prepare(Item ***rref_pointer_array, Item *having_init, ORDER *proc_param_init, SELECT_LEX *select, SELECT_LEX_UNIT *unit, - bool fake_select_lex, bool tables_and_fields_initied) + bool tables_and_fields_initied) { DBUG_ENTER("JOIN::prepare"); @@ -279,8 +279,7 @@ JOIN::prepare(Item ***rref_pointer_array, proc_param= proc_param_init; tables_list= tables_init; select_lex= select; - if (!fake_select_lex) - select_lex->join= this; + select_lex->join= this; union_part= (unit->first_select()->next_select() != 0); /* Check that all tables, fields, conds and order are ok */ @@ -450,6 +449,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 +457,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 +470,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 +489,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 +545,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 +716,10 @@ JOIN::optimize() } if (select_options & SELECT_DESCRIBE) + { + error= 0; DBUG_RETURN(0); - + } tmp_having= having; having= 0; @@ -807,10 +819,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 +890,9 @@ void JOIN::exec() { int tmp_error; - DBUG_ENTER("JOIN::exec"); + error= 0; if (procedure) { if (procedure->change_columns(fields_list) || @@ -888,7 +902,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 +928,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 +952,6 @@ JOIN::exec() select_describe(this, need_tmp, order != 0 && !skip_sort_order, select_distinct); - error=0; DBUG_VOID_RETURN; } @@ -1253,6 +1263,7 @@ JOIN::exec() DBUG_VOID_RETURN; } + /* Clean up join. Return error that hold JOIN. */ @@ -1261,12 +1272,23 @@ int JOIN::cleanup(THD *thd) { DBUG_ENTER("JOIN::cleanup"); - select_lex->join= 0; if (tmp_join) - memcpy(this, tmp_join, sizeof(tmp_join)); - + { + if (join_tab != tmp_join->join_tab) + { + JOIN_TAB *tab, *end; + for (tab= join_tab, end= tab+tables ; tab != end ; tab++) + { + delete tab->select; + delete tab->quick; + x_free(tab->cache.buff); + } + } + tmp_join->tmp_join= 0; + DBUG_RETURN(tmp_join->cleanup(thd)); + } lock=0; // It's faster to unlock later join_free(this, 1); @@ -1286,21 +1308,21 @@ JOIN::cleanup(THD *thd) DBUG_RETURN(error); } + int mysql_select(THD *thd, Item ***rref_pointer_array, TABLE_LIST *tables, uint wild_num, List &fields, COND *conds, uint og_num, ORDER *order, ORDER *group, Item *having, ORDER *proc_param, ulong select_options, select_result *result, SELECT_LEX_UNIT *unit, - SELECT_LEX *select_lex, bool fake_select_lex, - bool tables_and_fields_initied) + SELECT_LEX *select_lex, bool tables_and_fields_initied) { int err; bool free_join= 1; DBUG_ENTER("mysql_select"); JOIN *join; - if (!fake_select_lex && select_lex->join != 0) + if (select_lex->join != 0) { //here is EXPLAIN of subselect or derived table join= select_lex->join; @@ -1320,8 +1342,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array, if (join->prepare(rref_pointer_array, tables, wild_num, conds, og_num, order, group, having, proc_param, - select_lex, unit, fake_select_lex, - tables_and_fields_initied)) + select_lex, unit, tables_and_fields_initied)) { DBUG_RETURN(-1); } @@ -1350,7 +1371,7 @@ err: thd->limit_found_rows= curr_join->send_records; thd->examined_row_count= curr_join->examined_rows; thd->proc_info="end"; - err= (fake_select_lex ? curr_join->error : join->cleanup(thd)); + err= join->cleanup(thd); if (thd->net.report_error) err= -1; delete join; @@ -2757,19 +2778,15 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse, if (!keyuse->used_tables && !(join->select_options & SELECT_DESCRIBE)) { // Compare against constant - store_key_item *tmp=new store_key_item(thd, - keyinfo->key_part[i].field, - (char*)key_buff + - maybe_null, - maybe_null ? - (char*) key_buff : 0, - keyinfo->key_part[i].length, - keyuse->val); + store_key_item tmp(thd, keyinfo->key_part[i].field, + (char*)key_buff + maybe_null, + maybe_null ? (char*) key_buff : 0, + keyinfo->key_part[i].length, keyuse->val); if (thd->is_fatal_error) { return TRUE; } - tmp->copy(); + tmp.copy(); } else *ref_key++= get_store_key(thd, @@ -2920,6 +2937,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; @@ -3753,6 +3776,7 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value) == Item_func::COND_AND_FUNC; List_iterator li(*((Item_cond*) cond)->argument_list()); Item::cond_result tmp_cond_value; + bool should_fix_fields=0; *cond_value=Item::COND_UNDEF; Item *item; @@ -3772,6 +3796,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; @@ -3798,6 +3823,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; @@ -4898,6 +4926,10 @@ do_select(JOIN *join,List *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 @@ -4909,17 +4941,25 @@ do_select(JOIN *join,List *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); } @@ -6705,8 +6745,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, NullS)) DBUG_RETURN(1); - // BAR TODO: this must be fixed to use charset from "table" argument - if (hash_init(&hash, default_charset_info, (uint) file->records, 0, + if (hash_init(&hash, &my_charset_bin, (uint) file->records, 0, key_length,(hash_get_key) 0, 0, 0)) { my_free((char*) key_buffer,MYF(0)); @@ -7086,15 +7125,16 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,ORDER *order, List &fields, List &all_fields) { - if ((*order->item)->type() == Item::INT_ITEM) + Item *itemptr=*order->item; + if (itemptr->type() == Item::INT_ITEM) { /* Order by position */ Item *item=0; - uint count= (uint) ((Item_int*) (*order->item))->value; - if (count > fields.elements) + uint count= (uint) ((Item_int*)itemptr)->value; + if (!count || count > fields.elements) { my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR), - MYF(0),(*order->item)->full_name(), + MYF(0),itemptr->full_name(), thd->where); return 1; } @@ -7103,8 +7143,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, return 0; } uint counter; - Item **item= find_item_in_list(*order->item, fields, &counter, - IGNORE_ERRORS); + Item **item= find_item_in_list(itemptr, fields, &counter, IGNORE_ERRORS); if (item) { order->item= ref_pointer_array + counter; @@ -7683,7 +7722,7 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array, if (_db_on_ && !item_field->name) { char buff[256]; - String str(buff,sizeof(buff),default_charset_info); + String str(buff,sizeof(buff),&my_charset_bin); str.length(0); item->print(&str); item_field->name= sql_strmake(str.ptr(),str.length()); @@ -8097,7 +8136,7 @@ int mysql_explain_select(THD *thd, SELECT_LEX *select_lex, char const *type, select_lex->having, (ORDER*) thd->lex.proc_list.first, select_lex->options | thd->options | SELECT_DESCRIBE, - result, unit, select_lex, 0, 0); + result, unit, select_lex, 0); DBUG_RETURN(res); } diff --git a/sql/sql_select.h b/sql/sql_select.h index bb928846186..ffc98548db4 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -174,7 +174,7 @@ class JOIN :public Sql_alloc Item_sum **sum_funcs; Procedure *procedure; Item *having; - Item *tmp_having; // To store Having when processed tenporary table + Item *tmp_having; // To store Having when processed temporary table uint select_options; select_result *result; TMP_TABLE_PARAM tmp_table_param; @@ -256,8 +256,7 @@ class JOIN :public Sql_alloc int prepare(Item ***rref_pointer_array, TABLE_LIST *tables, uint wind_num, COND *conds, uint og_num, ORDER *order, ORDER *group, Item *having, ORDER *proc_param, SELECT_LEX *select, - SELECT_LEX_UNIT *unit, bool fake_select_lex, - bool tables_and_fields_initied); + SELECT_LEX_UNIT *unit, bool tables_and_fields_initied); int optimize(); int reinit(); void exec(); @@ -307,7 +306,6 @@ class store_key :public Sql_alloc { protected: Field *to_field; // Store data here - Field *key_field; // Copy of key field char *null_ptr; char err; public: diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 9c2280768da..122a0171777 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -85,7 +85,7 @@ mysqld_show_dbs(THD *thd,const char *wild) (grant_option && !check_grant_db(thd, file_name))) { protocol->prepare_for_resend(); - protocol->store(file_name); + protocol->store(file_name, system_charset_info); if (protocol->write()) DBUG_RETURN(-1); } @@ -120,8 +120,8 @@ int mysqld_show_open_tables(THD *thd,const char *wild) for (; open_list ; open_list=open_list->next) { protocol->prepare_for_resend(); - protocol->store(open_list->db); - protocol->store(open_list->table); + protocol->store(open_list->db, system_charset_info); + protocol->store(open_list->table, system_charset_info); protocol->store_tiny((longlong) open_list->in_use); protocol->store_tiny((longlong) open_list->locked); if (protocol->write()) @@ -166,7 +166,7 @@ int mysqld_show_tables(THD *thd,const char *db,const char *wild) while ((file_name=it++)) { protocol->prepare_for_resend(); - protocol->store(file_name); + protocol->store(file_name, system_charset_info); if (protocol->write()) DBUG_RETURN(-1); } @@ -225,14 +225,14 @@ int mysqld_show_table_types(THD *thd) for (types= sys_table_types; types->type; types++) { protocol->prepare_for_resend(); - protocol->store(types->type); + protocol->store(types->type, system_charset_info); const char *option_name= show_comp_option_name[(int) *types->value]; if (*types->value == SHOW_OPTION_YES && !my_strcasecmp(system_charset_info, default_type_name, types->type)) option_name= "DEFAULT"; - protocol->store(option_name); - protocol->store(types->comment); + protocol->store(option_name, system_charset_info); + protocol->store(types->comment, system_charset_info); if (protocol->write()) DBUG_RETURN(-1); } @@ -292,9 +292,9 @@ int mysqld_show_privileges(THD *thd) for (privilege= sys_privileges; privilege->privilege ; privilege++) { protocol->prepare_for_resend(); - protocol->store(privilege->privilege); - protocol->store(privilege->context); - protocol->store(privilege->comment); + protocol->store(privilege->privilege, system_charset_info); + protocol->store(privilege->context, system_charset_info); + protocol->store(privilege->comment, system_charset_info); if (protocol->write()) DBUG_RETURN(-1); } @@ -367,20 +367,20 @@ int mysqld_show_column_types(THD *thd) for (uint i=0; i < sizeof(sys_column_types)/sizeof(sys_column_types[0]); i++) { protocol->prepare_for_resend(); - protocol->store(sys_column_types[i].type); + protocol->store(sys_column_types[i].type, system_charset_info); protocol->store((ulonglong) sys_column_types[i].size); - protocol->store(sys_column_types[i].min_value); - protocol->store(sys_column_types[i].max_value); + protocol->store(sys_column_types[i].min_value, system_charset_info); + protocol->store(sys_column_types[i].max_value, system_charset_info); protocol->store_short((longlong) sys_column_types[i].precision); protocol->store_short((longlong) sys_column_types[i].scale); - protocol->store(sys_column_types[i].nullable); - protocol->store(sys_column_types[i].auto_increment); - protocol->store(sys_column_types[i].unsigned_attr); - protocol->store(sys_column_types[i].zerofill); - protocol->store(sys_column_types[i].searchable); - protocol->store(sys_column_types[i].case_sensitivity); - protocol->store(sys_column_types[i].default_value); - protocol->store(sys_column_types[i].comment); + protocol->store(sys_column_types[i].nullable, system_charset_info); + protocol->store(sys_column_types[i].auto_increment, system_charset_info); + protocol->store(sys_column_types[i].unsigned_attr, system_charset_info); + protocol->store(sys_column_types[i].zerofill, system_charset_info); + protocol->store(sys_column_types[i].searchable, system_charset_info); + protocol->store(sys_column_types[i].case_sensitivity, system_charset_info); + protocol->store(sys_column_types[i].default_value, system_charset_info); + protocol->store(sys_column_types[i].comment, system_charset_info); if (protocol->write()) DBUG_RETURN(-1); } @@ -524,7 +524,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) TABLE_LIST table_list; bzero((char*) &table_list,sizeof(table_list)); protocol->prepare_for_resend(); - protocol->store(file_name); + protocol->store(file_name, system_charset_info); table_list.db=(char*) db; table_list.real_name= table_list.alias= file_name; if (lower_case_table_names) @@ -534,7 +534,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) for (uint i=2 ; i < field_list.elements ; i++) protocol->store_null(); // Send error to Comment field - protocol->store(thd->net.last_error); + protocol->store(thd->net.last_error, system_charset_info); thd->net.last_error[0]=0; } else @@ -543,12 +543,12 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) const char *str; handler *file=table->file; file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_NO_LOCK); - protocol->store(file->table_type()); + protocol->store(file->table_type(), system_charset_info); str= ((table->db_options_in_use & HA_OPTION_COMPRESS_RECORD) ? "Compressed" : (table->db_options_in_use & HA_OPTION_PACK_RECORD) ? "Dynamic" : "Fixed"); - protocol->store(str); + protocol->store(str, system_charset_info); protocol->store((ulonglong) file->records); protocol->store((ulonglong) file->mean_rec_length); protocol->store((ulonglong) file->data_file_length); @@ -593,7 +593,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) protocol->store(&time); } str= (table->table_charset ? table->table_charset->name : "default"); - protocol->store(str); + protocol->store(str, system_charset_info); { char option_buff[350],*ptr; ptr=option_buff; @@ -631,11 +631,12 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) ptr=strmov(ptr,buff); } protocol->store(option_buff+1, - (ptr == option_buff ? 0 : (uint) (ptr-option_buff)-1)); + (ptr == option_buff ? 0 : (uint) (ptr-option_buff)-1) + , system_charset_info); } { char *comment=table->file->update_table_comment(table->comment); - protocol->store(comment); + protocol->store(comment, system_charset_info); if (comment != table->comment) my_free(comment,MYF(0)); } @@ -710,43 +711,43 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, { byte *pos; uint flags=field->flags; - String type(tmp,sizeof(tmp),current_thd->variables.thd_charset); + String type(tmp,sizeof(tmp), system_charset_info); uint col_access; bool null_default_value=0; protocol->prepare_for_resend(); - protocol->store(field->field_name); + protocol->store(field->field_name, system_charset_info); field->sql_type(type); - protocol->store(type.ptr(), type.length()); - protocol->store(field->charset()->name); + protocol->store(type.ptr(), type.length(), system_charset_info); + protocol->store(field->charset()->name, system_charset_info); pos=(byte*) ((flags & NOT_NULL_FLAG) && field->type() != FIELD_TYPE_TIMESTAMP ? "" : "YES"); - protocol->store((const char*) pos); + protocol->store((const char*) pos, system_charset_info); pos=(byte*) ((field->flags & PRI_KEY_FLAG) ? "PRI" : (field->flags & UNIQUE_KEY_FLAG) ? "UNI" : (field->flags & MULTIPLE_KEY_FLAG) ? "MUL":""); - protocol->store((char*) pos); + protocol->store((char*) pos, system_charset_info); if (field->type() == FIELD_TYPE_TIMESTAMP || field->unireg_check == Field::NEXT_NUMBER) null_default_value=1; if (!null_default_value && !field->is_null()) { // Not null by default - type.set(tmp,sizeof(tmp),&my_charset_bin); + type.set(tmp,sizeof(tmp),system_charset_info); field->val_str(&type,&type); - protocol->store(type.ptr(),type.length()); + protocol->store(type.ptr(),type.length(),type.charset()); } else if (field->maybe_null() || null_default_value) protocol->store_null(); // Null as default else - protocol->store("",0); // empty string + protocol->store("",0, system_charset_info); // empty string char *end=tmp; if (field->unireg_check == Field::NEXT_NUMBER) end=strmov(tmp,"auto_increment"); - protocol->store(tmp,(uint) (end-tmp)); + protocol->store(tmp,(uint) (end-tmp), system_charset_info); if (verbose) { @@ -761,8 +762,10 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, end=strmov(end,grant_types.type_names[bitnr]); } } - protocol->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1)); - protocol->store(field->comment.str, field->comment.length); + protocol->store(tmp+1,end == tmp ? 0 : (uint) (end-tmp-1), + system_charset_info); + protocol->store(field->comment.str, field->comment.length, + system_charset_info); } if (protocol->write()) DBUG_RETURN(1); @@ -799,11 +802,11 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) if (protocol->send_fields(&field_list, 1)) DBUG_RETURN(1); protocol->prepare_for_resend(); - protocol->store(table->table_name); + protocol->store(table->table_name, system_charset_info); buffer.length(0); if (store_create_info(thd, table, &buffer)) DBUG_RETURN(-1); - protocol->store(buffer.ptr(), buffer.length()); + protocol->store(buffer.ptr(), buffer.length(), buffer.charset()); if (protocol->write()) DBUG_RETURN(1); send_eof(thd); @@ -884,16 +887,16 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list) for (uint j=0 ; j < key_info->key_parts ; j++,key_part++) { protocol->prepare_for_resend(); - protocol->store(table->table_name); + protocol->store(table->table_name, system_charset_info); protocol->store_tiny((longlong) ((key_info->flags & HA_NOSAME) ? 0 :1)); - protocol->store(key_info->name); + protocol->store(key_info->name, system_charset_info); protocol->store_tiny((longlong) (j+1)); str=(key_part->field ? key_part->field->field_name : "?unknown field?"); - protocol->store(str); + protocol->store(str, system_charset_info); if (table->file->index_flags(i) & HA_READ_ORDER) protocol->store(((key_part->key_part_flag & HA_REVERSE_SORT) ? - "D" : "A"), 1); + "D" : "A"), 1, system_charset_info); else protocol->store_null(); /* purecov: inspected */ KEY *key=table->key_info+i; @@ -917,10 +920,10 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list) /* Null flag */ uint flags= key_part->field ? key_part->field->flags : 0; char *pos=(char*) ((flags & NOT_NULL_FLAG) ? "" : "YES"); - protocol->store((const char*) pos); - protocol->store(table->file->index_type(i)); + protocol->store((const char*) pos, system_charset_info); + protocol->store(table->file->index_type(i), system_charset_info); /* Comment */ - protocol->store("", 0); + protocol->store("", system_charset_info); if (protocol->write()) DBUG_RETURN(1); /* purecov: inspected */ } @@ -976,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()) @@ -1011,15 +1014,16 @@ append_identifier(THD *thd, String *packet, const char *name) if (thd->options & OPTION_QUOTE_SHOW_CREATE) { packet->append(&qtype, 1); - packet->append(name); + packet->append(name, 0, system_charset_info); packet->append(&qtype, 1); } else { - packet->append(name); + packet->append(name, 0, system_charset_info); } } +#define LIST_PROCESS_HOST_LEN 64 static int store_create_info(THD *thd, TABLE *table, String *packet) @@ -1292,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)); @@ -1326,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; @@ -1379,19 +1390,19 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) { protocol->prepare_for_resend(); protocol->store((ulonglong) thd_info->thread_id); - protocol->store(thd_info->user); - protocol->store(thd_info->host); - protocol->store(thd_info->db); + protocol->store(thd_info->user, system_charset_info); + protocol->store(thd_info->host, system_charset_info); + protocol->store(thd_info->db, system_charset_info); if (thd_info->proc_info) - protocol->store(thd_info->proc_info); + protocol->store(thd_info->proc_info, system_charset_info); else - protocol->store(command_name[thd_info->command]); + protocol->store(command_name[thd_info->command], system_charset_info); if (thd_info->start_time) protocol->store((uint32) (now - thd_info->start_time)); else protocol->store_null(); - protocol->store(thd_info->state_info); - protocol->store(thd_info->query); + protocol->store(thd_info->state_info, system_charset_info); + protocol->store(thd_info->query, system_charset_info); if (protocol->write()) break; /* purecov: inspected */ } @@ -1430,13 +1441,13 @@ int mysqld_show_charsets(THD *thd, const char *wild) wild_case_compare(system_charset_info,cs[0]->name,wild))) { protocol->prepare_for_resend(); - protocol->store(cs[0]->csname); - protocol->store(cs[0]->name); + 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); + protocol->store(flags, system_charset_info); protocol->store_tiny((longlong) cs[0]->strxfrm_multiply); protocol->store_tiny((longlong) cs[0]->mbmaxlen); if (protocol->write()) @@ -1472,7 +1483,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables, variables->name,wild))) { protocol->prepare_for_resend(); - protocol->store(variables->name); + protocol->store(variables->name, system_charset_info); SHOW_TYPE show_type=variables->type; char *value=variables->value; const char *pos, *end; @@ -1718,7 +1729,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables, default: break; } - if (protocol->store(pos, (uint32) (end - pos)) || + if (protocol->store(pos, (uint32) (end - pos), system_charset_info) || protocol->write()) goto err; /* purecov: inspected */ } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 1a0366112f4..ffa272713de 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -28,6 +28,10 @@ #include #endif +CHARSET_INFO *system_charset_info= &my_charset_utf8; +CHARSET_INFO *files_charset_info= &my_charset_utf8; +CHARSET_INFO *national_charset_info= &my_charset_utf8; + extern gptr sql_alloc(unsigned size); extern void sql_element_free(void *ptr); static uint32 @@ -231,6 +235,10 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs) bool String::copy(const char *str, uint32 arg_length, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs) { + if ((from_cs == &my_charset_bin) || (to_cs == &my_charset_bin)) + { + return copy(str, arg_length, &my_charset_bin); + } uint32 new_length= to_cs->mbmaxlen*arg_length; if (alloc(new_length)) return TRUE; @@ -333,6 +341,34 @@ bool String::append(const char *s,uint32 arg_length) } +/* + Append a string in the given charset to the string + with character set recoding +*/ + + +bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs) +{ + if (!arg_length) // Default argument + if (!(arg_length= (uint32) strlen(s))) + return FALSE; + if (str_charset->mbmaxlen > 1) + { + uint32 add_length=arg_length * str_charset->mbmaxlen; + if (realloc(str_length+ add_length)) + return TRUE; + str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset, + s, arg_length, cs); + return FALSE; + } + if (realloc(str_length+arg_length)) + return TRUE; + memcpy(Ptr+str_length,s,arg_length); + str_length+=arg_length; + return FALSE; +} + + #ifdef TO_BE_REMOVED bool String::append(FILE* file, uint32 arg_length, myf my_flags) { diff --git a/sql/sql_string.h b/sql/sql_string.h index 8e0705844ad..469574ca2e4 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -181,6 +181,7 @@ public: CHARSET_INFO *csto); bool append(const String &s); bool append(const char *s,uint32 arg_length=0); + bool append(const char *s,uint32 arg_length, CHARSET_INFO *cs); bool append(IO_CACHE* file, uint32 arg_length); int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1 int strstr_case(const String &s,uint32 offset=0); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a8428d4f3da..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); @@ -1108,10 +1110,10 @@ static int send_check_errmsg(THD *thd, TABLE_LIST* table, { Protocol *protocol= thd->protocol; protocol->prepare_for_resend(); - protocol->store(table->alias); - protocol->store((char*) operator_name); - protocol->store("error", 5); - protocol->store(errmsg); + protocol->store(table->alias, system_charset_info); + protocol->store((char*) operator_name, system_charset_info); + protocol->store("error", 5, system_charset_info); + protocol->store(errmsg, system_charset_info); thd->net.last_error[0]=0; if (protocol->write()) return -1; @@ -1301,12 +1303,12 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, { const char *err_msg; protocol->prepare_for_resend(); - protocol->store(table_name); - protocol->store(operator_name); - protocol->store("error",5); + protocol->store(table_name, system_charset_info); + protocol->store(operator_name, system_charset_info); + protocol->store("error",5, system_charset_info); if (!(err_msg=thd->net.last_error)) err_msg=ER(ER_CHECK_NO_SUCH_TABLE); - protocol->store(err_msg); + protocol->store(err_msg, system_charset_info); thd->net.last_error[0]=0; if (protocol->write()) goto err; @@ -1316,11 +1318,11 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, { char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE]; protocol->prepare_for_resend(); - protocol->store(table_name); - protocol->store(operator_name); - protocol->store("error", 5); + protocol->store(table_name, system_charset_info); + protocol->store(operator_name, system_charset_info); + protocol->store("error", 5, system_charset_info); sprintf(buff, ER(ER_OPEN_AS_READONLY), table_name); - protocol->store(buff); + protocol->store(buff, system_charset_info); close_thread_tables(thd); table->table=0; // For query cache if (protocol->write()) @@ -1355,8 +1357,8 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, thd->net.last_errno= 0; // these errors shouldn't get client #endif protocol->prepare_for_resend(); - protocol->store(table_name); - protocol->store(operator_name); + protocol->store(table_name, system_charset_info); + protocol->store(operator_name, system_charset_info); switch (result_code) { case HA_ADMIN_NOT_IMPLEMENTED: @@ -1364,40 +1366,41 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, char buf[ERRMSGSIZE+20]; uint length=my_snprintf(buf, ERRMSGSIZE, ER(ER_CHECK_NOT_IMPLEMENTED), operator_name); - protocol->store("error", 5); - protocol->store(buf, length); + protocol->store("error", 5, system_charset_info); + protocol->store(buf, length, system_charset_info); } break; case HA_ADMIN_OK: - protocol->store("status", 6); - protocol->store("OK",2); + protocol->store("status", 6, system_charset_info); + protocol->store("OK",2, system_charset_info); break; case HA_ADMIN_FAILED: - protocol->store("status", 6); - protocol->store("Operation failed",16); + protocol->store("status", 6, system_charset_info); + protocol->store("Operation failed",16, system_charset_info); break; case HA_ADMIN_ALREADY_DONE: - protocol->store("status", 6); - protocol->store("Table is already up to date", 27); + protocol->store("status", 6, system_charset_info); + protocol->store("Table is already up to date", 27, system_charset_info); break; case HA_ADMIN_CORRUPT: - protocol->store("error", 5); - protocol->store("Corrupt", 8); + protocol->store("error", 5, system_charset_info); + protocol->store("Corrupt", 8, system_charset_info); fatal_error=1; break; case HA_ADMIN_INVALID: - protocol->store("error", 5); - protocol->store("Invalid argument",16); + protocol->store("error", 5, system_charset_info); + protocol->store("Invalid argument",16, system_charset_info); break; default: // Probably HA_ADMIN_INTERNAL_ERROR - protocol->store("error", 5); - protocol->store("Unknown - internal error during operation", 41); + protocol->store("error", 5, system_charset_info); + protocol->store("Unknown - internal error during operation", 41 + , system_charset_info); fatal_error=1; break; } diff --git a/sql/sql_union.cc b/sql/sql_union.cc index feaa8371acb..5f7a1e44bde 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -122,9 +122,9 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result, this->result= result; t_and_f= tables_and_fields_initied; SELECT_LEX_NODE *lex_select_save= thd->lex.current_select; - SELECT_LEX *sl; + SELECT_LEX *select_cursor; - thd->lex.current_select= sl= first_select(); + thd->lex.current_select= select_cursor= first_select_in_union(); /* Global option */ if (((void*)(global_parameters)) == ((void*)this)) { @@ -136,26 +136,27 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result, if (t_and_f) { // Item list and tables will be initialized by mysql_derived - item_list= sl->item_list; + item_list= select_cursor->item_list; } else { item_list.empty(); - TABLE_LIST *first_table= (TABLE_LIST*) first_select()->table_list.first; + TABLE_LIST *first_table= (TABLE_LIST*) select_cursor->table_list.first; if (setup_tables(first_table) || - setup_wild(thd, first_table, sl->item_list, 0, sl->with_wild)) + setup_wild(thd, first_table, select_cursor->item_list, 0, select_cursor->with_wild)) goto err; - List_iterator it(sl->item_list); + List_iterator it(select_cursor->item_list); Item *item; while((item=it++)) item->maybe_null=1; - item_list= sl->item_list; - sl->with_wild= 0; - if (setup_ref_array(thd, &sl->ref_pointer_array, - (item_list.elements + sl->with_sum_func + - sl->order_list.elements + sl->group_list.elements)) || - setup_fields(thd, sl->ref_pointer_array, first_table, item_list, + item_list= select_cursor->item_list; + select_cursor->with_wild= 0; + if (setup_ref_array(thd, &select_cursor->ref_pointer_array, + (item_list.elements + select_cursor->with_sum_func + + select_cursor->order_list.elements + + select_cursor->group_list.elements)) || + setup_fields(thd, select_cursor->ref_pointer_array, first_table, item_list, 0, 0, 1)) goto err; t_and_f= 1; @@ -165,7 +166,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result, tmp_table_param.field_count=item_list.elements; if (!(table= create_tmp_table(thd, &tmp_table_param, item_list, (ORDER*) 0, !union_option, - 1, (first_select()->options | thd->options | + 1, (select_cursor->options | thd->options | TMP_TABLE_ALL_COLUMNS), HA_POS_ERROR))) goto err; @@ -181,9 +182,16 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result, union_result->not_describe=1; union_result->tmp_table_param=&tmp_table_param; + +/* + the following piece of code is placed here solely for the purpose of + getting correct results with EXPLAIN when UNION is withing a sub-select + or derived table ... +*/ + if (thd->lex.describe) { - for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) + for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) { JOIN *join= new JOIN(thd, sl->item_list, sl->options | thd->options | SELECT_NO_UNLOCK, @@ -206,16 +214,17 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result, (ORDER*) sl->group_list.first, sl->having, (ORDER*) NULL, - sl, this, 0, t_and_f); + sl, this, t_and_f); t_and_f= 0; if (res | thd->is_fatal_error) goto err; } } + item_list.empty(); thd->lex.current_select= lex_select_save; { - List_iterator it(first_select()->item_list); + List_iterator it(select_cursor->item_list); Field **field; for (field= table->field; *field; field++) @@ -232,11 +241,14 @@ 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); executed= 1; @@ -249,8 +261,9 @@ int st_select_lex_unit::exec() item->reset(); table->file->delete_all_rows(); } - for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) + for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) { + last_select=sl; if (optimized) res= sl->join->reinit(); else @@ -276,7 +289,7 @@ int st_select_lex_unit::exec() (ORDER*) sl->group_list.first, sl->having, (ORDER*) NULL, - sl, this, 0, t_and_f); + sl, this, t_and_f); t_and_f=0; if (res | thd->is_fatal_error) { @@ -307,23 +320,19 @@ int st_select_lex_unit::exec() /* Send result to 'result' */ // to correct ORDER BY reference resolving - thd->lex.current_select = first_select(); + thd->lex.current_select = select_cursor; res =-1; { -#if 0 - List ftfunc_list; - ftfunc_list.empty(); -#else List empty_list; empty_list.empty(); thd->lex.select_lex.ftfunc_list= &empty_list; -#endif if (!thd->is_fatal_error) // Check if EOM { - SELECT_LEX *sl=thd->lex.current_select->master_unit()->first_select(); - offset_limit_cnt= (sl->braces) ? global_parameters->offset_limit : 0; - select_limit_cnt= (sl->braces) ? global_parameters->select_limit+ + SELECT_LEX *fake_select = new SELECT_LEX(); + fake_select->make_empty_select(last_select); + offset_limit_cnt= (select_cursor->braces) ? global_parameters->offset_limit : 0; + select_limit_cnt= (select_cursor->braces) ? global_parameters->select_limit+ global_parameters->offset_limit : HA_POS_ERROR; if (select_limit_cnt < global_parameters->select_limit) select_limit_cnt= HA_POS_ERROR; // no limit @@ -334,9 +343,11 @@ int st_select_lex_unit::exec() global_parameters->order_list.elements, (ORDER*)global_parameters->order_list.first, (ORDER*) NULL, NULL, (ORDER*) NULL, - thd->options, result, this, first_select(), 1, 0); + thd->options, result, this, fake_select, 0); if (found_rows_for_union && !res) thd->limit_found_rows = (ulonglong)table->file->records; + fake_select->exclude(); + delete fake_select; } } thd->lex.select_lex.ftfunc_list= &thd->lex.select_lex.ftfunc_list_alloc; @@ -346,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) { @@ -357,7 +367,7 @@ int st_select_lex_unit::cleanup() free_tmp_table(thd, table); table= 0; // Safety } - for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) + for (SELECT_LEX *sl= first_select_in_union(); sl; sl= sl->next_select()) { JOIN *join; if ((join= sl->join)) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 65f07293c77..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 *fields); + /* Return 0 if row hasn't changed */ static bool compare_record(TABLE *table, ulong query_id) @@ -428,7 +430,7 @@ int mysql_multi_update(THD *thd, conds, 0, (ORDER *) NULL, (ORDER *)NULL, (Item *) NULL, (ORDER *)NULL, options | SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK, - result, unit, select_lex, 0, 0); + result, unit, select_lex, 0); delete result; DBUG_RETURN(res); } @@ -547,11 +549,12 @@ int multi_update::prepare(List ¬_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; + List temp_fields= *fields_for_table[cnt]; + ORDER group; + + if (table == main_table) // First table in join { - uint cnt= table_ref->shared; - ORDER group; - List 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); - - /* 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 (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 *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 ¬_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 e093a822303..af861875691 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -283,6 +283,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 @@ -290,6 +291,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 @@ -458,6 +460,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 @@ -532,6 +535,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token SUBJECT_SYM %token CIPHER_SYM +%token HELP +%token BEFORE_SYM %left SET_VAR %left OR_OR_CONCAT OR %left AND @@ -556,7 +561,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %type 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 + UNDERSCORE_CHARSET IDENT_sys TEXT_STRING_sys TEXT_STRING_db + NCHAR_STRING %type opt_table_alias @@ -660,9 +666,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 @@ -770,22 +776,22 @@ master_defs: | master_defs ',' master_def; master_def: - MASTER_HOST_SYM EQ TEXT_STRING + MASTER_HOST_SYM EQ TEXT_STRING_sys { Lex->mi.host = $3.str; } | - MASTER_USER_SYM EQ TEXT_STRING + MASTER_USER_SYM EQ TEXT_STRING_sys { Lex->mi.user = $3.str; } | - MASTER_PASSWORD_SYM EQ TEXT_STRING + MASTER_PASSWORD_SYM EQ TEXT_STRING_sys { Lex->mi.password = $3.str; } | - MASTER_LOG_FILE_SYM EQ TEXT_STRING + MASTER_LOG_FILE_SYM EQ TEXT_STRING_sys { Lex->mi.log_file_name = $3.str; } @@ -805,7 +811,7 @@ master_def: Lex->mi.connect_retry = $3; } | - RELAY_LOG_FILE_SYM EQ TEXT_STRING + RELAY_LOG_FILE_SYM EQ TEXT_STRING_sys { Lex->mi.relay_log_name = $3.str; } @@ -875,14 +881,14 @@ create: lex->name=$4.str; lex->create_info.options=$3; } - | CREATE udf_func_type UDF_SYM IDENT + | CREATE udf_func_type UDF_SYM IDENT_sys { LEX *lex=Lex; lex->sql_command = SQLCOM_CREATE_FUNCTION; lex->udf.name = $4; lex->udf.type= $2; } - UDF_RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING + UDF_RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING_sys { LEX *lex=Lex; lex->udf.returns=(Item_result) $7; @@ -964,8 +970,8 @@ create_table_option: | MAX_ROWS opt_equal ulonglong_num { Lex->create_info.max_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;} | MIN_ROWS opt_equal ulonglong_num { Lex->create_info.min_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;} | AVG_ROW_LENGTH opt_equal ULONG_NUM { Lex->create_info.avg_row_length=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;} - | PASSWORD opt_equal TEXT_STRING { Lex->create_info.password=$3.str; } - | COMMENT_SYM opt_equal TEXT_STRING { Lex->create_info.comment=$3.str; } + | PASSWORD opt_equal TEXT_STRING_sys { Lex->create_info.password=$3.str; } + | COMMENT_SYM opt_equal TEXT_STRING_sys { Lex->create_info.comment=$3.str; } | AUTO_INC opt_equal ulonglong_num { Lex->create_info.auto_increment_value=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;} | PACK_KEYS_SYM opt_equal ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_PACK_KEYS : HA_OPTION_NO_PACK_KEYS; Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;} | PACK_KEYS_SYM opt_equal DEFAULT { Lex->create_info.table_options&= ~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS); Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;} @@ -999,14 +1005,16 @@ create_table_option: Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET; } | INSERT_METHOD opt_equal merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;} - | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING { Lex->create_info.data_file_name= $4.str; } - | INDEX DIRECTORY_SYM opt_equal TEXT_STRING { Lex->create_info.index_file_name= $4.str; }; + | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys + { Lex->create_info.data_file_name= $4.str; } + | INDEX DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; }; table_types: ISAM_SYM { $$= DB_TYPE_ISAM; } | 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; }; @@ -1124,11 +1132,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; } @@ -1205,14 +1222,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; } @@ -1282,7 +1309,7 @@ attribute: | COMMENT_SYM text_literal { Lex->comment= $2; } | COLLATE_SYM collation_name { - if (Lex->charset && strcmp(Lex->charset->csname,$2->csname)) + if (Lex->charset && !my_charset_same(Lex->charset,$2)) { net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH, $2->name,Lex->charset->csname); @@ -1308,7 +1335,9 @@ charset_name: net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,$1.str); YYABORT; } - }; + } + | BINARY { $$= &my_charset_bin; } + ; charset_name_or_default: charset_name { $$=$1; } @@ -1635,7 +1664,7 @@ restore: { Lex->sql_command = SQLCOM_RESTORE_TABLE; } - table_list FROM TEXT_STRING + table_list FROM TEXT_STRING_sys { Lex->backup_dir = $6.str; }; @@ -1645,7 +1674,7 @@ backup: { Lex->sql_command = SQLCOM_BACKUP_TABLE; } - table_list TO_SYM TEXT_STRING + table_list TO_SYM TEXT_STRING_sys { Lex->backup_dir = $6.str; }; @@ -1895,9 +1924,9 @@ select_item: if (add_item_to_list(YYTHD, $2)) YYABORT; if ($4.str) - $2->set_name($4.str); + $2->set_name($4.str,$4.length,system_charset_info); else if (!$2->name) - $2->set_name($1,(uint) ($3 - $1)); + $2->set_name($1,(uint) ($3 - $1), YYTHD->charset()); }; remember_name: @@ -1911,11 +1940,12 @@ select_item2: | expr { $$=$1; }; select_alias: - { $$.str=0;} - | AS ident { $$=$2; } - | AS TEXT_STRING { $$=$2; } - | ident { $$=$1; } - | TEXT_STRING { $$=$1; }; + /* empty */ { $$.str=0;} + | AS ident { $$=$2; } + | AS TEXT_STRING_sys { $$=$2; } + | ident { $$=$1; } + | TEXT_STRING_sys { $$=$1; } + ; optional_braces: /* empty */ {} @@ -1993,11 +2023,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 */ @@ -2107,6 +2132,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 @@ -2217,9 +2247,9 @@ simple_expr: Lex->uncacheable();; } | ENCRYPT '(' expr ',' expr ')' { $$= new Item_func_encrypt($3,$5); } - | DECODE_SYM '(' expr ',' TEXT_STRING ')' + | DECODE_SYM '(' expr ',' TEXT_STRING_db ')' { $$= new Item_func_decode($3,$5.str); } - | ENCODE_SYM '(' expr ',' TEXT_STRING ')' + | ENCODE_SYM '(' expr ',' TEXT_STRING_db ')' { $$= new Item_func_encode($3,$5.str); } | DES_DECRYPT_SYM '(' expr ')' { $$= new Item_func_des_decrypt($3); } @@ -2250,7 +2280,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, @@ -2296,7 +2330,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 ')' @@ -2308,7 +2342,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); @@ -2331,15 +2365,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); } @@ -2359,11 +2393,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); } @@ -2816,8 +2850,8 @@ having_clause: ; opt_escape: - ESCAPE_SYM TEXT_STRING { $$= $2.str; } - | /* empty */ { $$= (char*) "\\"; }; + ESCAPE_SYM TEXT_STRING_db { $$= $2.str; } + | /* empty */ { $$= (char*) "\\"; }; /* @@ -3013,7 +3047,7 @@ procedure_item: if (add_proc_to_list(lex->thd, $2)) YYABORT; if (!$2->name) - $2->set_name($1,(uint) ((char*) lex->tok_end - $1)); + $2->set_name($1,(uint) ((char*) lex->tok_end - $1), YYTHD->charset()); } ; @@ -3042,7 +3076,7 @@ select_var_ident: '@' ident_or_text ; into: - INTO OUTFILE TEXT_STRING + INTO OUTFILE TEXT_STRING_sys { LEX *lex=Lex; if (!lex->describe) @@ -3054,7 +3088,7 @@ into: } } opt_field_term opt_line_term - | INTO DUMPFILE TEXT_STRING + | INTO DUMPFILE TEXT_STRING_sys { LEX *lex=Lex; if (!lex->describe) @@ -3116,7 +3150,7 @@ drop: lex->drop_if_exists=$3; lex->name=$4.str; } - | DROP UDF_SYM IDENT + | DROP UDF_SYM IDENT_sys { LEX *lex=Lex; lex->sql_command = SQLCOM_DROP_FUNCTION; @@ -3397,7 +3431,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; @@ -3476,7 +3511,7 @@ show_param: YYABORT; } | NEW_SYM MASTER_SYM FOR_SYM SLAVE WITH MASTER_LOG_FILE_SYM EQ - TEXT_STRING AND MASTER_LOG_POS_SYM EQ ulonglong_num + TEXT_STRING_sys AND MASTER_LOG_POS_SYM EQ ulonglong_num AND MASTER_SERVER_ID_SYM EQ ULONG_NUM { @@ -3591,7 +3626,7 @@ from_or_in: binlog_in: /* empty */ { Lex->mi.log_file_name = 0; } - | IN_SYM TEXT_STRING { Lex->mi.log_file_name = $2.str; }; + | IN_SYM TEXT_STRING_sys { Lex->mi.log_file_name = $2.str; }; binlog_from: /* empty */ { Lex->mi.pos = 4; /* skip magic number */ } @@ -3683,13 +3718,34 @@ purge: PURGE { LEX *lex=Lex; - lex->sql_command = SQLCOM_PURGE; lex->type=0; + } purge_options + {} + ; + +purge_options: + LOGS_SYM purge_option + | MASTER_SYM LOGS_SYM purge_option + ; + +purge_option: + TO_SYM TEXT_STRING_sys + { + Lex->sql_command = SQLCOM_PURGE; + Lex->to_log = $2.str; + } + | BEFORE_SYM expr + { + if ($2->check_cols(1) || $2->fix_fields(Lex->thd, 0, &$2)) + { + net_printf(Lex->thd, ER_WRONG_ARGUMENTS, "PURGE LOGS BEFORE"); + YYABORT; + } + Item *tmp= new Item_func_unix_timestamp($2); + Lex->sql_command = SQLCOM_PURGE_BEFORE; + Lex->purge_time= tmp->val_int(); } - MASTER_SYM LOGS_SYM TO_SYM TEXT_STRING - { - Lex->to_log = $6.str; - } ; + ; /* kill threads */ @@ -3717,7 +3773,7 @@ use: USE_SYM ident /* import, export of files */ -load: LOAD DATA_SYM load_data_lock opt_local INFILE TEXT_STRING +load: LOAD DATA_SYM load_data_lock opt_local INFILE TEXT_STRING_sys { LEX *lex=Lex; lex->sql_command= SQLCOM_LOAD; @@ -3801,17 +3857,24 @@ opt_ignore_lines: /* Common definitions */ text_literal: - TEXT_STRING - { $$ = new Item_string($1.str,$1.length, - YYTHD->variables.thd_charset); } + TEXT_STRING_db + { + THD *thd= YYTHD; + CHARSET_INFO *cs= my_charset_same(thd->charset(),thd->db_charset) ? + 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); } - | text_literal TEXT_STRING - { ((Item_string*) $1)->append($2.str,$2.length); }; + { $$ = new Item_string($2.str,$2.length,Lex->charset); } + | text_literal TEXT_STRING_db + { ((Item_string*) $1)->append($2.str,$2.length); } + ; text_string: - TEXT_STRING - { $$= new String($1.str,$1.length,YYTHD->variables.thd_charset); } + TEXT_STRING_db + { $$= new String($1.str,$1.length,YYTHD->db_charset); } | HEX_NUM { Item *tmp = new Item_varbinary($1.str,$1.length); @@ -3844,8 +3907,15 @@ literal: | REAL_NUM { $$ = new Item_real($1.str, $1.length); } | FLOAT_NUM { $$ = new Item_float($1.str, $1.length); } | NULL_SYM { $$ = new Item_null(); - Lex->next_state=STATE_OPERATOR_OR_IDENT;} + 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; }; @@ -3930,26 +4000,81 @@ 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 */; +IDENT_sys: + IDENT + { + THD *thd= YYTHD; + if (my_charset_same(thd->charset(),system_charset_info)) + { + $$=$1; + } + else + { + String ident; + ident.copy($1.str,$1.length,thd->charset(),system_charset_info); + $$.str= thd->strmake(ident.ptr(),ident.length()); + $$.length= ident.length(); + } + } + ; + +TEXT_STRING_sys: + TEXT_STRING + { + THD *thd= YYTHD; + if (my_charset_same(thd->charset(),system_charset_info)) + { + $$=$1; + } + else + { + String ident; + ident.copy($1.str,$1.length,thd->charset(),system_charset_info); + $$.str= thd->strmake(ident.ptr(),ident.length()); + $$.length= ident.length(); + } + } + ; + +TEXT_STRING_db: + TEXT_STRING + { + THD *thd= YYTHD; + if (my_charset_same(thd->charset(),thd->db_charset)) + { + $$=$1; + } + else + { + String ident; + ident.copy($1.str,$1.length,thd->charset(),thd->db_charset); + $$.str= thd->strmake(ident.ptr(),ident.length()); + $$.length= ident.length(); + } + } + ; + + ident: - IDENT { $$=$1; } + IDENT_sys { $$=$1; } | keyword { LEX *lex= Lex; $$.str= lex->thd->strmake($1.str,$1.length); $$.length=$1.length; - if (lex->next_state != STATE_END) - lex->next_state=STATE_OPERATOR_OR_IDENT; + if (lex->next_state != MY_LEX_END) + lex->next_state= MY_LEX_OPERATOR_OR_IDENT; } ; ident_or_text: - ident { $$=$1;} - | TEXT_STRING { $$=$1;} - | LEX_HOSTNAME { $$=$1;}; + ident { $$=$1;} + | TEXT_STRING_sys { $$=$1;} + | LEX_HOSTNAME { $$=$1;}; user: ident_or_text @@ -4064,6 +4189,7 @@ keyword: | MAX_UPDATES_PER_HOUR {} | MEDIUM_SYM {} | MERGE_SYM {} + | MEMORY_SYM {} | MINUTE_SYM {} | MIN_ROWS {} | MODIFY_SYM {} @@ -4213,22 +4339,56 @@ 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 { THD* thd= YYTHD; LEX *lex= &thd->lex; - system_variables vars= thd->variables; CHARSET_INFO *cs= $2 ? $2 : thd->db_charset; CHARSET_INFO *cl= $3 ? $3 : cs; - if ((cl != cs) && strcmp(cs->csname,cl->csname)) + if (!my_charset_same(cs,cl)) + { + net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH, + cl->name,cs->csname); + YYABORT; + } + Item_string *csname= 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("client_collation"), + csname)); + } + | COLLATION_SYM collation_name_or_default + { + THD* thd= YYTHD; + LEX *lex= &thd->lex; + system_variables *vars= &thd->variables; + CHARSET_INFO *cs= vars->thd_charset; + CHARSET_INFO *cl= $2; + + if (!cl) + { + if (!(cl=get_charset_by_csname(cs->csname,MY_CS_PRIMARY,MYF(0)))) + { + net_printf(YYTHD,ER_UNKNOWN_CHARACTER_SET,"DEFAULT"); + YYABORT; + } + } + else if (!my_charset_same(cs,cl)) { net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH, cl->name,cs->csname); @@ -4744,10 +4904,10 @@ optional_order_or_limit: LEX *lex= &thd->lex; DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE); SELECT_LEX *sel= lex->current_select->select_lex(); - sel->master_unit()->global_parameters= - sel->master_unit(); - lex->current_select= sel->master_unit(); - lex->current_select->no_table_names_allowed= 1; + SELECT_LEX_UNIT *unit= sel->master_unit(); + unit->global_parameters= unit; + unit->no_table_names_allowed= 1; + lex->current_select= unit; thd->where= "global ORDER clause"; } order_or_limit 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 dd5a957f984..17bb15d3033 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -515,6 +515,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 +532,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 +561,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); @@ -1162,7 +1163,7 @@ rename_file_ext(const char * from,const char * to,const char * ext) char *get_field(MEM_ROOT *mem, Field *field) { char buff[MAX_FIELD_WIDTH]; - String str(buff,sizeof(buff),default_charset_info); + String str(buff,sizeof(buff),&my_charset_bin); field->val_str(&str,&str); uint length=str.length(); if (!length) @@ -1229,6 +1230,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 +1246,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 +1255,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 +1275,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 1cd38d4d161..fa843fe5d1e 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -486,7 +486,7 @@ static bool pack_fields(File file,List &create_fields) /* Write intervals */ if (int_count) { - String tmp((char*) buff,sizeof(buff), default_charset_info); + String tmp((char*) buff,sizeof(buff), &my_charset_bin); tmp.length(0); it.rewind(); int_count=0; @@ -598,9 +598,9 @@ static bool make_empty_rec(File file,enum db_type table_type, regfield->store((longlong) 1); } else if (type == Field::YES) // Old unireg type - regfield->store(ER(ER_YES),(uint) strlen(ER(ER_YES)),default_charset_info); + regfield->store(ER(ER_YES),(uint) strlen(ER(ER_YES)),system_charset_info); else if (type == Field::NO) // Old unireg type - regfield->store(ER(ER_NO), (uint) strlen(ER(ER_NO)),default_charset_info); + regfield->store(ER(ER_NO), (uint) strlen(ER(ER_NO)),system_charset_info); else regfield->reset(); delete regfield; 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/ctype-big5.c b/strings/ctype-big5.c index c1d6d9e63de..87b76ce789b 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6244,6 +6244,7 @@ CHARSET_INFO my_charset_big5 = sort_order_big5, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 1, /* strxfrm_multiply */ my_strnncoll_big5, my_strnncollsp_big5, diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index b39697e6f81..33855bfcdcd 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -75,6 +75,21 @@ static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)), return cmp ? cmp : (int) (slen - tlen); } +static int my_strnncollsp_binary(CHARSET_INFO * cs, + const uchar *s, uint slen, + const uchar *t, uint tlen) +{ + int len, cmp; + + for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--); + for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--); + + len = ( slen > tlen ) ? tlen : slen; + + cmp= memcmp(s,t,len); + return cmp ? cmp : (int) (slen - tlen); +} + static void my_caseup_str_bin(CHARSET_INFO *cs __attribute__((unused)), char *str __attribute__((unused))) { @@ -306,9 +321,10 @@ CHARSET_INFO my_charset_bin = bin_char_array, /* sort_order */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_binary, /* strnncoll */ - my_strnncoll_binary, + my_strnncollsp_binary, my_strnxfrm_bin, /* strxnfrm */ my_like_range_simple, /* like_range */ my_wildcmp_bin, /* wildcmp */ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 9bdf666cc21..11e40dcf32f 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -618,6 +618,7 @@ CHARSET_INFO my_charset_czech = sort_order_czech, tab_8859_2_uni, /* tab_to_uni */ idx_uni_8859_2, /* tab_from_uni */ + "","", 4, /* strxfrm_multiply */ my_strnncoll_czech, my_strnncollsp_czech, diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index bd588c351c4..5ccc2cf486b 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -8652,6 +8652,7 @@ CHARSET_INFO my_charset_euc_kr = sort_order_euc_kr, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple, diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index cd82ffdd9bb..b95228c9f65 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -2818,6 +2818,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -2869,6 +2870,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -2919,6 +2921,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -2969,6 +2972,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3020,6 +3024,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3070,6 +3075,7 @@ CHARSET_INFO compiled_charsets[] = { sort_order_dec8, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple,/* strnncollsp */ @@ -3120,6 +3126,7 @@ CHARSET_INFO compiled_charsets[] = { sort_order_dos, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple,/* strnncollsp */ @@ -3170,6 +3177,7 @@ CHARSET_INFO compiled_charsets[] = { sort_order_estonia, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple,/* strnncollsp */ @@ -3221,6 +3229,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3271,6 +3280,7 @@ CHARSET_INFO compiled_charsets[] = { sort_order_greek, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple,/* strnncollsp */ @@ -3321,6 +3331,7 @@ CHARSET_INFO compiled_charsets[] = { sort_order_hebrew, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple,/* strnncollsp */ @@ -3371,6 +3382,7 @@ CHARSET_INFO compiled_charsets[] = { sort_order_hp8, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple,/* strnncollsp */ @@ -3421,6 +3433,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3471,6 +3484,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3521,6 +3535,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3572,6 +3587,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3622,6 +3638,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3673,6 +3690,7 @@ CHARSET_INFO compiled_charsets[] = { sort_order_swe7, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple,/* strnncollsp */ @@ -3724,6 +3742,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3774,6 +3793,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3824,6 +3844,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3874,6 +3895,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3924,6 +3946,7 @@ CHARSET_INFO compiled_charsets[] = { 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 */ @@ -3973,6 +3996,7 @@ CHARSET_INFO compiled_charsets[] = { NULL, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, NULL, /* strnncoll */ NULL, /* strnncollsp */ diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 9eca4383176..f346c249677 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -5702,6 +5702,7 @@ CHARSET_INFO my_charset_gb2312 = sort_order_gb2312, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple, diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index c1a65c48aef..9c3a36ffb9b 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -9899,6 +9899,7 @@ CHARSET_INFO my_charset_gbk = sort_order_gbk, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 1, /* strxfrm_multiply */ my_strnncoll_gbk, my_strnncollsp_gbk, diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 36260356816..7e721299692 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -188,6 +188,7 @@ CHARSET_INFO my_charset_latin1 = sort_order_latin1, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 2, /* strxfrm_multiply */ my_strnncoll_simple, my_strnncollsp_simple, diff --git a/strings/ctype-latin1_de.c b/strings/ctype-latin1_de.c index 66f47bb7326..e07bc6e9a70 100644 --- a/strings/ctype-latin1_de.c +++ b/strings/ctype-latin1_de.c @@ -359,6 +359,7 @@ CHARSET_INFO my_charset_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, 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-sjis.c b/strings/ctype-sjis.c index af87c550727..daeeb1706aa 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4486,6 +4486,7 @@ CHARSET_INFO my_charset_sjis = sort_order_sjis, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 1, /* strxfrm_multiply */ my_strnncoll_sjis, my_strnncollsp_sjis, diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index fd3a9318c25..345627dbc18 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -709,6 +709,7 @@ CHARSET_INFO my_charset_tis620 = sort_order_tis620, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 4, /* strxfrm_multiply */ my_strnncoll_tis620, my_strnncollsp_tis620, diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 6c238d50dcc..4930c6f95aa 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8443,6 +8443,7 @@ CHARSET_INFO my_charset_ujis = sort_order_ujis, NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 0, /* strxfrm_multiply */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple, diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index ecd163ac4c5..702a34fde84 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -27,6 +27,10 @@ #define EILSEQ ENOENT #endif +#ifndef HAVE_CHARSET_utf8 +#define HAVE_CHARSET_utf8 +#endif + #ifdef HAVE_CHARSET_utf8 #define HAVE_UNIDATA #endif @@ -1581,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; @@ -1620,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 */ @@ -1681,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)) , @@ -1988,6 +1991,7 @@ CHARSET_INFO my_charset_utf8 = to_upper_utf8, /* sort_order */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 1, /* strxfrm_multiply */ my_strnncoll_utf8, /* strnncoll */ my_strnncollsp_utf8, @@ -3095,6 +3099,7 @@ CHARSET_INFO my_charset_ucs2 = to_upper_ucs2, /* sort_order */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ + "","", 1, /* strxfrm_multiply */ my_strnncoll_ucs2, /* strnncoll */ my_strnncoll_ucs2, diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 978a5e8a55b..49ca0cf996c 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -653,6 +653,7 @@ CHARSET_INFO my_charset_win1250ch = sort_order_win1250ch, tab_cp1250_uni, /* tab_to_uni */ idx_uni_cp1250, /* tab_from_uni */ + "","", 2, /* strxfrm_multiply */ my_strnncoll_win1250ch, my_strnncollsp_win1250ch, 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 #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 @@ IFPkgFlagRestartAction NoRestart IFPkgFlagRootVolumeOnly - + IFPkgFlagUpdateInstalledLanguages IFPkgFormatVersion 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 34f4a919395..53912eb2af6 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -368,7 +368,7 @@ useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/nul chown -R mysql $mysql_datadir # Initiate databases -mysql_install_db -IN-RPM +mysql_install_db --rpm # Change permissions again to fix any new files. chown -R mysql $mysql_datadir @@ -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 + +- added missing file mysql_secure_installation to server subpackage + (bug #141) + * Tue Feb 11 2003 Lenz Grimmer - 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/tools/mysqlmanager.c b/tools/mysqlmanager.c index 4f2deeb0052..20fe2178005 100644 --- a/tools/mysqlmanager.c +++ b/tools/mysqlmanager.c @@ -89,6 +89,8 @@ #define MAX_LAUNCHER_MSG 256 #endif +static CHARSET_INFO *cs= &my_charset_latin1; + #define MAX_RETRY_COUNT 100 /* @@ -428,8 +430,8 @@ static int exec_line(struct manager_thd* thd,char* buf,char* buf_end) { char* p=buf; struct manager_cmd* cmd; - for (;pfatal=1; return 1; } - for (;phandler_func(thd,p,buf_end); } @@ -716,7 +718,7 @@ HANDLE_DECL(handle_query) int num_fields,i,ident_len; char* ident,*query; query=ident=args_start; - while (!my_isspace(system_charset_info,*query)) + while (!my_isspace(cs,*query)) query++; if (query == ident) { @@ -724,7 +726,7 @@ HANDLE_DECL(handle_query) goto err; } ident_len=(int)(query-ident); - while (querycmd_buf,p=thd->user,p_end=p+MAX_USER_NAME; bufuser, (uint)(p-thd->user)))) return 1; - for (;my_isspace(system_charset_info,*buf) && bufsd)); 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);