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/Makefile.am b/Makefile.am index 9da59074caa..f8b559c4238 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = INSTALL-SOURCE README \ COPYING COPYING.LIB SUBDIRS = . include @docs_dirs@ \ - @readline_topdir@ @readline_dir@ \ + @readline_topdir@ \ @thread_dirs@ pstack @sql_client_dirs@ \ @sql_server_dirs@ scripts man tests \ BUILD @netware_dir@ os2 @libmysqld_dirs@ \ diff --git a/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr b/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr new file mode 100755 index 00000000000..ef8404545fb --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr @@ -0,0 +1,51 @@ +[Language] +LanguageSupport0=0009 + +[OperatingSystem] +OSSupport=0000000000010010 + +[Data] +CurrentMedia= +CurrentComponentDef=Default.cdf +ProductName=MySQL Servers and Clients +set_mifserial= +DevEnvironment=Microsoft Visual C++ 6 +AppExe= +set_dlldebug=No +EmailAddresss= +Instructions=Instructions.txt +set_testmode=No +set_mif=No +SummaryText= +Department= +HomeURL= +Author= +Type=Database Application +InstallRoot=D:\MySQL-Install\4.0.xcom-clas +Version=1.00.000 +InstallationGUID=40744a4d-efed-4cff-84a9-9e6389550f5c +set_level=Level 3 +CurrentFileGroupDef=Default.fdf +Notes=Notes.txt +set_maxerr=50 +set_args= +set_miffile=Status.mif +set_dllcmdline= +Copyright= +set_warnaserr=No +CurrentPlatform= +Category= +set_preproc= +CurrentLanguage=English +CompanyName=MySQL +Description=Description.txt +set_maxwarn=50 +set_crc=Yes +set_compileb4build=No + +[MediaInfo] + +[General] +Type=INSTALLMAIN +Version=1.10.000 + diff --git a/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf new file mode 100755 index 00000000000..48d37800cd1 --- /dev/null +++ b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf @@ -0,0 +1,192 @@ +[Development] +required0=Servers +SELECTED=Yes +FILENEED=STANDARD +required1=Grant Tables +HTTPLOCATION= +STATUS=Examples, Libraries, Includes and Script files +UNINSTALLABLE=Yes +TARGET= +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/bdb/os_win32/os_rename.c b/bdb/os_win32/os_rename.c index ba14cb73bb0..67c3846649b 100644 --- a/bdb/os_win32/os_rename.c +++ b/bdb/os_win32/os_rename.c @@ -47,8 +47,11 @@ __os_rename(dbenv, oldname, newname, flags) * There is no MoveFileEx for Win9x/Me, so we have to * do the best we can. */ - if (!GetLongPathName(oldname, oldbuf, sizeof oldbuf) || - !GetLongPathName(newname, newbuf, sizeof newbuf)) { + LPTSTR FilePath; + if (!GetFullPathName(oldname, sizeof(oldbuf), oldbuf, + &FilePath) || + !GetFullPathName(newname, sizeof(newbuf), newbuf, + &FilePath)) { ret = __os_win32_errno(); goto done; } 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 1e0f68eb94e..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); } } @@ -1480,8 +1479,8 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length, uint find; char buff[255]; - *err_pos= 0; // No error yet - while (end > x && my_isspace(system_charset_info, end[-1])) + *err_pos= 0; /* No error yet */ + 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/mysqlshow.c b/client/mysqlshow.c index e6e21f177ef..9b376872ff8 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -89,7 +89,7 @@ int main(int argc, char **argv) } *to= *pos; } - *to= *pos; // just to copy a '\0' if '\\' was used + *to= *pos; /* just to copy a '\0' if '\\' was used */ } if (first_argument_uses_wildcards) wild= argv[--argc]; 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/config-netware.h b/include/config-netware.h index 57bf500da47..dab365a7127 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -22,17 +22,13 @@ #include #include #include -#include -#include #include #include #include #include -#include #include #include #include -#include #include #include @@ -48,6 +44,9 @@ #define HAVE_PTHREAD_YIELD_ZERO_ARG 1 #define HAVE_BROKEN_REALPATH 1 +/* include the old function apis */ +#define USE_OLD_FUNCTIONS 1 + /* no case sensitivity */ #define FN_NO_CASE_SENCE 1 diff --git a/include/m_ctype.h b/include/m_ctype.h index 4ed5c6eec6a..29ea40eaf33 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -74,9 +74,28 @@ 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; + uint primary_number; + uint binary_number; uint state; const char *csname; const char *name; @@ -87,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; @@ -179,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 c4fc157e6f2..b3be3588b2f 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -74,6 +74,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */ #define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */ #define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */ +#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */ #define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */ #define MY_GIVE_INFO 2 /* Give time info about process*/ @@ -202,26 +203,25 @@ 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, myf flags); -extern my_bool set_default_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 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 */ -extern ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests, - _my_cache_read; -extern ulong _my_blocks_used,_my_blocks_changed; +extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests, + my_cache_read; +extern ulong my_blocks_used, my_blocks_changed; extern uint key_cache_block_size; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; extern my_bool key_cache_inited, my_init_done; diff --git a/include/myisam.h b/include/myisam.h index e06f9fc37ca..33aa6aa3f31 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 */ @@ -363,8 +364,10 @@ typedef struct st_sort_info SORT_FT_BUF *ft_buf; /* sync things */ uint got_error, threads_running; +#ifdef THREAD pthread_mutex_t mutex; pthread_cond_t cond; +#endif } SORT_INFO; /* functions in mi_check */ 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/mysql_embed.h b/include/mysql_embed.h index bc75c3fbcb8..d48b0440660 100644 --- a/include/mysql_embed.h +++ b/include/mysql_embed.h @@ -25,6 +25,7 @@ #undef HAVE_OPENSSL #undef HAVE_VIO #undef HAVE_ISAM +#undef HAVE_SMEM /* No shared memory */ #define DONT_USE_RAID diff --git a/include/mysqld_error.h b/include/mysqld_error.h index ca3fe07e889..2f4158110cd 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -268,4 +268,6 @@ #define ER_NOT_SUPPORTED_AUTH_MODE 1249 #define ER_SPATIAL_CANT_HAVE_NULL 1250 #define ER_COLLATION_CHARSET_MISMATCH 1251 -#define ER_ERROR_MESSAGES 252 +#define ER_SLAVE_WAS_RUNNING 1252 +#define ER_SLAVE_WAS_NOT_RUNNING 1253 +#define ER_ERROR_MESSAGES 254 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/Makefile.shared b/libmysql/Makefile.shared index 9440d920719..60d6b320bb6 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -41,7 +41,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \ ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo \ ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \ - ctype-gb2312.lo ctype-gbk.lo ctype-latin1_de.lo \ + ctype-gb2312.lo ctype-gbk.lo \ ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo xml.lo mystringsextra= strto.c diff --git a/libmysql/get_password.c b/libmysql/get_password.c index 53eeb1080ce..e6221ea556e 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -23,7 +23,6 @@ #include "mysql.h" #include #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 cc3358de186..12647a32713 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -200,12 +200,6 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) if (!opt_mysql_tmpdir || !opt_mysql_tmpdir[0]) opt_mysql_tmpdir=(char*) P_tmpdir; /* purecov: inspected */ - if (init_thread_environment()) - { - mysql_server_end(); - return 1; - } - umask(((~my_umask) & 0666)); if (init_server_components()) { @@ -510,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) @@ -525,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..73bdcea9cc3 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -2096,7 +2096,7 @@ err: Threaded repair of table using sorting SYNOPSIS - mi_repair_by_sort_parallel() + mi_repair_parallel() param Repair parameters info MyISAM handler to repair name Name of table (for warnings) @@ -2115,6 +2115,9 @@ err: int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, const char * name, int rep_quick) { +#ifndef THREAD + return mi_repair_by_sort(param, info, name, rep_quick); +#else int got_error; uint i,key, total_key_length, istep; ulong rec_length; @@ -2485,6 +2488,7 @@ err: share->pack.header_length=0; } DBUG_RETURN(got_error); +#endif /* THREAD */ } /* Read next record and return next key */ @@ -3824,8 +3828,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/mi_test2.c b/myisam/mi_test2.c index b5da87355c6..8c7713c4b4d 100644 --- a/myisam/mi_test2.c +++ b/myisam/mi_test2.c @@ -646,13 +646,13 @@ int main(int argc, char *argv[]) (long) range_records > (long) records*14/10+2) { printf("mi_records_range for key: %d returned %ld; Should be about %ld\n", - i, range_records, records); + i, (long) range_records, (long) records); goto end; } if (verbose && records) { printf("mi_records_range returned %ld; Exact is %ld (diff: %4.2g %%)\n", - range_records,records, + (long) range_records, (long) records, labs((long) range_records-(long) records)*100.0/records); } @@ -667,7 +667,7 @@ int main(int argc, char *argv[]) { puts("Wrong info from mi_info"); printf("Got: records: %ld delete: %ld i_keys: %d\n", - info.records,info.deleted,info.keys); + (long) info.records, (long) info.deleted,info.keys); } if (verbose) { @@ -822,8 +822,8 @@ w_requests: %10lu\n\ writes: %10lu\n\ r_requests: %10lu\n\ reads: %10lu\n", - _my_blocks_used,_my_cache_w_requests, _my_cache_write, - _my_cache_r_requests,_my_cache_read); + my_blocks_used, my_cache_w_requests, my_cache_write, + my_cache_r_requests, my_cache_read); } end_key_cache(); if (blob_buffer) diff --git a/myisam/rt_index.c b/myisam/rt_index.c index 131ab5bd0b7..f02d6121eb5 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -158,7 +158,10 @@ int rtree_find_first(MI_INFO *info, uint keynr, uchar *key, uint key_length, MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; return -1; + } /* Save searched key */ memcpy(info->lastkey2, key, keyinfo->keylength - info->s->base.rec_reflength); @@ -185,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; @@ -217,7 +226,10 @@ int rtree_find_next(MI_INFO *info, uint keynr, uint search_flag) } } if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; return -1; + } nod_cmp_flag = ((search_flag & (MBR_EQUAL | MBR_WITHIN)) ? MBR_WITHIN : MBR_INTERSECT); @@ -340,7 +352,10 @@ int rtree_get_first(MI_INFO *info, uint keynr, uint key_length) MI_KEYDEF *keyinfo = info->s->keyinfo + keynr; if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; return -1; + } info->rtree_recursion_depth = -1; info->buff_used = 1; @@ -383,7 +398,10 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length) else { if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) + { + my_errno= HA_ERR_END_OF_FILE; return -1; + } return rtree_get_req(info, &keyinfo[keynr], key_length, root, 0); } @@ -732,7 +750,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) { - my_errno = HA_ERR_KEY_NOT_FOUND; + my_errno= HA_ERR_END_OF_FILE; return -1; } @@ -802,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: @@ -899,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/rt_split.c b/myisam/rt_split.c index a075b81e3a7..879cc0dc1dd 100644 --- a/myisam/rt_split.c +++ b/myisam/rt_split.c @@ -301,8 +301,11 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, } if (!(new_page = (uchar*)my_alloca((uint)keyinfo->block_length))) - return -1; - + { + err_code= -1; + goto split_err; + } + stop = task + (max_keys + 1); cur1 = rt_PAGE_FIRST_KEY(page, nod_flag); cur2 = rt_PAGE_FIRST_KEY(new_page, nod_flag); @@ -330,14 +333,14 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, mi_putint(page, 2 + n1 * full_length, nod_flag); mi_putint(new_page, 2 + n2 * full_length, nod_flag); - *new_page_offs=_mi_new(info, keyinfo); - _mi_write_keypage(info, keyinfo, *new_page_offs, new_page); + if ((*new_page_offs= _mi_new(info, keyinfo)) == HA_OFFSET_ERROR) + err_code= -1; + else + err_code= _mi_write_keypage(info, keyinfo, *new_page_offs, new_page); + my_afree((byte*)new_page); split_err: my_afree((byte*)coord_buf); return err_code; } - - - diff --git a/myisam/sort.c b/myisam/sort.c index 006b96cfaab..09e487e1165 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -297,6 +297,7 @@ static ha_rows NEAR_F find_all_keys(MI_SORT_PARAM *info, uint keys, } /* find_all_keys */ +#ifdef THREAD /* Search after all keys and place them in a temp. file */ pthread_handler_decl(thr_find_all_keys,arg) @@ -590,6 +591,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) my_free((gptr) mergebuf,MYF(MY_ALLOW_ZERO_PTR)); return got_error; } +#endif /* THREAD */ /* Write all keys in memory to file for later merge */ diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 82c2b1f8510..f669d217026 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -47,7 +47,7 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, dlen = _mi_calc_blob_length(keyseg->bit_start, pos); memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*)); - sp_mbr_from_wkb(dptr, dlen, SPDIMS, mbr); + sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */ for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) { @@ -56,6 +56,31 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, pos = ((byte*)mbr) + keyseg->start; if (keyseg->flag & HA_SWAP_KEY) { +#ifdef HAVE_ISNAN + if (keyseg->type == HA_KEYTYPE_FLOAT) + { + float nr; + float4get(nr, pos); + if (isnan(nr)) + { + /* Replace NAN with zero */ + bzero(key, length); + key+= length; + continue; + } + } + else if (keyseg->type == HA_KEYTYPE_DOUBLE) + { + double nr; + float8get(nr, pos); + if (isnan(nr)) + { + bzero(key, length); + key+= length; + continue; + } + } +#endif pos += length; while (length--) { @@ -99,19 +124,19 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, double *mbr) { double ord; - double *mbr_end = mbr + n_dims * 2; + double *mbr_end= mbr + n_dims * 2; while (mbr < mbr_end) { if ((*wkb) > end - 8) return -1; float8get(ord, (*wkb)); - (*wkb) += 8; + (*wkb)+= 8; if (ord < *mbr) - *mbr = ord; + float8store((char*) mbr, ord); mbr++; if (ord > *mbr) - *mbr = ord; + float8store((char*) mbr, ord); mbr++; } return 0; diff --git a/myisam/sp_test.c b/myisam/sp_test.c index 7ae41c2088c..7021cb4a8ee 100644 --- a/myisam/sp_test.c +++ b/myisam/sp_test.c @@ -272,7 +272,7 @@ int run_test(const char *filename) create_key(key, nrecords*upd); print_key(key," INTERSECT\n"); hrows=mi_records_in_range(file,0,key,0,HA_READ_MBR_INTERSECT,record+1,0,0); - printf(" %ld rows\n",hrows); + printf(" %ld rows\n", (long) hrows); if (mi_close(file)) goto err; diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 9f0936b1264..fb97dd5b1de 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -31,6 +31,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data install-data-local: $(mkinstalldirs) \ @@ -47,6 +48,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data SUFFIXES = .sh 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/include/master-slave.inc b/mysql-test/include/master-slave.inc index 008466c426f..5ec4b4379f8 100644 --- a/mysql-test/include/master-slave.inc +++ b/mysql-test/include/master-slave.inc @@ -3,8 +3,11 @@ connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,); connection slave; ---error 0,1199 -!stop slave; +#we expect STOP SLAVE to produce a warning as the slave is stopped +#(the server was started with skip-slave-start) +--disable_warnings +stop slave; +--enable_warnings @r/slave-stopped.result show status like 'Slave_running'; connection master; --disable_warnings 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/bdb-crash.result b/mysql-test/r/bdb-crash.result index 42c826d55da..5079368ea21 100644 --- a/mysql-test/r/bdb-crash.result +++ b/mysql-test/r/bdb-crash.result @@ -1,6 +1,6 @@ drop table if exists t1; CREATE TABLE t1 ( -ChargeID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, +ChargeID int(10) unsigned NOT NULL auto_increment, ServiceID int(10) unsigned DEFAULT '0' NOT NULL, ChargeDate date DEFAULT '0000-00-00' NOT NULL, ChargeAmount decimal(20,2) DEFAULT '0.00' NOT NULL, 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 cf93de4b7c6..a0150dc485a 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -92,7 +92,7 @@ z Ä ä ß -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_de; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci; latin1_f A a @@ -121,7 +121,7 @@ Y y Z z -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci; latin1_f A a @@ -181,7 +181,7 @@ z ü SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' -SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A a @@ -210,7 +210,7 @@ z Ä ä ß -SELECT latin1_f COLLATE latin1_de AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A a @@ -239,7 +239,7 @@ Y y Z z -SELECT latin1_f COLLATE latin1_ci_as AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A a @@ -268,7 +268,7 @@ Y y Z z -SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; latin1_f_as A AD @@ -297,7 +297,7 @@ z ä å ü -SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; latin1_f count(*) @@ -329,7 +329,7 @@ Z 2 Å 2 Ä 2 ß 1 -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_de; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci; latin1_f count(*) A 4 AD 2 @@ -344,7 +344,7 @@ UE 2 Ü 2 Y 2 Z 2 -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci; latin1_f count(*) A 2 AD 2 @@ -391,7 +391,7 @@ z 1 ü 1 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' -SELECT DISTINCT latin1_f FROM t1; +SELECT DISTINCT latin1_f FROM t1; latin1_f A AD @@ -406,7 +406,7 @@ UE SS ß Z -SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; latin1_f COLLATE latin1 A AD @@ -421,8 +421,8 @@ UE SS ß Z -SELECT DISTINCT latin1_f COLLATE latin1_de FROM t1; -latin1_f COLLATE latin1_de +SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1; +latin1_f COLLATE latin1_german2_ci A AD AE @@ -436,8 +436,8 @@ SS ß Y Z -SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1; -latin1_f COLLATE latin1_ci_as +SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1; +latin1_f COLLATE latin1_general_ci A AD AE @@ -452,7 +452,7 @@ SS ß Y Z -SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; latin1_f COLLATE latin1_bin A a @@ -481,6 +481,94 @@ Y y Z z -SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; +SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `latin1_f` char(32) NOT NULL default '' +) TYPE=MyISAM CHARSET=latin1 +SHOW FIELDS FROM t1; +Field Type Collation Null Key Default Extra +latin1_f char(32) latin1 +ALTER TABLE t1 CHANGE latin1_f +latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `latin1_f` char(32) character set latin1 collate latin1_bin default NULL +) TYPE=MyISAM CHARSET=latin1 +SHOW FIELDS FROM t1; +Field Type Collation Null Key Default Extra +latin1_f char(32) character set latin1 latin1_bin YES NULL +ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `latin1_f` char(32) collate latin1_bin default NULL +) TYPE=MyISAM CHARSET=latin1 COLLATE=latin1_bin +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 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 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 3 1 +SET NAMES latin1 COLLATE koi8r; +COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' +SET NAMES 'DEFAULT'; +Unknown character set: 'DEFAULT' DROP TABLE t1; 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 d3ec335aac6..3771245bff9 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -7,6 +7,38 @@ CREATE TABLE mls (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING); CREATE TABLE mp (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON); CREATE TABLE gc (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION); CREATE TABLE geo (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); +SHOW FIELDS FROM pt; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g point binary YES NULL +SHOW FIELDS FROM ls; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g linestring binary YES NULL +SHOW FIELDS FROM p; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g polygon binary YES NULL +SHOW FIELDS FROM mpt; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g multipoint binary YES NULL +SHOW FIELDS FROM mls; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g multilinestring binary YES NULL +SHOW FIELDS FROM mp; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g multipolygon binary YES NULL +SHOW FIELDS FROM gc; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g geometrycollection binary YES NULL +SHOW FIELDS FROM geo; +Field Type Collation Null Key Default Extra +fid int(11) binary PRI 0 +g geometry binary YES NULL INSERT INTO pt VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), @@ -15,26 +47,26 @@ INSERT INTO pt VALUES INSERT INTO ls VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), -(107, LineString(Point(10, 10), Point(40, 10))); +(107, GeometryFromWKB(LineString(Point(10, 10), Point(40, 10)))); INSERT INTO p VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), -(110, Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))); +(110, GeometryFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); INSERT INTO mpt VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), -(113, MultiPoint(Point(3, 6), Point(4, 10))); +(113, GeometryFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); INSERT INTO mls VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), -(116, MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))); +(116, GeometryFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); INSERT INTO mp VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), -(119, MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))); +(119, GeometryFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); INSERT INTO gc VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), -(121, GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))); +(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); INSERT into geo SELECT * FROM pt; INSERT into geo SELECT * FROM ls; INSERT into geo SELECT * FROM p; @@ -259,6 +291,21 @@ fid AsText(InteriorRingN(g, 1)) 108 NULL 109 LINESTRING(10 10,20 10,20 20,10 20,10 10) 110 NULL +SELECT fid, IsClosed(g) FROM mls; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM mp; +fid AsText(Centroid(g)) +117 POINT(55.588527753042 17.426536064114) +118 POINT(55.588527753042 17.426536064114) +119 POINT(2 2) +SELECT fid, Area(g) FROM mp; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 SELECT fid, NumGeometries(g) from mpt; fid NumGeometries(g) 111 4 diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index e6f3256d779..337d5639056 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -13,7 +13,7 @@ INSERT INTO t1 VALUES (2,2,2,'','0000-00-00'); INSERT INTO t1 VALUES (2,1,1,'','0000-00-00'); INSERT INTO t1 VALUES (3,3,3,'','0000-00-00'); CREATE TABLE t2 ( -userID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, +userID int(10) unsigned NOT NULL auto_increment, niName char(15), passwd char(8), mail char(50), @@ -53,7 +53,7 @@ userid MIN(t1.score+0.0) 2 2.0 drop table t1,t2; CREATE TABLE t1 ( -PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, +PID int(10) unsigned NOT NULL auto_increment, payDate date DEFAULT '0000-00-00' NOT NULL, recDate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, URID int(10) unsigned DEFAULT '0' NOT NULL, @@ -76,7 +76,7 @@ SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000 Can't group on 'IsNew' drop table t1; CREATE TABLE t1 ( -cid mediumint(9) DEFAULT '0' NOT NULL auto_increment, +cid mediumint(9) NOT NULL auto_increment, firstname varchar(32) DEFAULT '' NOT NULL, surname varchar(32) DEFAULT '' NOT NULL, PRIMARY KEY (cid) @@ -84,7 +84,7 @@ PRIMARY KEY (cid) INSERT INTO t1 VALUES (1,'That','Guy'); INSERT INTO t1 VALUES (2,'Another','Gent'); CREATE TABLE t2 ( -call_id mediumint(8) DEFAULT '0' NOT NULL auto_increment, +call_id mediumint(8) NOT NULL auto_increment, contact_id mediumint(8) DEFAULT '0' NOT NULL, PRIMARY KEY (call_id), KEY contact_id (contact_id) @@ -104,7 +104,7 @@ cid CONCAT(firstname, ' ', surname) COUNT(call_id) drop table t1,t2; unlock tables; CREATE TABLE t1 ( -bug_id mediumint(9) DEFAULT '0' NOT NULL auto_increment, +bug_id mediumint(9) NOT NULL auto_increment, groupset bigint(20) DEFAULT '0' NOT NULL, assigned_to mediumint(9) DEFAULT '0' NOT NULL, bug_file_loc text, @@ -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 c2 and cqty>1; +id sqty cqty +1 5 2 +2 9 2 +select id, sum(qty) as sqty from t1 group by id having sqty>2 and count(qty)>1; +id sqty +1 5 +2 9 +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty>2 and cqty>1; +id sqty cqty +1 5 2 +2 9 2 +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and count(qty)>1; +id sqty cqty +1 5 2 +2 9 2 +drop table t1; diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require index dae48a472b5..032b60d544a 100644 --- a/mysql-test/r/have_openssl_1.require +++ b/mysql-test/r/have_openssl_1.require @@ -1,2 +1,2 @@ Variable_name Value -have_openssl YES +Ssl_cipher EDH-RSA-DES-CBC3-SHA diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index ffd62ceabb6..76022b66100 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -23,7 +23,7 @@ a b 4 6 alter table t1 add c int not null, add key (c,a); drop table t1; -create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps"; +create table t1 (a int not null,b int not null, primary key (a)) type=memory comment="testing heaps"; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a > 0; select * from t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 5bc21501eca..52b6fc307ae 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2; +drop table if exists t1,t2,t3; create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb; insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); select id, code, name from t1 order by id; @@ -140,13 +140,13 @@ id parent_id level 1015 102 2 explain select level from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 12 Using where; Using index +1 SIMPLE t1 ref level level 1 const # Using where; Using index explain select level,id from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 12 Using where; Using index +1 SIMPLE t1 ref level level 1 const # Using where; Using index explain select level,id,parent_id from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 12 Using where +1 SIMPLE t1 ref level level 1 const # Using where select level,id from t1 where level=1; level id 1 1002 @@ -168,9 +168,9 @@ Table Op Msg_type Msg_text test.t1 optimize error The handler for the table doesn't support optimize show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 id A 87 NULL NULL BTREE -t1 1 parent_id 1 parent_id A 43 NULL NULL BTREE -t1 1 level 1 level A 6 NULL NULL BTREE +t1 0 PRIMARY 1 id A # NULL NULL BTREE +t1 1 parent_id 1 parent_id A # NULL NULL BTREE +t1 1 level 1 level A # NULL NULL BTREE drop table t1; CREATE TABLE t1 ( gesuchnr int(11) DEFAULT '0' NOT NULL, @@ -1073,3 +1073,133 @@ id select * from t2; id t1_id drop table t1,t2; +DROP TABLE IF EXISTS t1,t2; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +id +1 +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +id +2 +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +id +3 +DROP TABLE t1,t2; +set autocommit=0; +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) TYPE=InnoDB; +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; +SELECT * FROM t1; +id value +this-key will disappear +SELECT * FROM t2; +id value +this-key will also disappear +SELECT * FROM t3; +id1 id2 +ROLLBACK; +SELECT * FROM t1; +id value +SELECT * FROM t2; +id value +SELECT * FROM t3; +id1 id2 +my-test-1 my-test-2 +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +id1 id2 +my-test-1 my-test-2 +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +a b +1 1 +102 2 +103 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +drop table t1; +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) type=innodb; +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update t1,t2 set t1.a=t1.a+100; +select * from t1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; +a b +201 1 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +102 12 +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b where t1.b between 3 and 5; +select * from t1; +a b +201 1 +103 5 +104 6 +106 6 +105 7 +107 7 +108 8 +109 9 +102 12 +select * from t2; +a b +1 5 +2 5 +3 5 +4 5 +5 5 +6 5 +7 5 +8 5 +9 5 +drop table t1,t2; diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 274a4dec85d..09b819888eb 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -251,3 +251,26 @@ t1_id t2_id type cost_unit min_value max_value t3_id item_id id name 22 1 Percent Cost 100 -1 6 291 1 s1 23 1 Percent Cost 100 -1 21 291 1 s1 drop table t1,t2; +CREATE TABLE t1 ( +siteid varchar(25) NOT NULL default '', +emp_id varchar(30) NOT NULL default '', +rate_code varchar(10) default NULL, +UNIQUE KEY site_emp (siteid,emp_id), +KEY siteid (siteid) +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); +CREATE TABLE t2 ( +siteid varchar(25) NOT NULL default '', +rate_code varchar(10) NOT NULL default '', +base_rate float NOT NULL default '0', +PRIMARY KEY (siteid,rate_code), +FULLTEXT KEY rate_code (rate_code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('rivercats','cust',20); +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; +rate_code base_rate +cust 20 +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith'; +rate_code base_rate +cust 20 +drop table t1,t2; diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 8abe6d517ee..9ac44bec377 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -234,7 +234,7 @@ INSERT INTO t2 VALUES (11410,11410,131,0); INSERT INTO t2 VALUES (11416,11416,32767,0); INSERT INTO t2 VALUES (11409,0,0,0); CREATE TABLE t3 ( -id int(11) DEFAULT '0' NOT NULL auto_increment, +id int(11) NOT NULL auto_increment, dni_pasaporte char(16) DEFAULT '' NOT NULL, idPla int(11) DEFAULT '0' NOT NULL, cod_asig int(11) DEFAULT '0' NOT NULL, @@ -247,7 +247,7 @@ UNIQUE dni_pasaporte_2 (dni_pasaporte,idPla,cod_asig,any,quatrimestre) ); INSERT INTO t3 VALUES (1,'11111111',1,10362,98,1,'M'); CREATE TABLE t4 ( -id int(11) DEFAULT '0' NOT NULL auto_increment, +id int(11) NOT NULL auto_increment, papa int(11) DEFAULT '0' NOT NULL, fill int(11) DEFAULT '0' NOT NULL, idPla int(11) DEFAULT '0' NOT NULL, @@ -284,7 +284,7 @@ fill idPla 10362 NULL drop table t1,t2,t3,test.t4; CREATE TABLE t1 ( -id smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment, +id smallint(5) unsigned NOT NULL auto_increment, name char(60) DEFAULT '' NOT NULL, PRIMARY KEY (id) ); @@ -292,7 +292,7 @@ INSERT INTO t1 VALUES (1,'Antonio Paz'); INSERT INTO t1 VALUES (2,'Lilliana Angelovska'); INSERT INTO t1 VALUES (3,'Thimble Smith'); CREATE TABLE t2 ( -id smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment, +id smallint(5) unsigned NOT NULL auto_increment, owner smallint(5) unsigned DEFAULT '0' NOT NULL, name char(60), PRIMARY KEY (id) @@ -382,15 +382,15 @@ id str 2 NULL drop table t1; CREATE TABLE t1 ( -t1_id bigint(21) DEFAULT '0' NOT NULL auto_increment, +t1_id bigint(21) NOT NULL auto_increment, PRIMARY KEY (t1_id) ); CREATE TABLE t2 ( -t2_id bigint(21) DEFAULT '0' NOT NULL auto_increment, +t2_id bigint(21) NOT NULL auto_increment, PRIMARY KEY (t2_id) ); CREATE TABLE t3 ( -t3_id bigint(21) DEFAULT '0' NOT NULL auto_increment, +t3_id bigint(21) NOT NULL auto_increment, PRIMARY KEY (t3_id) ); CREATE TABLE t4 ( 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/order_by.result b/mysql-test/r/order_by.result index d0d7a954c99..bd5b283f26a 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -15,7 +15,7 @@ INSERT INTO t1 VALUES (2,6,'60671515','Y'); INSERT INTO t1 VALUES (2,7,'60671569','Y'); INSERT INTO t1 VALUES (2,3,'dd','Y'); CREATE TABLE t2 ( -id int(6) DEFAULT '0' NOT NULL auto_increment, +id int(6) NOT NULL auto_increment, description varchar(40) NOT NULL, idform varchar(40), ordre int(6) unsigned DEFAULT '0' NOT NULL, diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index f6be48cb185..46fa12dd9bc 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 @@ -625,3 +625,14 @@ show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 drop table t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +select * from t1 into outfile "query_caceh.out.file"; +select * from t1 limit 1 into dumpfile "query_cache.dump.file"; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1; 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_blob.result b/mysql-test/r/type_blob.result index 2126fadba58..24c0fcbac40 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -351,7 +351,7 @@ Incorrect sub part key. The used key part isn't a string, the used length is lon create table t1 (a text, key (a(255))); drop table t1; CREATE TABLE t1 ( -t1_id bigint(21) DEFAULT '0' NOT NULL auto_increment, +t1_id bigint(21) NOT NULL auto_increment, _field_72 varchar(128) DEFAULT '' NOT NULL, _field_95 varchar(32), _field_115 tinyint(4) DEFAULT '0' NOT NULL, @@ -375,7 +375,7 @@ INSERT INTO t2 VALUES (1,1); INSERT INTO t2 VALUES (2,1); INSERT INTO t2 VALUES (2,2); CREATE TABLE t3 ( -t3_id bigint(21) DEFAULT '0' NOT NULL auto_increment, +t3_id bigint(21) NOT NULL auto_increment, _field_131 varchar(128), _field_133 tinyint(4) DEFAULT '0' NOT NULL, _field_135 datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, @@ -403,7 +403,7 @@ PRIMARY KEY (seq_0_id,seq_1_id) INSERT INTO t4 VALUES (1,1); INSERT INTO t4 VALUES (2,1); CREATE TABLE t5 ( -t5_id bigint(21) DEFAULT '0' NOT NULL auto_increment, +t5_id bigint(21) NOT NULL auto_increment, _field_149 tinyint(4), _field_156 varchar(128) DEFAULT '' NOT NULL, _field_157 varchar(128) DEFAULT '' NOT NULL, @@ -430,7 +430,7 @@ INSERT INTO t6 VALUES (1,1); INSERT INTO t6 VALUES (1,2); INSERT INTO t6 VALUES (2,2); CREATE TABLE t7 ( -t7_id bigint(21) DEFAULT '0' NOT NULL auto_increment, +t7_id bigint(21) NOT NULL auto_increment, _field_143 tinyint(4), _field_165 varchar(32), _field_166 smallint(6) DEFAULT '0' NOT NULL, 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_decimal.result b/mysql-test/r/type_decimal.result index 0e60eefc9c7..4c326957c03 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -1,6 +1,6 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( -id int(11) DEFAULT '0' NOT NULL auto_increment, +id int(11) NOT NULL auto_increment, datatype_id int(11) DEFAULT '0' NOT NULL, minvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL, maxvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL, diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 8215977ea39..afc4f7c7a8b 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -1,6 +1,6 @@ drop table if exists t1,t2,t3; CREATE TABLE t1 ( -auto int(5) unsigned DEFAULT 0 NOT NULL auto_increment, +auto int(5) unsigned NOT NULL auto_increment, string char(10) default "hello", tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , @@ -129,7 +129,7 @@ auto new_field new_blob_col date_field 15 new 4294967295 0000-00-00 16 new NULL NULL CREATE TABLE t2 ( -auto int(5) unsigned NOT NULL DEFAULT 0 auto_increment, +auto int(5) unsigned NOT NULL auto_increment, string char(20), mediumblob_col mediumblob not null, new_field char(2), @@ -233,7 +233,7 @@ auto bigint(17) unsigned binary PRI 0 select,insert,update,references t1 bigint(1) binary 0 select,insert,update,references t2 char(1) latin1 select,insert,update,references t3 mediumtext latin1 select,insert,update,references -t4 mediumblob binary select,insert,update,references +t4 mediumtext character set latin1 latin1_bin select,insert,update,references select * from t2; auto t1 t2 t3 t4 11 1 a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 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/update.result b/mysql-test/r/update.result index 159b971440b..9978e3cb29c 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -96,7 +96,7 @@ KEY k4 (assignment), KEY ticket (ticket) ) TYPE=MyISAM; INSERT INTO t1 VALUES (773,773,'','','',980257344,20010318180652,0,'Open',10,0,0,0,1,'','','','',''); -alter table t1 change lfdnr lfdnr int(10) unsigned default 0 not null auto_increment; +alter table t1 change lfdnr lfdnr int(10) unsigned not null auto_increment; update t1 set status=1 where type='Open'; select status from t1; status 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/bdb-crash.test b/mysql-test/t/bdb-crash.test index 956645b1188..d77de901a30 100644 --- a/mysql-test/t/bdb-crash.test +++ b/mysql-test/t/bdb-crash.test @@ -6,7 +6,7 @@ drop table if exists t1; --enable_warnings CREATE TABLE t1 ( - ChargeID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + ChargeID int(10) unsigned NOT NULL auto_increment, ServiceID int(10) unsigned DEFAULT '0' NOT NULL, ChargeDate date DEFAULT '0000-00-00' NOT NULL, ChargeAmount decimal(20,2) DEFAULT '0.00' NOT NULL, 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 741db4d55e7..e2631a06156 100644 --- a/mysql-test/t/ctype_collate.test +++ b/mysql-test/t/ctype_collate.test @@ -58,8 +58,8 @@ INSERT INTO t1 (latin1_f) VALUES (_latin1'z'); SELECT latin1_f FROM t1 ORDER BY latin1_f; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1; -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_de; -SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci; +SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin; --error 1251 SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; @@ -67,20 +67,20 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; --SELECT latin1_f COLLATE koi8r FROM t1 ; -- AS + ORDER BY -SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -SELECT latin1_f COLLATE latin1_de AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -SELECT latin1_f COLLATE latin1_ci_as AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as; --error 1251 -SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; +SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; -- GROUP BY SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1; -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_de; -SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_ci_as; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci; +SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin; --error 1251 SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; @@ -88,28 +88,74 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; -- DISTINCT -SELECT DISTINCT latin1_f FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1_de FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1; -SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; +SELECT DISTINCT latin1_f FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1; +SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; --error 1251 -SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; +SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; -- Aggregates ---SELECT MAX(k COLLATE latin1_de) +--SELECT MAX(k COLLATE latin1_german2_ci) --FROM t1 -- WHERE --SELECT * --FROM t1 ---WHERE (_latin1'Mu"ller' COLLATE latin1_de) = k +--WHERE (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k --HAVING --SELECT * --FROM t1 ---HAVING (_latin1'Mu"ller' COLLATE latin1_de) = k +--HAVING (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k + + +# +# Check that SHOW displays COLLATE clause +# + +SHOW CREATE TABLE t1; +SHOW FIELDS FROM t1; +ALTER TABLE t1 CHANGE latin1_f +latin1_f CHAR(32) CHARACTER SET latin1 COLLATE latin1_bin; +SHOW CREATE TABLE t1; +SHOW FIELDS FROM t1; +ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin; +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; +--error 1115 +SET NAMES 'DEFAULT'; + DROP TABLE t1; diff --git a/mysql-test/t/ctype_latin1_de-master.opt b/mysql-test/t/ctype_latin1_de-master.opt index 98accd58c46..62f864d501d 100644 --- a/mysql-test/t/ctype_latin1_de-master.opt +++ b/mysql-test/t/ctype_latin1_de-master.opt @@ -1 +1 @@ ---default-character-set=latin1_de +--default-character-set=latin1_german2_ci diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index a4b4b816ec4..e0591913f68 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -4,13 +4,13 @@ --disable_warnings drop table if exists t1; --enable_warnings -create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b)); +create table t1 (a char (20) not null, b int not null auto_increment, index (a,b)); insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb'); insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf'); insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb'); insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa'); insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae'); -insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'); +insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a'); select a,b from t1 order by a,b; select a,b from t1 order by upper(a),b; select a from t1 order by a desc; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 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 128d369b0b6..179dd12e6a3 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -15,6 +15,16 @@ CREATE TABLE mp (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON); CREATE TABLE gc (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION); CREATE TABLE geo (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY); +SHOW FIELDS FROM pt; +SHOW FIELDS FROM ls; +SHOW FIELDS FROM p; +SHOW FIELDS FROM mpt; +SHOW FIELDS FROM mls; +SHOW FIELDS FROM mp; +SHOW FIELDS FROM gc; +SHOW FIELDS FROM geo; + + INSERT INTO pt VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), @@ -24,32 +34,32 @@ INSERT INTO pt VALUES INSERT INTO ls VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), -(107, LineString(Point(10, 10), Point(40, 10))); +(107, GeometryFromWKB(LineString(Point(10, 10), Point(40, 10)))); INSERT INTO p VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), -(110, Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))); +(110, GeometryFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); INSERT INTO mpt VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), -(113, MultiPoint(Point(3, 6), Point(4, 10))); +(113, GeometryFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); INSERT INTO mls VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), -(116, MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))); +(116, GeometryFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); INSERT INTO mp VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), -(119, MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))); +(119, GeometryFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); INSERT INTO gc VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), -(121, GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))); +(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); INSERT into geo SELECT * FROM pt; INSERT into geo SELECT * FROM ls; @@ -89,6 +99,11 @@ SELECT fid, AsText(ExteriorRing(g)) FROM p; SELECT fid, NumInteriorRings(g) FROM p; SELECT fid, AsText(InteriorRingN(g, 1)) FROM p; +SELECT fid, IsClosed(g) FROM mls; + +SELECT fid, AsText(Centroid(g)) FROM mp; +SELECT fid, Area(g) FROM mp; + SELECT fid, NumGeometries(g) from mpt; SELECT fid, NumGeometries(g) from mls; SELECT fid, NumGeometries(g) from mp; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index dfcf72eb2c3..912bed1955c 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -27,7 +27,7 @@ INSERT INTO t1 VALUES (2,1,1,'','0000-00-00'); INSERT INTO t1 VALUES (3,3,3,'','0000-00-00'); CREATE TABLE t2 ( - userID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + userID int(10) unsigned NOT NULL auto_increment, niName char(15), passwd char(8), mail char(50), @@ -57,7 +57,7 @@ drop table t1,t2; # CREATE TABLE t1 ( - PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + PID int(10) unsigned NOT NULL auto_increment, payDate date DEFAULT '0000-00-00' NOT NULL, recDate datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, URID int(10) unsigned DEFAULT '0' NOT NULL, @@ -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; @@ -88,7 +89,7 @@ drop table t1; # CREATE TABLE t1 ( - cid mediumint(9) DEFAULT '0' NOT NULL auto_increment, + cid mediumint(9) NOT NULL auto_increment, firstname varchar(32) DEFAULT '' NOT NULL, surname varchar(32) DEFAULT '' NOT NULL, PRIMARY KEY (cid) @@ -97,7 +98,7 @@ INSERT INTO t1 VALUES (1,'That','Guy'); INSERT INTO t1 VALUES (2,'Another','Gent'); CREATE TABLE t2 ( - call_id mediumint(8) DEFAULT '0' NOT NULL auto_increment, + call_id mediumint(8) NOT NULL auto_increment, contact_id mediumint(8) DEFAULT '0' NOT NULL, PRIMARY KEY (call_id), KEY contact_id (contact_id) @@ -123,7 +124,7 @@ unlock tables; # CREATE TABLE t1 ( - bug_id mediumint(9) DEFAULT '0' NOT NULL auto_increment, + bug_id mediumint(9) NOT NULL auto_increment, groupset bigint(20) DEFAULT '0' NOT NULL, assigned_to mediumint(9) DEFAULT '0' NOT NULL, bug_file_loc text, @@ -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 c2 and cqty>1; +select id, sum(qty) as sqty from t1 group by id having sqty>2 and count(qty)>1; +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sqty>2 and cqty>1; +select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(qty)>2 and count(qty)>1; +drop table t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index cd5dbd5afbe..22d9e57a574 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -20,7 +20,7 @@ select * from t1; alter table t1 add c int not null, add key (c,a); drop table t1; -create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps"; +create table t1 (a int not null,b int not null, primary key (a)) type=memory comment="testing heaps"; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a > 0; select * from t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index b8ba55d9230..4d1a620d67f 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -5,7 +5,7 @@ # --disable_warnings -drop table if exists t1,t2; +drop table if exists t1,t2,t3; --enable_warnings create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=innodb; @@ -22,6 +22,8 @@ drop table t1; # # A bit bigger test +# The 'replace_result' statements are needed because the cardinality calculated +# by innodb is not always the same between runs # CREATE TABLE t1 ( @@ -43,12 +45,16 @@ update ignore t1 set id=id+1; # This will change all rows select * from t1; update ignore t1 set id=1023 where id=1010; select * from t1 where parent_id=102; +--replace_result 12 # 6 # explain select level from t1 where level=1; +--replace_result 12 # 6 # explain select level,id from t1 where level=1; +--replace_result 12 # 6 # 5 # explain select level,id,parent_id from t1 where level=1; select level,id from t1 where level=1; select level,id,parent_id from t1 where level=1; optimize table t1; +--replace_result 87 # 50 # 48 # 43 # 25 # 24 # 6 # 3 # show keys from t1; drop table t1; @@ -717,3 +723,85 @@ delete t1,t2 from t1,t2 where t1.id=t2.t1_id; select * from t1; select * from t2; drop table t1,t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +DROP TABLE t1,t2; + +# +# Test of range_optimizer +# + +set autocommit=0; + +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; + +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) TYPE=InnoDB; + +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) TYPE=InnoDB; + +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; + +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; + +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +ROLLBACK; + +SELECT * FROM t1; +SELECT * FROM t2; +SELECT * FROM t3; +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; + +# +# Check update with conflicting key +# + +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +# We need the a < 1000 test here to quard against the halloween problems +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +drop table t1; + +# +# Test multi update with different join methods +# + +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) type=innodb; +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); + +# Full join, without key +update t1,t2 set t1.a=t1.a+100; +select * from t1; + +# unique key +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; + +# ref key +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; + +# Range key (in t1) +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b where t1.b between 3 and 5; +select * from t1; +select * from t2; + +drop table t1,t2; diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 59c0c37e40d..7840e128ac7 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -248,3 +248,27 @@ CREATE TABLE t2 ( INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5'); select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2; drop table t1,t2; + +# +# Bug in range optimiser with MAYBE_KEY +# + +CREATE TABLE t1 ( + siteid varchar(25) NOT NULL default '', + emp_id varchar(30) NOT NULL default '', + rate_code varchar(10) default NULL, + UNIQUE KEY site_emp (siteid,emp_id), + KEY siteid (siteid) +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust'); +CREATE TABLE t2 ( + siteid varchar(25) NOT NULL default '', + rate_code varchar(10) NOT NULL default '', + base_rate float NOT NULL default '0', + PRIMARY KEY (siteid,rate_code), + FULLTEXT KEY rate_code (rate_code) +) TYPE=MyISAM; +INSERT INTO t2 VALUES ('rivercats','cust',20); +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats'; +SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith'; +drop table t1,t2; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index bfeb5bbb06b..c57fb8273fe 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -169,7 +169,7 @@ INSERT INTO t2 VALUES (11416,11416,32767,0); INSERT INTO t2 VALUES (11409,0,0,0); CREATE TABLE t3 ( - id int(11) DEFAULT '0' NOT NULL auto_increment, + id int(11) NOT NULL auto_increment, dni_pasaporte char(16) DEFAULT '' NOT NULL, idPla int(11) DEFAULT '0' NOT NULL, cod_asig int(11) DEFAULT '0' NOT NULL, @@ -184,7 +184,7 @@ CREATE TABLE t3 ( INSERT INTO t3 VALUES (1,'11111111',1,10362,98,1,'M'); CREATE TABLE t4 ( - id int(11) DEFAULT '0' NOT NULL auto_increment, + id int(11) NOT NULL auto_increment, papa int(11) DEFAULT '0' NOT NULL, fill int(11) DEFAULT '0' NOT NULL, idPla int(11) DEFAULT '0' NOT NULL, @@ -211,7 +211,7 @@ drop table t1,t2,t3,test.t4; # CREATE TABLE t1 ( - id smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment, + id smallint(5) unsigned NOT NULL auto_increment, name char(60) DEFAULT '' NOT NULL, PRIMARY KEY (id) ); @@ -220,7 +220,7 @@ INSERT INTO t1 VALUES (2,'Lilliana Angelovska'); INSERT INTO t1 VALUES (3,'Thimble Smith'); CREATE TABLE t2 ( - id smallint(5) unsigned DEFAULT '0' NOT NULL auto_increment, + id smallint(5) unsigned NOT NULL auto_increment, owner smallint(5) unsigned DEFAULT '0' NOT NULL, name char(60), PRIMARY KEY (id) @@ -258,15 +258,15 @@ drop table t1; # CREATE TABLE t1 ( - t1_id bigint(21) DEFAULT '0' NOT NULL auto_increment, + t1_id bigint(21) NOT NULL auto_increment, PRIMARY KEY (t1_id) ); CREATE TABLE t2 ( - t2_id bigint(21) DEFAULT '0' NOT NULL auto_increment, + t2_id bigint(21) NOT NULL auto_increment, PRIMARY KEY (t2_id) ); CREATE TABLE t3 ( - t3_id bigint(21) DEFAULT '0' NOT NULL auto_increment, + t3_id bigint(21) NOT NULL auto_increment, PRIMARY KEY (t3_id) ); CREATE TABLE t4 ( 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/order_by.test b/mysql-test/t/order_by.test index f7677709ca4..8e1f304a5a5 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -25,7 +25,7 @@ INSERT INTO t1 VALUES (2,7,'60671569','Y'); INSERT INTO t1 VALUES (2,3,'dd','Y'); CREATE TABLE t2 ( - id int(6) DEFAULT '0' NOT NULL auto_increment, + id int(6) NOT NULL auto_increment, description varchar(40) NOT NULL, idform varchar(40), ordre int(6) unsigned DEFAULT '0' NOT NULL, diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index f6e32a99523..56eda7fa104 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -435,4 +435,16 @@ select * from t1; show status like "Qcache_queries_in_cache"; load data infile '../../std_data/words.dat' into table t1; show status like "Qcache_queries_in_cache"; -drop table t1; \ No newline at end of file +drop table t1; + +# +# INTO OUTFILE/DUMPFILE test +# + +create table t1 (a int); +insert into t1 values (1),(2),(3); +show status like "Qcache_queries_in_cache"; +select * from t1 into outfile "query_caceh.out.file"; +select * from t1 limit 1 into dumpfile "query_cache.dump.file"; +show status like "Qcache_queries_in_cache"; +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_blob.test b/mysql-test/t/type_blob.test index 002aeaed9dc..9c00abe980b 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -130,7 +130,7 @@ drop table t1; # CREATE TABLE t1 ( - t1_id bigint(21) DEFAULT '0' NOT NULL auto_increment, + t1_id bigint(21) NOT NULL auto_increment, _field_72 varchar(128) DEFAULT '' NOT NULL, _field_95 varchar(32), _field_115 tinyint(4) DEFAULT '0' NOT NULL, @@ -161,7 +161,7 @@ INSERT INTO t2 VALUES (2,1); INSERT INTO t2 VALUES (2,2); CREATE TABLE t3 ( - t3_id bigint(21) DEFAULT '0' NOT NULL auto_increment, + t3_id bigint(21) NOT NULL auto_increment, _field_131 varchar(128), _field_133 tinyint(4) DEFAULT '0' NOT NULL, _field_135 datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, @@ -196,7 +196,7 @@ INSERT INTO t4 VALUES (1,1); INSERT INTO t4 VALUES (2,1); CREATE TABLE t5 ( - t5_id bigint(21) DEFAULT '0' NOT NULL auto_increment, + t5_id bigint(21) NOT NULL auto_increment, _field_149 tinyint(4), _field_156 varchar(128) DEFAULT '' NOT NULL, _field_157 varchar(128) DEFAULT '' NOT NULL, @@ -228,7 +228,7 @@ INSERT INTO t6 VALUES (1,2); INSERT INTO t6 VALUES (2,2); CREATE TABLE t7 ( - t7_id bigint(21) DEFAULT '0' NOT NULL auto_increment, + t7_id bigint(21) NOT NULL auto_increment, _field_143 tinyint(4), _field_165 varchar(32), _field_166 smallint(6) DEFAULT '0' NOT NULL, 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_decimal.test b/mysql-test/t/type_decimal.test index 9b10e8943ad..053d0517904 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS t1; --enable_warnings CREATE TABLE t1 ( - id int(11) DEFAULT '0' NOT NULL auto_increment, + id int(11) NOT NULL auto_increment, datatype_id int(11) DEFAULT '0' NOT NULL, minvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL, maxvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL, diff --git a/mysql-test/t/type_ranges.test b/mysql-test/t/type_ranges.test index 767012d0b34..ea7fa7be8c1 100644 --- a/mysql-test/t/type_ranges.test +++ b/mysql-test/t/type_ranges.test @@ -7,7 +7,7 @@ drop table if exists t1,t2,t3; --enable_warnings CREATE TABLE t1 ( - auto int(5) unsigned DEFAULT 0 NOT NULL auto_increment, + auto int(5) unsigned NOT NULL auto_increment, string char(10) default "hello", tiny tinyint(4) DEFAULT '0' NOT NULL , short smallint(6) DEFAULT '1' NOT NULL , @@ -93,7 +93,7 @@ select auto,new_field,new_blob_col,date_field from t1 ; # check with old syntax # CREATE TABLE t2 ( - auto int(5) unsigned NOT NULL DEFAULT 0 auto_increment, + auto int(5) unsigned NOT NULL auto_increment, string char(20), mediumblob_col mediumblob not null, new_field char(2), 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/update.test b/mysql-test/t/update.test index 31d22c1f850..6a7eac41a96 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -75,7 +75,7 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (773,773,'','','',980257344,20010318180652,0,'Open',10,0,0,0,1,'','','','',''); -alter table t1 change lfdnr lfdnr int(10) unsigned default 0 not null auto_increment; +alter table t1 change lfdnr lfdnr int(10) unsigned not null auto_increment; update t1 set status=1 where type='Open'; select status from t1; drop table t1; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 39aa5a20a71..4bde54f868a 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -92,11 +92,11 @@ set net_buffer_length=2000000000; show variables like 'net_buffer_length'; set GLOBAL character set cp1251_koi8; -show global variables like "convert_character_set"; +show global variables like "client_collation"; set character set cp1251_koi8; -show variables like "convert_character_set"; +show variables like "client_collation"; set global character set default, session character set default; -show variables like "convert_character_set"; +show variables like "client_collation"; select @@timestamp>0; set @@rand_seed1=10000000,@@rand_seed2=1000000; @@ -123,7 +123,7 @@ set SESSION query_cache_size=10000; --error 1230 set GLOBAL table_type=DEFAULT; --error 1115 -set convert_character_set=UNKNOWN_CHARACTER_SET; +set client_collation=UNKNOWN_CHARACTER_SET; --error 1115 set character set unknown; --error 1232 @@ -148,8 +148,8 @@ set big_tables=1; select @@autocommit, @@big_tables; set global binlog_cache_size=100; set bulk_insert_buffer_size=100; -set convert_character_set=cp1251_koi8; -set convert_character_set=default; +set character set cp1251_koi8; +set character set default; set @@global.concurrent_insert=1; set global connect_timeout=100; select @@delay_key_write; diff --git a/mysys/charset.c b/mysys/charset.c index 1b53eac77df..e1545dc4f8f 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,25 +58,100 @@ 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) { - cs->strnxfrm = my_strnxfrm_simple; - cs->strnncoll = my_strnncoll_simple; - cs->strnncollsp = my_strnncollsp_simple; - cs->like_range = my_like_range_simple; - cs->wildcmp = my_wildcmp_8bit; - cs->mb_wc = my_mb_wc_8bit; - cs->wc_mb = my_wc_mb_8bit; + if (cs->state & MY_CS_BINSORT) + { + CHARSET_INFO *b= &my_charset_bin; + cs->strnxfrm = b->strnxfrm; + cs->like_range = b->like_range; + cs->wildcmp = b->wildcmp; + cs->strnncoll = b->strnncoll; + cs->strnncollsp = b->strnncollsp; + cs->tosort = b->tosort; + cs->strcasecmp = b->strcasecmp; + cs->strncasecmp = b->strncasecmp; + cs->hash_caseup = b->hash_caseup; + cs->hash_sort = b->hash_sort; + } + else + { + cs->strnxfrm = my_strnxfrm_simple; + cs->like_range = my_like_range_simple; + cs->wildcmp = my_wildcmp_8bit; + cs->strnncoll = my_strnncoll_simple; + cs->strnncollsp = my_strnncollsp_simple; + cs->tosort = my_tosort_8bit; + cs->strcasecmp = my_strcasecmp_8bit; + cs->strncasecmp = my_strncasecmp_8bit; + cs->hash_caseup = my_hash_caseup_simple; + cs->hash_sort = my_hash_sort_simple; + } + cs->caseup_str = my_caseup_str_8bit; cs->casedn_str = my_casedn_str_8bit; cs->caseup = my_caseup_8bit; cs->casedn = my_casedn_8bit; - cs->tosort = my_tosort_8bit; - cs->strcasecmp = my_strcasecmp_8bit; - cs->strncasecmp = my_strncasecmp_8bit; - cs->hash_caseup = my_hash_caseup_simple; - cs->hash_sort = my_hash_sort_simple; + cs->mb_wc = my_mb_wc_8bit; + cs->wc_mb = my_wc_mb_8bit; cs->snprintf = my_snprintf_8bit; cs->long10_to_str= my_long10_to_str_8bit; cs->longlong10_to_str= my_longlong10_to_str_8bit; @@ -192,9 +271,15 @@ static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) if (from->name) to->name= my_once_strdup(from->name,MYF(MY_WME)); + if (from->comment) + to->comment= my_once_strdup(from->comment,MYF(MY_WME)); + if (from->ctype) + { to->ctype= (uchar*) my_once_memdup((char*) from->ctype, 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)); @@ -223,7 +308,8 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs) { return ((cs->csname && cs->tab_to_uni && cs->ctype && cs->to_upper && cs->to_lower) && - (cs->number && cs->name && cs->sort_order)); + (cs->number && cs->name && + (cs->sort_order || (cs->state & MY_CS_BINSORT) ))); } @@ -238,7 +324,13 @@ static int add_collation(CHARSET_INFO *cs) return MY_XML_ERROR; bzero((void*)all_charsets[cs->number],sizeof(CHARSET_INFO)); } + + if (cs->primary_number == cs->number) + cs->state |= MY_CS_PRIMARY; + if (cs->binary_number == cs->number) + cs->state |= MY_CS_BINSORT; + if (!(all_charsets[cs->number]->state & MY_CS_COMPILED)) { simple_cs_copy_data(all_charsets[cs->number],cs); @@ -248,7 +340,16 @@ static int add_collation(CHARSET_INFO *cs) all_charsets[cs->number]->state |= MY_CS_LOADED; } } + else + { + CHARSET_INFO *dst= all_charsets[cs->number]; + dst->state |= cs->state; + if (cs->comment) + dst->comment= my_once_strdup(cs->comment,MYF(MY_WME)); + } cs->number= 0; + cs->primary_number= 0; + cs->binary_number= 0; cs->name= NULL; cs->state= 0; cs->sort_order= NULL; @@ -320,7 +421,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) @@ -418,7 +518,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); @@ -450,7 +553,10 @@ uint get_charset_number(const char *charset_name) for (cs= all_charsets; cs < all_charsets+255; ++cs) { - if ( cs[0] && cs[0]->name && !strcmp(cs[0]->name, charset_name)) + if ( cs[0] && cs[0]->name && + (!strcasecmp(cs[0]->name, charset_name) || + (!strcasecmp(cs[0]->csname, charset_name) && + (cs[0]->state & MY_CS_PRIMARY)))) return cs[0]->number; } return 0; /* this mimics find_type() */ @@ -515,24 +621,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; @@ -553,7 +641,9 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags) } -CHARSET_INFO *get_charset_by_csname(const char *cs_name, myf flags) +CHARSET_INFO *get_charset_by_csname(const char *cs_name, + uint cs_flags, + myf flags) { CHARSET_INFO *cs=NULL; CHARSET_INFO **css; @@ -561,8 +651,8 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, myf flags) for (css= all_charsets; css < all_charsets+255; ++css) { - if ( css[0] && (css[0]->state & MY_CS_PRIMARY) && - css[0]->csname && !strcmp(css[0]->csname, cs_name)) + if ( css[0] && (css[0]->state & cs_flags) && + css[0]->csname && !strcasecmp(css[0]->csname, cs_name)) { cs= css[0]->number ? get_internal_charset(css[0]->number,flags) : NULL; break; @@ -580,25 +670,6 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, myf flags) } -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/mf_keycache.c b/mysys/mf_keycache.c index 482a594fa73..45cbcdb3ab7 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -29,42 +29,42 @@ #include #include -/* - Some compilation flags have been added specifically for this module - to control the following: - - not to let a thread to yield the control when reading directly - from key cache, which might improve performance in many cases; - to enable this add: - #define SERIALIZED_READ_FROM_CACHE - - to set an upper bound for number of threads simultaneously - using the key cache; this setting helps to determine an optimal - size for hash table and improve performance when the number of - blocks in the key cache much less than the number of threads - accessing it; - to set this number equal to add - #define MAX_THREADS - - to substitute calls of pthread_cond_wait for calls of - pthread_cond_timedwait (wait with timeout set up); - this setting should be used only when you want to trap a deadlock - situation, which theoretically should not happen; - to set timeout equal to seconds add - #define KEYCACHE_TIMEOUT - - to enable the module traps and to send debug information from - key cache module to a special debug log add: - #define KEYCACHE_DEBUG - the name of this debug log file can be set through: - #define KEYCACHE_DEBUG_LOG - if the name is not defined, it's set by default; - if the KEYCACHE_DEBUG flag is not set up and we are in a debug - mode, i.e. when ! defined(DBUG_OFF), the debug information from the - module is sent to the regular debug log. +/* + Some compilation flags have been added specifically for this module + to control the following: + - not to let a thread to yield the control when reading directly + from key cache, which might improve performance in many cases; + to enable this add: + #define SERIALIZED_READ_FROM_CACHE + - to set an upper bound for number of threads simultaneously + using the key cache; this setting helps to determine an optimal + size for hash table and improve performance when the number of + blocks in the key cache much less than the number of threads + accessing it; + to set this number equal to add + #define MAX_THREADS + - to substitute calls of pthread_cond_wait for calls of + pthread_cond_timedwait (wait with timeout set up); + this setting should be used only when you want to trap a deadlock + situation, which theoretically should not happen; + to set timeout equal to seconds add + #define KEYCACHE_TIMEOUT + - to enable the module traps and to send debug information from + key cache module to a special debug log add: + #define KEYCACHE_DEBUG + the name of this debug log file can be set through: + #define KEYCACHE_DEBUG_LOG + if the name is not defined, it's set by default; + if the KEYCACHE_DEBUG flag is not set up and we are in a debug + mode, i.e. when ! defined(DBUG_OFF), the debug information from the + module is sent to the regular debug log. - Example of the settings: - #define SERIALIZED_READ_FROM_CACHE - #define MAX_THREADS 100 - #define KEYCACHE_TIMEOUT 1 - #define KEYCACHE_DEBUG - #define KEYCACHE_DEBUG_LOG "my_key_cache_debug.log" + Example of the settings: + #define SERIALIZED_READ_FROM_CACHE + #define MAX_THREADS 100 + #define KEYCACHE_TIMEOUT 1 + #define KEYCACHE_DEBUG + #define KEYCACHE_DEBUG_LOG "my_key_cache_debug.log" */ #if defined(MSDOS) && !defined(M_IC80386) @@ -83,20 +83,24 @@ #define COND_FOR_SAVED 1 #define COND_FOR_READERS 2 -typedef pthread_cond_t KEYCACHE_CONDVAR; -typedef struct st_keycache_wqueue -{ /* info about requests in a waiting queue */ +typedef pthread_cond_t KEYCACHE_CONDVAR; + +/* info about requests in a waiting queue */ +typedef struct st_keycache_wqueue +{ struct st_my_thread_var *last_thread; /* circular list of waiting threads */ } KEYCACHE_WQUEUE; +/* descriptor of the page in the key cache block buffer */ typedef struct st_keycache_page -{ /* descriptor of the page in the key cache block buffer */ +{ int file; /* file to which the page belongs to */ my_off_t filepos; /* position of the page in the file */ } KEYCACHE_PAGE; -typedef struct st_hash_link -{ /* element in the chain of a hash table bucket */ +/* element in the chain of a hash table bucket */ +typedef struct st_hash_link +{ struct st_hash_link *next, **prev; /* to connect links in the same bucket */ struct st_block_link *block; /* reference to the block for the page: */ File file; /* from such a file */ @@ -117,8 +121,9 @@ typedef struct st_hash_link #define PAGE_TO_BE_READ 1 #define PAGE_WAIT_TO_BE_READ 2 +/* key cache block */ typedef struct st_block_link -{ /* key cache block */ +{ struct st_block_link *next_used, **prev_used; /* to connect links in the LRU chain (ring) */ struct st_block_link @@ -143,40 +148,36 @@ static uint key_cache_shift; #define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */ #define FLUSH_CACHE 2000 /* sort this many blocks at once */ -static KEYCACHE_WQUEUE +static KEYCACHE_WQUEUE waiting_for_hash_link; /* queue of requests waiting for a free hash link */ -static KEYCACHE_WQUEUE +static KEYCACHE_WQUEUE waiting_for_block; /* queue of requests waiting for a free block */ -static HASH_LINK **_my_hash_root; /* arr. of entries into hash table buckets */ -static uint _my_hash_entries; /* max number of entries in the hash table */ -static HASH_LINK *_my_hash_link_root; /* memory for hash table links */ -static int _my_hash_links; /* max number of hash links */ -static int _my_hash_links_used; /* number of hash links currently used */ -static HASH_LINK *_my_free_hash_list; /* list of free hash links */ -static BLOCK_LINK *_my_block_root; /* memory for block links */ -static int _my_disk_blocks; /* max number of blocks in the cache */ -static byte HUGE_PTR *_my_block_mem; /* memory for block buffers */ -static BLOCK_LINK *_my_used_last; /* ptr to the last block of the LRU chain */ -ulong _my_blocks_used, /* number of currently used blocks */ - _my_blocks_changed; /* number of currently dirty blocks */ +static HASH_LINK **my_hash_root; /* arr. of entries into hash table buckets */ +static uint my_hash_entries; /* max number of entries in the hash table */ +static HASH_LINK *my_hash_link_root; /* memory for hash table links */ +static int my_hash_links; /* max number of hash links */ +static int my_hash_links_used; /* number of hash links currently used */ +static HASH_LINK *my_free_hash_list; /* list of free hash links */ +static BLOCK_LINK *my_block_root; /* memory for block links */ +static int my_disk_blocks; /* max number of blocks in the cache */ +static byte HUGE_PTR *my_block_mem; /* memory for block buffers */ +static BLOCK_LINK *my_used_last; /* ptr to the last block of the LRU chain */ +ulong my_blocks_used, /* number of currently used blocks */ + my_blocks_changed; /* number of currently dirty blocks */ #if defined(KEYCACHE_DEBUG) static -ulong _my_blocks_available; /* number of blocks available in the LRU chain */ +ulong my_blocks_available; /* number of blocks available in the LRU chain */ #endif /* defined(KEYCACHE_DEBUG) */ -ulong _my_cache_w_requests,_my_cache_write, /* counters */ - _my_cache_r_requests,_my_cache_read; /* for statistics */ -static BLOCK_LINK +ulong my_cache_w_requests, my_cache_write, /* counters */ + my_cache_r_requests, my_cache_read; /* for statistics */ +static BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash table for file dirty blocks */ static BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash table for other file blocks */ /* that are not free */ -#ifndef DBUG_OFF -static my_bool _my_printed; -#endif - #define KEYCACHE_HASH(f, pos) \ - (((ulong) ((pos) >> key_cache_shift)+(ulong) (f)) & (_my_hash_entries-1)) + (((ulong) ((pos) >> key_cache_shift)+(ulong) (f)) & (my_hash_entries-1)) #define FILE_HASH(f) ((uint) (f) & (CHANGED_BLOCKS_HASH-1)) #define DEFAULT_KEYCACHE_DEBUG_LOG "keycache_debug.log" @@ -194,11 +195,11 @@ static void keycache_debug_print _VARARGS((const char *fmt,...)); #define KEYCACHE_DEBUG_CLOSE \ if (keycache_debug_log) fclose(keycache_debug_log) #else -#define KEYCACHE_DEBUG_OPEN +#define KEYCACHE_DEBUG_OPEN #define KEYCACHE_DEBUG_CLOSE #endif /* defined(KEYCACHE_DEBUG_LOG) */ -#if defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) +#if defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) #define KEYCACHE_DBUG_PRINT(l, m) \ { if (keycache_debug_log) fprintf(keycache_debug_log, "%s: ", l); \ keycache_debug_print m; } @@ -224,15 +225,15 @@ static long keycache_thread_id; #define KEYCACHE_THREAD_TRACE_END(l) \ KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id)) #else -#define KEYCACHE_THREAD_TRACE_BEGIN(l) -#define KEYCACHE_THREAD_TRACE_END(l) -#define KEYCACHE_THREAD_TRACE(l) +#define KEYCACHE_THREAD_TRACE_BEGIN(l) +#define KEYCACHE_THREAD_TRACE_END(l) +#define KEYCACHE_THREAD_TRACE(l) #endif /* defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF) */ #define BLOCK_NUMBER(b) \ - ((uint) (((char*)(b) - (char *) _my_block_root) / sizeof(BLOCK_LINK))) + ((uint) (((char*)(b) - (char *) my_block_root) / sizeof(BLOCK_LINK))) #define HASH_LINK_NUMBER(h) \ - ((uint) (((char*)(h) - (char *) _my_hash_link_root) / sizeof(HASH_LINK))) + ((uint) (((char*)(h) - (char *) my_hash_link_root) / sizeof(HASH_LINK))) #if (defined(KEYCACHE_TIMEOUT) && !defined(__WIN__)) || defined(KEYCACHE_DEBUG) static int keycache_pthread_cond_wait(pthread_cond_t *cond, @@ -266,18 +267,19 @@ static uint next_power(uint value) /* - Initialize the key cache, - return number of blocks in it + Initialize the key cache, + return number of blocks in it */ + int init_key_cache(ulong use_mem) { uint blocks, hash_links, length; int error; - + DBUG_ENTER("init_key_cache"); - + KEYCACHE_DEBUG_OPEN; - if (key_cache_inited && _my_disk_blocks > 0) + if (key_cache_inited && my_disk_blocks > 0) { DBUG_PRINT("warning",("key cache already in use")); DBUG_RETURN(0); @@ -285,101 +287,101 @@ int init_key_cache(ulong use_mem) if (! key_cache_inited) { key_cache_inited=TRUE; - _my_disk_blocks= -1; + my_disk_blocks= -1; key_cache_shift=my_bit_log2(key_cache_block_size); - DBUG_PRINT("info",("key_cache_block_size: %u", + DBUG_PRINT("info",("key_cache_block_size: %u", key_cache_block_size)); -#ifndef DBUG_OFF - _my_printed=0; -#endif } - - _my_cache_w_requests=_my_cache_r_requests=_my_cache_read=_my_cache_write=0; - - _my_block_mem=NULL; - _my_block_root=NULL; - + + my_cache_w_requests= my_cache_r_requests= my_cache_read= my_cache_write=0; + + my_block_mem=NULL; + my_block_root=NULL; + blocks= (uint) (use_mem/(sizeof(BLOCK_LINK)+2*sizeof(HASH_LINK)+ sizeof(HASH_LINK*)*5/4+key_cache_block_size)); /* It doesn't make sense to have too few blocks (less than 8) */ - if (blocks >= 8 && _my_disk_blocks < 0) + if (blocks >= 8 && my_disk_blocks < 0) { for (;;) { - /* Set _my_hash_entries to the next bigger 2 power */ - if ((_my_hash_entries=next_power(blocks)) < blocks*5/4) - _my_hash_entries<<=1; + /* Set my_hash_entries to the next bigger 2 power */ + if ((my_hash_entries=next_power(blocks)) < blocks*5/4) + my_hash_entries<<=1; hash_links=2*blocks; #if defined(MAX_THREADS) if (hash_links < MAX_THREADS + blocks - 1) hash_links=MAX_THREADS + blocks - 1; #endif - while ((length=blocks*sizeof(BLOCK_LINK)+hash_links*sizeof(HASH_LINK)+ - sizeof(HASH_LINK*)*_my_hash_entries)+ - ((ulong) blocks << key_cache_shift) > - use_mem) + while ((length=(ALIGN_SIZE(blocks*sizeof(BLOCK_LINK))+ + ALIGN_SIZE(hash_links*sizeof(HASH_LINK))+ + ALIGN_SIZE(sizeof(HASH_LINK*)*my_hash_entries)))+ + ((ulong) blocks << key_cache_shift) > use_mem) blocks--; /* Allocate memory for cache page buffers */ - if ((_my_block_mem=my_malloc_lock((ulong) blocks*key_cache_block_size, - MYF(0)))) + if ((my_block_mem=my_malloc_lock((ulong) blocks*key_cache_block_size, + MYF(0)))) { - /* + /* Allocate memory for blocks, hash_links and hash entries; - For each block 2 hash links are allocated + For each block 2 hash links are allocated */ - if ((_my_block_root=(BLOCK_LINK*) my_malloc((uint) length,MYF(0)))) + if ((my_block_root=(BLOCK_LINK*) my_malloc((uint) length,MYF(0)))) break; - my_free_lock(_my_block_mem,MYF(0)); + my_free_lock(my_block_mem,MYF(0)); } - if (blocks < 8) + if (blocks < 8) { my_errno=ENOMEM; goto err; } blocks=blocks/4*3; } - _my_disk_blocks=(int) blocks; - _my_hash_links=hash_links; - _my_hash_root=(HASH_LINK**) (_my_block_root+blocks); - _my_hash_link_root=(HASH_LINK*) (_my_hash_root+_my_hash_entries); - bzero((byte*) _my_block_root,_my_disk_blocks*sizeof(BLOCK_LINK)); - bzero((byte*) _my_hash_root,_my_hash_entries*sizeof(HASH_LINK*)); - bzero((byte*) _my_hash_link_root,_my_hash_links*sizeof(HASH_LINK)); - _my_hash_links_used=0; - _my_free_hash_list=NULL; - _my_blocks_used=_my_blocks_changed=0; + my_disk_blocks=(int) blocks; + my_hash_links=hash_links; + my_hash_root= (HASH_LINK**) ((char*) my_block_root + + ALIGN_SIZE(blocks*sizeof(BLOCK_LINK))); + my_hash_link_root= (HASH_LINK*) ((char*) my_hash_root + + ALIGN_SIZE((sizeof(HASH_LINK*) * + my_hash_entries))); + bzero((byte*) my_block_root, my_disk_blocks*sizeof(BLOCK_LINK)); + bzero((byte*) my_hash_root, my_hash_entries*sizeof(HASH_LINK*)); + bzero((byte*) my_hash_link_root, my_hash_links*sizeof(HASH_LINK)); + my_hash_links_used=0; + my_free_hash_list=NULL; + my_blocks_used= my_blocks_changed=0; #if defined(KEYCACHE_DEBUG) - _my_blocks_available=0; + my_blocks_available=0; #endif /* The LRU chain is empty after initialization */ - _my_used_last=NULL; - + my_used_last=NULL; + waiting_for_hash_link.last_thread=NULL; waiting_for_block.last_thread=NULL; DBUG_PRINT("exit", ("disk_blocks: %d block_root: %lx hash_entries: %d hash_root: %lx \ hash_links: %d hash_link_root %lx", - _my_disk_blocks,_my_block_root,_my_hash_entries,_my_hash_root, - _my_hash_links,_my_hash_link_root)); + my_disk_blocks, my_block_root, my_hash_entries, my_hash_root, + my_hash_links, my_hash_link_root)); } bzero((gptr) changed_blocks,sizeof(changed_blocks[0])*CHANGED_BLOCKS_HASH); bzero((gptr) file_blocks,sizeof(file_blocks[0])*CHANGED_BLOCKS_HASH); - + DBUG_RETURN((int) blocks); - + err: error=my_errno; - if (_my_block_mem) - my_free_lock((gptr) _my_block_mem,MYF(0)); - if (_my_block_mem) - my_free((gptr) _my_block_root,MYF(0)); + if (my_block_mem) + my_free_lock((gptr) my_block_mem,MYF(0)); + if (my_block_mem) + my_free((gptr) my_block_root,MYF(0)); my_errno=error; DBUG_RETURN(0); } /* - Resize the key cache + Resize the key cache */ int resize_key_cache(ulong use_mem) { @@ -394,51 +396,54 @@ int resize_key_cache(ulong use_mem) end_key_cache(); /* the following will work even if memory is 0 */ blocks=init_key_cache(use_mem); - keycache_pthread_mutex_unlock(&THR_LOCK_keycache); + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); return blocks; } /* - Remove key_cache from memory + Remove key_cache from memory */ + void end_key_cache(void) { DBUG_ENTER("end_key_cache"); - if (_my_disk_blocks > 0) + if (my_disk_blocks > 0) { - if (_my_block_mem) + if (my_block_mem) { - my_free_lock((gptr) _my_block_mem,MYF(0)); - my_free((gptr) _my_block_root,MYF(0)); + my_free_lock((gptr) my_block_mem,MYF(0)); + my_free((gptr) my_block_root,MYF(0)); } - _my_disk_blocks= -1; + my_disk_blocks= -1; } KEYCACHE_DEBUG_CLOSE; key_cache_inited=0; DBUG_PRINT("status", ("used: %d changed: %d w_requests: %ld \ writes: %ld r_requests: %ld reads: %ld", - _my_blocks_used,_my_blocks_changed,_my_cache_w_requests, - _my_cache_write,_my_cache_r_requests,_my_cache_read)); + my_blocks_used, my_blocks_changed, my_cache_w_requests, + my_cache_write, my_cache_r_requests, my_cache_read)); DBUG_VOID_RETURN; } /* end_key_cache */ /* - Link a thread into double-linked queue of waiting threads + Link a thread into double-linked queue of waiting threads */ + static inline void link_into_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread) -{ +{ struct st_my_thread_var *last; if (! (last=wqueue->last_thread)) - { /* Queue is empty */ + { + /* Queue is empty */ thread->next=thread; thread->prev=&thread->next; } else - { + { thread->prev=last->next->prev; last->next->prev=&thread->next; thread->next=last->next; @@ -448,16 +453,17 @@ static inline void link_into_queue(KEYCACHE_WQUEUE *wqueue, } /* - Unlink a thread from double-linked queue of waiting threads + Unlink a thread from double-linked queue of waiting threads */ + static inline void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread) -{ +{ KEYCACHE_DBUG_PRINT("unlink_from_queue", ("thread %ld", thread->id)); if (thread->next == thread) /* The queue contains only one member */ wqueue->last_thread=NULL; - else + else { thread->next->prev=thread->prev; *thread->prev=thread->next; @@ -470,16 +476,17 @@ static inline void unlink_from_queue(KEYCACHE_WQUEUE *wqueue, /* - Add a thread to single-linked queue of waiting threads + Add a thread to single-linked queue of waiting threads */ + static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue, struct st_my_thread_var *thread) -{ +{ struct st_my_thread_var *last; if (! (last=wqueue->last_thread)) thread->next=thread; else - { + { thread->next=last->next; last->next=thread; } @@ -488,10 +495,11 @@ static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue, /* - Remove all threads from queue signaling them to proceed + Remove all threads from queue signaling them to proceed */ -static inline void release_queue(KEYCACHE_WQUEUE *wqueue) -{ + +static void release_queue(KEYCACHE_WQUEUE *wqueue) +{ struct st_my_thread_var *last=wqueue->last_thread; struct st_my_thread_var *next=last->next; struct st_my_thread_var *thread; @@ -509,8 +517,9 @@ static inline void release_queue(KEYCACHE_WQUEUE *wqueue) /* - Unlink a block from the chain of dirty/clean blocks + Unlink a block from the chain of dirty/clean blocks */ + static inline void unlink_changed(BLOCK_LINK *block) { if (block->next_changed) @@ -520,8 +529,9 @@ static inline void unlink_changed(BLOCK_LINK *block) /* - Link a block into the chain of dirty/clean blocks + Link a block into the chain of dirty/clean blocks */ + static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead) { block->prev_changed=phead; @@ -532,11 +542,12 @@ static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead) /* - Unlink a block from the chain of dirty/clean blocks, if it's asked for, - and link it to the chain of clean blocks for the specified file + Unlink a block from the chain of dirty/clean blocks, if it's asked for, + and link it to the chain of clean blocks for the specified file */ -static inline void link_to_file_list(BLOCK_LINK *block,int file, - my_bool unlink) + +static void link_to_file_list(BLOCK_LINK *block,int file, + my_bool unlink) { if (unlink) unlink_changed(block); @@ -544,27 +555,29 @@ static inline void link_to_file_list(BLOCK_LINK *block,int file, if (block->status & BLOCK_CHANGED) { block->status&=~BLOCK_CHANGED; - _my_blocks_changed--; + my_blocks_changed--; } } -/* - Unlink a block from the chain of clean blocks for the specified - file and link it to the chain of dirty blocks for this file +/* + Unlink a block from the chain of clean blocks for the specified + file and link it to the chain of dirty blocks for this file */ + static inline void link_to_changed_list(BLOCK_LINK *block) { unlink_changed(block); link_changed(block,&changed_blocks[FILE_HASH(block->hash_link->file)]); block->status|=BLOCK_CHANGED; - _my_blocks_changed++; + my_blocks_changed++; } /* - Link a block to the LRU chain at the beginning or at the end + Link a block to the LRU chain at the beginning or at the end */ + static void link_block(BLOCK_LINK *block, my_bool at_end) { KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests)); @@ -579,7 +592,7 @@ static void link_block(BLOCK_LINK *block, my_bool at_end) { thread=next_thread; next_thread=thread->next; - /* + /* We notify about the event all threads that ask for the same page as the first thread in the queue */ @@ -589,78 +602,79 @@ static void link_block(BLOCK_LINK *block, my_bool at_end) unlink_from_queue(&waiting_for_block, thread); block->requests++; } - } + } while (thread != last_thread); hash_link->block=block; KEYCACHE_THREAD_TRACE("link_block: after signaling"); #if defined(KEYCACHE_DEBUG) - KEYCACHE_DBUG_PRINT("link_block", + KEYCACHE_DBUG_PRINT("link_block", ("linked,unlinked block %u status=%x #requests=%u #available=%u", BLOCK_NUMBER(block),block->status, - block->requests,_my_blocks_available)); + block->requests, my_blocks_available)); #endif return; } - if (_my_used_last) + if (my_used_last) { - _my_used_last->next_used->prev_used=&block->next_used; - block->next_used=_my_used_last->next_used; - block->prev_used=&_my_used_last->next_used; - _my_used_last->next_used=block; + my_used_last->next_used->prev_used=&block->next_used; + block->next_used= my_used_last->next_used; + block->prev_used= &my_used_last->next_used; + my_used_last->next_used=block; if (at_end) - _my_used_last=block; + my_used_last=block; } else { /* The LRU chain is empty */ - _my_used_last=block->next_used=block; + my_used_last=block->next_used=block; block->prev_used=&block->next_used; } KEYCACHE_THREAD_TRACE("link_block"); #if defined(KEYCACHE_DEBUG) - _my_blocks_available++; - KEYCACHE_DBUG_PRINT("link_block", + my_blocks_available++; + KEYCACHE_DBUG_PRINT("link_block", ("linked block %u:%1u status=%x #requests=%u #available=%u", BLOCK_NUMBER(block),at_end,block->status, - block->requests,_my_blocks_available)); - KEYCACHE_DBUG_ASSERT(_my_blocks_available <= _my_blocks_used); + block->requests, my_blocks_available)); + KEYCACHE_DBUG_ASSERT(my_blocks_available <= my_blocks_used); #endif } /* - Unlink a block from the LRU chain + Unlink a block from the LRU chain */ -static inline void unlink_block(BLOCK_LINK *block) + +static void unlink_block(BLOCK_LINK *block) { if (block->next_used == block) /* The list contains only one member */ - _my_used_last=NULL; - else + my_used_last=NULL; + else { block->next_used->prev_used=block->prev_used; *block->prev_used=block->next_used; - if (_my_used_last == block) - _my_used_last=STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used); + if (my_used_last == block) + my_used_last=STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used); } block->next_used=NULL; - + KEYCACHE_THREAD_TRACE("unlink_block"); #if defined(KEYCACHE_DEBUG) - _my_blocks_available--; - KEYCACHE_DBUG_PRINT("unlink_block", + my_blocks_available--; + KEYCACHE_DBUG_PRINT("unlink_block", ("unlinked block %u status=%x #requests=%u #available=%u", BLOCK_NUMBER(block),block->status, - block->requests,_my_blocks_available)); - KEYCACHE_DBUG_ASSERT(_my_blocks_available >= 0); + block->requests, my_blocks_available)); + KEYCACHE_DBUG_ASSERT(my_blocks_available >= 0); #endif } /* - Register requests for a block + Register requests for a block */ -static inline void reg_requests(BLOCK_LINK *block, int count) +static void reg_requests(BLOCK_LINK *block, int count) { if (! block->requests) /* First request for the block unlinks it */ @@ -669,10 +683,11 @@ static inline void reg_requests(BLOCK_LINK *block, int count) } -/* - Unregister request for a block - linking it to the LRU chain if it's the last request +/* + Unregister request for a block + linking it to the LRU chain if it's the last request */ + static inline void unreg_request(BLOCK_LINK *block, int at_end) { if (! --block->requests) @@ -680,18 +695,19 @@ static inline void unreg_request(BLOCK_LINK *block, int at_end) } /* - Remove a reader of the page in block + Remove a reader of the page in block */ + static inline void remove_reader(BLOCK_LINK *block) -{ +{ if (! --block->hash_link->requests && block->condvar) keycache_pthread_cond_signal(block->condvar); } /* - Wait until the last reader of the page in block - signals on its termination + Wait until the last reader of the page in block + signals on its termination */ static inline void wait_for_readers(BLOCK_LINK *block) { @@ -706,8 +722,9 @@ static inline void wait_for_readers(BLOCK_LINK *block) /* - add a hash link to a bucket in the hash_table + Add a hash link to a bucket in the hash_table */ + static inline void link_hash(HASH_LINK **start, HASH_LINK *hash_link) { if (*start) @@ -719,9 +736,10 @@ static inline void link_hash(HASH_LINK **start, HASH_LINK *hash_link) /* - Remove a hash link from the hash table + Remove a hash link from the hash table */ -static inline void unlink_hash(HASH_LINK *hash_link) + +static void unlink_hash(HASH_LINK *hash_link) { KEYCACHE_DBUG_PRINT("unlink_hash", ("file %u, filepos %lu #requests=%u", (uint) hash_link->file,(ulong) hash_link->diskpos, hash_link->requests)); @@ -730,7 +748,8 @@ static inline void unlink_hash(HASH_LINK *hash_link) hash_link->next->prev=hash_link->prev; hash_link->block=NULL; if (waiting_for_hash_link.last_thread) - { /* Signal that A free hash link appeared */ + { + /* Signal that A free hash link appeared */ struct st_my_thread_var *last_thread=waiting_for_hash_link.last_thread; struct st_my_thread_var *first_thread=last_thread->next; struct st_my_thread_var *next_thread=first_thread; @@ -745,7 +764,7 @@ static inline void unlink_hash(HASH_LINK *hash_link) thread=next_thread; page= (KEYCACHE_PAGE *) thread->opt_info; next_thread=thread->next; - /* + /* We notify about the event all threads that ask for the same page as the first thread in the queue */ @@ -756,18 +775,20 @@ static inline void unlink_hash(HASH_LINK *hash_link) } } while (thread != last_thread); - link_hash(&_my_hash_root[KEYCACHE_HASH(hash_link->file, - hash_link->diskpos)], hash_link); + link_hash(&my_hash_root[KEYCACHE_HASH(hash_link->file, + hash_link->diskpos)], hash_link); return; - } - hash_link->next=_my_free_hash_list; - _my_free_hash_list=hash_link; + } + hash_link->next= my_free_hash_list; + my_free_hash_list=hash_link; } + /* - Get the hash link for a page + Get the hash link for a page */ -static inline HASH_LINK *get_hash_link(int file, my_off_t filepos) + +static HASH_LINK *get_hash_link(int file, my_off_t filepos) { reg1 HASH_LINK *hash_link, **start; KEYCACHE_PAGE page; @@ -784,7 +805,7 @@ restart: start contains the head of the bucket list, hash_link points to the first member of the list */ - hash_link=*(start=&_my_hash_root[KEYCACHE_HASH(file, filepos)]); + hash_link= *(start= &my_hash_root[KEYCACHE_HASH(file, filepos)]); #if defined(KEYCACHE_DEBUG) cnt=0; #endif @@ -795,7 +816,7 @@ restart: hash_link= hash_link->next; #if defined(KEYCACHE_DEBUG) cnt++; - if (! (cnt <= _my_hash_links_used)) + if (! (cnt <= my_hash_links_used)) { int i; for (i=0, hash_link=*start ; @@ -805,22 +826,24 @@ restart: (uint) hash_link->file,(ulong) hash_link->diskpos)); } } - KEYCACHE_DBUG_ASSERT(n <= _my_hash_links_used); + KEYCACHE_DBUG_ASSERT(n <= my_hash_links_used); #endif } if (! hash_link) - { /* There is no hash link in the hash table for the pair (file, filepos) */ - if (_my_free_hash_list) + { + /* There is no hash link in the hash table for the pair (file, filepos) */ + if (my_free_hash_list) { - hash_link=_my_free_hash_list; - _my_free_hash_list=hash_link->next; + hash_link= my_free_hash_list; + my_free_hash_list=hash_link->next; } - else if (_my_hash_links_used < _my_hash_links) + else if (my_hash_links_used < my_hash_links) { - hash_link= &_my_hash_link_root[_my_hash_links_used++]; + hash_link= &my_hash_link_root[my_hash_links_used++]; } else - { /* Wait for a free hash link */ + { + /* Wait for a free hash link */ struct st_my_thread_var *thread=my_thread_var; KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting")); page.file=file; page.filepos=filepos; @@ -836,16 +859,17 @@ restart: } /* Register the request for the page */ hash_link->requests++; - + return hash_link; } /* - Get a block for the file page requested by a keycache read/write operation; - If the page is not in the cache return a free block, if there is none - return the lru block after saving its buffer if the page is dirty -*/ + Get a block for the file page requested by a keycache read/write operation; + If the page is not in the cache return a free block, if there is none + return the lru block after saving its buffer if the page is dirty +*/ + static BLOCK_LINK *find_key_block(int file, my_off_t filepos, int wrmode, int *page_st) { @@ -853,7 +877,7 @@ static BLOCK_LINK *find_key_block(int file, my_off_t filepos, BLOCK_LINK *block; int error=0; int page_status; - + DBUG_ENTER("find_key_block"); KEYCACHE_THREAD_TRACE("find_key_block:begin"); DBUG_PRINT("enter", ("file %u, filepos %lu, wrmode %lu", @@ -863,22 +887,22 @@ static BLOCK_LINK *find_key_block(int file, my_off_t filepos, #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2",test_key_cache("start of find_key_block",0);); #endif - + restart: /* Find the hash link for the requested page (file, filepos) */ hash_link=get_hash_link(file, filepos); - + page_status=-1; if ((block=hash_link->block) && block->hash_link == hash_link && (block->status & BLOCK_READ)) page_status=PAGE_READ; - - if (page_status == PAGE_READ && (block->status & BLOCK_IN_SWITCH)) - { /* This is a request for a page to be removed from cache */ - - KEYCACHE_DBUG_PRINT("find_key_block", + + if (page_status == PAGE_READ && (block->status & BLOCK_IN_SWITCH)) + { + /* This is a request for a page to be removed from cache */ + KEYCACHE_DBUG_PRINT("find_key_block", ("request for old page in block %u",BLOCK_NUMBER(block))); - /* + /* Only reading requests can proceed until the old dirty page is flushed, all others are to be suspended, then resubmitted */ @@ -887,7 +911,7 @@ restart: else { hash_link->requests--; - KEYCACHE_DBUG_PRINT("find_key_block", + KEYCACHE_DBUG_PRINT("find_key_block", ("request waiting for old page to be saved")); { struct st_my_thread_var *thread=my_thread_var; @@ -900,47 +924,51 @@ restart: } while(thread->next); } - KEYCACHE_DBUG_PRINT("find_key_block", + KEYCACHE_DBUG_PRINT("find_key_block", ("request for old page resubmitted")); /* Resubmit the request */ goto restart; } } else - { /* This is a request for a new page or for a page not to be removed */ + { + /* This is a request for a new page or for a page not to be removed */ if (! block) - { /* No block is assigned for the page yet */ - if (_my_blocks_used < (uint) _my_disk_blocks) - { /* There are some never used blocks, take first of them */ - hash_link->block=block= &_my_block_root[_my_blocks_used]; - block->buffer=ADD_TO_PTR(_my_block_mem, - ((ulong) _my_blocks_used*key_cache_block_size), + { + /* No block is assigned for the page yet */ + if (my_blocks_used < (uint) my_disk_blocks) + { + /* There are some never used blocks, take first of them */ + hash_link->block=block= &my_block_root[my_blocks_used]; + block->buffer=ADD_TO_PTR(my_block_mem, + ((ulong) my_blocks_used*key_cache_block_size), byte*); block->status=0; block->length=0; block->offset=key_cache_block_size; block->requests=1; - _my_blocks_used++; + my_blocks_used++; link_to_file_list(block, file, 0); block->hash_link=hash_link; page_status=PAGE_TO_BE_READ; - KEYCACHE_DBUG_PRINT("find_key_block", + KEYCACHE_DBUG_PRINT("find_key_block", ("got never used block %u",BLOCK_NUMBER(block))); } else - { /* There are no never used blocks, use a block from the LRU chain */ + { + /* There are no never used blocks, use a block from the LRU chain */ /* - Wait until a new block is added to the LRU chain; + Wait until a new block is added to the LRU chain; several threads might wait here for the same page, all of them must get the same block */ - - if (! _my_used_last) + + if (! my_used_last) { struct st_my_thread_var *thread=my_thread_var; thread->opt_info=(void *) hash_link; link_into_queue(&waiting_for_block, thread); - do + do { keycache_pthread_cond_wait(&thread->suspend,&THR_LOCK_keycache); } @@ -950,50 +978,53 @@ restart: block=hash_link->block; if (! block) { - /* - Take the first block from the LRU chain + /* + Take the first block from the LRU chain unlinking it from the chain */ - block=_my_used_last->next_used; + block= my_used_last->next_used; reg_requests(block,1); hash_link->block=block; } - - if (block->hash_link != hash_link && ! (block->status & BLOCK_IN_SWITCH) ) - { /* this is a primary request for a new page */ + + if (block->hash_link != hash_link && + ! (block->status & BLOCK_IN_SWITCH) ) + { + /* this is a primary request for a new page */ block->status|=BLOCK_IN_SWITCH; - - KEYCACHE_DBUG_PRINT("find_key_block", + + KEYCACHE_DBUG_PRINT("find_key_block", ("got block %u for new page",BLOCK_NUMBER(block))); - + if (block->status & BLOCK_CHANGED) - { /* The block contains a dirty page - push it out of the cache */ - + { + /* The block contains a dirty page - push it out of the cache */ + KEYCACHE_DBUG_PRINT("find_key_block",("block is dirty")); - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - /* - The call is thread safe because only the current - thread might change the block->hash_link value + /* + The call is thread safe because only the current + thread might change the block->hash_link value */ error=my_pwrite(block->hash_link->file,block->buffer, block->length,block->hash_link->diskpos, - MYF(MY_NABP | MY_WAIT_IF_FULL)); + MYF(MY_NABP | MY_WAIT_IF_FULL)); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_write++; + my_cache_write++; } - + block->status|=BLOCK_REASSIGNED; if (block->hash_link) { - /* - Wait until all pending read requests - for this page are executed - (we could have avoided this waiting, if we had read - a page in the cache in a sweep, without yielding control) + /* + Wait until all pending read requests + for this page are executed + (we could have avoided this waiting, if we had read + a page in the cache in a sweep, without yielding control) */ wait_for_readers(block); - + /* Remove the hash link for this page from the hash table */ unlink_hash(block->hash_link); /* All pending requests for this page must be resubmitted */ @@ -1006,7 +1037,7 @@ restart: block->offset=key_cache_block_size; block->hash_link=hash_link; page_status=PAGE_TO_BE_READ; - + KEYCACHE_DBUG_ASSERT(block->hash_link->block == block); KEYCACHE_DBUG_ASSERT(hash_link->block->hash_link == hash_link); } @@ -1018,8 +1049,8 @@ restart: PAGE_READ : PAGE_WAIT_TO_BE_READ; } } - - _my_cache_read++; + + my_cache_read++; } else { @@ -1029,10 +1060,10 @@ restart: PAGE_READ : PAGE_WAIT_TO_BE_READ; } } - + KEYCACHE_DBUG_ASSERT(page_status != -1); *page_st=page_status; - + #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2",test_key_cache("end of find_key_block",0);); #endif @@ -1042,55 +1073,58 @@ restart: /* - Read into a key cache block buffer from disk; - do not to report error when the size of successfully read - portion is less than read_length, but not less than min_length + Read into a key cache block buffer from disk; + do not to report error when the size of successfully read + portion is less than read_length, but not less than min_length */ + static void read_block(BLOCK_LINK *block, uint read_length, uint min_length, my_bool primary) { uint got_length; - + /* On entry THR_LOCK_keycache is locked */ - + KEYCACHE_THREAD_TRACE("read_block"); if (primary) - { /* - This code is executed only by threads - that submitted primary requests + { + /* + This code is executed only by threads + that submitted primary requests */ - - KEYCACHE_DBUG_PRINT("read_block", + + KEYCACHE_DBUG_PRINT("read_block", ("page to be read by primary request")); - + /* Page is not in buffer yet, is to be read from disk */ keycache_pthread_mutex_unlock(&THR_LOCK_keycache); got_length=my_pread(block->hash_link->file,block->buffer, read_length,block->hash_link->diskpos,MYF(0)); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - if (got_length < min_length) + if (got_length < min_length) block->status|=BLOCK_ERROR; else { block->status=BLOCK_READ; block->length=got_length; } - KEYCACHE_DBUG_PRINT("read_block", + KEYCACHE_DBUG_PRINT("read_block", ("primary request: new page in cache")); /* Signal that all pending requests for this page now can be processed */ if (block->wqueue[COND_FOR_REQUESTED].last_thread) release_queue(&block->wqueue[COND_FOR_REQUESTED]); } - else - { /* - This code is executed only by threads - that submitted secondary requests + else + { + /* + This code is executed only by threads + that submitted secondary requests */ - KEYCACHE_DBUG_PRINT("read_block", + KEYCACHE_DBUG_PRINT("read_block", ("secondary request waiting for new page to be read")); { struct st_my_thread_var *thread=my_thread_var; - /* Put the request into a queue and wait until it can be processed */ + /* Put the request into a queue and wait until it can be processed */ add_to_queue(&block->wqueue[COND_FOR_REQUESTED],thread); do { @@ -1098,44 +1132,45 @@ static void read_block(BLOCK_LINK *block, uint read_length, } while (thread->next); } - KEYCACHE_DBUG_PRINT("read_block", + KEYCACHE_DBUG_PRINT("read_block", ("secondary request: new page in cache")); } } /* - Read a block of data from a cached file into a buffer; - if return_buffer is set then the cache buffer is returned if - it can be used; - filepos must be a multiple of 'block_length', but it doesn't - have to be a multiple of key_cache_block_size; - returns adress from where data is read + Read a block of data from a cached file into a buffer; + if return_buffer is set then the cache buffer is returned if + it can be used; + filepos must be a multiple of 'block_length', but it doesn't + have to be a multiple of key_cache_block_size; + returns adress from where data is read */ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, - uint block_length __attribute__((unused)), - int return_buffer __attribute__((unused))) + uint block_length __attribute__((unused)), + int return_buffer __attribute__((unused))) { int error=0; DBUG_ENTER("key_cache_read"); DBUG_PRINT("enter", ("file %u, filepos %lu, length %u", (uint) file,(ulong) filepos,length)); - - if (_my_disk_blocks > 0) - { /* Key cache is used */ + + if (my_disk_blocks > 0) + { + /* Key cache is used */ reg1 BLOCK_LINK *block; uint offset= (uint) (filepos & (key_cache_block_size-1)); byte *start=buff; uint read_length; uint status; int page_st; - + #ifndef THREAD if (block_length > key_cache_block_size || offset) return_buffer=0; #endif - + /* Read data in key_cache_block_size increments */ filepos-= offset; do @@ -1144,7 +1179,7 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, key_cache_block_size : length; KEYCACHE_DBUG_ASSERT(read_length > 0); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_r_requests++; + my_cache_r_requests++; block=find_key_block(file,filepos,0,&page_st); if (page_st != PAGE_READ) { @@ -1154,26 +1189,26 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, } else if (! (block->status & BLOCK_ERROR) && block->length < read_length + offset) - { - /* - Impossible if nothing goes wrong: - this could only happen if we are using a file with - small key blocks and are trying to read outside the file + { + /* + Impossible if nothing goes wrong: + this could only happen if we are using a file with + small key blocks and are trying to read outside the file */ my_errno=-1; block->status|=BLOCK_ERROR; } - + if (! ((status=block->status) & BLOCK_ERROR)) { #ifndef THREAD - if (! return_buffer) + if (! return_buffer) #endif { #if !defined(SERIALIZED_READ_FROM_CACHE) keycache_pthread_mutex_unlock(&THR_LOCK_keycache); #endif - + /* Copy data from the cache buffer */ if (!(read_length & 511)) bmove512(buff,block->buffer+offset,read_length); @@ -1185,35 +1220,35 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, #endif } } - + remove_reader(block); - /* - Link the block into the LRU chain - if it's the last submitted request for the block + /* + Link the block into the LRU chain + if it's the last submitted request for the block */ unreg_request(block,1); - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - + if (status & BLOCK_ERROR) DBUG_RETURN((byte *) 0); - + #ifndef THREAD if (return_buffer) return (block->buffer); #endif - + buff+=read_length; filepos+=read_length; offset=0; - + } while ((length-= read_length)); DBUG_RETURN(start); } - + /* Key cache is not used */ - statistic_increment(_my_cache_r_requests,&THR_LOCK_keycache); - statistic_increment(_my_cache_read,&THR_LOCK_keycache); + statistic_increment(my_cache_r_requests,&THR_LOCK_keycache); + statistic_increment(my_cache_read,&THR_LOCK_keycache); if (my_pread(file,(byte*) buff,length,filepos,MYF(MY_NABP))) error=1; DBUG_RETURN(error? (byte*) 0 : buff); @@ -1221,12 +1256,13 @@ byte *key_cache_read(File file, my_off_t filepos, byte *buff, uint length, /* - Write a buffer into disk; - filepos must be a multiple of 'block_length', but it doesn't - have to be a multiple of key cache block size; - if !dont_write then all dirty pages involved in writing should - have been flushed from key cache before the function starts + Write a buffer into disk; + filepos must be a multiple of 'block_length', but it doesn't + have to be a multiple of key cache block size; + if !dont_write then all dirty pages involved in writing should + have been flushed from key cache before the function starts */ + int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, uint block_length __attribute__((unused)), int dont_write) @@ -1239,31 +1275,33 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, (uint) file,(ulong) filepos,length,block_length)); if (!dont_write) - { /* Force writing from buff into disk */ - statistic_increment(_my_cache_write, &THR_LOCK_keycache); + { + /* Force writing from buff into disk */ + statistic_increment(my_cache_write, &THR_LOCK_keycache); if (my_pwrite(file,buff,length,filepos,MYF(MY_NABP | MY_WAIT_IF_FULL))) DBUG_RETURN(1); } - + #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache",test_key_cache("start of key_cache_write",1);); #endif - - if (_my_disk_blocks > 0) - { /* Key cache is used */ + + if (my_disk_blocks > 0) + { + /* Key cache is used */ uint read_length; uint offset= (uint) (filepos & (key_cache_block_size-1)); int page_st; - + /* Write data in key_cache_block_size increments */ filepos-= offset; do { read_length= length > key_cache_block_size ? - key_cache_block_size : length; + key_cache_block_size : length; KEYCACHE_DBUG_ASSERT(read_length > 0); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_w_requests++; + my_cache_w_requests++; block=find_key_block(file, filepos, 1, &page_st); if (page_st != PAGE_READ && (offset || read_length < key_cache_block_size)) @@ -1271,19 +1309,20 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, offset + read_length >= key_cache_block_size? offset : key_cache_block_size, offset,(my_bool)(page_st == PAGE_TO_BE_READ)); - + if (!dont_write) - { /* buff has been written to disk at start */ - if ((block->status & BLOCK_CHANGED) && + { + /* buff has been written to disk at start */ + if ((block->status & BLOCK_CHANGED) && (!offset && read_length >= key_cache_block_size)) link_to_file_list(block, block->hash_link->file, 1); } else if (! (block->status & BLOCK_CHANGED)) link_to_changed_list(block); - + set_if_smaller(block->offset,offset) set_if_bigger(block->length,read_length+offset); - + if (! (block->status & BLOCK_ERROR)) { if (!(read_length & 511)) @@ -1291,26 +1330,26 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, else memcpy(block->buffer+offset,buff,(size_t) read_length); } - - block->status|=BLOCK_READ; - + + block->status|=BLOCK_READ; + /* Unregister the request */ block->hash_link->requests--; unreg_request(block,1); - + if (block->status & BLOCK_ERROR) { keycache_pthread_mutex_unlock(&THR_LOCK_keycache); error=1; break; } - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - + buff+=read_length; filepos+=read_length; offset=0; - + } while ((length-= read_length)); } else @@ -1318,8 +1357,8 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, /* Key cache is not used */ if (dont_write) { - statistic_increment(_my_cache_w_requests, &THR_LOCK_keycache); - statistic_increment(_my_cache_write, &THR_LOCK_keycache); + statistic_increment(my_cache_w_requests, &THR_LOCK_keycache); + statistic_increment(my_cache_write, &THR_LOCK_keycache); if (my_pwrite(file,(byte*) buff,length,filepos,MYF(MY_NABP | MY_WAIT_IF_FULL))) error=1; } @@ -1332,32 +1371,33 @@ int key_cache_write(File file, my_off_t filepos, byte *buff, uint length, } -/* - Free block: remove reference to it from hash table, - remove it from the chain file of dirty/clean blocks - and add it at the beginning of the LRU chain -*/ +/* + Free block: remove reference to it from hash table, + remove it from the chain file of dirty/clean blocks + and add it at the beginning of the LRU chain +*/ + static void free_block(BLOCK_LINK *block) { KEYCACHE_THREAD_TRACE("free block"); - KEYCACHE_DBUG_PRINT("free_block", - ("block %u to be freed",BLOCK_NUMBER(block))); - if (block->hash_link) + KEYCACHE_DBUG_PRINT("free_block", + ("block %u to be freed",BLOCK_NUMBER(block))); + if (block->hash_link) { block->status|=BLOCK_REASSIGNED; wait_for_readers(block); unlink_hash(block->hash_link); } - + unlink_changed(block); block->status=0; block->length=0; block->offset=key_cache_block_size; KEYCACHE_THREAD_TRACE("free block"); - KEYCACHE_DBUG_PRINT("free_block", + KEYCACHE_DBUG_PRINT("free_block", ("block is freed")); unreg_request(block,0); - block->hash_link=NULL; + block->hash_link=NULL; } @@ -1368,10 +1408,11 @@ static int cmp_sec_link(BLOCK_LINK **a, BLOCK_LINK **b) } -/* - Flush a portion of changed blocks to disk, - free used blocks if requested +/* + Flush a portion of changed blocks to disk, + free used blocks if requested */ + static int flush_cached_blocks(File file, BLOCK_LINK **cache, BLOCK_LINK **end, enum flush_type type) @@ -1379,27 +1420,27 @@ static int flush_cached_blocks(File file, BLOCK_LINK **cache, int error; int last_errno=0; uint count=end-cache; - + /* Don't lock the cache during the flush */ keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - /* - As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH - we are guarunteed no thread will change them + /* + As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH + we are guarunteed no thread will change them */ qsort((byte*) cache,count,sizeof(*cache),(qsort_cmp) cmp_sec_link); - + keycache_pthread_mutex_lock(&THR_LOCK_keycache); for ( ; cache != end ; cache++) { BLOCK_LINK *block= *cache; - - KEYCACHE_DBUG_PRINT("flush_cached_blocks", + + KEYCACHE_DBUG_PRINT("flush_cached_blocks", ("block %u to be flushed", BLOCK_NUMBER(block))); keycache_pthread_mutex_unlock(&THR_LOCK_keycache); error=my_pwrite(file,block->buffer+block->offset,block->length, block->hash_link->diskpos,MYF(MY_NABP | MY_WAIT_IF_FULL)); keycache_pthread_mutex_lock(&THR_LOCK_keycache); - _my_cache_write++; + my_cache_write++; if (error) { block->status|= BLOCK_ERROR; @@ -1409,42 +1450,44 @@ static int flush_cached_blocks(File file, BLOCK_LINK **cache, /* type will never be FLUSH_IGNORE_CHANGED here */ if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE)) { - _my_blocks_changed--; + my_blocks_changed--; free_block(block); } - else + else { block->status&=~BLOCK_IN_FLUSH; link_to_file_list(block,file,1); unreg_request(block,1); } - + } return last_errno; } /* - Flush all blocks for a file to disk + Flush all blocks for a file to disk */ + int flush_key_blocks(File file, enum flush_type type) { int last_errno=0; BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache; DBUG_ENTER("flush_key_blocks"); DBUG_PRINT("enter",("file: %d blocks_used: %d blocks_changed: %d", - file,_my_blocks_used,_my_blocks_changed)); - + file, my_blocks_used, my_blocks_changed)); + #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache",test_key_cache("start of flush_key_blocks",0);); #endif - + keycache_pthread_mutex_lock(&THR_LOCK_keycache); - - cache=cache_buff; - if (_my_disk_blocks > 0 && + + cache=cache_buff; + if (my_disk_blocks > 0 && (!my_disable_flush_key_blocks || type != FLUSH_KEEP)) - { /* Key cache exists and flush is not disabled */ + { + /* Key cache exists and flush is not disabled */ int error=0; uint count=0; BLOCK_LINK **pos,**end; @@ -1453,10 +1496,10 @@ int flush_key_blocks(File file, enum flush_type type) #if defined(KEYCACHE_DEBUG) uint cnt=0; #endif - + if (type != FLUSH_IGNORE_CHANGED) { - /* + /* Count how many key blocks we have to cache to be able to flush all dirty pages with minimum seek moves */ @@ -1467,18 +1510,18 @@ int flush_key_blocks(File file, enum flush_type type) if (block->hash_link->file == file) { count++; - KEYCACHE_DBUG_ASSERT(count<=_my_blocks_used); + KEYCACHE_DBUG_ASSERT(count<= my_blocks_used); } } /* Allocate a new buffer only if its bigger than the one we have */ - if (count > FLUSH_CACHE && + if (count > FLUSH_CACHE && !(cache=(BLOCK_LINK**) my_malloc(sizeof(BLOCK_LINK*)*count,MYF(0)))) { - cache=cache_buff; + cache=cache_buff; count=FLUSH_CACHE; } } - + /* Retrieve the blocks and write them to a buffer to be flushed */ restart: end=(pos=cache)+count; @@ -1488,37 +1531,40 @@ restart: { #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif next=block->next_changed; if (block->hash_link->file == file) { - /* + /* Mark the block with BLOCK_IN_FLUSH in order not to let other threads to use it for new pages and interfere with our sequence ot flushing dirty file pages */ block->status|= BLOCK_IN_FLUSH; - + if (! (block->status & BLOCK_IN_SWITCH)) - { /* - We care only for the blocks for which flushing was not - initiated by other threads as a result of page swapping - */ + { + /* + We care only for the blocks for which flushing was not + initiated by other threads as a result of page swapping + */ reg_requests(block,1); - if (type != FLUSH_IGNORE_CHANGED) - { /* It's not a temporary file */ + if (type != FLUSH_IGNORE_CHANGED) + { + /* It's not a temporary file */ if (pos == end) - { /* - This happens only if there is not enough - memory for the big block + { + /* + This happens only if there is not enough + memory for the big block */ if ((error=flush_cached_blocks(file,cache,end,type))) - last_errno=error; - /* - Restart the scan as some other thread might have changed - the changed blocks chain: the blocks that were in switch - state before the flush started have to be excluded + last_errno=error; + /* + Restart the scan as some other thread might have changed + the changed blocks chain: the blocks that were in switch + state before the flush started have to be excluded */ goto restart; } @@ -1527,12 +1573,13 @@ restart: else { /* It's a temporary file */ - _my_blocks_changed--; + my_blocks_changed--; free_block(block); } } else - { /* Link the block into a list of blocks 'in switch' */ + { + /* Link the block into a list of blocks 'in switch' */ unlink_changed(block); link_changed(block,&first_in_switch); } @@ -1561,7 +1608,7 @@ restart: } #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif } /* The following happens very seldom */ @@ -1576,7 +1623,7 @@ restart: { #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif next=block->next_changed; if (block->hash_link->file == file && @@ -1589,9 +1636,9 @@ restart: } } } - + keycache_pthread_mutex_unlock(&THR_LOCK_keycache); - + #ifndef DBUG_OFF DBUG_EXECUTE("check_keycache", test_key_cache("end of flush_key_blocks",0);); @@ -1604,30 +1651,31 @@ restart: } -/* - Flush all blocks in the key cache to disk +/* + Flush all blocks in the key cache to disk */ + static int flush_all_key_blocks() { #if defined(KEYCACHE_DEBUG) uint cnt=0; #endif - while (_my_blocks_changed > 0) + while (my_blocks_changed > 0) { BLOCK_LINK *block; - for (block=_my_used_last->next_used ; ; block=block->next_used) + for (block= my_used_last->next_used ; ; block=block->next_used) { if (block->hash_link) { #if defined(KEYCACHE_DEBUG) cnt++; - KEYCACHE_DBUG_ASSERT(cnt <= _my_blocks_used); + KEYCACHE_DBUG_ASSERT(cnt <= my_blocks_used); #endif if (flush_key_blocks(block->hash_link->file, FLUSH_RELEASE)) return 1; break; } - if (block == _my_used_last) + if (block == my_used_last) break; } } @@ -1637,13 +1685,13 @@ static int flush_all_key_blocks() #ifndef DBUG_OFF /* - Test if disk-cache is ok + Test if disk-cache is ok */ -static void test_key_cache(const char *where __attribute__((unused)), +static void test_key_cache(const char *where __attribute__((unused)), my_bool lock __attribute__((unused))) { /* TODO */ -} +} #endif #if defined(KEYCACHE_TIMEOUT) @@ -1680,7 +1728,7 @@ static void keycache_dump() break; } while (thread != last); - + i=0; thread=last=waiting_for_block.last_thread; fprintf(keycache_dump_file, "queue of threads waiting for block\n"); @@ -1698,11 +1746,11 @@ static void keycache_dump() } while (thread != last); - for (i=0 ; i< _my_blocks_used ; i++) + for (i=0 ; i< my_blocks_used ; i++) { int j; - block=&_my_block_root[i]; - hash_link=block->hash_link; + block= &my_block_root[i]; + hash_link= block->hash_link; fprintf(keycache_dump_file, "block:%u hash_link:%d status:%x #requests=%u waiting_for_readers:%d\n", i, (int) (hash_link ? HASH_LINK_NUMBER(hash_link) : -1), @@ -1713,6 +1761,7 @@ static void keycache_dump() thread=last=wqueue->last_thread; fprintf(keycache_dump_file, "queue #%d\n", j); if (thread) + { do { thread=thread->next; @@ -1722,20 +1771,23 @@ static void keycache_dump() break; } while (thread != last); + } } } fprintf(keycache_dump_file, "LRU chain:"); - block=_my_used_last; + block= my_used_last; if (block) + { do { block=block->next_used; fprintf(keycache_dump_file, "block:%u, ", BLOCK_NUMBER(block)); } - while (block != _my_used_last); + while (block != my_used_last); + } fprintf(keycache_dump_file, "\n"); - + fclose(keycache_dump_file); } @@ -1744,7 +1796,7 @@ static void keycache_dump() #if defined(KEYCACHE_TIMEOUT) && !defined(__WIN__) -static int keycache_pthread_cond_wait(pthread_cond_t *cond, +static int keycache_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { int rc; @@ -1754,8 +1806,8 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond, #if defined(KEYCACHE_DEBUG) int cnt=0; #endif - - /* Get current time */ + + /* Get current time */ gettimeofday(&now, &tz); /* Prepare timeout value */ timeout.tv_sec = now.tv_sec + KEYCACHE_TIMEOUT; @@ -1773,16 +1825,16 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond, KEYCACHE_THREAD_TRACE_BEGIN("finished waiting"); #if defined(KEYCACHE_DEBUG) if (rc == ETIMEDOUT) - { + { fprintf(keycache_debug_log,"aborted by keycache timeout\n"); fclose(keycache_debug_log); abort(); } #endif - + if (rc == ETIMEDOUT) keycache_dump(); - + #if defined(KEYCACHE_DEBUG) KEYCACHE_DBUG_ASSERT(rc != ETIMEDOUT); #else @@ -1867,4 +1919,3 @@ void keycache_debug_log_close(void) #endif /* defined(KEYCACHE_DEBUG_LOG) */ #endif /* defined(KEYCACHE_DEBUG) */ - diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 4d3b0604984..abd51369f95 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -25,6 +25,8 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size __attribute__((unused))) { + DBUG_ENTER("init_alloc_root"); + DBUG_PRINT("enter",("root: %lx", mem_root)); mem_root->free= mem_root->used= mem_root->pre_alloc= 0; mem_root->min_malloc= 32; mem_root->block_size= block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8; @@ -45,24 +47,27 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size, } } #endif + DBUG_VOID_RETURN; } gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) { #if defined(HAVE_purify) && defined(EXTRA_DEBUG) reg1 USED_MEM *next; - Size+=ALIGN_SIZE(sizeof(USED_MEM)); + DBUG_ENTER("alloc_root"); + DBUG_PRINT("enter",("root: %lx", mem_root)); + Size+=ALIGN_SIZE(sizeof(USED_MEM)); if (!(next = (USED_MEM*) my_malloc(Size,MYF(MY_WME)))) { if (mem_root->error_handler) (*mem_root->error_handler)(); - return((gptr) 0); /* purecov: inspected */ + DBUG_RETURN((gptr) 0); /* purecov: inspected */ } next->next= mem_root->used; next->size= Size; mem_root->used= next; - return (gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM))); + DBUG_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); #else uint get_size, block_size; gptr point; @@ -151,8 +156,9 @@ void free_root(MEM_ROOT *root, myf MyFlags) { reg1 USED_MEM *next,*old; DBUG_ENTER("free_root"); + DBUG_PRINT("enter",("root: %lx flags: %u", root, (uint) MyFlags)); - if (!root) + if (!root) /* QQ: Should be deleted */ DBUG_VOID_RETURN; /* purecov: inspected */ if (MyFlags & MY_MARK_BLOCKS_FREE) { diff --git a/mysys/my_copy.c b/mysys/my_copy.c index 012eaec4ea8..84eda781a09 100644 --- a/mysys/my_copy.c +++ b/mysys/my_copy.c @@ -31,17 +31,29 @@ struct utimbuf { #endif - /* - Ordinary ownership and accesstimes are copied from 'from-file' - if MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then - the modes of to-file isn't changed - Dont set MY_FNABP or MY_NABP bits on when calling this function ! - */ +/* + int my_copy(const char *from, const char *to, myf MyFlags) + + NOTES + Ordinary ownership and accesstimes are copied from 'from-file' + If MyFlags & MY_HOLD_ORIGINAL_MODES is set and to-file exists then + the modes of to-file isn't changed + If MyFlags & MY_DONT_OVERWRITE_FILE is set, we will give an error + if the file existed. + + WARNING + Don't set MY_FNABP or MY_NABP bits on when calling this function ! + + RETURN + 0 ok + # Error + +*/ int my_copy(const char *from, const char *to, myf MyFlags) { uint Count; - int new_file_stat; + int new_file_stat, create_flag; File from_file,to_file; char buff[IO_SIZE]; struct stat stat_buff,new_stat_buff; @@ -62,8 +74,10 @@ int my_copy(const char *from, const char *to, myf MyFlags) } if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) stat_buff=new_stat_buff; + create_flag= (MyFlags & MY_DONT_OVERWRITE_FILE) ? O_EXCL : O_TRUNC; + if ((to_file= my_create(to,(int) stat_buff.st_mode, - O_WRONLY | O_TRUNC | O_BINARY | O_SHARE, + O_WRONLY | create_flag | O_BINARY | O_SHARE, MyFlags)) < 0) goto err; diff --git a/mysys/my_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-AUTOTOOLS b/netware/BUILD/compile-AUTOTOOLS new file mode 100755 index 00000000000..0688ea5aaca --- /dev/null +++ b/netware/BUILD/compile-AUTOTOOLS @@ -0,0 +1,16 @@ +#! /bin/sh + +for package in . ./innobase +do + (cd $package + rm -rf config.cache autom4te.cache + aclocal + autoheader + libtoolize --force + aclocal + automake --add-missing --force-missing + autoconf) +done + +#rm -rf ./bdb/build_unix/config.cache ./bdb/dist/autom4te.cache +#(cd ./bdb/dist && sh s_all) diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools new file mode 100755 index 00000000000..598be96ab66 --- /dev/null +++ b/netware/BUILD/compile-linux-tools @@ -0,0 +1,52 @@ +#! /bin/sh + +#debug +#set -x + +if test ! -r ./sql/mysqld.cc +then + echo "you must start from the top source directory" + exit 1 +fi + +path=`dirname $0` + +# clean +if test -e "Makefile"; then make -k clean; fi + +# remove files +rm -f NEW-RPMS/* +rm -f */.deps/*.P +rm -f */*.linux + +# run autotools +. $path/compile-AUTOTOOLS + +# configure +./configure --without-innodb --without-docs + +# build tools only +make clean config.h +(cd dbug; make libdbug.a) +(cd strings; make libmystrings.a) +(cd mysys; make libmysys.a) +(cd heap; make libheap.a) +(cd vio; make libvio.a) +(cd regex; make libregex.a) +(cd isam; make libnisam.a) +(cd merge; make libmerge.a) +(cd myisam; make libmyisam.a) +(cd myisammrg; make libmyisammrg.a) +(cd extra; make comp_err) +(cd libmysql; make conf_to_src) +(cd libmysql_r; make conf_to_src) +(cd sql; make gen_lex_hash) +(cd strings; make conf_to_src) + +# copying required linux tools +cp extra/comp_err extra/comp_err.linux +cp libmysql/conf_to_src libmysql/conf_to_src.linux +cp libmysql_r/conf_to_src libmysql_r/conf_to_src.linux +cp sql/gen_lex_hash sql/gen_lex_hash.linux +cp strings/conf_to_src strings/conf_to_src.linux + diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END new file mode 100755 index 00000000000..beb15fbeda3 --- /dev/null +++ b/netware/BUILD/compile-netware-END @@ -0,0 +1,35 @@ +#! /bin/sh + +path=`dirname $0` + +# clean +if test -e "Makefile"; then make -k clean; fi + +# remove files +rm -f NEW-RPMS/* +rm -f */.deps/*.P +rm -rf Makefile.in.bk + +# Metrowerks enviornment +. $path/mwenv + +# run auto tools +. $path/compile-AUTOTOOLS + +# configure +./configure $base_configs $extra_configs + +# make +make clean bin-dist + +# mark the build +for file in *.tar.gz +do + if (expr "$file" : "mysql-[1-9].*" > /dev/null) + then + new_file=`echo $file | sed -e "s/mysql-/mysql-$suffix-/"` + if test -e "$new_file"; then mv -f $new_file $new_file.old; fi + mv $file $new_file + fi +done + diff --git a/netware/BUILD/compile-netware-START b/netware/BUILD/compile-netware-START new file mode 100755 index 00000000000..2941d8868e4 --- /dev/null +++ b/netware/BUILD/compile-netware-START @@ -0,0 +1,23 @@ +#! /bin/sh + +#debug +#set -x + +if test ! -r ./sql/mysqld.cc +then + echo "you must start from the top source directory" + exit 1 +fi + +path=`dirname $0` + +# stop on errors +set -e + +base_configs=" \ + --host=i686-pc-netware \ + --enable-local-infile \ + --with-extra-charsets=all \ + --prefix=N:/mysql \ + " + diff --git a/netware/BUILD/compile-netware-all b/netware/BUILD/compile-netware-all new file mode 100755 index 00000000000..f8dea0f7583 --- /dev/null +++ b/netware/BUILD/compile-netware-all @@ -0,0 +1,8 @@ +#! /bin/sh + +path=`dirname $0` + +$path/compile-netware-standard +$path/compile-netware-debug +#$path/compile-netware-max +#$path/compile-netware-max-debug diff --git a/netware/BUILD/compile-netware-debug b/netware/BUILD/compile-netware-debug new file mode 100755 index 00000000000..2cd292c82fd --- /dev/null +++ b/netware/BUILD/compile-netware-debug @@ -0,0 +1,15 @@ +#! /bin/sh + +path=`dirname $0` +. $path/compile-netware-START + +suffix="debug" + +extra_configs=" \ + --with-innodb \ + --with-debug=full \ + " + +. $path/compile-netware-END + + diff --git a/netware/BUILD/compile-netware-standard b/netware/BUILD/compile-netware-standard new file mode 100755 index 00000000000..c09337b5fe0 --- /dev/null +++ b/netware/BUILD/compile-netware-standard @@ -0,0 +1,14 @@ +#! /bin/sh + +path=`dirname $0` +. $path/compile-netware-START + +suffix="standard" + +extra_configs=" \ + --with-innodb + " + +. $path/compile-netware-END + + diff --git a/netware/BUILD/create-patch b/netware/BUILD/create-patch new file mode 100644 index 00000000000..711eabf2d89 --- /dev/null +++ b/netware/BUILD/create-patch @@ -0,0 +1,56 @@ +#! /bin/sh + +# debug +#set -x + +# stop on errors +set -e + +# repository direcotry +repo_dir=`pwd` + +# show usage +show_usage() +{ + cat << EOF + +usage: create-patch + +Creates a patch file between the latest revision of the current tree +and the latest revision not create by \$BK_USER. + +EOF + exit 0; +} + +if test $1 || test -z $BK_USER +then + show_usage +fi + +echo "starting patch..." + +echo "user: $BK_USER" + +# check for bk and repo_dir +bk help > /dev/null +repo_dir=`bk root $repo_dir` +cd $repo_dir + +# determine version +version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"` +echo "version: $version" + +# user revision +user_rev=`bk changes -e -n -d':REV:' | head -1` +echo "latest revision: $user_rev" + +# tree revision +tree_rev=`bk changes -e -n -d':REV:' -U$BK_USER | head -1` +echo "latest non-$BK_USER revision: $tree_rev" + +# create patch +patch="$repo_dir/../$BK_USER-$version.patch" +echo "creating \"$patch\"..." +bk export -tpatch -r$tree_rev..$user_rev > $patch + diff --git a/netware/mw/mwasmnlm b/netware/BUILD/mwasmnlm old mode 100644 new mode 100755 similarity index 100% rename from netware/mw/mwasmnlm rename to netware/BUILD/mwasmnlm diff --git a/netware/mw/mwccnlm b/netware/BUILD/mwccnlm old mode 100644 new mode 100755 similarity index 100% rename from netware/mw/mwccnlm rename to netware/BUILD/mwccnlm diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv new file mode 100755 index 00000000000..26794c3f77f --- /dev/null +++ b/netware/BUILD/mwenv @@ -0,0 +1,29 @@ +#! /bin/sh + +# WINE_BUILD_DIR, BUILD_DIR, and VERSION must be correct before compiling +# This values are normally changed by the nwbootstrap script + +# the default is "F:/mydev" +export MYDEV="WINE_BUILD_DIR" + +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" +export PATH="$PATH:BUILD_DIR/mysql-VERSION/netware/BUILD" + +export AR='mwldnlm' +export AR_FLAGS='-type library -o' +export AS='mwasmnlm' +export CC='mwccnlm -gccincludes' +export CFLAGS='-dialect c -proc 686 -relax_pointers' +export CXX='mwccnlm -gccincludes' +export CXXFLAGS='-dialect c++ -proc 686 -bool on -wchar_t on -relax_pointers -D_WCHAR_T' +export LD='mwldnlm' +export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption' +export RANLIB=: +export STRIP=: + diff --git a/netware/mw/mwldnlm b/netware/BUILD/mwldnlm old mode 100644 new mode 100755 similarity index 100% rename from netware/mw/mwldnlm rename to netware/BUILD/mwldnlm diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap new file mode 100755 index 00000000000..002e19c8e49 --- /dev/null +++ b/netware/BUILD/nwbootstrap @@ -0,0 +1,166 @@ +#! /bin/sh + +# debug +#set -x + +path=`dirname $0` + +# stop on errors +set -e + +# repository direcotry +repo_dir=`pwd` + +# build direcotry +build_dir="$HOME/mydev" +wine_build_dir="F:/mydev" + +# doc directory +doc_dir="$repo_dir/../mysqldoc" + +# init +target_dir="" +temp_dir="" +revision="" +rev="" +build="" +mwenv="" + +# show usage +show_usage() +{ + cat << EOF + +usage: nwbootstrap [options] + +Exports a revision of the BitKeeper tree (nwbootstrap must be run inside a +directory of the BitKeeper tree to be used). Creates the ChangeLog file. +Adds the latest manual.texi from the mysqldoc BitKeeper tree. Builds the +Linux tools required for cross-platform builds. Optionally, builds the +binary distributions for NetWare. + +options: + +--build= Build the binary distributions for NetWare, + where is "standard", "debug", or "all" + (default is to not build a binary distribution) + +--build-dir= Export the BitKeeper tree to the directroy + (default is "$build_dir") + +--doc-dir= Use the mysqldoc BitKeeper tree located in the + directory + (default is parallel to current BitKeeper tree) + +--help Show this help information + +--revision= Export the BitKeeper tree as of revision + (default is the latest revision) + +--wine-build-dir= Use the WINE directory , which should + correspond to the --build-dir directory + (default is "$wine_build_dir") + +examples: + + nwbootstrap + + nwbootstrap --revision=1.1594 --build=all + + nwbootstrap --build-dir=/home/jdoe/dev --wine-build-dir=F:/dev + + +EOF + exit 0; +} + +# parse arguments +for arg do + case "$arg" in + --build-dir=*) build_dir=`echo "$arg" | sed -e "s;--build-dir=;;"` ;; + --wine-build-dir=*) wine_build_dir=`echo "$arg" | sed -e "s;--wine-build-dir=;;"` ;; + --revision=*) revision=`echo "$arg" | sed -e "s;--revision=;;"` ;; + --build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;; + --doc-dir=*) doc_dir=`echo "$arg" | sed -e "s;--doc-dir=;;"` ;; + *) show_usage ;; + esac +done + +echo "starting build..." + +# check for bk and repo_dir +bk help > /dev/null +repo_dir=`bk root $repo_dir` +cd $repo_dir +doc_dir="$repo_dir/../mysqldoc" + +# build temporary directory +temp_dir="$build_dir/mysql-$$.tmp" + +# export the bk tree +command="bk export"; +if test $revision; then command="$command -r$revision"; fi +command="$command $temp_dir" +echo "exporting $repo_dir..." +$command + +# determine version +version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < $temp_dir/configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"` +echo "version: $version" + +# build target directory +target_dir="$build_dir/mysql-$version" + +# delete any old target +if test -d $target_dir.old; then rm -rf $target_dir.old; fi + +# rename old target +if test -d $target_dir; then mv -f $target_dir $target_dir.old; fi + +# rename directory to use version +mv $temp_dir $target_dir + +# create ChangeLog +if test $revision +then + rev=`bk changes -r..$revision -t -d':REV:' -n | head -2 | tail -1` +else + rev=`bk changes -t -d':REV:' -n | head -1` +fi + +echo "creating ChangeLog..." +bk changes -v -r$rev..$revision > $target_dir/ChangeLog + +# add the latest manual +if test -d $doc_dir +then + echo "adding the latest manual..." + install -m 644 $doc_dir/Docs/{manual,reservedwords}.texi $target_dir/Docs/ +fi + +# make files writeable +cd $target_dir +chmod -R u+rw,g+rw . + +# edit the mvenv file +mwenv="./netware/BUILD/mwenv" +mv -f $mwenv $mwenv.org +sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \ + -e "s;BUILD_DIR;$build_dir;g" \ + -e "s;VERSION;$version;g" $mwenv.org > $mwenv +chmod +rwx $mwenv + +# build linux tools +echo "compiling linux tools..." +./netware/BUILD/compile-linux-tools + +# compile +if test $build +then + echo "compiling $build..." + ./netware/BUILD/compile-netware-$build +fi + +echo "done" + + diff --git a/netware/Makefile.am b/netware/Makefile.am index 5933340febb..801d144b968 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -28,12 +28,13 @@ netware_build_files = client/mysql.def client/mysqladmin.def \ client/mysqlshow.def client/mysqltest.def \ extra/mysql_install.def extra/my_print_defaults.def \ extra/perror.def extra/replace.def \ - extra/resolveip.def isam/isamchk.def \ + extra/resolveip.def extra/comp_err.def \ + isam/isamchk.def \ isam/isamlog.def isam/pack_isam.def \ libmysqld/libmysqld.def myisam/myisamchk.def \ myisam/myisamlog.def myisam/myisampack.def \ - sql/mysqld.def sql/mysqld.xdc - + sql/mysqld.def + link_sources: set -x; \ for f in $(netware_build_files); do \ diff --git a/netware/comp_err.def b/netware/comp_err.def new file mode 100644 index 00000000000..d694c07174a --- /dev/null +++ b/netware/comp_err.def @@ -0,0 +1,10 @@ +#------------------------------------------------------------------------------ +# MySQL Error File Compiler +#------------------------------------------------------------------------------ +MODULE libc.nlm +COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +DESCRIPTION "MySQL Error File Compiler" +VERSION 4, 0 +XDCDATA ../netware/mysql.xdc +#DEBUG + diff --git a/netware/init_db.sql b/netware/init_db.sql index 1e8354e13a1..4613e5c0274 100644 --- a/netware/init_db.sql +++ b/netware/init_db.sql @@ -4,22 +4,23 @@ CREATE DATABASE test; USE mysql; CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; - + INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; + +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('%','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 VALUES ('','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 ('%',''); +INSERT INTO user (host,user) values ('',''); CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; + diff --git a/netware/isamchk.def b/netware/isamchk.def index a724340066a..8d756466609 100644 --- a/netware/isamchk.def +++ b/netware/isamchk.def @@ -6,5 +6,6 @@ COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved DESCRIPTION "MySQL ISAM Table Check Tool" VERSION 4, 0 STACKSIZE 65536 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/isamlog.def b/netware/isamlog.def index 3f74d17f284..bb8312066ef 100644 --- a/netware/isamlog.def +++ b/netware/isamlog.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Log Tool" VERSION 4, 0 -DEBUG +XDCDATA ../netware/mysql.xdc +#DEBUG diff --git a/netware/libmysql.def b/netware/libmysql.def index f2ab1f0f21a..7804c4468a5 100644 --- a/netware/libmysql.def +++ b/netware/libmysql.def @@ -7,4 +7,5 @@ COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved DESCRIPTION "MySQL Client Library" VERSION 4, 0 AUTOUNLOAD +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/libmysqld.def b/netware/libmysqld.def deleted file mode 100644 index c6615ee971c..00000000000 --- a/netware/libmysqld.def +++ /dev/null @@ -1,65 +0,0 @@ -LIBRARY LIBMYSQLD -DESCRIPTION 'MySQL 4.0 Embedded Server Library' -VERSION 4.0 -EXPORTS - mysql_server_end - mysql_server_init - mysql_use_result - mysql_thread_safe - mysql_thread_id - mysql_store_result - mysql_stat - mysql_shutdown - mysql_select_db - mysql_row_tell - mysql_row_seek - mysql_real_query - mysql_real_connect - mysql_query - mysql_ping - mysql_options - mysql_num_rows - mysql_num_fields - mysql_list_tables - mysql_list_processes - mysql_list_fields - mysql_list_dbs - mysql_kill - mysql_insert_id - mysql_init - mysql_info - mysql_get_server_info - mysql_get_proto_info - mysql_get_host_info - mysql_get_client_info - mysql_free_result - mysql_field_tell - mysql_field_count - mysql_field_seek - mysql_fetch_row - mysql_fetch_lengths - mysql_fetch_fields - mysql_fetch_field_direct - mysql_fetch_field - mysql_escape_string - mysql_real_escape_string - mysql_error - mysql_errno - mysql_eof - mysql_dump_debug_info - mysql_drop_db - mysql_debug - mysql_data_seek - mysql_create_db - mysql_character_set_name - mysql_change_user - mysql_connect - mysql_close - mysql_affected_rows - mysql_thread_init - mysql_thread_end - mysql_send_query - mysql_read_query_result - mysql_refresh - mysql_odbc_escape_string - myodbc_remove_escape diff --git a/netware/mw/mwenv b/netware/mw/mwenv deleted file mode 100644 index 31500ae400f..00000000000 --- a/netware/mw/mwenv +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -export MYDEV="F:/mydev" - -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 WINEPATH="$MYDEV/mw/bin" - -export PATH="$PATH:$HOME/mydev/mysql-4.1/netware/mw" diff --git a/netware/my_manage.c b/netware/my_manage.c index 25147b16674..490438b0485 100644 --- a/netware/my_manage.c +++ b/netware/my_manage.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,18 +54,16 @@ Init an argument list. ******************************************************************************/ -void _init_args(arg_list *al) +void init_args(arg_list_t *al) { - int i; + ASSERT(al != NULL); - *al = malloc(sizeof(arg_list_t)); + al->argc = 0; + al->size = ARG_BUF; + al->argv = malloc(al->size * sizeof(char *)); + ASSERT(al->argv != NULL); - (*al)->argc = 0; - - for(i = 0; i < ARG_MAX; i++) - { - (*al)->argv[i] = NULL; - } + return; } /****************************************************************************** @@ -75,49 +73,66 @@ void _init_args(arg_list *al) Add an argument to a list. ******************************************************************************/ -void add_arg(arg_list al, char *format, ...) +void add_arg(arg_list_t *al, char *format, ...) { va_list ap; + char temp[PATH_MAX]; ASSERT(al != NULL); - ASSERT(al->argc < ARG_MAX); - al->argv[al->argc] = malloc(PATH_MAX); + // increase size + if (al->argc >= al->size) + { + al->size += ARG_BUF; + al->argv = realloc(al->argv, al->size * sizeof(char *)); + ASSERT(al->argv != NULL); + } - ASSERT(al->argv[al->argc] != NULL); + if (format) + { + va_start(ap, format); + vsprintf(temp, format, ap); + va_end(ap); - va_start(ap, format); + al->argv[al->argc] = malloc(strlen(temp)+1); + ASSERT(al->argv[al->argc] != NULL); + strcpy(al->argv[al->argc], temp); - vsprintf(al->argv[al->argc], format, ap); + ++(al->argc); + } + else + { + al->argv[al->argc] = NULL; + } - va_end(ap); - - ++(al->argc); + return; } /****************************************************************************** - _free_args() + free_args() Free an argument list. ******************************************************************************/ -void _free_args(arg_list *al) +void free_args(arg_list_t *al) { int i; ASSERT(al != NULL); - ASSERT(*al != NULL); - for(i = 0; i < (*al)->argc; i++) + for(i = 0; i < al->argc; i++) { - ASSERT((*al)->argv[i] != NULL); - free((*al)->argv[i]); - (*al)->argv[i] = NULL; + ASSERT(al->argv[i] != NULL); + free(al->argv[i]); + al->argv[i] = NULL; } - free(*al); - *al = NULL; + free(al->argv); + al->argc = 0; + al->argv = NULL; + + return; } /****************************************************************************** @@ -167,7 +182,7 @@ int sleep_until_file_exists(char *pid_file) ******************************************************************************/ int wait_for_server_start(char *bin_dir, char *user, char *password, int port) { - arg_list al; + arg_list_t al; int err, i; char mysqladmin_file[PATH_MAX]; char trash[PATH_MAX]; @@ -177,27 +192,27 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port) snprintf(trash, PATH_MAX, "/tmp/trash.out"); // args - init_args(al); - add_arg(al, "%s", mysqladmin_file); - add_arg(al, "--no-defaults"); - add_arg(al, "--port=%u", port); - add_arg(al, "--user=%s", user); - add_arg(al, "--password=%s", password); - add_arg(al, "--silent"); - add_arg(al, "-O"); - add_arg(al, "connect_timeout=10"); - add_arg(al, "-w"); - add_arg(al, "--host=localhost"); - add_arg(al, "ping"); + init_args(&al); + add_arg(&al, "%s", mysqladmin_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", port); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "--silent"); + add_arg(&al, "-O"); + add_arg(&al, "connect_timeout=10"); + add_arg(&al, "-w"); + add_arg(&al, "--host=localhost"); + add_arg(&al, "ping"); // NetWare does not support the connect timeout in the TCP/IP stack // -- we will try the ping multiple times for(i = 0; (i < TRY_MAX) - && (err = spawn(mysqladmin_file, al, TRUE, NULL, + && (err = spawn(mysqladmin_file, &al, TRUE, NULL, trash, NULL)); i++) sleep(1); // free args - free_args(al); + free_args(&al); return err; } @@ -206,71 +221,53 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port) spawn() - Spawn the given file with the given arguments. + Spawn the given path with the given arguments. ******************************************************************************/ -int spawn(char *file, arg_list al, int join, char *input, +int spawn(char *path, arg_list_t *al, int join, char *input, char *output, char *error) { - NXNameSpec_t name; - NXExecEnvSpec_t env; - NXVmId_t vm, ignore; - int result; - - // name - name.ssType = NX_OBJ_FILE; - name.ssPathCtx = 0; - name.ssPath = file; - - // env - env.esArgc = al->argc; - env.esArgv = al->argv; - env.esEnv = NULL; - - env.esStdin.ssPathCtx = 0; - env.esStdout.ssPathCtx = 0; - env.esStderr.ssPathCtx = 0; - - if (input == NULL) - { - env.esStdin.ssType = NX_OBJ_DEFAULT; - env.esStdin.ssPath = NULL; - } - else - { - env.esStdin.ssType = NX_OBJ_FILE; - env.esStdin.ssPath = input; - } - - if (output == NULL) + pid_t pid; + int result = 0; + wiring_t wiring = { FD_UNUSED, FD_UNUSED, FD_UNUSED }; + unsigned long flags = PROC_CURRENT_SPACE | PROC_INHERIT_CWD; + + // open wiring + if (input) + wiring.infd = open(input, O_RDONLY); + + if (output) + wiring.outfd = open(output, O_WRONLY | O_CREAT | O_TRUNC); + + if (error) + wiring.errfd = open(error, O_WRONLY | O_CREAT | O_TRUNC); + + // procve requires a NULL + add_arg(al, NULL); + + // go + pid = procve(path, flags, NULL, &wiring, NULL, NULL, 0, + NULL, (const char **)al->argv); + + if (pid == -1) { - env.esStdout.ssType = NX_OBJ_DEFAULT; - env.esStdout.ssPath = NULL; + result = -1; } - else + else if (join) { - env.esStdout.ssType = NX_OBJ_FILE; - env.esStdout.ssPath = output; + waitpid(pid, &result, 0); } - if (error == NULL) - { - env.esStderr.ssType = NX_OBJ_DEFAULT; - env.esStderr.ssPath = NULL; - } - else - { - env.esStderr.ssType = NX_OBJ_FILE; - env.esStderr.ssPath = error; - } - - result = NXVmSpawn(&name, &env, NX_VM_SAME_ADDRSPACE | NX_VM_INHERIT_ENV, &vm); - - if (!result && join) - { - NXVmJoin(vm, &ignore, &result); - } - + // close wiring + if (wiring.infd != -1) + close(wiring.infd); + + if (wiring.outfd != -1) + close(wiring.outfd); + + if (wiring.errfd != -1) + close(wiring.errfd); + return result; } @@ -284,7 +281,7 @@ int spawn(char *file, arg_list al, int join, char *input, int stop_server(char *bin_dir, char *user, char *password, int port, char *pid_file) { - arg_list al; + arg_list_t al; int err, i, argc = 0; char mysqladmin_file[PATH_MAX]; char trash[PATH_MAX]; @@ -294,18 +291,18 @@ int stop_server(char *bin_dir, char *user, char *password, int port, snprintf(trash, PATH_MAX, "/tmp/trash.out"); // args - init_args(al); - add_arg(al, "%s", mysqladmin_file); - add_arg(al, "--no-defaults"); - add_arg(al, "--port=%u", port); - add_arg(al, "--user=%s", user); - add_arg(al, "--password=%s", password); - add_arg(al, "-O"); - add_arg(al, "shutdown_timeout=20"); - add_arg(al, "shutdown"); + init_args(&al); + add_arg(&al, "%s", mysqladmin_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", port); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "-O"); + add_arg(&al, "shutdown_timeout=20"); + add_arg(&al, "shutdown"); // spawn - if ((err = spawn(mysqladmin_file, al, TRUE, NULL, + if ((err = spawn(mysqladmin_file, &al, TRUE, NULL, trash, NULL)) == 0) { sleep_until_file_deleted(pid_file); @@ -324,7 +321,7 @@ int stop_server(char *bin_dir, char *user, char *password, int port, } // free args - free_args(al); + free_args(&al); return err; } diff --git a/netware/my_manage.h b/netware/my_manage.h index 92ed66ea865..b19662c4ee9 100644 --- a/netware/my_manage.h +++ b/netware/my_manage.h @@ -34,12 +34,9 @@ ******************************************************************************/ -#define ARG_MAX 50 +#define ARG_BUF 10 #define TRY_MAX 5 -#define init_args(al) _init_args(&al); -#define free_args(al) _free_args(&al); - /****************************************************************************** structures @@ -50,9 +47,11 @@ typedef struct { int argc; - char *argv[ARG_MAX]; + char **argv; -} arg_list_t, * arg_list; + size_t size; + +} arg_list_t; /****************************************************************************** @@ -66,18 +65,23 @@ typedef struct ******************************************************************************/ -void _init_args(arg_list *); -void add_arg(arg_list, char *, ...); -void _free_args(arg_list *); +void init_args(arg_list_t *); +void add_arg(arg_list_t *, char *, ...); +void free_args(arg_list_t *); + int sleep_until_file_exists(char *); int sleep_until_file_deleted(char *); int wait_for_server_start(char *, char *, char *, int); -int spawn(char *, arg_list, int, char *, char *, char *); + +int spawn(char *, arg_list_t *, int, char *, char *, char *); + int stop_server(char *, char *, char *, int, char *); pid_t get_server_pid(char *); void kill_server(pid_t pid); + void del_tree(char *); int removef(char *, ...); + void get_basedir(char *, char *); #endif /* _MY_MANAGE */ diff --git a/netware/my_print_defaults.def b/netware/my_print_defaults.def index 7f474c50469..49f167341ae 100644 --- a/netware/my_print_defaults.def +++ b/netware/my_print_defaults.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Print Defaults Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/myisamchk.def b/netware/myisamchk.def index 5a57866c1ee..2222a1317e1 100644 --- a/netware/myisamchk.def +++ b/netware/myisamchk.def @@ -6,5 +6,6 @@ COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved DESCRIPTION "MySQL MyISAM Table Check Tool" VERSION 4, 0 STACKSIZE 65536 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/myisamlog.def b/netware/myisamlog.def index c3bbee38d16..bfa673e12be 100644 --- a/netware/myisamlog.def +++ b/netware/myisamlog.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Log Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/myisampack.def b/netware/myisampack.def index ae025e5f84d..72403d2591e 100644 --- a/netware/myisampack.def +++ b/netware/myisampack.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Pack Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysql.def b/netware/mysql.def index a5e3ae21369..9b4424ed4fb 100644 --- a/netware/mysql.def +++ b/netware/mysql.def @@ -7,5 +7,6 @@ COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved DESCRIPTION "MySQL Monitor" VERSION 4, 0 MULTIPLE +XDCDATA ../netware/mysql.xdc #DEBUG 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/mysql_install.def b/netware/mysql_install.def index 2c2819ec6af..87fc76919f9 100644 --- a/netware/mysql_install.def +++ b/netware/mysql_install.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Install Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c index 128f07dc2bc..b4060bfdb7e 100644 --- a/netware/mysql_install_db.c +++ b/netware/mysql_install_db.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "my_config.h" #include "my_manage.h" @@ -51,7 +52,7 @@ char default_option[PATH_MAX]; void start_defaults(int, char*[]); void finish_defaults(); -void read_defaults(arg_list); +void read_defaults(arg_list_t *); void parse_args(int, char*[]); void get_options(int, char*[]); void create_paths(); @@ -151,9 +152,9 @@ void finish_defaults() Read the defaults. ******************************************************************************/ -void read_defaults(arg_list pal) +void read_defaults(arg_list_t *pal) { - arg_list al; + arg_list_t al; char defaults_file[PATH_MAX]; char mydefaults[PATH_MAX]; char line[PATH_MAX]; @@ -167,15 +168,15 @@ void read_defaults(arg_list pal) snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir); // args - init_args(al); - add_arg(al, mydefaults); - if (default_option[0]) add_arg(al, default_option); - add_arg(al, "mysqld"); - add_arg(al, "mysql_install_db"); + init_args(&al); + add_arg(&al, mydefaults); + if (default_option[0]) add_arg(&al, default_option); + add_arg(&al, "mysqld"); + add_arg(&al, "mysql_install_db"); - spawn(mydefaults, al, TRUE, NULL, defaults_file, NULL); + spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL); - free_args(al); + free_args(&al); // gather defaults if((fp = fopen(defaults_file, "r")) != NULL) @@ -267,17 +268,17 @@ void parse_args(int argc, char *argv[]) ******************************************************************************/ void get_options(int argc, char *argv[]) { - arg_list al; + arg_list_t al; // start defaults start_defaults(argc, argv); // default file arguments - init_args(al); - add_arg(al, "dummy"); - read_defaults(al); - parse_args(al->argc, al->argv); - free_args(al); + init_args(&al); + add_arg(&al, "ignore"); + read_defaults(&al); + parse_args(al.argc, al.argv); + free_args(&al); // command-line arguments parse_args(argc, argv); @@ -323,7 +324,7 @@ void create_paths() ******************************************************************************/ int mysql_install_db(int argc, char *argv[]) { - arg_list al; + arg_list_t al; int i, j, err; char skip; @@ -336,8 +337,8 @@ int mysql_install_db(int argc, char *argv[]) }; // args - init_args(al); - add_arg(al, "%s", mysqld); + init_args(&al); + add_arg(&al, "%s", mysqld); // parent args for(i = 1; i < argc; i++) @@ -354,19 +355,19 @@ int mysql_install_db(int argc, char *argv[]) } } - if (!skip) add_arg(al, "%s", argv[i]); + if (!skip) add_arg(&al, "%s", argv[i]); } - add_arg(al, "--bootstrap"); - add_arg(al, "--skip-grant-tables"); - add_arg(al, "--skip-innodb"); - add_arg(al, "--skip-bdb"); + add_arg(&al, "--bootstrap"); + add_arg(&al, "--skip-grant-tables"); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-bdb"); // spawn mysqld - err = spawn(mysqld, al, TRUE, sql_file, out_log, err_log); + err = spawn(mysqld, &al, TRUE, sql_file, out_log, err_log); // free args - free_args(al); + free_args(&al); return err; } @@ -384,6 +385,9 @@ int main(int argc, char **argv) // check for an autoclose option if (!autoclose) setscreenmode(SCR_NO_MODE); + // header + printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); + // create paths create_paths(); @@ -391,6 +395,7 @@ int main(int argc, char **argv) if (mysql_install_db(argc, argv)) { printf("ERROR - The database creation failed!\n"); + printf(" %s\n", strerror(errno)); printf("See the following log for more infomration:\n"); printf("\t%s\n\n", err_log); exit(-1); diff --git a/netware/mysql_install_db.def b/netware/mysql_install_db.def index c813e80d768..4653638b5ad 100644 --- a/netware/mysql_install_db.def +++ b/netware/mysql_install_db.def @@ -6,5 +6,6 @@ SCREENNAME "MySQL Install" COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Initial Database Installer" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index f19cee32e92..ff629546793 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -28,6 +28,7 @@ #include #include +#include "my_config.h" #include "my_manage.h" /****************************************************************************** @@ -178,7 +179,7 @@ void report_stats() ******************************************************************************/ void install_db(char *datadir) { - arg_list al; + arg_list_t al; int err, i; char input[PATH_MAX]; char output[PATH_MAX]; @@ -190,23 +191,23 @@ void install_db(char *datadir) snprintf(error, PATH_MAX, "%s/install.err", datadir); // args - init_args(al); - add_arg(al, mysqld_file); - add_arg(al, "--bootstrap"); - add_arg(al, "--skip-grant-tables"); - add_arg(al, "--basedir=%s", base_dir); - add_arg(al, "--datadir=%s", datadir); - add_arg(al, "--skip-innodb"); - add_arg(al, "--skip-bdb"); + init_args(&al); + add_arg(&al, mysqld_file); + add_arg(&al, "--bootstrap"); + add_arg(&al, "--skip-grant-tables"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--datadir=%s", datadir); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-bdb"); // spawn - if ((err = spawn(mysqld_file, al, TRUE, input, output, error)) != 0) + if ((err = spawn(mysqld_file, &al, TRUE, input, output, error)) != 0) { die("Unable to create database."); } // free args - free_args(al); + free_args(&al); } /****************************************************************************** @@ -261,7 +262,7 @@ void mysql_install_db() ******************************************************************************/ void start_master() { - arg_list al; + arg_list_t al; int err, i; char master_out[PATH_MAX]; char master_err[PATH_MAX]; @@ -297,32 +298,32 @@ void start_master() mysql_test_dir, restarts); // args - init_args(al); - add_arg(al, "%s", mysqld_file); - add_arg(al, "--no-defaults"); - add_arg(al, "--log-bin=master-bin"); - add_arg(al, "--server-id=1"); - add_arg(al, "--basedir=%s", base_dir); - add_arg(al, "--port=%u", master_port); - add_arg(al, "--local-infile"); - add_arg(al, "--core"); - add_arg(al, "--datadir=%s", master_dir); - add_arg(al, "--pid-file=%s", master_pid); - add_arg(al, "--character-sets-dir=%s", char_dir); - add_arg(al, "--tmpdir=%s", mysql_tmp_dir); - add_arg(al, "--language=%s", lang_dir); + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=master-bin"); + add_arg(&al, "--server-id=1"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--port=%u", master_port); + add_arg(&al, "--local-infile"); + add_arg(&al, "--core"); + add_arg(&al, "--datadir=%s", master_dir); + add_arg(&al, "--pid-file=%s", master_pid); + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); // $MASTER_40_ARGS - add_arg(al, "--rpl-recovery-rank=1"); - add_arg(al, "--init-rpl-role=master"); + add_arg(&al, "--rpl-recovery-rank=1"); + add_arg(&al, "--init-rpl-role=master"); // $SMALL_SERVER - add_arg(al, "-O"); - add_arg(al, "key_buffer_size=1M"); - add_arg(al, "-O"); - add_arg(al, "sort_buffer=256K"); - add_arg(al, "-O"); - add_arg(al, "max_heap_table_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); // $EXTRA_MASTER_OPT if (master_opt[0] != NULL) @@ -333,7 +334,7 @@ void start_master() while(p) { - add_arg(al, "%s", p); + add_arg(&al, "%s", p); p = (char *)strtok(NULL, " \t"); } @@ -343,7 +344,7 @@ void start_master() remove(master_pid); // spawn - if ((err = spawn(mysqld_file, al, FALSE, NULL, master_out, master_err)) == 0) + if ((err = spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err)) == 0) { sleep_until_file_exists(master_pid); @@ -362,7 +363,7 @@ void start_master() } // free_args - free_args(al); + free_args(&al); } /****************************************************************************** @@ -374,7 +375,7 @@ void start_master() ******************************************************************************/ void start_slave() { - arg_list al; + arg_list_t al; int err, i; char slave_out[PATH_MAX]; char slave_err[PATH_MAX]; @@ -444,34 +445,34 @@ void start_slave() mysql_test_dir, restarts); // args - init_args(al); - add_arg(al, "%s", mysqld_file); - add_arg(al, "--no-defaults"); - add_arg(al, "--log-bin=slave-bin"); - add_arg(al, "--relay_log=slave-relay-bin"); - add_arg(al, "--basedir=%s", base_dir); - add_arg(al, "--port=%u", slave_port); - add_arg(al, "--datadir=%s", slave_dir); - add_arg(al, "--pid-file=%s", slave_pid); - add_arg(al, "--character-sets-dir=%s", char_dir); - add_arg(al, "--core"); - add_arg(al, "--tmpdir=%s", mysql_tmp_dir); - add_arg(al, "--language=%s", lang_dir); + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=slave-bin"); + add_arg(&al, "--relay_log=slave-relay-bin"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--port=%u", slave_port); + add_arg(&al, "--datadir=%s", slave_dir); + add_arg(&al, "--pid-file=%s", slave_pid); + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--core"); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); - add_arg(al, "--exit-info=256"); - add_arg(al, "--log-slave-updates"); - add_arg(al, "--init-rpl-role=slave"); - add_arg(al, "--skip-innodb"); - add_arg(al, "--skip-slave-start"); - add_arg(al, "--slave-load-tmpdir=../../var/tmp"); + add_arg(&al, "--exit-info=256"); + add_arg(&al, "--log-slave-updates"); + add_arg(&al, "--init-rpl-role=slave"); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-slave-start"); + add_arg(&al, "--slave-load-tmpdir=../../var/tmp"); - add_arg(al, "--report-user=%s", user); - add_arg(al, "--report-host=127.0.0.1"); - add_arg(al, "--report-port=%u", slave_port); + add_arg(&al, "--report-user=%s", user); + add_arg(&al, "--report-host=127.0.0.1"); + add_arg(&al, "--report-port=%u", slave_port); - add_arg(al, "--master-retry-count=10"); - add_arg(al, "-O"); - add_arg(al, "slave_net_timeout=10"); + add_arg(&al, "--master-retry-count=10"); + add_arg(&al, "-O"); + add_arg(&al, "slave_net_timeout=10"); // slave master info if (slave_master_info[0] != NULL) @@ -482,29 +483,29 @@ void start_slave() while(p) { - add_arg(al, "%s", p); + add_arg(&al, "%s", p); p = (char *)strtok(NULL, " \t"); } } else { - add_arg(al, "--master-user=%s", user); - add_arg(al, "--master-password=%s", password); - add_arg(al, "--master-host=127.0.0.1"); - add_arg(al, "--master-port=%u", master_port); - add_arg(al, "--master-connect-retry=1"); - add_arg(al, "--server-id=2"); - add_arg(al, "--rpl-recovery-rank=2"); + add_arg(&al, "--master-user=%s", user); + add_arg(&al, "--master-password=%s", password); + add_arg(&al, "--master-host=127.0.0.1"); + add_arg(&al, "--master-port=%u", master_port); + add_arg(&al, "--master-connect-retry=1"); + add_arg(&al, "--server-id=2"); + add_arg(&al, "--rpl-recovery-rank=2"); } // small server - add_arg(al, "-O"); - add_arg(al, "key_buffer_size=1M"); - add_arg(al, "-O"); - add_arg(al, "sort_buffer=256K"); - add_arg(al, "-O"); - add_arg(al, "max_heap_table_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); // opt args if (slave_opt[0] != NULL) @@ -515,7 +516,7 @@ void start_slave() while(p) { - add_arg(al, "%s", p); + add_arg(&al, "%s", p); p = (char *)strtok(NULL, " \t"); } @@ -525,7 +526,7 @@ void start_slave() remove(slave_pid); // spawn - if ((err = spawn(mysqld_file, al, FALSE, NULL, slave_out, slave_err)) == 0) + if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err)) == 0) { sleep_until_file_exists(slave_pid); @@ -544,7 +545,7 @@ void start_slave() } // free args - free_args(al); + free_args(&al); } /****************************************************************************** @@ -749,7 +750,7 @@ void run_test(char *test) char out_file[PATH_MAX]; char err_file[PATH_MAX]; int err; - arg_list al; + arg_list_t al; NXTime_t start, stop; // skip slave? @@ -812,25 +813,25 @@ void run_test(char *test) log("%-46s ", test); // args - init_args(al); - add_arg(al, "%s", mysqltest_file); - add_arg(al, "--no-defaults"); - add_arg(al, "--port=%u", master_port); - add_arg(al, "--database=%s", db); - add_arg(al, "--user=%s", user); - add_arg(al, "--password=%s", password); - add_arg(al, "--silent"); - add_arg(al, "--basedir=%s/", mysql_test_dir); - add_arg(al, "--host=127.0.0.1"); - add_arg(al, "-v"); - add_arg(al, "-R"); - add_arg(al, "%s", result_file); + init_args(&al); + add_arg(&al, "%s", mysqltest_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", master_port); + add_arg(&al, "--database=%s", db); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "--silent"); + add_arg(&al, "--basedir=%s/", mysql_test_dir); + add_arg(&al, "--host=127.0.0.1"); + add_arg(&al, "-v"); + add_arg(&al, "-R"); + add_arg(&al, "%s", result_file); // start timer NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &start); // spawn - err = spawn(mysqltest_file, al, TRUE, test_file, out_file, err_file); + err = spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file); // stop timer NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &stop); @@ -840,7 +841,7 @@ void run_test(char *test) total_time += elapsed; // free args - free_args(al); + free_args(&al); if (err == 0) { @@ -1055,9 +1056,6 @@ void setup(char *file) // enviornment setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); - - // install test databases - mysql_install_db(); } /****************************************************************************** @@ -1067,11 +1065,17 @@ void setup(char *file) ******************************************************************************/ int main(int argc, char **argv) { - log("Initializing Tests...\n"); - // setup setup(argv[0]); + // header + log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); + + log("Initializing Tests...\n"); + + // install test databases + mysql_install_db(); + log("Starting Tests...\n"); log("\n"); diff --git a/netware/mysql_test_run.def b/netware/mysql_test_run.def index 7cca2e1dea6..b34f62a1f91 100644 --- a/netware/mysql_test_run.def +++ b/netware/mysql_test_run.def @@ -7,4 +7,5 @@ SCREENNAME "MySQL Test Run" COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Test Run" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqladmin.def b/netware/mysqladmin.def index 02ea42a2343..0ace36992b1 100644 --- a/netware/mysqladmin.def +++ b/netware/mysqladmin.def @@ -6,5 +6,6 @@ SCREENNAME "MySQL Admin" COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Admin Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqlbinlog.def b/netware/mysqlbinlog.def index b62ce4a578f..74d8e168b00 100644 --- a/netware/mysqlbinlog.def +++ b/netware/mysqlbinlog.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Binary Log Dump Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqlcheck.def b/netware/mysqlcheck.def index ae554bc6a06..6e476556ffe 100644 --- a/netware/mysqlcheck.def +++ b/netware/mysqlcheck.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Check Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqld.def b/netware/mysqld.def index d2ee41955ba..6856aefe56c 100644 --- a/netware/mysqld.def +++ b/netware/mysqld.def @@ -2,11 +2,11 @@ # MySQL Server #------------------------------------------------------------------------------ MODULE libc.nlm -XDCDATA mysqld.xdc COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Database Server" VERSION 4, 0 MULTIPLE STACKSIZE 65536 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c index 59c40eb61e6..845797e0022 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,11 +55,12 @@ FILE *log_fd = NULL; ******************************************************************************/ +void usage(void); void vlog(char *, va_list); void log(char *, ...); void start_defaults(int, char*[]); void finish_defaults(); -void read_defaults(arg_list); +void read_defaults(arg_list_t *); void parse_args(int, char*[]); void get_options(int, char*[]); void check_data_vol(); @@ -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) { @@ -208,9 +249,9 @@ void finish_defaults() Read the defaults. ******************************************************************************/ -void read_defaults(arg_list pal) +void read_defaults(arg_list_t *pal) { - arg_list al; + arg_list_t al; char defaults_file[PATH_MAX]; char mydefaults[PATH_MAX]; char line[PATH_MAX]; @@ -224,17 +265,17 @@ void read_defaults(arg_list pal) snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir); // args - init_args(al); - add_arg(al, mydefaults); - if (default_option[0]) add_arg(al, default_option); - add_arg(al, "mysqld"); - add_arg(al, "server"); - add_arg(al, "mysqld_safe"); - add_arg(al, "safe_mysqld"); + init_args(&al); + add_arg(&al, mydefaults); + if (default_option[0]) add_arg(&al, default_option); + add_arg(&al, "mysqld"); + add_arg(&al, "server"); + add_arg(&al, "mysqld_safe"); + add_arg(&al, "safe_mysqld"); - spawn(mydefaults, al, TRUE, NULL, defaults_file, NULL); + spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL); - free_args(al); + free_args(&al); // gather defaults if((fp = fopen(defaults_file, "r")) != NULL) @@ -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; @@ -357,17 +405,17 @@ void parse_args(int argc, char *argv[]) ******************************************************************************/ void get_options(int argc, char *argv[]) { - arg_list al; + arg_list_t al; // start defaults start_defaults(argc, argv); // default file arguments - init_args(al); - add_arg(al, "ignore"); - read_defaults(al); - parse_args(al->argc, al->argv); - free_args(al); + init_args(&al); + add_arg(&al, "ignore"); + read_defaults(&al); + parse_args(al.argc, al.argv); + free_args(&al); // command-line arguments parse_args(argc, argv); @@ -456,7 +504,7 @@ void check_setup() ******************************************************************************/ void check_tables() { - arg_list al; + arg_list_t al; char mycheck[PATH_MAX]; char table[PATH_MAX]; char db[PATH_MAX]; @@ -501,21 +549,21 @@ void check_tables() snprintf(mycheck, PATH_MAX, "%s/bin/myisamchk", basedir); // args - init_args(al); - add_arg(al, mycheck); - add_arg(al, "--silent"); - add_arg(al, "--force"); - add_arg(al, "--fast"); - add_arg(al, "--medium-check"); - add_arg(al, "-O"); - add_arg(al, "key_buffer=64M"); - add_arg(al, "-O"); - add_arg(al, "sort_buffer=64M"); - add_arg(al, table); + init_args(&al); + add_arg(&al, mycheck); + add_arg(&al, "--silent"); + add_arg(&al, "--force"); + add_arg(&al, "--fast"); + add_arg(&al, "--medium-check"); + add_arg(&al, "-O"); + add_arg(&al, "key_buffer=64M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=64M"); + add_arg(&al, table); - spawn(mycheck, al, TRUE, NULL, NULL, NULL); + spawn(mycheck, &al, TRUE, NULL, NULL, NULL); - free_args(al); + free_args(&al); } else if (strindex(table, ".ism")) { @@ -525,17 +573,17 @@ void check_tables() snprintf(mycheck, PATH_MAX, "%s/bin/isamchk", basedir); // args - init_args(al); - add_arg(al, mycheck); - add_arg(al, "--silent"); - add_arg(al, "--force"); - add_arg(al, "-O"); - add_arg(al, "sort_buffer=64M"); - add_arg(al, table); + init_args(&al); + add_arg(&al, mycheck); + add_arg(&al, "--silent"); + add_arg(&al, "--force"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=64M"); + add_arg(&al, table); - spawn(mycheck, al, TRUE, NULL, NULL, NULL); + spawn(mycheck, &al, TRUE, NULL, NULL, NULL); - free_args(al); + free_args(&al); } } } @@ -551,7 +599,7 @@ void check_tables() ******************************************************************************/ void mysql_start(int argc, char *argv[]) { - arg_list al; + arg_list_t al; int i, j, err; struct stat info; time_t cal; @@ -563,14 +611,16 @@ void mysql_start(int argc, char *argv[]) static char *private_options[] = { "--autoclose", + "--check-tables", + "--help", "--err-log=", "--mysqld=", NULL }; // args - init_args(al); - add_arg(al, "%s", mysqld); + init_args(&al); + add_arg(&al, "%s", mysqld); // parent args for(i = 1; i < argc; i++) @@ -587,14 +637,14 @@ void mysql_start(int argc, char *argv[]) } } - if (!skip) add_arg(al, "%s", argv[i]); + if (!skip) add_arg(&al, "%s", argv[i]); } // spawn do { // check the database tables - check_tables(); + if (checktables) check_tables(); // status time(&cal); @@ -603,7 +653,7 @@ void mysql_start(int argc, char *argv[]) log("mysql started : %s\n", stamp); // spawn mysqld - spawn(mysqld, al, TRUE, NULL, NULL, err_log); + spawn(mysqld, &al, TRUE, NULL, NULL, err_log); } while (!stat(pid_file, &info)); @@ -614,7 +664,7 @@ void mysql_start(int argc, char *argv[]) log("mysql stopped : %s\n\n", stamp); // free args - free_args(al); + free_args(&al); } /****************************************************************************** diff --git a/netware/mysqld_safe.def b/netware/mysqld_safe.def index 36a8c1cd89e..9080ef783c9 100644 --- a/netware/mysqld_safe.def +++ b/netware/mysqld_safe.def @@ -6,5 +6,7 @@ SCREENNAME "MySQL Database Server" COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Database Server Monitor" VERSION 4, 0 +MULTIPLE +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqldump.def b/netware/mysqldump.def index 763097a338c..f267b60ff77 100644 --- a/netware/mysqldump.def +++ b/netware/mysqldump.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Dump Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqlimport.def b/netware/mysqlimport.def index 990e704b73d..69e9f6eada5 100644 --- a/netware/mysqlimport.def +++ b/netware/mysqlimport.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Import Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqlshow.def b/netware/mysqlshow.def index 2849def8109..2b41386f643 100644 --- a/netware/mysqlshow.def +++ b/netware/mysqlshow.def @@ -6,5 +6,6 @@ SCREENNAME "MySQL Show" COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Show Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/mysqltest.def b/netware/mysqltest.def index c4fadf141c6..d98f6436a4a 100644 --- a/netware/mysqltest.def +++ b/netware/mysqltest.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Test Case Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/netware.patch b/netware/netware.patch deleted file mode 100644 index 2dcf36a2d9c..00000000000 --- a/netware/netware.patch +++ /dev/null @@ -1,4162 +0,0 @@ -*** mysql-4.0.7-gamma/ltmain.sh Fri Dec 20 07:25:10 2002 ---- mysql40/ltmain.sh Mon Jan 6 09:26:55 2003 -*************** -*** 49,62 **** - fi - - # The name of this program. -! progname=`$echo "$0" | sed 's%^.*/%%'` - modename="$progname" - - # Constants. - PROGRAM=ltmain.sh - PACKAGE=libtool -! VERSION=1.4.2 -! TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)" - - default_mode= - help="Try \`$progname --help' for more information." ---- 49,62 ---- - fi - - # The name of this program. -! progname=`$echo "$0" | ${SED} 's%^.*/%%'` - modename="$progname" - - # Constants. - PROGRAM=ltmain.sh - PACKAGE=libtool -! VERSION=1.4e -! TIMESTAMP=" (1.1125 2002/06/26 07:15:36)" - - default_mode= - help="Try \`$progname --help' for more information." -*************** -*** 67,76 **** - - # Sed substitution that helps us do robust quoting. It backslashifies - # metacharacters that are still active within double-quoted strings. -! Xsed='sed -e 1s/^X//' - sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -! SP2NL='tr \040 \012' -! NL2SP='tr \015\012 \040\040' - - # NLS nuisances. - # Only set LANG and LC_ALL to C if already set. ---- 67,85 ---- - - # Sed substitution that helps us do robust quoting. It backslashifies - # metacharacters that are still active within double-quoted strings. -! Xsed="${SED}"' -e 1s/^X//' - sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -! # test EBCDIC or ASCII -! case `echo A|od -x` in -! *[Cc]1*) # EBCDIC based system -! SP2NL="tr '\100' '\n'" -! NL2SP="tr '\r\n' '\100\100'" -! ;; -! *) # Assume ASCII based system -! SP2NL="tr '\040' '\012'" -! NL2SP="tr '\015\012' '\040\040'" -! ;; -! esac - - # NLS nuisances. - # Only set LANG and LC_ALL to C if already set. -*************** -*** 106,112 **** - o2lo="s/\\.${objext}\$/.lo/" - - # Parse our command line options once, thoroughly. -! while test $# -gt 0 - do - arg="$1" - shift ---- 115,121 ---- - o2lo="s/\\.${objext}\$/.lo/" - - # Parse our command line options once, thoroughly. -! while test "$#" -gt 0 - do - arg="$1" - shift -*************** -*** 122,127 **** ---- 131,163 ---- - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; -+ tag) -+ tagname="$arg" -+ -+ # Check whether tagname contains only valid characters -+ case $tagname in -+ *[!-_A-Za-z0-9,/]*) -+ echo "$progname: invalid tag name: $tagname" 1>&2 -+ exit 1 -+ ;; -+ esac -+ -+ case $tagname in -+ CC) -+ # Don't test for the "default" C tag, as we know, it's there, but -+ # not specially marked. -+ ;; -+ *) -+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then -+ taglist="$taglist $tagname" -+ # Evaluate the configuration. -+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" -+ else -+ echo "$progname: ignoring unknown tag $tagname" 1>&2 -+ fi -+ ;; -+ esac -+ ;; - *) - eval "$prev=\$arg" - ;; -*************** -*** 140,150 **** - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) -! sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 - exit 0 - ;; - ---- 176,195 ---- - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" -+ echo -+ echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001" -+ echo "Free Software Foundation, Inc." -+ echo "This is free software; see the source for copying conditions. There is NO" -+ echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit 0 - ;; - - --config) -! ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 -! # Now print the configurations for the tags. -! for tagname in $taglist; do -! ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" -! done - exit 0 - ;; - -*************** -*** 177,186 **** ---- 222,240 ---- - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - -+ --preserve-dup-deps) duplicate_deps="yes" ;; -+ - --quiet | --silent) - show=: - ;; - -+ --tag) prevopt="--tag" prev=tag ;; -+ --tag=*) -+ set tag "$optarg" ${1+"$@"} -+ shift -+ prev=tag -+ ;; -+ - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles -*************** -*** 270,317 **** - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= -! prev= -! lastarg= -! srcfile="$nonopt" - suppress_output= - -- user_target=no - for arg - do -! case $prev in -! "") ;; -! xcompiler) -! # Aesthetically quote the previous argument. -! prev= -! lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` -! -! case $arg in -! # Double-quote args containing other shell metacharacters. -! # Many Bourne shells cannot handle close brackets correctly -! # in scan sets, so we specify it separately. -! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -! arg="\"$arg\"" - ;; -- esac - -! # Add the previous argument to base_compile. -! if test -z "$base_compile"; then -! base_compile="$lastarg" -! else -! base_compile="$base_compile $lastarg" -! fi - continue - ;; -- esac - - # Accept any command-line options. - case $arg in - -o) -! if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi -! user_target=next - ;; - - -static) ---- 324,359 ---- - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= -! srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_output= -+ arg_mode=normal -+ libobj= - - for arg - do -! case "$arg_mode" in -! arg ) -! # do not "continue". Instead, add this to base_compile -! lastarg="$arg" -! arg_mode=normal - ;; - -! target ) -! libobj="$arg" -! arg_mode=normal - continue - ;; - -+ normal ) - # Accept any command-line options. - case $arg in - -o) -! if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi -! arg_mode=target -! continue - ;; - - -static) -*************** -*** 330,338 **** - ;; - - -Xcompiler) -! prev=xcompiler -! continue -! ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` ---- 372,380 ---- - ;; - - -Xcompiler) -! arg_mode=arg # the next one goes into the "base_compile" arg list -! continue # The current "srcfile" will either be retained or -! ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` -*************** -*** 355,427 **** - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. -- if test -z "$base_compile"; then -- base_compile="$lastarg" -- else - base_compile="$base_compile $lastarg" -- fi - continue - ;; -- esac -- -- case $user_target in -- next) -- # The next one is the -o target name -- user_target=yes -- continue -- ;; -- yes) -- # We got the output file -- user_target=set -- libobj="$arg" -- continue -- ;; -- esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. -- -- # Backslashify any backslashes, double quotes, and dollar signs. -- # These are the only characters that are still specially -- # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. -- case $lastarg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - -- # Add the previous argument to base_compile. -- if test -z "$base_compile"; then -- base_compile="$lastarg" -- else - base_compile="$base_compile $lastarg" -! fi -! done - -! case $user_target in -! set) -! ;; -! no) -! # Get the name of the library object. -! libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; -! *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo -! xform='[cCFSfmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; ---- 397,450 ---- - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - -+ * ) - # Accept the current argument as the source file. -+ # The previous "srcfile" becomes the current argument. -+ # - lastarg="$srcfile" - srcfile="$arg" -+ ;; -+ esac # case $arg -+ ;; -+ esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - -+ case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" -! done # for arg - -! case $arg_mode in -! arg) -! $echo "$modename: you must specify an argument for -Xcompile" -! exit 1 - ;; -! target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; -+ *) -+ # Get the name of the library object. -+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` -+ ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo -! xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; -*************** -*** 429,438 **** ---- 452,464 ---- - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; -+ *.ii) xform=ii ;; -+ *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; -+ *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` -*************** -*** 445,450 **** ---- 471,526 ---- - ;; - esac - -+ # Infer tagged configuration to use if any are available and -+ # if one wasn't chosen via the "--tag" command line option. -+ # Only attempt this if the compiler in the base compile -+ # command doesn't match the default compiler. -+ if test -n "$available_tags" && test -z "$tagname"; then -+ case $base_compile in -+ # Blanks in the command may have been stripped by the calling shell, -+ # but not from the CC environment variable when ltconfig was run. -+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; -+ # Blanks at the start of $base_compile will cause this to fail -+ # if we don't check for them as well. -+ *) -+ for z in $available_tags; do -+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then -+ # Evaluate the configuration. -+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" -+ case "$base_compile " in -+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) -+ # The compiler in the base compile command matches -+ # the one in the tagged configuration. -+ # Assume this is the tagged configuration we want. -+ tagname=$z -+ break -+ ;; -+ esac -+ fi -+ done -+ # If $tagname still isn't set, then no tagged configuration -+ # was found and let the user know that the "--tag" command -+ # line option must be used. -+ if test -z "$tagname"; then -+ echo "$modename: unable to infer tagged configuration" -+ echo "$modename: specify a tag with \`--tag'" 1>&2 -+ exit 1 -+ # else -+ # echo "$modename: using $tagname tagged configuration" -+ fi -+ ;; -+ esac -+ fi -+ -+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` -+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$obj"; then -+ xdir= -+ else -+ xdir=$xdir/ -+ fi -+ lobj=${xdir}$objdir/$objname -+ - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 -*************** -*** 453,461 **** - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then -! removelist="$obj $libobj" - else -! removelist="$libobj" - fi - - $run $rm $removelist ---- 529,537 ---- - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then -! removelist="$obj $lobj $libobj ${libobj}T" - else -! removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist -*************** -*** 467,473 **** - pic_mode=default - ;; - esac -! if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi ---- 543,549 ---- - pic_mode=default - ;; - esac -! if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi -*************** -*** 480,485 **** ---- 556,562 ---- - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else -+ output_obj= - need_locks=no - lockfile= - fi -*************** -*** 514,562 **** - eval srcfile=\"$fix_srcfile_path\" - fi - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then -! # All platforms use -DPIC, to notify preprocessed assembler code. -! command="$base_compile $srcfile $pic_flag -DPIC" - else - # Don't build PIC code - command="$base_compile $srcfile" - fi -- if test "$build_old_libs" = yes; then -- lo_libobj="$libobj" -- dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` -- if test "X$dir" = "X$libobj"; then -- dir="$objdir" -- else -- dir="$dir/$objdir" -- fi -- libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - -! if test -d "$dir"; then -! $show "$rm $libobj" -! $run $rm $libobj -! else -! $show "$mkdir $dir" -! $run $mkdir $dir - status=$? -! if test $status -ne 0 && test ! -d $dir; then - exit $status - fi - fi -! fi -! if test "$compiler_o_lo" = yes; then -! output_obj="$libobj" -! command="$command -o $output_obj" -! elif test "$compiler_c_o" = yes; then -! output_obj="$obj" -! command="$command -o $output_obj" - fi - -! $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else ---- 591,638 ---- - eval srcfile=\"$fix_srcfile_path\" - fi - -+ $run $rm "$libobj" "${libobj}T" -+ -+ # Create a libtool object file (analogous to a ".la" file), -+ # but don't create it if we're doing a dry run. -+ test -z "$run" && cat > ${libobj}T </dev/null`" != x"$srcfile"; then - echo "\ - *** ERROR, $lockfile contains: - `cat $lockfile 2>/dev/null` ---- 641,647 ---- - fi - - if test "$need_locks" = warn && -! test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - echo "\ - *** ERROR, $lockfile contains: - `cat $lockfile 2>/dev/null` -*************** -*** 585,593 **** - fi - - # Just move the object if needed, then go on to compile the next one -! if test x"$output_obj" != x"$libobj"; then -! $show "$mv $output_obj $libobj" -! if $run $mv $output_obj $libobj; then : - else - error=$? - $run $rm $removelist ---- 661,669 ---- - fi - - # Just move the object if needed, then go on to compile the next one -! if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then -! $show "$mv $output_obj $lobj" -! if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist -*************** -*** 595,642 **** - fi - fi - -! # If we have no pic_flag, then copy the object into place and finish. -! if (test -z "$pic_flag" || test "$pic_mode" != default) && -! test "$build_old_libs" = yes; then -! # Rename the .lo from within objdir to obj -! if test -f $obj; then -! $show $rm $obj -! $run $rm $obj -! fi - -! $show "$mv $libobj $obj" -! if $run $mv $libobj $obj; then : -! else -! error=$? -! $run $rm $removelist -! exit $error -! fi -! -! xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` -! if test "X$xdir" = "X$obj"; then -! xdir="." -! else -! xdir="$xdir" -! fi -! baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` -! libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` -! # Now arrange that obj and lo_libobj become the same file -! $show "(cd $xdir && $LN_S $baseobj $libobj)" -! if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then -! # Unlock the critical section if it was locked -! if test "$need_locks" != no; then -! $run $rm "$lockfile" -! fi -! exit 0 -! else -! error=$? -! $run $rm $removelist -! exit $error -! fi -! fi - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - fi - - # Only build a position-dependent object if we build old libraries. ---- 671,691 ---- - fi - fi - -! # Append the name of the PIC object to the libtool object file. -! test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != x"$srcfile"; then - echo "\ - *** ERROR, $lockfile contains: - `cat $lockfile 2>/dev/null` ---- 711,717 ---- - fi - - if test "$need_locks" = warn && -! test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - echo "\ - *** ERROR, $lockfile contains: - `cat $lockfile 2>/dev/null` -*************** -*** 684,690 **** - fi - - # Just move the object if needed -! if test x"$output_obj" != x"$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else ---- 731,737 ---- - fi - - # Just move the object if needed -! if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else -*************** -*** 694,716 **** - fi - fi - -! # Create an invalid libtool object if no PIC, so that we do not -! # accidentally link it into a program. -! if test "$build_libtool_libs" != yes; then -! $show "echo timestamp > $libobj" -! $run eval "echo timestamp > \$libobj" || exit $? -! else -! # Move the .lo from within objdir -! $show "$mv $libobj $lo_libobj" -! if $run $mv $libobj $lo_libobj; then : - else -! error=$? -! $run $rm $removelist -! exit $error -! fi -! fi - fi - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" ---- 741,765 ---- - fi - fi - -! # Append the name of the non-PIC object the libtool object file. -! # Only append if the libtool object file exists. -! test -z "$run" && cat >> ${libobj}T <> ${libobj}T <\?\'\ \ ]*|*]*|"") ---- 863,871 ---- - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. -! while test "$#" -gt 0; do - arg="$1" -+ base_compile="$base_compile $arg" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") -*************** -*** 892,897 **** ---- 944,1056 ---- - prev= - continue - ;; -+ objectlist) -+ if test -f "$arg"; then -+ save_arg=$arg -+ moreargs= -+ for fil in `cat $save_arg` -+ do -+ # moreargs="$moreargs $fil" -+ arg=$fil -+ # A libtool-controlled object. -+ -+ # Check to see that this really is a libtool object. -+ if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -+ pic_object= -+ non_pic_object= -+ -+ # Read the .lo file -+ # If there is no directory component, then add one. -+ case $arg in -+ */* | *\\*) . $arg ;; -+ *) . ./$arg ;; -+ esac -+ -+ if test -z "$pic_object" || \ -+ test -z "$non_pic_object" || -+ test "$pic_object" = none && \ -+ test "$non_pic_object" = none; then -+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2 -+ exit 1 -+ fi -+ -+ # Extract subdirectory from the argument. -+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$arg"; then -+ xdir= -+ else -+ xdir="$xdir/" -+ fi -+ -+ if test "$pic_object" != none; then -+ # Prepend the subdirectory the object is found in. -+ pic_object="$xdir$pic_object" -+ -+ if test "$prev" = dlfiles; then -+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then -+ dlfiles="$dlfiles $pic_object" -+ prev= -+ continue -+ else -+ # If libtool objects are unsupported, then we need to preload. -+ prev=dlprefiles -+ fi -+ fi -+ -+ # CHECK ME: I think I busted this. -Ossama -+ if test "$prev" = dlprefiles; then -+ # Preload the old-style object. -+ dlprefiles="$dlprefiles $pic_object" -+ prev= -+ fi -+ -+ # A PIC object. -+ libobjs="$libobjs $pic_object" -+ arg="$pic_object" -+ fi -+ -+ # Non-PIC object. -+ if test "$non_pic_object" != none; then -+ # Prepend the subdirectory the object is found in. -+ non_pic_object="$xdir$non_pic_object" -+ -+ # A standard non-PIC object -+ non_pic_objects="$non_pic_objects $non_pic_object" -+ if test -z "$pic_object" || test "$pic_object" = none ; then -+ arg="$non_pic_object" -+ fi -+ fi -+ else -+ # Only an error if not doing a dry-run. -+ if test -z "$run"; then -+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 -+ exit 1 -+ else -+ # Dry-run case. -+ -+ # Extract subdirectory from the argument. -+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -+ if test "X$xdir" = "X$arg"; then -+ xdir= -+ else -+ xdir="$xdir/" -+ fi -+ -+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` -+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` -+ libobjs="$libobjs $pic_object" -+ non_pic_objects="$non_pic_objects $non_pic_object" -+ fi -+ fi -+ done -+ else -+ $echo "$modename: link input file \`$save_arg' does not exist" -+ exit 1 -+ fi -+ arg=$save_arg -+ prev= -+ continue -+ ;; - rpath | xrpath) - # We need an absolute path. - case $arg in -*************** -*** 936,945 **** - continue - ;; - esac -! fi # test -n $prev - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then ---- 1095,1122 ---- - continue - ;; - esac -! fi # test -n "$prev" - - prevarg="$arg" - -+ # Pass Metrowerks x86 NLM linker flags to linker. -+ case "$LD" in -+ mwldnlm) -+ case "$arg" in -+ -check | -commandfile | -entry | -exit | -flags | -map) -+ linker_flags="$linker_flags $qarg" -+ prev=xlinker -+ ;; -+ -nocheck | -zerobss | -nozerobss) -+ linker_flags="$linker_flags $qarg" -+ ;; -+ -g) -+ # If -g then include symbols for NetWare internal debugger -+ linker_flags="$linker_flags -sym internal" -+ ;; -+ esac -+ ;; -+ esac - case $arg in - -all-static) - if test -n "$link_static_flag"; then -*************** -*** 992,998 **** - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in -! no/*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; ---- 1169,1175 ---- - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in -! no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; -*************** -*** 1043,1056 **** - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; -! *-*-openbsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in -! *-*-openbsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; ---- 1220,1237 ---- - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; -! *-*-openbsd* | *-*-freebsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; -+ *-*-rhapsody* | *-*-darwin1.[012]) -+ # Rhapsody C and math libraries are in the System framework -+ deplibs="$deplibs -framework System" -+ continue - esac - elif test "X$arg" = "X-lc_r"; then - case $host in -! *-*-openbsd* | *-*-freebsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; -*************** -*** 1089,1094 **** ---- 1270,1280 ---- - continue - ;; - -+ -objectlist) -+ prev=objectlist -+ continue -+ ;; -+ - -o) prev=output ;; - - -release) -*************** -*** 1201,1212 **** - esac - ;; - -! *.lo | *.$objext) -! # A library or standard object. - if test "$prev" = dlfiles; then -- # This file was specified with -dlopen. - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then -! dlfiles="$dlfiles $arg" - prev= - continue - else ---- 1387,1435 ---- - esac - ;; - -! *.$objext) -! # A standard object. -! objs="$objs $arg" -! ;; -! -! *.lo) -! # A libtool-controlled object. -! -! # Check to see that this really is a libtool object. -! if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -! pic_object= -! non_pic_object= -! -! # Read the .lo file -! # If there is no directory component, then add one. -! case $arg in -! */* | *\\*) . $arg ;; -! *) . ./$arg ;; -! esac -! -! if test -z "$pic_object" || \ -! test -z "$non_pic_object" || -! test "$pic_object" = none && \ -! test "$non_pic_object" = none; then -! $echo "$modename: cannot find name of object for \`$arg'" 1>&2 -! exit 1 -! fi -! -! # Extract subdirectory from the argument. -! xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -! if test "X$xdir" = "X$arg"; then -! xdir= -! else -! xdir="$xdir/" -! fi -! -! if test "$pic_object" != none; then -! # Prepend the subdirectory the object is found in. -! pic_object="$xdir$pic_object" -! - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then -! dlfiles="$dlfiles $pic_object" - prev= - continue - else -*************** -*** 1215,1229 **** - fi - fi - - if test "$prev" = dlprefiles; then - # Preload the old-style object. -! dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= - else -! case $arg in -! *.lo) libobjs="$libobjs $arg" ;; -! *) objs="$objs $arg" ;; -! esac - fi - ;; - ---- 1438,1487 ---- - fi - fi - -+ # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. -! dlprefiles="$dlprefiles $pic_object" - prev= -+ fi -+ -+ # A PIC object. -+ libobjs="$libobjs $pic_object" -+ arg="$pic_object" -+ fi -+ -+ # Non-PIC object. -+ if test "$non_pic_object" != none; then -+ # Prepend the subdirectory the object is found in. -+ non_pic_object="$xdir$non_pic_object" -+ -+ # A standard non-PIC object -+ non_pic_objects="$non_pic_objects $non_pic_object" -+ if test -z "$pic_object" || test "$pic_object" = none ; then -+ arg="$non_pic_object" -+ fi -+ fi - else -! # Only an error if not doing a dry-run. -! if test -z "$run"; then -! $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 -! exit 1 -! else -! # Dry-run case. -! -! # Extract subdirectory from the argument. -! xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` -! if test "X$xdir" = "X$arg"; then -! xdir= -! else -! xdir="$xdir/" -! fi -! -! pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` -! non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` -! libobjs="$libobjs $pic_object" -! non_pic_objects="$non_pic_objects $non_pic_object" -! fi - fi - ;; - -*************** -*** 1277,1288 **** ---- 1535,1617 ---- - exit 1 - fi - -+ # Special handling for Metrowerks compiler for NetWare -+ case "$LD" in -+ mwldnlm) -+ # If building debug (-g) add internal debug symbols. -+ compile_command=`echo $compile_command | ${SED} -e 's/ -g / -g -sym internal /'` -+ -+ # When using the Metrowerks linker for NetWare, if there is a -+ # .def or .exp file with the same filename as the $output file, -+ # add it as a -commandfile to $compile_command and $linker_flags -+ # (if no -commandfile yet) -+ base=`echo $output | ${SED} 's,\(.*\)\..*$,\1,'` -+ cmd_file= -+ for ext in def exp; do -+ if test -f "$base.$ext"; then -+ cmd_file="$base.$ext" -+ break -+ fi -+ done -+ if test -n "$cmd_file"; then -+ if ! ( expr "$compile_command" : ".*-commandfile.*" > /dev/null ); then -+ compile_command="$compile_command -commandfile $cmd_file" -+ fi -+ if ! ( expr "$linker_flags" : ".*-commandfile.*" > /dev/null ); then -+ linker_flags="$linker_flags -commandfile $cmd_file" -+ fi -+ fi -+ ;; -+ esac -+ -+ # Infer tagged configuration to use if any are available and -+ # if one wasn't chosen via the "--tag" command line option. -+ # Only attempt this if the compiler in the base link -+ # command doesn't match the default compiler. -+ if test -n "$available_tags" && test -z "$tagname"; then -+ case $base_compile in -+ # Blanks in the command may have been stripped by the calling shell, -+ # but not from the CC environment variable when ltconfig was run. -+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; -+ # Blanks at the start of $base_compile will cause this to fail -+ # if we don't check for them as well. -+ *) -+ for z in $available_tags; do -+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then -+ # Evaluate the configuration. -+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" -+ case $base_compile in -+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) -+ # The compiler in $compile_command matches -+ # the one in the tagged configuration. -+ # Assume this is the tagged configuration we want. -+ tagname=$z -+ break -+ ;; -+ esac -+ fi -+ done -+ # If $tagname still isn't set, then no tagged configuration -+ # was found and let the user know that the "--tag" command -+ # line option must be used. -+ if test -z "$tagname"; then -+ echo "$modename: unable to infer tagged configuration" -+ echo "$modename: specify a tag with \`--tag'" 1>&2 -+ exit 1 -+ # else -+ # echo "$modename: using $tagname tagged configuration" -+ fi -+ ;; -+ esac -+ fi -+ - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - -+ oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" -*************** -*** 1303,1313 **** - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. -! if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? -! if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi ---- 1632,1642 ---- - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. -! if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? -! if test "$status" -ne 0 && test ! -d "$output_objdir"; then - exit $status - fi - fi -*************** -*** 1325,1340 **** ---- 1654,1713 ---- - *) linkmode=prog ;; # Anything else should be a program. - esac - -+ case $host in -+ *cygwin*) -+ # This is a hack, but we run into problems on cygwin. -+ # libgcc.a depends on libcygwin, but gcc puts -lgcc onto -+ # the link line twice: once before the "normal" libs -+ # (-lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32) and -+ # once AFTER those. However, the "eliminate dup deps" -+ # proceedure keeps only the LAST duplicate -- thus -+ # messing up the order, since after dup elimination -+ # -lgcc comes AFTER -lcygwin. In normal C operation, -+ # you don't notice the problem, because -lgcc isn't -+ # really used. However, now that C++ libraries are -+ # libtool-able, you DO see the problem. So, it must -+ # be fixed. We could always force "--preserve-dup-deps" -+ # but that could lead to other problems. So, on cygwin, -+ # always preserve dups of -lgcc...but only -lgcc. That -+ # way, the dependency order won't get corrupted. -+ specialdeplibs="-lgcc" -+ ;; -+ *) - specialdeplibs= -+ ;; -+ esac -+ - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do -+ if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac -+ fi - libs="$libs $deplib" - done -+ -+ if test "$linkmode" = lib; then -+ libs="$predeps $libs $compiler_lib_search_path $postdeps" -+ -+ # Compute libraries that are listed more than once in $predeps -+ # $postdeps and mark them as special (i.e., whose duplicates are -+ # not to be eliminated). -+ pre_post_deps= -+ if test "X$duplicate_deps" = "Xyes" ; then -+ for pre_post_dep in $predeps $postdeps; do -+ case "$pre_post_deps " in -+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; -+ esac -+ pre_post_deps="$pre_post_deps $pre_post_dep" -+ done -+ fi -+ pre_post_deps= -+ fi -+ - deplibs= - newdependency_libs= - newlib_search_path= -*************** -*** 1366,1393 **** - ;; - esac - for pass in $passes; do -! if test $linkmode = prog; then -! # Determine which files to process -! case $pass in -! dlopen) -! libs="$dlfiles" -! save_deplibs="$deplibs" # Collect dlpreopened libraries - deplibs= -! ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -l*) -! if test $linkmode = oldlib && test $linkmode = obj; then -! $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 - continue - fi -! if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi ---- 1739,1771 ---- - ;; - esac - for pass in $passes; do -! if test "$linkmode,$pass" = "lib,link" || -! test "$linkmode,$pass" = "prog,scan"; then -! libs="$deplibs" - deplibs= -! fi -! if test "$linkmode" = prog; then -! case $pass in -! dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi -+ if test "$pass" = dlopen; then -+ # Collect dlpreopened libraries -+ save_deplibs="$deplibs" -+ deplibs= -+ fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -l*) -! if test "$linkmode" != lib && test "$linkmode" != prog; then -! $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi -! if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi -*************** -*** 1407,1413 **** - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" -! test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi ---- 1785,1791 ---- - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" -! test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi -*************** -*** 1416,1431 **** - case $linkmode in - lib) - deplibs="$deplib $deplibs" -! test $pass = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) -! if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi -! if test $pass = scan; then - deplibs="$deplib $deplibs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - else ---- 1794,1809 ---- - case $linkmode in - lib) - deplibs="$deplib $deplibs" -! test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) -! if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi -! if test "$pass" = scan; then - deplibs="$deplib $deplibs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - else -*************** -*** 1434,1446 **** - fi - ;; - *) -! $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) -! if test $pass = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in ---- 1812,1824 ---- - fi - ;; - *) -! $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) -! if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in -*************** -*** 1453,1459 **** - ;; - *.la) lib="$deplib" ;; - *.$libext) -! if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi ---- 1831,1837 ---- - ;; - *.la) lib="$deplib" ;; - *.$libext) -! if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi -*************** -*** 1461,1470 **** - lib) - if test "$deplibs_check_method" != pass_all; then - echo -! echo "*** Warning: This library needs some functionality provided by $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have." - else - echo - echo "*** Warning: Linking the shared library $output against the" ---- 1839,1850 ---- - lib) - if test "$deplibs_check_method" != pass_all; then - echo -! echo "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have" -! echo "*** because the file extensions .$libext of this argument makes me believe" -! echo "*** that it is just a static archive that I should not used here." - else - echo - echo "*** Warning: Linking the shared library $output against the" -*************** -*** 1474,1480 **** - continue - ;; - prog) -! if test $pass != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" ---- 1854,1860 ---- - continue - ;; - prog) -! if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" -*************** -*** 1485,1491 **** - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) -! if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" ---- 1865,1874 ---- - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) -! if test "$pass" = conv; then -! deplibs="$deplib $deplibs" -! elif test "$linkmode" = prog; then -! if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" -*************** -*** 1494,1499 **** ---- 1877,1883 ---- - else - newdlfiles="$newdlfiles $deplib" - fi -+ fi - continue - ;; - %DEPLIBS%) -*************** -*** 1501,1514 **** - continue - ;; - esac # case $deplib -! if test $found = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit 1 - fi - - # Check to see that this really is a libtool archive. -! if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 ---- 1885,1898 ---- - continue - ;; - esac # case $deplib -! if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit 1 - fi - - # Check to see that this really is a libtool archive. -! if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 -*************** -*** 1535,1547 **** - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || -! { test $linkmode = oldlib && test $linkmode = obj; }; then -! # Add dl[pre]opened files of deplib - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - -! if test $pass = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then ---- 1919,1930 ---- - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || -! { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - -! if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then -*************** -*** 1555,1566 **** - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done -! elif test $linkmode != prog && test $linkmode != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit 1 - fi ---- 1938,1951 ---- - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" -+ if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac -+ fi - tmp_libs="$tmp_libs $deplib" - done -! elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit 1 - fi -*************** -*** 1578,1592 **** - fi - - # This library was specified with -dlopen. -! if test $pass = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking -! # statically, we need to preload. -! dlprefiles="$dlprefiles $lib" - else - newdlfiles="$newdlfiles $lib" - fi ---- 1963,1979 ---- - fi - - # This library was specified with -dlopen. -! if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking -! # statically, we need to preload. We also need to preload any -! # dependent libraries so libltdl's deplib preloader doesn't -! # bomb out in the load deplibs phase. -! dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi -*************** -*** 1627,1633 **** - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. -! if test $pass = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit 1 ---- 2014,2020 ---- - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. -! if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit 1 -*************** -*** 1646,1663 **** - - if test -z "$libdir"; then - # Link the convenience library -! if test $linkmode = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else -! deplibs="$lib $deplibs" - fi - continue - fi - -! if test $linkmode = prog && test $pass != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - ---- 2033,2050 ---- - - if test -z "$libdir"; then - # Link the convenience library -! if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else -! deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - -! if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - -*************** -*** 1673,1700 **** - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? -! if test $linkalldeplibs = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - -! link_static=no # Whether the deplib will be linked statically - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then -! # Link against this shared library - -- if test "$linkmode,$pass" = "prog,link" || -- { test $linkmode = lib && test $hardcode_into_libs = yes; }; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. ---- 2060,2095 ---- - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? -! if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi -+ if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac -+ fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - -! if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then -! # We need to hardcode the library path -! if test -n "$shlibpath_var"; then -! # Make sure the rpath contains only unique directories. -! case "$temp_rpath " in -! *" $dir "*) ;; -! *" $absdir "*) ;; -! *) temp_rpath="$temp_rpath $dir" ;; -! esac -! fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. -*************** -*** 1716,1732 **** - esac - ;; - esac -- if test $linkmode = prog; then -- # We need to hardcode the library path -- if test -n "$shlibpath_var"; then -- # Make sure the rpath contains only unique directories. -- case "$temp_rpath " in -- *" $dir "*) ;; -- *" $absdir "*) ;; -- *) temp_rpath="$temp_rpath $dir" ;; -- esac -- fi -- fi - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && ---- 2111,2116 ---- -*************** -*** 1736,1746 **** ---- 2120,2159 ---- - # We only need to search for static libraries - continue - fi -+ fi - -+ link_static=no # Whether the deplib will be linked statically -+ if test -n "$library_names" && -+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi -+ # This is a shared library -+ if test "$linkmode" = lib && -+ test "$hardcode_into_libs" = yes; then -+ # Hardcode the library path. -+ # Skip directories that are in the system default run-time -+ # search path. -+ case " $sys_lib_dlsearch_path " in -+ *" $absdir "*) ;; -+ *) -+ case "$compile_rpath " in -+ *" $absdir "*) ;; -+ *) compile_rpath="$compile_rpath $absdir" -+ esac -+ ;; -+ esac -+ case " $sys_lib_dlsearch_path " in -+ *" $libdir "*) ;; -+ *) -+ case "$finalize_rpath " in -+ *" $libdir "*) ;; -+ *) finalize_rpath="$finalize_rpath $libdir" -+ esac -+ ;; -+ esac -+ fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname -*************** -*** 1766,1773 **** - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" -! soname=`echo $soroot | sed -e 's/^.*\///'` -! newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : ---- 2179,2186 ---- - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" -! soname=`echo $soroot | ${SED} -e 's/^.*\///'` -! newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : -*************** -*** 1798,1806 **** - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib -! fi # test -n $old_archive_from_expsyms_cmds - -! if test $linkmode = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= ---- 2211,2219 ---- - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib -! fi # test -n "$old_archive_from_expsyms_cmds" - -! if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= -*************** -*** 1808,1813 **** ---- 2221,2229 ---- - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then -+ case $host in -+ *-*-sco3.2v5* ) add_dir="-L$dir" ;; -+ esac - add="$dir/$linklib" - elif test "$hardcode_minus_L" = no; then - case $host in -*************** -*** 1849,1855 **** - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi -! if test $linkmode = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else ---- 2265,2271 ---- - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi -! if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else -*************** -*** 1866,1872 **** - fi - fi - -! if test $linkmode = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= ---- 2282,2288 ---- - fi - fi - -! if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= -*************** -*** 1884,1898 **** - add="-l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. -- if test "X$installed" = Xyes; then - add_dir="-L$libdir" -- else -- add_dir="-L$DESTDIR$libdir" -- fi - add="-l$name" - fi - -! if test $linkmode = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else ---- 2300,2310 ---- - add="-l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - add="-l$name" - fi - -! if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else -*************** -*** 1900,1915 **** - test -n "$add" && deplibs="$add $deplibs" - fi - fi -! elif test $linkmode = prog; then -! if test "$alldeplibs" = yes && -! { test "$deplibs_check_method" = pass_all || -! { test "$build_libtool_libs" = yes && -! test -n "$library_names"; }; }; then -! # We only need to search for static libraries -! continue -! fi -! -! # Try to link the static library - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. ---- 2312,2318 ---- - test -n "$add" && deplibs="$add $deplibs" - fi - fi -! elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. -*************** -*** 1930,1942 **** - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo -! echo "*** Warning: This library needs some functionality provided by $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then -! echo "*** Therefore, libtool will create a static module, that should work " -! echo "*** as long as the dlopening application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" ---- 2333,2346 ---- - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo -! echo "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then -! echo "*** But as you try to build a module library, libtool will still create " -! echo "*** a static module, that should work as long as the dlopening application" -! echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" -*************** -*** 1959,1968 **** - fi - fi # link shared/static library? - -! if test $linkmode = lib; then - if test -n "$dependency_libs" && -! { test $hardcode_into_libs != yes || test $build_old_libs = yes || -! test $link_static = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do ---- 2363,2372 ---- - fi - fi # link shared/static library? - -! if test "$linkmode" = lib; then - if test -n "$dependency_libs" && -! { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || -! test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do -*************** -*** 1985,1997 **** - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done - -! if test $link_all_deplibs != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in ---- 2389,2403 ---- - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" -+ if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac -+ fi - tmp_libs="$tmp_libs $deplib" - done - -! if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in -*************** -*** 2013,2019 **** - if grep "^installed=no" $deplib > /dev/null; then - path="-L$absdir/$objdir" - else -! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 ---- 2419,2425 ---- - if grep "^installed=no" $deplib > /dev/null; then - path="-L$absdir/$objdir" - else -! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 -*************** -*** 2034,2048 **** - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs -! if test $pass = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi -! if test $pass != dlopen; then -! test $pass != scan && dependency_libs="$newdependency_libs" -! if test $pass != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do ---- 2440,2454 ---- - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs -! dependency_libs="$newdependency_libs" -! if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi -! if test "$pass" != dlopen; then -! if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do -*************** -*** 2064,2072 **** ---- 2470,2498 ---- - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do -+ # FIXME: Pedantically, this is the right thing to do, so -+ # that some nasty dependency loop isn't accidentally -+ # broken: -+ #new_libs="$deplib $new_libs" -+ # Pragmatically, this seems to cause very few problems in -+ # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - *) -+ # And here is the reason: when a library appears more -+ # than once as an explicit dependence of a library, or -+ # is implicitly linked in more than once by the -+ # compiler, it is considered special, and multiple -+ # occurrences thereof are not removed. Compare this -+ # with having the same library being listed as a -+ # dependency of multiple other libraries: in this case, -+ # we know (pedantically, we assume) the library does not -+ # need to be listed more than once, so we keep only the -+ # last copy. This is not always right, but it is rare -+ # enough that we require users that really mean to play -+ # such unportable linking tricks to link the library -+ # using -Wl,-lname, so that libtool does not consider it -+ # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) -*************** -*** 2094,2112 **** - eval $var=\"$tmp_libs\" - done # for var - fi -- if test "$pass" = "conv" && -- { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then -- libs="$deplibs" # reset libs -- deplibs= -- fi - done # for pass -! if test $linkmode = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi ---- 2520,2537 ---- - eval $var=\"$tmp_libs\" - done # for var - fi - done # for pass -! if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) -+ if test -n "$deplibs"; then -+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 -+ fi -+ - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi -*************** -*** 2177,2183 **** - fi - - set dummy $rpath -! if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" ---- 2602,2608 ---- - fi - - set dummy $rpath -! if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" -*************** -*** 2186,2192 **** - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. -! libext=al - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes ---- 2611,2619 ---- - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. -! # Some compilers have problems with a `.al' extension so -! # convenience libraries should have the same extension an -! # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes -*************** -*** 2244,2250 **** - ;; - esac - -! if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 ---- 2671,2677 ---- - ;; - esac - -! if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 -*************** -*** 2277,2292 **** - versuffix=".$current"; - ;; - -! irix) - major=`expr $current - $age + 1` -! verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision -! while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` -! verstring="sgi$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. ---- 2704,2724 ---- - versuffix=".$current"; - ;; - -! irix | nonstopux) - major=`expr $current - $age + 1` -! -! case $version_type in -! nonstopux) verstring_prefix=nonstopux ;; -! *) verstring_prefix=sgi ;; -! esac -! verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision -! while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` -! verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. -*************** -*** 2306,2312 **** - - # Add in all the interfaces that we are compatible with. - loop=$age -! while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" ---- 2738,2744 ---- - - # Add in all the interfaces that we are compatible with. - loop=$age -! while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" -*************** -*** 2338,2349 **** - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= -- verstring="0.0" - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely -! verstring="" - ;; - *) - verstring="0.0" ---- 2770,2780 ---- - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely -! verstring= - ;; - *) - verstring="0.0" -*************** -*** 2377,2385 **** - fi - - if test "$mode" != relink; then -! # Remove our outputs. -! $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" -! $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - fi - - # Now set the variables for building old libraries. ---- 2808,2831 ---- - fi - - if test "$mode" != relink; then -! # Remove our outputs, but don't remove object files since they -! # may have been created when compiling PIC objects. -! removelist= -! tempremovelist=`echo "$output_objdir/*"` -! for p in $tempremovelist; do -! case $p in -! *.$objext) -! ;; -! $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) -! removelist="$removelist $p" -! ;; -! *) ;; -! esac -! done -! if test -n "$removelist"; then -! $show "${rm}r $removelist" -! $run ${rm}r $removelist -! fi - fi - - # Now set the variables for building old libraries. -*************** -*** 2392,2400 **** - - # Eliminate all temporary directories. - for path in $notinst_path; do -! lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` -! deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` -! dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then ---- 2838,2846 ---- - - # Eliminate all temporary directories. - for path in $notinst_path; do -! lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'` -! deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'` -! dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then -*************** -*** 2407,2413 **** - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done -! if test $hardcode_into_libs != yes || test $build_old_libs = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi ---- 2853,2859 ---- - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done -! if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi -*************** -*** 2445,2456 **** - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; -! *-*-openbsd*) - # Do not include libc due to us having libc/libc_r. - ;; - *) - # Add libc to deplibs on all other systems if necessary. -! if test $build_libtool_need_lc = "yes"; then - deplibs="$deplibs -lc" - fi - ;; ---- 2891,2903 ---- - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; -! *-*-openbsd* | *-*-freebsd*) - # Do not include libc due to us having libc/libc_r. -+ test "X$arg" = "X-lc" && continue - ;; - *) - # Add libc to deplibs on all other systems if necessary. -! if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; -*************** -*** 2490,2502 **** - int main() { return 0; } - EOF - $rm conftest -! $CC -o conftest conftest.c $deplibs -! if test $? -eq 0 ; then - ldd_output=`ldd conftest` - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. -! if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches ---- 2937,2949 ---- - int main() { return 0; } - EOF - $rm conftest -! $LTCC -o conftest conftest.c $deplibs -! if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. -! if test "$name" != "" && test "$name" -ne "0"; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches -*************** -*** 2506,2531 **** - else - droppeddeps=yes - echo -! echo "*** Warning: This library needs some functionality provided by $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else -! # Error occured in the first compile. Let's try to salvage the situation: -! # Compile a seperate program for each library. - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. -! if test -n "$name" && test "$name" != "0"; then - $rm conftest -! $CC -o conftest conftest.c $i - # Did it work? -! if test $? -eq 0 ; then - ldd_output=`ldd conftest` - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` ---- 2953,2980 ---- - else - droppeddeps=yes - echo -! echo "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which I believe you do not have" -! echo "*** because a test_compile did reveal that the linker did not use it for" -! echo "*** its dynamic dependency list that programs get resolved with at runtime." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else -! # Error occured in the first compile. Let's try to salvage -! # the situation: Compile a separate program for each library. - for i in $deplibs; do - name="`expr $i : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. -! if test "$name" != "" && test "$name" != "0"; then - $rm conftest -! $LTCC -o conftest conftest.c $i - # Did it work? -! if test "$?" -eq 0 ; then - ldd_output=`ldd conftest` - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` -*************** -*** 2536,2545 **** - else - droppeddeps=yes - echo -! echo "*** Warning: This library needs some functionality provided by $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have." - fi - else - droppeddeps=yes ---- 2985,2996 ---- - else - droppeddeps=yes - echo -! echo "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have" -! echo "*** because a test_compile did reveal that the linker did not use this one" -! echo "*** as a dynamic dependency that programs can get resolved with at runtime." - fi - else - droppeddeps=yes -*************** -*** 2561,2567 **** - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. -! if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` ---- 3012,3018 ---- - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. -! if test "$name" != "" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` -*************** -*** 2578,2591 **** - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do -! potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ -! | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" ---- 3029,3042 ---- - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do -! potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ -! | ${SED} 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" -*************** -*** 2596,2605 **** - if test -n "$a_deplib" ; then - droppeddeps=yes - echo -! echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. ---- 3047,3063 ---- - if test -n "$a_deplib" ; then - droppeddeps=yes - echo -! echo "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have" -! echo "*** because I did check the linker path looking for a file starting" -! if test -z "$potlib" ; then -! echo "*** with $libname but no candidates were found. (...for file magic test)" -! else -! echo "*** with $libname and none of the candidates passed a file format test" -! echo "*** using a file magic. Last file checked: $potlib" -! fi - fi - else - # Add a -L argument. -*************** -*** 2618,2625 **** - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - if eval echo \"$potent_lib\" 2>/dev/null \ -! | sed 10q \ - | egrep "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" ---- 3076,3084 ---- - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do -+ potlib="$potent_lib" # see symlink-check above in file_magic test - if eval echo \"$potent_lib\" 2>/dev/null \ -! | ${SED} 10q \ - | egrep "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" -*************** -*** 2630,2639 **** - if test -n "$a_deplib" ; then - droppeddeps=yes - echo -! echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. ---- 3089,3105 ---- - if test -n "$a_deplib" ; then - droppeddeps=yes - echo -! echo "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" -! echo "*** shared version of the library, which you do not appear to have" -! echo "*** because I did check the linker path looking for a file starting" -! if test -z "$potlib" ; then -! echo "*** with $libname but no candidates were found. (...for regex pattern test)" -! else -! echo "*** with $libname and none of the candidates passed a file format test" -! echo "*** using a regex pattern. Last file checked: $potlib" -! fi - fi - else - # Add a -L argument. -*************** -*** 2696,2702 **** - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - -! if test $allow_undefined = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" ---- 3162,3168 ---- - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - -! if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" -*************** -*** 2723,2729 **** - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then -! if test $hardcode_into_libs = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= ---- 3189,3195 ---- - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then -! if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= -*************** -*** 2789,2795 **** - else - soname="$realname" - fi -! test -z "$dlname" && dlname=$soname - - lib="$output_objdir/$realname" - for link ---- 3255,3263 ---- - else - soname="$realname" - fi -! if test -z "$dlname"; then -! dlname=$soname -! fi - - lib="$output_objdir/$realname" - for link -*************** -*** 2797,2819 **** - linknames="$linknames $link" - done - -- # Ensure that we have .o objects for linkers which dislike .lo -- # (e.g. aix) in case we are running --disable-static -- for obj in $libobjs; do -- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` -- if test "X$xdir" = "X$obj"; then -- xdir="." -- else -- xdir="$xdir" -- fi -- baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` -- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` -- if test ! -f $xdir/$oldobj; then -- $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" -- $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? -- fi -- done -- - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - ---- 3265,3270 ---- -*************** -*** 2827,2834 **** ---- 3278,3293 ---- - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -+ if len=`expr "X$cmd" : ".*"` && -+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? -+ skipped_export=false -+ else -+ # The command line is too long to execute in one step. -+ $show "using reloadable object file for export list..." -+ skipped_export=: -+ fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then -*************** -*** 2846,2860 **** - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" -! $show "mkdir $gentop" -! $run mkdir "$gentop" - status=$? -! if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" ---- 3305,3320 ---- - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then -+ save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" -! $show "$mkdir $gentop" -! $run $mkdir "$gentop" - status=$? -! if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" -*************** -*** 2870,2885 **** - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" -! $show "mkdir $xdir" -! $run mkdir "$xdir" - status=$? -! if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - -! libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi ---- 3330,3345 ---- - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" -! $show "$mkdir $xdir" -! $run $mkdir "$xdir" - status=$? -! if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - -! libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - fi - fi -*************** -*** 2898,2905 **** ---- 3358,3488 ---- - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else -+ save_deplibs="$deplibs" -+ for conv in $convenience; do -+ tmp_deplibs= -+ for test_deplib in $deplibs; do -+ if test "$test_deplib" != "$conv"; then -+ tmp_deplibs="$tmp_deplibs $test_deplib" -+ fi -+ done -+ deplibs="$tmp_deplibs" -+ done -+ eval cmds=\"$archive_cmds\" -+ deplibs="$save_deplibs" -+ fi -+ -+ if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && -+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then -+ : -+ else -+ # The command line is too long to link in one step, link piecewise. -+ $echo "creating reloadable object files..." -+ -+ # Save the value of $output and $libobjs because we want to -+ # use them later. If we have whole_archive_flag_spec, we -+ # want to use save_libobjs as it was before -+ # whole_archive_flag_spec was expanded, because we can't -+ # assume the linker understands whole_archive_flag_spec. -+ # This may have to be revisited, in case too many -+ # convenience libraries get linked in and end up exceeding -+ # the spec. -+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then -+ save_libobjs=$libobjs -+ fi -+ save_output=$output -+ -+ # Clear the reloadable object creation command queue and -+ # initialize k to one. -+ test_cmds= -+ concat_cmds= -+ objlist= -+ delfiles= -+ last_robj= -+ k=1 -+ output=$output_objdir/$save_output-${k}.$objext -+ # Loop over the list of objects to be linked. -+ for obj in $save_libobjs -+ do -+ eval test_cmds=\"$reload_cmds $objlist $last_robj\" -+ if test "X$objlist" = X || -+ { len=`expr "X$test_cmds" : ".*"` && -+ test "$len" -le "$max_cmd_len"; }; then -+ objlist="$objlist $obj" -+ else -+ # The command $test_cmds is almost too long, add a -+ # command to the queue. -+ if test "$k" -eq 1 ; then -+ # The first file doesn't have a previous command to add. -+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\" -+ else -+ # All subsequent reloadable object files will link in -+ # the last one created. -+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" -+ fi -+ last_robj=$output_objdir/$save_output-${k}.$objext -+ k=`expr $k + 1` -+ output=$output_objdir/$save_output-${k}.$objext -+ objlist=$obj -+ len=1 -+ fi -+ done -+ # Handle the remaining objects by creating one last -+ # reloadable object file. All subsequent reloadable object -+ # files will link in the last one created. -+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~ -+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" -+ -+ if ${skipped_export-false}; then -+ $show "generating symbol list for \`$libname.la'" -+ export_symbols="$output_objdir/$libname.exp" -+ $run $rm $export_symbols -+ libobjs=$output -+ # Append the command to create the export file. -+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" -+ fi -+ -+ # Set up a command to remove the reloadale object files -+ # after they are used. -+ i=0 -+ while test "$i" -lt "$k" -+ do -+ i=`expr $i + 1` -+ delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" -+ done -+ -+ $echo "creating a temporary reloadable object file: $output" -+ -+ # Loop through the commands generated above and execute them. -+ save_ifs="$IFS"; IFS='~' -+ for cmd in $concat_cmds; do -+ IFS="$save_ifs" -+ $show "$cmd" -+ $run eval "$cmd" || exit $? -+ done -+ IFS="$save_ifs" -+ -+ libobjs=$output -+ # Restore the value of output. -+ output=$save_output -+ -+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then -+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\" -+ fi -+ # Expand the library linking commands again to reset the -+ # value of $libobjs for piecewise linking. -+ -+ # Do each of the archive commands. -+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then -+ eval cmds=\"$archive_expsym_cmds\" -+ else - eval cmds=\"$archive_cmds\" - fi -+ -+ # Append the command to remove the reloadable object files -+ # to the just-reset $cmds. -+ eval cmds=\"\$cmds~$rm $delfiles\" -+ fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" -*************** -*** 2990,2999 **** - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" -! $show "mkdir $gentop" -! $run mkdir "$gentop" - status=$? -! if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" ---- 3573,3582 ---- - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" -! $show "$mkdir $gentop" -! $run $mkdir "$gentop" - status=$? -! if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" -*************** -*** 3009,3024 **** - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" -! $show "mkdir $xdir" -! $run mkdir "$xdir" - status=$? -! if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - -! reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi ---- 3592,3607 ---- - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" -! $show "$mkdir $xdir" -! $run $mkdir "$xdir" - status=$? -! if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - -! reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - fi - fi -*************** -*** 3054,3061 **** - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. -! $show "echo timestamp > $libobj" -! $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - ---- 3637,3644 ---- - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. -! # $show "echo timestamp > $libobj" -! # $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - -*************** -*** 3071,3090 **** - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" -- else -- # Just create a symlink. -- $show $rm $libobj -- $run $rm $libobj -- xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` -- if test "X$xdir" = "X$libobj"; then -- xdir="." -- else -- xdir="$xdir" -- fi -- baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` -- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` -- $show "(cd $xdir && $LN_S $oldobj $baseobj)" -- $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? - fi - - if test -n "$gentop"; then ---- 3654,3659 ---- -*************** -*** 3097,3103 **** - - prog) - case $host in -! *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 ---- 3666,3672 ---- - - prog) - case $host in -! *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 -*************** -*** 3285,3293 **** - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols -! $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else -! $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi ---- 3854,3862 ---- - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols -! $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else -! $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi -*************** -*** 3295,3301 **** - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" -! name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done ---- 3864,3870 ---- - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" -! name=`echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done -*************** -*** 3310,3316 **** - fi - - # Try sorting and uniquifying the output. -! if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S ---- 3879,3891 ---- - fi - - # Try sorting and uniquifying the output. -! if grep -v "^: " < "$nlist" | -! if sort -k 3 /dev/null 2>&1; then -! sort -k 3 -! else -! sort +2 -! fi | -! uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S -*************** -*** 3371,3388 **** - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; -! *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; -! *) pic_flag_for_symtable=" $pic_flag -DPIC";; - esac - esac - - # Now compile the dynamic symbol file. -! $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" -! $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" ---- 3946,3963 ---- - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; -! *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; -! *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. -! $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" -! $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" -*************** -*** 3407,3413 **** - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - -! if test $need_relink = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" ---- 3982,3988 ---- - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - -! if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" -*************** -*** 3532,3538 **** - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done -! relink_command="cd `pwd`; $relink_command" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - ---- 4107,4113 ---- - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done -! relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - -*************** -*** 3552,3562 **** - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in -! *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in -! *cygwin*) exeext=.exe ;; - *) exeext= ;; - esac - $rm $output ---- 4127,4139 ---- - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in -! *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in -! *cygwin*) -! exeext=.exe -! outputname=`echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - $rm $output -*************** -*** 3576,3582 **** - - # Sed substitution that helps us do robust quoting. It backslashifies - # metacharacters that are still active within double-quoted strings. -! Xsed='sed -e 1s/^X//' - sed_quote_subst='$sed_quote_subst' - - # The HP-UX ksh and POSIX shell print the target directory to stdout ---- 4153,4159 ---- - - # Sed substitution that helps us do robust quoting. It backslashifies - # metacharacters that are still active within double-quoted strings. -! Xsed='${SED} -e 1s/^X//' - sed_quote_subst='$sed_quote_subst' - - # The HP-UX ksh and POSIX shell print the target directory to stdout -*************** -*** 3614,3620 **** - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. -! file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - ---- 4191,4197 ---- - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. -! file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - -*************** -*** 3627,3633 **** - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` -! file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. ---- 4204,4210 ---- - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` -! file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. -*************** -*** 3641,3647 **** - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ -! { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" ---- 4218,4224 ---- - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ -! { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" -*************** -*** 3763,3769 **** - oldobjs="$libobjs_save" - build_libtool_libs=no - else -! oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - fi - addlibs="$old_convenience" - fi ---- 4340,4346 ---- - oldobjs="$libobjs_save" - build_libtool_libs=no - else -! oldobjs="$oldobjs$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi -*************** -*** 3772,3781 **** - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" -! $show "mkdir $gentop" -! $run mkdir "$gentop" - status=$? -! if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" ---- 4349,4358 ---- - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" -! $show "$mkdir $gentop" -! $run $mkdir "$gentop" - status=$? -! if test "$status" -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" -*************** -*** 3792,3801 **** - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" -! $show "mkdir $xdir" -! $run mkdir "$xdir" - status=$? -! if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" ---- 4369,4378 ---- - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" -! $show "$mkdir $xdir" -! $run $mkdir "$xdir" - status=$? -! if test "$status" -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" -*************** -*** 3809,3833 **** - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else -! # Ensure that we have .o objects in place in case we decided -! # not to build a shared library, and have fallen back to building -! # static libs even though --disable-static was passed! -! for oldobj in $oldobjs; do -! if test ! -f $oldobj; then -! xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` -! if test "X$xdir" = "X$oldobj"; then -! xdir="." -! else -! xdir="$xdir" -! fi -! baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` -! obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` -! $show "(cd $xdir && ${LN_S} $obj $baseobj)" -! $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? - fi - done -! -! eval cmds=\"$old_archive_cmds\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do ---- 4386,4438 ---- - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else -! eval cmds=\"$old_archive_cmds\" -! -! if len=`expr "X$cmds" : ".*"` && -! test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then -! : -! else -! # the command line is too long to link in one step, link in parts -! $echo "using piecewise archive linking..." -! save_RANLIB=$RANLIB -! RANLIB=: -! objlist= -! concat_cmds= -! save_oldobjs=$oldobjs -! # GNU ar 2.10+ was changed to match POSIX; thus no paths are -! # encoded into archives. This makes 'ar r' malfunction in -! # this piecewise linking case whenever conflicting object -! # names appear in distinct ar calls; check, warn and compensate. -! if (for obj in $save_oldobjs -! do -! $echo "X$obj" | $Xsed -e 's%^.*/%%' -! done | sort | sort -uc >/dev/null 2>&1); then -! : -! else -! $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 -! $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 -! AR_FLAGS=cq -! fi -! for obj in $save_oldobjs -! do -! oldobjs="$objlist $obj" -! objlist="$objlist $obj" -! eval test_cmds=\"$old_archive_cmds\" -! if len=`expr "X$test_cmds" : ".*"` && -! test "$len" -le "$max_cmd_len"; then -! : -! else -! # the above command should be used before it gets too long -! oldobjs=$objlist -! test -z "$concat_cmds" || concat_cmds=$concat_cmds~ -! eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" -! objlist= - fi - done -! RANLIB=$save_RANLIB -! oldobjs=$objlist -! eval cmds=\"\$concat_cmds~$old_archive_cmds\" -! fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do -*************** -*** 3862,3868 **** - fi - done - # Quote the link command for shipping. -! relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - - # Only create the output if not a dry run. ---- 4467,4473 ---- - fi - done - # Quote the link command for shipping. -! relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - - # Only create the output if not a dry run. -*************** -*** 3879,3885 **** - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` -! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 ---- 4484,4490 ---- - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` -! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 -*************** -*** 3893,3899 **** - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` -! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 ---- 4498,4504 ---- - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` -! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 -*************** -*** 3904,3910 **** - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` -! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 ---- 4509,4515 ---- - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` -! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 -*************** -*** 3952,3958 **** - - # Directory that this library needs to be installed in: - libdir='$install_libdir'" -! if test "$installed" = no && test $need_relink = yes; then - $echo >> $output "\ - relink_command=\"$relink_command\"" - fi ---- 4557,4563 ---- - - # Directory that this library needs to be installed in: - libdir='$install_libdir'" -! if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ - relink_command=\"$relink_command\"" - fi -*************** -*** 4088,4094 **** - - # Not a directory, so check to see that there is only one file specified. - set dummy $files -! if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 ---- 4693,4699 ---- - - # Not a directory, so check to see that there is only one file specified. - set dummy $files -! if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 -*************** -*** 4128,4134 **** - - *.la) - # Check to see that this really is a libtool archive. -! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 ---- 4733,4739 ---- - - *.la) - # Check to see that this really is a libtool archive. -! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 -*************** -*** 4145,4165 **** - esac - - # Add the libdir to current_libdirs if it is the destination. -- DESTDIR= - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else -- case "$destdir" in -- *"$libdir") -- DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'` -- if test "X$destdir" != "X$DESTDIR$libdir"; then -- DESTDIR= -- fi -- ;; -- esac - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; ---- 4750,4761 ---- -*************** -*** 4173,4179 **** - - if test -n "$relink_command"; then - $echo "$modename: warning: relinking \`$file'" 1>&2 -- export DESTDIR - $show "$relink_command" - if $run eval "$relink_command"; then : - else ---- 4769,4774 ---- -*************** -*** 4181,4187 **** - continue - fi - fi -- unset DESTDIR - - # See the names of the shared library. - set dummy $library_names ---- 4776,4781 ---- -*************** -*** 4201,4207 **** - $run eval "$striplib $destdir/$realname" || exit $? - fi - -! if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do ---- 4795,4801 ---- - $run eval "$striplib $destdir/$realname" || exit $? - fi - -! if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do -*************** -*** 4287,4306 **** - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. -! if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # If there is no directory component, then add one. - case $file in -! */* | *\\*) . $file ;; -! *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then -! $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - ---- 4881,4921 ---- - destfile="$destdir/$destfile" - fi - -+ # If the file is missing, and there is a .exe on the end, strip it -+ # because it is most likely a libtool script we actually want to -+ # install -+ stripped_ext="" -+ case $file in -+ *.exe) -+ if test ! -f "$file"; then -+ file=`echo $file|${SED} 's,.exe$,,'` -+ stripped_ext=".exe" -+ fi -+ ;; -+ esac -+ - # Do a test to see if this is really a libtool program. -! case $host in -! *cygwin*|*mingw*) -! wrapper=`echo $file | ${SED} -e 's,.exe$,,'` -! ;; -! *) -! wrapper=$file -! ;; -! esac -! if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # If there is no directory component, then add one. - case $file in -! */* | *\\*) . $wrapper ;; -! *) . ./$wrapper ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then -! $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit 1 - fi - -*************** -*** 4340,4346 **** - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi -! file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` ---- 4955,4961 ---- - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi -! file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` -*************** -*** 4358,4371 **** - fi - else - # Install the binary that we compiled earlier. -! file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in -! /usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok ---- 4973,4986 ---- - fi - else - # Install the binary that we compiled earlier. -! file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in -! */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok -*************** -*** 4374,4380 **** - destfile=$destfile.exe - ;; - *:*.exe) -! destfile=`echo $destfile | sed -e 's,.exe$,,'` - ;; - esac - ;; ---- 4989,4995 ---- - destfile=$destfile.exe - ;; - *:*.exe) -! destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; -*************** -*** 4459,4465 **** - fi - - # Exit here if they wanted silent mode. -! test "$show" = ":" && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" ---- 5074,5080 ---- - fi - - # Exit here if they wanted silent mode. -! test "$show" = : && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" -*************** -*** 4522,4528 **** - case $file in - *.la) - # Check to see that this really is a libtool archive. -! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 ---- 5137,5143 ---- - case $file in - *.la) - # Check to see that this really is a libtool archive. -! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 -*************** -*** 4593,4599 **** - -*) ;; - *) - # Do a test to see if this is really a libtool program. -! if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; ---- 5208,5214 ---- - -*) ;; - *) - # Do a test to see if this is really a libtool program. -! if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; -*************** -*** 4625,4631 **** - fi - - # Now prepare to actually exec the command. -! exec_cmd='"$cmd"$args' - else - # Display what would be done. - if test -n "$shlibpath_var"; then ---- 5240,5246 ---- - fi - - # Now prepare to actually exec the command. -! exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then -*************** -*** 4675,4684 **** - objdir="$dir/$objdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` -! test $mode = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates -! if test $mode = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; ---- 5290,5299 ---- - objdir="$dir/$objdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` -! test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates -! if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; -*************** -*** 4702,4708 **** - case $name in - *.la) - # Possibly a libtool archive, so verify it. -! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. ---- 5317,5323 ---- - case $name in - *.la) - # Possibly a libtool archive, so verify it. -! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. -*************** -*** 4710,4718 **** - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" -! test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - -! if test $mode = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" ---- 5325,5333 ---- - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" -! test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - -! if test "$mode" = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" -*************** -*** 4721,4727 **** - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" -! if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done ---- 5336,5342 ---- - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" -! if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done -*************** -*** 4736,4742 **** - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" -! if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done ---- 5351,5357 ---- - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" -! if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done -*************** -*** 4748,4763 **** - ;; - - *.lo) -! if test "$build_old_libs" = yes; then -! oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` -! rmfiles="$rmfiles $dir/$oldobj" - fi - ;; - - *) - # Do a test to see if this is a libtool program. -! if test $mode = clean && -! (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$file - ---- 5363,5392 ---- - ;; - - *.lo) -! # Possibly a libtool object, so verify it. -! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then -! -! # Read the .lo file -! . $dir/$name -! -! # Add PIC object to the list of files to remove. -! if test -n "$pic_object" \ -! && test "$pic_object" != none; then -! rmfiles="$rmfiles $dir/$pic_object" -! fi -! -! # Add non-PIC object to the list of files to remove. -! if test -n "$non_pic_object" \ -! && test "$non_pic_object" != none; then -! rmfiles="$rmfiles $dir/$non_pic_object" -! fi - fi - ;; - - *) - # Do a test to see if this is a libtool program. -! if test "$mode" = clean && -! (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$file - -*************** -*** 4818,4823 **** ---- 5447,5453 ---- - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages -+ --tag=TAG use configuration variables from tag TAG - --version print version information - - MODE must be one of the following: -*************** -*** 4943,4948 **** ---- 5573,5579 ---- - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -+ -objectlist FILE Use a list of object files found in FILE to specify objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -*************** -*** 4993,4998 **** ---- 5624,5649 ---- - - exit 0 - -+ # The TAGs below are defined such that we never get into a situation -+ # in which we disable both kinds of libraries. Given conflicting -+ # choices, we go for a static library, that is the most portable, -+ # since we can't tell whether shared libraries were disabled because -+ # the user asked for that or because the platform doesn't support -+ # them. This is particularly important on AIX, because we don't -+ # support having both static and shared libraries enabled at the same -+ # time on that platform, so we default to a shared-only configuration. -+ # If a disable-shared tag is given, we'll fallback to a static-only -+ # configuration. But we'll never go from static-only to shared-only. -+ -+ # ### BEGIN LIBTOOL TAG CONFIG: disable-shared -+ build_libtool_libs=no -+ build_old_libs=yes -+ # ### END LIBTOOL TAG CONFIG: disable-shared -+ -+ # ### BEGIN LIBTOOL TAG CONFIG: disable-static -+ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -+ # ### END LIBTOOL TAG CONFIG: disable-static -+ - # Local Variables: - # mode:shell-script - # sh-indentation:2 diff --git a/netware/nwbootstrap b/netware/nwbootstrap deleted file mode 100755 index 3e4b03de0f5..00000000000 --- a/netware/nwbootstrap +++ /dev/null @@ -1,145 +0,0 @@ -#! /bin/sh - -# show executed commands -# set -x - -# stop on errors -set -e - -BD=`pwd` - -build=0 -build_debug=0 -skip_linux=0 - -# parse arguments -for arg do - case "$arg" in - --build) build=1 ;; - --build-debug) build_debug=1 ;; - --skip-linux) skip_linux=1 ;; - *) echo "$0: unrecognized option: $arg" ;; - esac -done - -# run the auto tools -autotools() -{ - for package in $BD $BD/innobase - do - echo "cd $package" - cd $package - rm -f config.cache - echo "aclocal" - aclocal - echo "autoheader" - autoheader - echo "libtoolize --force" - libtoolize --force - echo "aclocal" - aclocal - echo "automake --add-missing --force-missing" - automake --add-missing --force-missing - echo "autoconf" - autoconf - done - - cd $BD -} - -# check the source direcotry -echo "looking for \"$BD/sql/mysqld.cc\"..." -if test ! -r ./sql/mysqld.cc -then - echo "./netware/nwbootstrap must be started from the top source directory" - exit 1 -fi - -# clean -# make -j 2 -k distclean -rm -f NEW-RPMS/* -rm -f */.deps/*.P - -# make files writeable -chmod -R u+rw,g+rw . - -# skip linux? -if test $skip_linux -ne 1 -then - echo "starting linux build..." - - echo "autotools..." - autotools - - echo "configuring for linux..." - ./configure --without-docs --without-innodb - - echo "building for linux..." - make clean all - - echo "copying required linux binaries..." - rm -f */*.linux - cp extra/comp_err extra/comp_err.linux - cp libmysql/conf_to_src libmysql/conf_to_src.linux - cp libmysql/conf_to_src libmysql_r/conf_to_src.linux - cp sql/gen_lex_hash sql/gen_lex_hash.linux - cp strings/conf_to_src strings/conf_to_src.linux - - echo "cleaning linux build..." - make clean distclean -fi - -echo "starting netware build..." - -# remove stale Makefile.in.bk files -rm -rf Makefile.in.bk - -# start mw enviornment -chmod +x ./netware/nwconfigure -chmod +x ./netware/mw/mwenv -chmod +x ./netware/mw/mwasmnlm -chmod +x ./netware/mw/mwccnlm -chmod +x ./netware/mw/mwldnlm - -. ./netware/mw/mwenv - -# link nwconfigure -rm -f ./nwconfigure -ln ./netware/nwconfigure ./nwconfigure - -# save old builds from previous run -if test -e *.tar.gz -then - rm -f *.tar.gz.old - rename .tar.gz .tar.gz.old *.tar.gz -fi - -echo "autotools..." -autotools - -# debug build -if test $build_debug -eq 1 -then - echo "configuring for netware (debug)..." - ./nwconfigure --with-debug=full - - echo "building for netware (debug)..." - make clean bin-dist - - # mark the debug build - rename .tar.gz -debug.tar.gz *.tar.gz -fi - -# release build -if test $build -eq 1 -then - echo "configuring for netware..." - ./nwconfigure - - echo "building for netware..." - make clean bin-dist -fi - -echo "done" - - diff --git a/netware/nwconfigure b/netware/nwconfigure deleted file mode 100644 index 3d89377dea8..00000000000 --- a/netware/nwconfigure +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/sh -CMD="\ - AR='mwldnlm' \ - AR_FLAGS='-type library -o' \ - AS='mwasmnlm' \ - CC='mwccnlm -gccincludes' \ - CFLAGS='-dialect c -proc 686 -bool on -relax_pointers -DUSE_OLD_FUNCTIONS' \ - CXX='mwccnlm -gccincludes' \ - CXXFLAGS='-dialect c++ -proc 686 -bool on -relax_pointers' \ - LD='mwldnlm' \ - LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption' \ - RANLIB=: \ - STRIP=: \ - ./configure --host=i686-pc-netware $* \ - --without-docs \ - --enable-local-infile \ - --with-extra-charsets=latin1_de \ - --prefix=N:/mysql \ - " -#rm -f config.cache config.log config.status -echo $CMD -eval $CMD - diff --git a/netware/pack_isam.def b/netware/pack_isam.def index 0e077be6f00..f0f5a7e328a 100644 --- a/netware/pack_isam.def +++ b/netware/pack_isam.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Pack Tool" VERSION 4, 0 -DEBUG +XDCDATA ../netware/mysql.xdc +#DEBUG diff --git a/netware/perror.def b/netware/perror.def index 08725a515ef..f1d23715f55 100644 --- a/netware/perror.def +++ b/netware/perror.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Error Code Description Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/replace.def b/netware/replace.def index b639d40f58b..b55690152b9 100644 --- a/netware/replace.def +++ b/netware/replace.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Text Replacement Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/resolveip.def b/netware/resolveip.def index fc6ee0fa313..10b99304e22 100644 --- a/netware/resolveip.def +++ b/netware/resolveip.def @@ -5,5 +5,6 @@ MODULE libc.nlm COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL IP/Hostname Resolve Tool" VERSION 4, 0 +XDCDATA ../netware/mysql.xdc #DEBUG diff --git a/netware/test_db.sql b/netware/test_db.sql index d43b632289c..acdc3630f58 100644 --- a/netware/test_db.sql +++ b/netware/test_db.sql @@ -4,17 +4,25 @@ CREATE DATABASE test; USE mysql; CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; - -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; + +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('localhost','','','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 VALUES ('','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 ('',''); CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; + +CREATE TABLE help_topic (help_topic_id int unsigned not null auto_increment, name varchar(64) not null, description text not null, example text not null, url varchar(128) not null, primary key (help_topic_id), unique index (name)) comment='help topics'; + +CREATE TABLE help_category (help_category_id smallint unsigned not null auto_increment, name varchar(64) not null, url varchar(128) not null, primary key (help_category_id), unique index (name)) comment='help topics-categories relation'; + +CREATE TABLE help_relation (help_topic_id int unsigned not null references help_topic, help_category_id smallint unsigned not null references help_category, primary key (help_category_id, help_topic_id)) comment='categories of help topics'; 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 78eb1343f47..5ed76cefdb4 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -64,16 +64,17 @@ case $system in esac -mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ +mkdir $BASE $BASE/bin \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man $BASE/man/man1 -fi + mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ + $BASE/man/man1 $BASE/data $BASE/data/mysql $BASE/data/test -chmod o-rwx $BASE/data $BASE/data/* + chmod o-rwx $BASE/data $BASE/data/* +fi for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ @@ -159,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 \ @@ -182,13 +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 da6592bd630..9a787080c3e 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -11,38 +11,58 @@ CP="cp -p" DEBUG=0 SILENT=0 -TMP=/tmp SUFFIX="" OUTTAR=0 -SRCDIR=$SOURCE -DSTDIR=$TMP - # # This script must run from MySQL top directory # -if [ ! -f scripts/make_win_src_distribution.sh ]; then +if [ ! -f scripts/make_win_src_distribution ]; then echo "ERROR : You must run this script from the MySQL top-level directory" exit 1 fi - + +# +# Check for source compilation/configuration +# + +if [ ! -f sql/sql_yacc.cc ]; then + echo "ERROR : Sorry, you must run this script after the complete build," + echo " hope you know what you are trying to do !!" + exit 1 +fi + +# +# Debug print of the status +# + +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 1 + exit 0 } # @@ -69,18 +89,20 @@ parse_arguments() { parse_arguments "$@" # -# Currently return an error if --tar is not used +# Assign the tmp directory if it was set from the environment variables # -if [ x$OUTTAR = x0 ] && [ x$DEBUG = x0 ] -then - echo "ERROR: The default .zip doesn't yet work on Windows, as it can't load" - echo " the workspace files due to LF->CR+LF issues, instead use --tar" - echo " to create a .tar.gz package " - echo "" - show_usage; - exit 1 -fi +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 @@ -89,25 +111,33 @@ fi BASE=$TMP/my_win_dist$SUFFIX if [ -d $BASE ] ; then + print_debug "Destination directory '$BASE' already exists, deleting it" rm -r -f $BASE fi $CP -r $SOURCE/VC++Files $BASE - ( -find $BASE -name *.dsw -and -not -path \*SCCS\* -print -find $BASE -name *.dsp -and -not -path \*SCCS\* -print +find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print )|( -while read v -do - sed 's/$'"/`echo -e \\\r`/" $v > $v.tmp + 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 -done + done ) -# move all error message files to root directory +# +# Move all error message files to root directory +# + $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 @@ -116,11 +146,10 @@ $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 +mkdir $BASE/Docs $BASE/extra $BASE/include # @@ -130,32 +159,24 @@ mkdir $BASE/Docs $BASE/extra $BASE/include copy_dir_files() { for arg do - + print_debug "Copying files from directory '$arg'" cd $SOURCE/$arg/ - ( - ls -A1|grep \\.[ch]$ - ls -A1|grep \\.ih$ - ls -A1|grep \\.i$ - ls -A1|grep \\.ic$ - ls -A1|grep \\.asm$ - ls -A1|grep README - ls -A1|grep INSTALL - ls -A1|grep LICENSE - )|( - while read v - do - $CP $SOURCE/$arg/$v $BASE/$arg/$v - done - ) - - cd $SOURCE/$arg/ - ( - ls -A1|grep \\.cc$|sed 's/.cc$//g')|( - while read v - do - $CP $SOURCE/$arg/$v.cc $BASE/$arg/$v.cpp - done - ) + for i in *.c *.h *.ih *.i *.ic *.asm \ + README INSTALL* LICENSE + do + if [ -f $i ] + then + $CP $SOURCE/$arg/$i $BASE/$arg/$i + fi + done + for i in *.cc + do + if [ -f $i ] + then + i=`echo $i | sed 's/.cc$//g'` + $CP $SOURCE/$arg/$i.cc $BASE/$arg/$i.cpp + fi + done done } @@ -169,27 +190,22 @@ copy_dir_dirs() { basedir=$arg - if [ ! -d $BASE/$arg ]; then + if [ ! -d $BASE/$arg ]; then mkdir $BASE/$arg fi copy_dir_files $arg - cd $SOURCE/$arg/ - ( - ls -l |grep "^d"|awk '{print($9)}' - - )|( - while read dir_name - do - if [ x$dir_name != x"SCCS" ] - then - if [ ! -d $BASE/$basedir/$dir_name ]; then - mkdir $BASE/$basedir/$dir_name - fi - copy_dir_files $basedir/$dir_name + cd $SOURCE/$arg/ + for i in * + do + if [ -d $SOURCE/$basedir/$i ] && [ "$i" != "SCCS" ]; then + if [ ! -d $BASE/$basedir/$i ]; then + mkdir $BASE/$basedir/$i fi - done - ) + copy_dir_files $basedir/$i + fi + done done } @@ -197,49 +213,37 @@ copy_dir_dirs() { # Input directories to be copied # -copy_dir_files 'bdb' -copy_dir_files 'bdb/build_win32' -copy_dir_files 'client' -copy_dir_files 'dbug' -copy_dir_files 'extra' -copy_dir_files 'heap' -copy_dir_files 'include' -copy_dir_files 'innobase' -copy_dir_files 'isam' -copy_dir_files 'libmysql' -copy_dir_files 'libmysqld' -copy_dir_files 'merge' -copy_dir_files 'myisam' -copy_dir_files 'myisammrg' -copy_dir_files 'mysys' -copy_dir_files 'regex' -copy_dir_files 'sql' -copy_dir_files 'strings' -copy_dir_files 'vio' -copy_dir_files 'zlib' +for i in client dbug extra heap include isam \ + libmysql libmysqld merge myisam \ + myisammrg mysys regex sql strings \ + vio zlib +do + copy_dir_files $i +done # # Input directories to be copied recursively # -copy_dir_dirs 'bdb' -copy_dir_dirs 'innobase' +for i in bdb innobase +do + copy_dir_dirs $i +done -# create dummy innobase configure header -if [ -f $BASE/innobase/ib_config.h ] -then +# +# Create dummy innobase configure header +# + +if [ -f $BASE/innobase/ib_config.h ]; then rm -f $BASE/innobase/ib_config.h - touch $BASE/innobase/ib_config.h fi +touch $BASE/innobase/ib_config.h + # # Copy miscellaneous files # -$CP $SOURCE/myisam/myisampack.c $BASE/myisampack/ -$CP $SOURCE/client/mysqlbinlog.cc $BASE/mysqlbinlog/mysqlbinlog.cpp -$CP $SOURCE/isam/pack_isam.c $BASE/pack_isam/pack_isam.c - cd $SOURCE for i in COPYING ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ @@ -248,23 +252,31 @@ for i in COPYING ChangeLog README \ Docs/mysqld_error.txt Docs/INSTALL-BINARY do + print_debug "Copying file '$i'" if [ -f $i ] then - $CP $i $BASE/$i + $CP $i $BASE/$i fi done # -# TODO: Initialize the initial data directory +# Initialize the initial data directory # +if [ -f scripts/mysql_install_db ]; then + print_debug "Initializing the 'data' directory" + scripts/mysql_install_db --windows --datadir=$BASE/data +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 @@ -273,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 @@ -305,56 +317,73 @@ which_1 () } # -# Create the result zip file +# Create the result zip/tar file # -if [ x$OUTTAR = x1 ]; then - ZIPFILE1=gnutar - ZIPFILE2=gtar - OPT=cvf - EXT=".tar" - NEED_COMPRESS=1 - if [ x$SILENT = x1 ] ; then - OPT=cf - fi +set_tarzip_options() +{ + for arg + do + if [ "$arg" = "tar" ]; then + ZIPFILE1=gnutar + ZIPFILE2=gtar + OPT=cvf + EXT=".tar" + NEED_COMPRESS=1 + if [ "$SILENT" = "1" ] ; then + OPT=cf + fi + else + ZIPFILE1=zip + ZIPFILE2="" + OPT="-vr" + EXT=".zip" + NEED_COMPRESS=0 + if [ "$SILENT" = "1" ] ; then + OPT="-r" + fi + fi + done +} + +if [ "$OUTTAR" = "1" ]; then + set_tarzip_options 'tar' else - ZIPFILE1=zip - ZIPFILE2="" - OPT="-lvr" - EXT=".zip" - NEED_COMPRESS=0 - if [ x$SILENT = x1 ] ; then - OPT="-lr" - fi + set_tarzip_options 'zip' 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 -echo "Using $tar to create archive" +# +# Create the archive +# + +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 - echo "Compressing archive" + print_debug "Compressing archive" gzip -9 $NEW_NAME$EXT - EXT=".tar.gz" + EXT="$EXT.gz" fi -echo "Removing temporary directory" +print_debug "Removing temporary directory" rm -r -f $BASE echo "$NEW_NAME$EXT created successfully !!" -# # End of script -# diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 862cffb0cb7..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,10 +7,16 @@ # # 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="1"; shift ;; esac defaults= @@ -37,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 @@ -70,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 "$@" @@ -79,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 ! -x $execdir/mysqld +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 @@ -110,7 +139,7 @@ fi hostname=`@HOSTNAME@` # Install this too in the user table # Check if hostname is valid -if test "$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 ] @@ -134,7 +163,7 @@ then fi # Create database directories mysql & test -if test "$IN_RPM" -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 @@ -154,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," @@ -184,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," @@ -208,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," @@ -247,18 +281,27 @@ then c_u="$c_u comment='Users and global privileges';" i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); 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); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('localhost',''); +" + + if test "$windows" -eq 0 + then + i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + + REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('$hostname','');" + fi 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," @@ -272,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," @@ -291,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," @@ -306,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; @@ -325,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 + 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" @@ -351,7 +401,7 @@ then echo "able to use the new GRANT command!" fi echo - if test "$IN_RPM" -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 &" @@ -365,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..79090e3e6db 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(); } @@ -2178,6 +2178,20 @@ report("views","views", save_config_data('foreign_key',$result,"foreign keys"); } +if ($limits{'foreign_key'} eq 'yes') +{ + report("allows to update of foreign key values",'foreign_update', + "create table crash_me1 (a int not null primary key)", + "create table crash_me2 (a int not null," . + " foreign key (a) references crash_me1 (a))", + "insert into crash_me1 values (1)", + "insert into crash_me2 values (1)", + "update crash_me1 set a = 2", ## <- must fail + "drop table crash_me2 $drop_attr", + "drop table crash_me1 $drop_attr" + ); +} + report("Create SCHEMA","create_schema", "create schema crash_schema create table crash_q (a int) ". "create table crash_q2(b int)", @@ -2880,9 +2894,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 +3167,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-bench/limits/mysql.cfg b/sql-bench/limits/mysql.cfg index 01614741dcd..cebb85d8dfd 100644 --- a/sql-bench/limits/mysql.cfg +++ b/sql-bench/limits/mysql.cfg @@ -1,4 +1,4 @@ -#This file is automaticly generated by crash-me 1.60 +#This file is automaticly generated by crash-me 1.61 NEG=yes # update of column= -column ###< create table crash_q (a integer) @@ -177,7 +177,7 @@ compute=no # Compute ###> execute error:You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'compute sum(a) by a' at line 1 ### ###As far as some queries didnt return OK, result is NO -connections=101 # Simultaneous connections (installation default) +connections=99 # Simultaneous connections (installation default) constraint_check=syntax only # Column constraints ###< create table crash_q (a int check (a>0)) ###> OK @@ -213,7 +213,7 @@ constraint_null=yes # NULL constraint (SyBase style) ### ###As far as all queries returned OK, result is YES crash_me_safe=yes # crash me safe -crash_me_version=1.60 # crash me version +crash_me_version=1.61 # crash me version create_default=yes # default value for column ###< create table crash_q (q integer default 10 not null) ###> OK @@ -345,7 +345,7 @@ date_format_inresult=iso # Date format in result ###> OK ### ###< select a from crash_me_d - ###> 2003-02-08 + ###> 2003-03-26 ###< delete from crash_me_d ###> OK date_infinity=error # Supports 'infinity dates @@ -695,7 +695,7 @@ func_extra_elt=yes # Function ELT func_extra_encrypt=yes # Function ENCRYPT ### ###2003-02-08 00:09:52 + ###>2003-03-26 13:44:57 func_extra_tail=no # Function TAIL ### ###4.0.11-gamma + ###>4.0.12-debug func_extra_weekday=yes # Function WEEKDAY ### ###00:09:52 + ###>13:44:57 func_odbc_database=yes # Function DATABASE ### ###2003-02-08 + ###>2003-03-26 func_sql_current_time=yes # Function CURRENT_TIME ### ###2003-02-08 00:09:52 + ###>2003-03-26 13:44:57 func_sql_current_user=with_parenthesis # CURRENT_USER ###< select CURRENT_USER ###> execute error:Unknown column 'CURRENT_USER' in 'field list' @@ -1438,11 +1438,11 @@ func_sql_extract_sql=yes # Function EXTRACT func_sql_localtime=yes # Function LOCALTIME ### ###2003-02-08 00:09:52 + ###>2003-03-26 13:44:57 func_sql_lower=yes # Function LOWER ### ###