diff --git a/.bzrignore b/.bzrignore index 35db3c5d5ba..c2e7d0878e4 100644 --- a/.bzrignore +++ b/.bzrignore @@ -23,6 +23,7 @@ .vimrc 50 =6 +BUILD/compile-pentium-maintainer BitKeeper/etc/config BitKeeper/etc/csets BitKeeper/etc/csets-in @@ -30,6 +31,8 @@ BitKeeper/etc/csets-out BitKeeper/etc/gone BitKeeper/etc/level BitKeeper/etc/pushed +BitKeeper/post-commit +BitKeeper/post-commit-manual BitKeeper/tmp/* BitKeeper/tmp/bkr3sAHD BitKeeper/tmp/gone @@ -223,6 +226,7 @@ bkpull.log.5 bkpull.log.6 bkpush.log build.log +build_tags.sh client/insert_test client/log_event.cc client/log_event.h @@ -305,12 +309,16 @@ libmysql/conf_to_src libmysql/my_static.h libmysql/mysys_priv.h libmysql/net.c +libmysql/vio_priv.h libmysql_r/*.c libmysql_r/acconfig.h libmysql_r/conf_to_src libmysql_r/my_static.h libmysql_r/mysys_priv.h +libmysql_r/vio_priv.h libmysqld/backup_dir +libmysqld/client.c +libmysqld/client_settings.h libmysqld/convert.cc libmysqld/derror.cc libmysqld/errmsg.c @@ -355,6 +363,7 @@ libmysqld/item_sum.cc libmysqld/item_timefunc.cc libmysqld/item_uniq.cc libmysqld/key.cc +libmysqld/libmysql.c libmysqld/lock.cc libmysqld/log.cc libmysqld/log_event.cc @@ -366,6 +375,7 @@ libmysqld/net_serv.cc libmysqld/opt_ft.cc libmysqld/opt_range.cc libmysqld/opt_sum.cc +libmysqld/pack.c libmysqld/password.c libmysqld/procedure.cc libmysqld/protocol.cc @@ -473,6 +483,7 @@ mysql-test/r/rpl_log.eval mysql-test/r/slave-running.eval mysql-test/r/slave-stopped.eval mysql-test/share/mysql +mysql-test/std_data/*.pem mysql-test/var/* mysql.kdevprj mysql.proj @@ -482,6 +493,7 @@ mysys/#mf_iocache.c# mysys/charset2html mysys/getopt.c mysys/getopt1.c +mysys/main.cc mysys/ste5KbMa mysys/test_charset mysys/test_dir @@ -585,6 +597,7 @@ stamp-h1 stamp-h2 stamp-h3 stamp-h4 +start_mysqld.sh strings/conf_to_src strings/ctype_autoconf.c strings/ctype_extra_sources.c @@ -611,6 +624,7 @@ support-files/mysql.spec tags test_xml tests/client_test +tests/connect_test thread_test tmp/* tools/my_vsnprintf.c @@ -622,7 +636,3 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl -libmysqld/client.c -libmysqld/client_settings.h -libmysqld/libmysql.c -libmysqld/pack.c diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh index 32a4efefdfb..72188b9c24b 100644 --- a/BUILD/FINISH.sh +++ b/BUILD/FINISH.sh @@ -23,12 +23,16 @@ autoconf || (echo \"Can't execute autoconf\" && exit 1) if [ -d gemini ] then (cd gemini && aclocal && autoheader && aclocal && automake && autoconf) -fi +fi" +if [ -z "$just_clean" ] +then +commands="$commands CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" \ $configure" +fi -if [ -z "$just_configure" ] +if [ -z "$just_configure" -a -z "$just_clean" ] then commands="$commands diff --git a/BUILD/cleanup b/BUILD/cleanup new file mode 100755 index 00000000000..518c5722d87 --- /dev/null +++ b/BUILD/cleanup @@ -0,0 +1,8 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +just_clean=1; + +. "$path/FINISH.sh" diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 299c12c1f4a..177107f8779 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -20,7 +20,9 @@ bk@admin.bk bk@mysql.r18.ru carsten@tsort.bitbybit.dk davida@isil.mysql.com +dlenev@build.mysql.com dlenev@mysql.com +gerberb@ou800.zenez.com gluh@gluh.(none) gluh@gluh.mysql.r18.ru greg@gcw.ath.cx @@ -71,6 +73,7 @@ monty@donna.mysql.fi monty@hundin.mysql.fi monty@mashka.(none) monty@mashka.mysql.fi +monty@mishka.mysql.fi monty@narttu. monty@narttu.mysql.fi monty@rescue. @@ -95,6 +98,7 @@ peter@linux.local peter@mysql.com peterg@mysql.com pgulutzan@linux.local +ram@gw.mysql.r18.ru ram@gw.udmsearch.izhnet.ru ram@mysql.r18.ru ram@ram.(none) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 33eca958ae0..94446d9880f 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -10,6 +10,7 @@ # written by Lenz Grimmer # +use Cwd; use Getopt::Long; Getopt::Long::Configure ("bundling"); @@ -26,18 +27,19 @@ else # Some predefined settings $build_command= "BUILD/compile-pentium-max"; -chomp ($LOGFILE= `pwd`); -$LOGFILE.= "/Bootstrap.log"; -chomp ($opt_directory= `pwd`); -$opt_docdir= $opt_directory . "/mysqldoc"; +$PWD= cwd(); +$LOGFILE= $PWD . "/Bootstrap.log"; +$opt_docdir= $PWD . "/mysqldoc"; $opt_build_command= undef; $opt_changelog= undef; $opt_delete= undef; +$opt_directory= $PWD; $opt_dry_run= undef; $opt_export_only= undef; $opt_help= $opt_verbose= 0; $opt_log= undef; $opt_mail= ""; +$opt_pull= undef; $opt_revision= undef; $opt_suffix= ""; $opt_test= undef; @@ -58,6 +60,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", + "pull|p", "revision|r=s", "skip-check|s", "skip-manual", @@ -80,8 +83,7 @@ if (defined $opt_log) } else { - chomp ($LOGFILE= `pwd`); - $LOGFILE.= "/" . $opt_log; + $LOGFILE= $PWD . "/" . $opt_log; } } } @@ -103,13 +105,30 @@ defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used system ("bk help > /dev/null") == 0 or &abort("Cannot execute BitKeeper binary!"); system ("bk root $REPO > /dev/null 2>&1") == 0 or &abort("$REPO does not seem to be a valid BK repository!"); -if (($opt_directory ne ".") && (!-d $opt_directory && !$opt_dry_run)) +if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run)) { &abort("Could not find target directory \"$opt_directory\"!"); } &logger("Logging to $LOGFILE") if (defined $opt_log); +# +# Pull recent changes first +# +if ($opt_pull) +{ + &logger("Updating BK tree $REPO to latest ChangeSet first"); + $command= "cd $REPO; bk pull; cd .."; + &run_command($command, "Could not update $REPO!"); + + unless ($opt_skip_manual) + { + &logger("Updating manual tree in $opt_docdir"); + $command= "cd $opt_docdir; bk pull; cd .."; + &run_command($command, "Could not update $opt_docdir!"); + } +} + # # Use a temporary name until we know the version number # @@ -253,7 +272,7 @@ if (defined $opt_changelog) # # Add the latest manual from the mysqldoc tree # -if (!$opt_skip_manual) +unless ($opt_skip_manual) { $msg= "Adding manual.texi"; &logger($msg); @@ -310,7 +329,7 @@ $command= "make dist"; if ($opt_win_dist) { &logger ("Creating Windows source package"); - $command= "./scripts/make_win_src_distibution"; + $command= "./scripts/make_win_src_distribution --tar --zip"; &run_command($command, "make_win_src_distribution failed!"); } @@ -378,6 +397,7 @@ Options: include a log file snippet, if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com +-p, --pull Update the source BK trees before building -r, --revision= Export the tree as of revision (default is up to the latest revision) -s, --skip-check Skip checking the distribution with "make distcheck" diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 1e404f9c509..0541ebe96ce 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -8,7 +8,7 @@ use Getopt::Long; $opt_distribution=$opt_user=$opt_config_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; -$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=0; +$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; $opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=0; GetOptions( @@ -36,6 +36,7 @@ GetOptions( "perl-files=s", "perl-options=s", "raid", + "readline", "stage=i", "static-client", "static-perl", @@ -51,6 +52,7 @@ GetOptions( "with-low-memory", "with-other-libc=s", "with-small-disk", + "without-embedded", ) || usage(); usage() if ($opt_help); @@ -230,6 +232,8 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-low-memory" if ($opt_with_low_memory); $opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server); $opt_config_options.= " --with-raid" if ($opt_raid); + $opt_config_options.= " --with-readline" if ($opt_readline); + $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); # Only enable InnoDB when requested (required to be able to # build the "Classic" packages that do not include InnoDB) @@ -446,10 +450,10 @@ $0 takes the following options: --bdb Compile with support for Berkeley DB tables ---config-env +--config-env= To set up the environment, like 'CC=cc CXX=gcc CXXFLAGS=-O3' ---config-options +--config-options= To add some extra options to configure (e.g. '--with-perl=yes') --dbd-options @@ -461,7 +465,7 @@ Print all shell commands on stdout. --delete Delete the distribution file. ---distribution +--distribution= Name of the MySQL source distribution file. --enable-shared @@ -482,7 +486,7 @@ Compile with TCP wrapper support --local-perl Install Perl modules locally ---make-options +--make-options= Options to make after configure. (Like 'CXXLD=gcc') --no-crash-me @@ -500,16 +504,22 @@ Do not run the benchmark test (written in perl) --no-mysqltest Do not run the the mysql-test-run test (Same as 'make test') ---perl-files=list of files +--no-perl +Do not compile or install Perl modules, use the system installed ones + +--perl-files= Compile and install the given perl modules. ---perl-options +--perl-options= Build Perl modules with the additional options --raid Compile with RAID support ---stage (1-6) +--readline +Compile against readline library instead of libedit + +--stage=[1-6] Start script from some specific point. --static-client @@ -524,18 +534,18 @@ Build statically linked server binary --tcpip Connect to the server to be tested via TCP/IP instead of socket ---tmp +--tmp= Use a different temporary directory than /tmp --use-old-distribution Do not clean up the build environment and extract a fresh source distribution, use an existing one instead. ---user +--user= Mail 'user_name'\@mysql.com if something went wrong. If user is empty then no mail is sent. ---version-suffix suffix +--version-suffix=suffix Set name suffix (e.g. 'com' or '-max') for a distribution --with-debug @@ -544,13 +554,16 @@ Build binaries with debug information (implies "--no-strip") --with-low-memory Use less memory when compiling. ---with-other-libc +--with-other-libc= Link against libc and other standard libraries installed in the specified non-standard location overriding default. --with-small-disk Clean up the build environment before testing the binary distribution (to save disk space) + +--without-embedded +Don't compile the embedded server. EOF exit 1; } diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index e95d86c0f6e..4d0f120c6e3 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -1,7 +1,9 @@ #!/usr/bin/perl -w # # Do-pkg - convert a binary distribution into a Mac OS X PKG and put it -# inside a Disk Image (.dmg) +# inside a Disk Image (.dmg). Additionally, add a separate package, +# including the required Startup Item to automatically start MySQL on +# bootup. # # The script currently assumes the following environment (which should exist # like that, if the Do-compile script was used to build the binary @@ -17,14 +19,19 @@ # written by Lenz Grimmer # +use Cwd; +use File::Basename; +use File::Copy; use Getopt::Long; Getopt::Long::Configure ("bundling"); +use Sys::Hostname; $opt_dry_run= undef; $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_skip_dmg= undef; +$opt_skip_si= undef; $opt_suffix= undef; $opt_verbose= undef; $opt_version= undef; @@ -35,13 +42,14 @@ GetOptions( "log|l:s", "mail|m=s", "skip-dmg|skip-disk-image|s", + "skip-si|skip-startup-item", "suffix=s", "verbose|v", "version=s", ) || &print_help; # Include helper functions -chomp($PWD= `pwd`); +$PWD= cwd(); $LOGGER= "$PWD/logger.pm"; if (-f "$LOGGER") { @@ -54,7 +62,7 @@ else $PM= "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; $TMP= $ENV{TMPDIR}; -$TMP eq "" ? $TMP= $TMP . "/PKGBUILD": $TMP= "/tmp/PKGBUILD"; +$TMP eq "" ? $TMP= $TMP . "/PKGBUILD.$$": $TMP= "/tmp/PKGBUILD.$$"; $PKGROOT= "$TMP/PMROOT"; $PKGDEST= "$TMP/PKG"; $RESOURCE_DIR= "$TMP/Resources"; @@ -62,8 +70,8 @@ $SUFFIX= $opt_suffix; $VERSION= $opt_version; ($MAJOR, $MINOR, $RELEASE)= split(/\./, $VERSION); $NAME= "mysql$SUFFIX-$VERSION"; -chomp($HOST= `hostname`); -chomp($ID= `whoami`); +$HOST= hostname(); +$ID= getpwuid($>); $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; @@ -73,6 +81,12 @@ $SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; $TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; $INFO= <$SUPFILEDIR/Info.plist>; $DESC= <$SUPFILEDIR/Description.plist>; +$SI_INFO= <$SUPFILEDIR/StartupItem.Info.plist>; +$SI_DESC= <$SUPFILEDIR/StartupItem.Description.plist>; +$SI_PARAMS= <$SUPFILEDIR/StartupParameters.plist>; +$SI_POST= <$SUPFILEDIR/StartupItem.postinstall>; +$SI_NAME= "MySQLStartupItem"; +$SI_SCRIPT= <$SUPFILEDIR/MySQL>; @RESOURCES= qw/ ReadMe.txt postinstall preinstall /; @LICENSES= ("$SRCBASEDIR/COPYING","$SRCBASEDIR/MySQLEULA.txt"); @@ -99,7 +113,9 @@ if (defined $opt_log) # Creating the UFS disk image requires root privileges die("You must be root to run this script!") if ($ID ne "root" && !$opt_dry_run); -foreach $file ($TAR, $INFO, $DESC) +@files= ($TAR, $INFO, $DESC); +@files= (@files, $SI_INFO, $SI_DESC, $SI_POST, $SI_SCRIPT) unless $opt_skip_si; +foreach $file (@files) { &abort("Unable to find $file!") unless (-f "$file"); } @@ -112,14 +128,22 @@ foreach $dir ($TMP, $PKGROOT, $PKGDEST, $RESOURCE_DIR) { if (!-d $dir) { - &run_command("mkdir $dir", "Could not make directory $dir!"); + &logger("Creating directory $dir!"); + unless($opt_dry_run) + { + mkdir($dir) or &abort("Could not make directory $dir!"); + } } } foreach $resfile (@RESOURCES) { - $command= "cp $SUPFILEDIR/$resfile $RESOURCE_DIR"; - &run_command($command, "Error while copying $SUPFILEDIR/$resfile to $RESOURCE_DIR"); + &logger("Copying $SUPFILEDIR/$resfile to $RESOURCE_DIR"); + unless($opt_dry_run) + { + copy("$SUPFILEDIR/$resfile", "$RESOURCE_DIR") or + &abort("Error while copying $SUPFILEDIR/$resfile to $RESOURCE_DIR"); + } } # Search for license file @@ -127,12 +151,17 @@ foreach $license (@LICENSES) { if (-f "$license") { - $command= "cp $license $RESOURCE_DIR/License.txt"; - &run_command($command, "Error while copying $license to $RESOURCE_DIR"); + &logger("Copy $license to $RESOURCE_DIR/License.txt"); + unless($opt_dry_run) + { + copy("$license", "$RESOURCE_DIR/License.txt") or + &abort("Error while copying $license to $RESOURCE_DIR"); + } } } -&abort("Could not find a license file!") unless (-f "$RESOURCE_DIR/License.txt"); +&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"); @@ -145,10 +174,38 @@ foreach $license (@LICENSES) # returning a non-zero value, even though the package was created correctly &logger("Running PackageMaker"); $command= "$PM -build -p $PKGDEST/$NAME.pkg -f $PKGROOT -r $RESOURCE_DIR -i $INFO -d $DESC || true"; -&run_command($command, "Error while building package!"); +&run_command($command, "Error while building package $NAME.pkg!"); -&logger("Removing $PKGROOT"); -&run_command("rm -rf $PKGROOT", "Unable to remove $PKGROOT!"); +# +# Build the Startup Item PKG +# +unless ($opt_skip_si) +{ + &logger("Cleaning up $PKGROOT"); + &run_command("rm -rf $PKGROOT/*", "Unable to clean up $PKGROOT!"); + &logger("Cleaning up $RESOURCE_DIR"); + &run_command("rm -rf $RESOURCE_DIR/*", "Unable to clean up $RESOURCE_DIR!"); + + &logger("Installing MySQL StartupItem files into $PKGROOT/MySQL"); + unless($opt_dry_run) + { + mkdir("$PKGROOT/MySQL") or &abort("Error creating $PKGROOT/MySQL"); + copy("$SI_SCRIPT", "$PKGROOT/MySQL/") + or &abort("Error copying $SI_SCRIPT!"); + chmod(0755, "$PKGROOT/MySQL/" . basename("$SI_SCRIPT")); + copy("$SI_PARAMS", "$PKGROOT/MySQL/") + or &abort("Error copying $SI_PARAMS!"); + chmod(0644, "$PKGROOT/MySQL/" . basename("$SI_PARAMS")); + &run_command("chown -R root.wheel $PKGROOT/*", "Cannot chown $PKGROOT!"); + copy("$SI_POST", "$RESOURCE_DIR/postinstall") + or &abort("Error copying $SI_POST!"); + chmod(0644, "$RESOURCE_DIR/postinstall"); + } + + &logger("Building $SI_NAME.pkg using PackageMaker"); + $command= "$PM -build -p $PKGDEST/$SI_NAME.pkg -f $PKGROOT -r $RESOURCE_DIR -i $SI_INFO -d $SI_DESC || true"; + &run_command($command, "Error while building package $SI_NAME.pkg!"); +} if ($opt_skip_dmg) { @@ -159,7 +216,7 @@ if ($opt_skip_dmg) # 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"); -if (! $opt_dry_run) +unless($opt_dry_run) { chomp($_= `du -sk $PKGDEST`); @size= split(); @@ -167,7 +224,10 @@ if (! $opt_dry_run) &logger("Disk image size: $size KB"); } -&abort("Zero bytes? Something is wrong here!") if ($size == 0); +unless($opt_dry_run) +{ + &abort("Zero bytes? Something is wrong here!") if ($size == 0); +} # Now create and mount the disk image $TMPNAME= $NAME . ".tmp"; @@ -181,7 +241,7 @@ $command= "hdiutil create $TMPNAME -size ${size}k -ov -fs UFS -volname $NAME"; chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f3 -d" "`) if (!$opt_dry_run); &logger("Copying $PKGDEST/$NAME.pkg to Disk image /Volumes/$NAME"); &run_command("ditto $PKGDEST /Volumes/$NAME", "Could not copy $PKGDEST to /Volumes/$NAME!"); -&run_command("ditto $RESOURCE_DIR/ReadMe.txt /Volumes/$NAME", "Could not copy $RESOURCE_DIR/ReadMe.txt to /Volumes/$NAME!"); +&run_command("ditto $SUPFILEDIR/ReadMe.txt /Volumes/$NAME", "Could not copy $SPFILEDIR/ReadMe.txt to /Volumes/$NAME!"); chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f1 -d" "`) if (!$opt_dry_run); &abort("/Volumes/$NAME not attached!") if (!$mountpoint && !$opt_dry_run); &logger("Unmounting $mountpoint"); @@ -221,20 +281,23 @@ NOTE: You need to run this script with root privileges (required Options: - --dry-run Dry run without executing --h, --help Print this help --l, --log[=] Write a log file [to ] - (default is "$LOGFILE") --m, --mail=
Mail a failure report to the given address - (and include a log file snippet, if logging - 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 + --dry-run Dry run without executing +-h, --help Print this help +-l, --log[=] Write a log file [to ] + (default is "$LOGFILE") +-m, --mail=
Mail a failure report to the given + address (and include a log file snippet, + if logging is enabled) + Note that the \@-Sign needs to be quoted! + Example: --mail=user\\\@domain.com +-s, --skip-disk-image, --skip-dmg Just build the PKGs, don't put it into a + disk image afterwards + --skip-startup-item, --skip-si Skip the creation of the StartupItem PKG + --suffix= The package suffix + (e.g. "-standard" or "-pro) + --version= The MySQL version number + (e.g. 4.0.11-gamma) +-v, --verbose Verbose execution EOF exit 1; diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm index 6d107bc2413..0f423feb921 100755 --- a/Build-tools/Do-rpm +++ b/Build-tools/Do-rpm @@ -1,259 +1,227 @@ -#!/bin/bash +#!/usr/bin/perl -w +# +# Do-rpm - compile RPM packages out of a source tarball and move the +# resulting RPM packages into the current directory. +# +# 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 source distribution (mysql-.tar.gz) +# in the current directory +# - there must be a spec file (mysql-.spec) in the directory +# $HOME//mysql-/support-files/ +# +# Use the "--help" option for more info! +# +# written by Lenz Grimmer +# -#helper functions +use Cwd; +use File::Basename; +use File::Copy; +use Getopt::Long; +Getopt::Long::Configure ("bundling"); +use Sys::Hostname; -function copy_to_bmachine +$opt_cc= undef; +$opt_cflags= undef; +$opt_clean= undef; +$opt_cxx= undef; +$opt_cxxflags= undef; +$opt_dry_run= undef; +$opt_help= undef; +$opt_log= undef; +$opt_mail= ""; +$opt_verbose= undef; + +$MAJOR= $MINOR= $RELEASE= 0; + +GetOptions( + "cc=s", + "cflags=s", + "clean|c", + "cxx=s", + "cxxflags=s", + "dry-run|t", + "help|h", + "log|l:s", + "mail|m=s", + "verbose|v", +) || &print_help; + +defined($VERSION=$ARGV[0]) || print_help("Please provide the MySQL version!"); + +# Include helper functions +$PWD= cwd(); +$LOGGER= "$PWD/logger.pm"; +if (-f "$LOGGER") { - if [ x$local_build = x1 ]; then - rm -f $2 - cp $1 $2 - else - scp $1 $owner@$bmachine:$2 - fi + do "$LOGGER"; +} +else +{ + die "ERROR: $LOGGER cannot be found!\n"; } -function copy_from_bmachine +# +# Override predefined Log file name +# +if (defined $opt_log) { - if [ x$local_build = x1 ]; then - rm -f $2 - cp $1 $2 - else - scp $owner@$bmachine:$1 $2 - fi + if ($opt_log ne "") + { + if ($opt_log =~ /^\/.*/) + { + $LOGFILE= $opt_log; + } + else + { + $LOGFILE= $PWD . "/" . $opt_log; + } + } } -function run_command +($MAJOR, $MINOR, $RELEASE)= split(/\./, $VERSION); +$HOST= hostname(); +$HOST=~ /^([^.-]*)/; +$HOST= $1; +$LOGFILE= "$PWD/Logs/Do-rpm-$HOST-$MAJOR.$MINOR.log"; + +&print_help("") if ($opt_help); + +# +# Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs +# +if (-x "/usr/bin/rpmbuild") { - if [ x$local_build = x1 ]; then - bash $1 - else - cat $1 | ssh $owner@$bmachine bash - fi + $RPM= "/usr/bin/rpmbuild"; +} +else +{ + $RPM= "/bin/rpm"; } -#Supply defaults +if ($RPM) +{ + &logger("Found rpm binary: $RPM"); +} +else +{ + &abort("Unable to find RPM binary!"); +} -# We built on one of two machines -bmachine=work -smachine=work -owner=my +# +# determine some RPM settings for this host +# +chomp($RPMARCH= `$RPM --eval "%{_arch}" 2> /dev/null`); +chomp($RPMDIR= `$RPM --eval "%{_rpmdir}" 2> /dev/null`); +chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`); +chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`); +chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); -# Hard path!! -bpath=`/bin/pwd` +$SOURCEFILE= "mysql-$VERSION.tar.gz"; +$SPECFILE= "$PWD/$HOST/mysql-$VERSION/support-files/mysql-$VERSION.spec"; -for d in /usr/src/redhat /usr/src/packages ; do -if test -d "$d" -then - rpmdir=$d -fi -done +&logger("Starting RPM build of MySQL-$VERSION on $HOST"); -if test -z "$rpmdir" -then - echo "Could not find suitable rpmdir on this system" - exit 1 -fi - +foreach $file ($SOURCEFILE, $SPECFILE) +{ + &abort("Unable to find $file!") unless (-f "$file"); +} -logdir="$bpath/Logs" +# +# Install source and spec file +# +&logger("Copying SOURCE and SPEC file to build directories."); +copy($SOURCEFILE, $SOURCEDIR) +or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); +copy($SPECFILE, $SPECDIR) +or &abort("Unable to copy $SPECFILE to $SPECDIR!"); -###### Perl STUFF ##### +# +# Set environment variables - these are being used in the +# official MySQL RPM spec file +# +&logger("Setting special build environment variables") +if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx); +$ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc); +$ENV{MYSQL_BUILD_CFLAGS}=$opt_cflags if ($opt_cflags); +$ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags); +$ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx); -# Perl version numbers. Should be autodetected from the files in the -# Perl-mysql-modules/ directory. -DBI_VERSION="1.14" -DATA_SHOWTABLE_VERSION="3.3" -DBD_MYSQL_VERSION="1.2215" -MAKERPM="$rpmdir/SOURCES/makerpm.pl" +# +# Build the RPMs +# +$command= "$RPM"; +$command.= " -v" if ($opt_verbose); +$command.= " -ba"; +$command.= " --clean" if $opt_clean; +$command.= " $SPECDIR/"; +$command.= basename($SPECFILE); +&logger("Building RPM."); +&run_command($command, "Error while building the RPMs!"); -####################### -AM_MAKEFLAGS="-j 2" +# +# Move the resulting RPMs into the pwd +# +$command= "mv"; +$command.= " -v " if ($opt_verbose); +$command.= "$SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD"; +&run_command($command, "Error moving source RPM!"); -VER=`grep "AM_INIT_AUTOMAKE(mysql, " $bpath/configure.in | \ - sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;'` -VER_NO_DASH=`echo $VER | sed -e "s|-.*$||"` -tarball=$bpath/mysql-$VER.tar.gz +$command= "mv"; +$command.= " -v " if ($opt_verbose); +$command.= "$RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; +&run_command($command, "Error moving binary RPMs!"); -while test $# -gt 0; do - case "$1" in - --rpmdir=*) - rpmdir=`echo $1 | sed -e "s;--rpmdir=;;"` - ;; - --smachine=*) - smachine=`echo $1 | sed -e "s;--smachine=;;"` - ;; - --bmachine=*) - bmachine=`echo $1 | sed -e "s;--bmachine=;;"` - ;; - --owner=*) - owner=`echo $1 | sed -e "s;--owner=;;"` - ;; - --tarball=*) - tarball=`echo $1 | sed -e "s;--tarball=;;"` - ;; - --logdir=*) - logdir=`echo $1 | sed -e "s;--logdir=;;"` - ;; - --local ) - local_build=1 - ;; - --skip-perl ) - skip_perl=1 - ;; - * ) break ;; - esac - shift -done +# +# Clean up +# +if ($opt_clean) +{ + &logger("Removing spec file and source package"); + unlink("$SPECDIR/" . basename($SPECFILE)); + unlink("$SOURCEDIR/$SOURCEFILE"); +} -echo "Removing old MySQL packages" -rm -f $bpath/NEW-RPMS/MySQL-*rpm +&logger("SUCCESS: RPM files successfully created.") if (!$opt_dry_run); +exit 0; -if [ ! -d "$logdir" ]; then - echo "$logdir does not exist, creating" - mkdir -p $logdir -fi +sub print_help +{ + my $message= $_[0]; + if ($message ne "") + { + print "\n"; + print "ERROR: $message\n\n}"; + } + print < -log=$logdir/Log-RPM-`date +%y%m%d-%H%M` +Creates a binary RPM package out of a MySQL source distribution and moves the +resulting RPMs into the current directory. is the MySQL version +number (e.g. 4.0.11-gamma) -echo "Building RPM for MySQL version $VER on $bmachine" -echo "Details in $log" +Options: -( -set -x -# remove old stuff -rm -rf $rpmdir/BUILD/mysql-* -rm -f $rpmdir/SOURCES/mysql-* -rm -f $rpmdir/SRPMS/MySQL-* -rm -f $rpmdir/SPECS/mysql-* -rm -rf /var/tmp/mysql + --cc= Use to compile C code + --ccflags= Use special C compiler flags + --cxx= Use to compile C++ code + --cxxflags= Use special C++ compiler flags +-c, --clean Clean up after the build +-t, --dry-run Dry run without executing +-h, --help Print this help +-l, --log[=] Write a log file [to ] + (default is "$LOGFILE") +-m, --mail=
Mail a failure report to the given address + (and include a log file snippet, if logging + is enabled) + Note that the \@-Sign needs to be quoted! + Example: --mail=user\\\@domain.com +-v, --verbose Verbose execution -# Copy MySQL source and spec files - -#Sasha: I left the scp stuff commented out instead of deleted to make it -#easy to revert in a hurry, if there is a need. Once everything is tested -#and works perfectly, the scp stuff should be deleted to avoid confusion - -#scp $bpath/mysql-$VER.tar.gz $owner@$bmachine:$rpmdir/SOURCES -copy_to_bmachine $tarball $rpmdir/SOURCES -#scp $bpath/Docs/Images/mysql-logo.gif $owner@$bmachine:$rpmdir/SOURCES/mysql.gif -copy_to_bmachine $bpath/Docs/Images/mysql-logo.gif $rpmdir/SOURCES/mysql.gif -#scp $bpath/support-files/mysql-$VER.spec $owner@$bmachine:$rpmdir/SPECS -copy_to_bmachine $bpath/support-files/mysql-$VER.spec $rpmdir/SPECS - -# Copy perl things. Has to be uncompressed since Compress.pm is not -# installed yet. Set CEXT to .gz when we support compression. -CEXT= -#scp $bpath/Perl-mysql-modules/To-SOURCES/* $owner@$bmachine:$rpmdir/SOURCES - -# This had to be installed on the target machince! -# http://www.perl.com/CPAN/modules/by-module/Archive/Archive-Tar-0.21.tar.gz -# cd /usr/lib/perl5/site_perl/5.005; ln -s ../* .; rm -f 5.005 - -TMP_SCRIPT_MYSQL=00-temp-for-do-rpm.$$ -cat > $logdir/$TMP_SCRIPT_MYSQL < $logdir/$TMP_SCRIPT_PERL < $log 2>&1 +EOF + exit 1; +} diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright index 70b65d3f2cf..a798ee7ab65 100755 --- a/Build-tools/mysql-copyright +++ b/Build-tools/mysql-copyright @@ -3,8 +3,11 @@ # Untar a MySQL distribution, change the copyright texts, # pack it up again to a given directory -$VER="1.2"; +$VER="1.3"; +use Cwd; +use File::Basename; +use File::Copy; use Getopt::Long; $opt_help = 0; @@ -17,8 +20,7 @@ GetOptions("help","version","target=s") || error(); # fix the directory prefix for target dir -$WD= `pwd`; -chop $WD; +$WD= cwd(); $opt_target= $WD . '/' . $opt_target; &main(); @@ -73,11 +75,11 @@ sub main $newdistname= $1."com".$2.$3; } # find out the extract path (should be same as distname!) - $destdir= `tar tvzf ../$distfile | head -1`; - # remove leading crab - $destdir =~ s/.*\d+:\d+:\d+[ ]//; - # remove newline and slash from the end - $destdir= substr($destdir, 0, -2); + chomp($destdir= `tar ztf ../$distfile | head -1`); + # remove slash from the end + $destdir= substr($destdir, 0, -1); + print "destdir: $destdir\n"; + print "distname: $distname\n"; if ("$destdir" ne "$distname") { @@ -96,15 +98,18 @@ sub main # remove the 'PUBLIC' file from distribution and copy MySQLEULA.txt # on the toplevel of the directory instead. file 'PUBLIC' shouldn't # exist in the new mysql distributions, but let's be sure.. - `rm -f $destdir/PUBLIC $destdir/README`; - `cp -p $WD/Docs/MySQLEULA.txt $destdir/`; + unlink("$destdir/PUBLIC", "$destdir/README"); + copy("$WD/Docs/MySQLEULA.txt", "$destdir"); + # remove readline subdir + `rm -rf $destdir/cmd-line-utils/readline`; + # fix file copyrights &fix_usage_copyright(); &add_copyright(); # rename the directory with new distribution name - `mv -f $destdir $newdistname`; + rename($destdir, $newdistname); # tar the new distribution `tar cz -f $opt_target/$newdistname.tar.gz *`; diff --git a/INSTALL-WIN-SOURCE b/INSTALL-WIN-SOURCE old mode 100755 new mode 100644 diff --git a/Makefile.am b/Makefile.am index ffebf891795..56e5b78ea90 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,7 @@ AUTOMAKE_OPTIONS = foreign # These are built from source in the Docs directory EXTRA_DIST = INSTALL-SOURCE README \ - COPYING COPYING.LIB + COPYING COPYING.LIB zlib SUBDIRS = . include @docs_dirs@ \ @readline_topdir@ sql-common \ @thread_dirs@ pstack @sql_client_dirs@ \ diff --git a/SSL/cacert.pem b/SSL/cacert.pem index 698784b49f9..b939a037c30 100644 --- a/SSL/cacert.pem +++ b/SSL/cacert.pem @@ -1,20 +1,21 @@ -----BEGIN CERTIFICATE----- -MIIDQjCCAqugAwIBAgIBADANBgkqhkiG9w0BAQQFADB6MQswCQYDVQQGEwJSVTET -MBEGA1UECBMKU29tZS1TdGF0ZTERMA8GA1UEBxMIT3JlbmJ1cmcxETAPBgNVBAoT -CE15U1FMIEFCMQ8wDQYDVQQDEwZXYWxydXMxHzAdBgkqhkiG9w0BCQEWEHdhbHJ1 -c0BteXNxbC5jb20wHhcNMDIwODAyMjE1NTUzWhcNMDMwODAyMjE1NTUzWjB6MQsw -CQYDVQQGEwJSVTETMBEGA1UECBMKU29tZS1TdGF0ZTERMA8GA1UEBxMIT3JlbmJ1 -cmcxETAPBgNVBAoTCE15U1FMIEFCMQ8wDQYDVQQDEwZXYWxydXMxHzAdBgkqhkiG -9w0BCQEWEHdhbHJ1c0BteXNxbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ -AoGBALFLPDNDeq213XvhBP3TxhC0NcGKJ/sWzaHkNmunQ8sTbV8AfdFafvP7cSHk -O3jh7smpVWnxmcIbq1dpsbb7X5vQVc8ru07Z8VhCJWx6H8kgI95Am6wbm2ho2Lok -9ODG8f/lA4kLv8Vo0hqtfV5T1mnZpSzkh6G4b0yPzHu8gtObAgMBAAGjgdcwgdQw -HQYDVR0OBBYEFNnYan2rzhBiGhb86Wr03PFmrNC5MIGkBgNVHSMEgZwwgZmAFNnY -an2rzhBiGhb86Wr03PFmrNC5oX6kfDB6MQswCQYDVQQGEwJSVTETMBEGA1UECBMK -U29tZS1TdGF0ZTERMA8GA1UEBxMIT3JlbmJ1cmcxETAPBgNVBAoTCE15U1FMIEFC -MQ8wDQYDVQQDEwZXYWxydXMxHzAdBgkqhkiG9w0BCQEWEHdhbHJ1c0BteXNxbC5j -b22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQADeMZEA5Rh4PDq -DmS9cYyogjb9gkuLHeo/pqfU8iSZVsSaf6Uqh6TWKQOuK3I4R1K8iMo4cW6LhxxH -HLFrVIQn6xhLvfC0T6Zl7G0w6rAY2+QlbEhjnsgHtLGrB5xjSYLq6Uz3gAMbEsA4 -rCpQJECDe2PzoUXZj9mE2sdljiGcvQ== +MIIDcTCCAtqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCU0Ux +EDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhB +YnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0 +Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wHhcNMDMwODA3MTEyMTQwWhcNMDMw +OTA2MTEyMTQwWjCBiDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAP +BgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhBYnN0cmFjdCBNeVNRTCBEZXZlbG9w +ZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNx +bC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALgbnH12rP8XEJsRuy69 +9n412tEOucpQyxkpNiDgLRvlYEGIJutK2LAqPHoPg7Em2+WJ+vrFh/BVx4hOUHmk +tJ94qTHLLCCj07cjzcoADjzPT9254VqSuQy/JvDNamKEOEdXU8l4/bc26VKVZ99x +iqXbHLiIWNa+UUwyRDSkERepAgMBAAGjgegwgeUwHQYDVR0OBBYEFJVKQT7xXBK0 +ez6fOwwjZpA9f07YMIG1BgNVHSMEga0wgaqAFJVKQT7xXBK0ez6fOwwjZpA9f07Y +oYGOpIGLMIGIMQswCQYDVQQGEwJTRTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UE +ChMITXlTUUwgQUIxITAfBgNVBAMTGEFic3RyYWN0IE15U1FMIERldmVsb3BlcjEx +MC8GCSqGSIb3DQEJARYiYWJzdHJhY3QubXlzcWwuZGV2ZWxvcGVyQG15c3FsLmNv +bYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4GBAJFucCIj0wREcF9P +vOaKVbvcaBwgit6oXOf7ZOPcIUQxQJOnXLVkWIdMP2mP/zHAUsCmXT2k8aXWRegB +6kh/PjV/vSYFbGtE/vh/12x/nSIUU+Y9B1EwvoeskuOwu34Ih514Y1z1bPMNt18N +4LGzMEBeklJ3gxBPlRXER9BSUpRH -----END CERTIFICATE----- diff --git a/SSL/client-cert.pem b/SSL/client-cert.pem index 729379babdc..54b173baae2 100644 --- a/SSL/client-cert.pem +++ b/SSL/client-cert.pem @@ -3,24 +3,24 @@ Certificate: Version: 3 (0x2) Serial Number: 2 (0x2) Signature Algorithm: md5WithRSAEncryption - Issuer: C=RU, ST=Some-State, L=Orenburg, O=MySQL AB, CN=Walrus/Email=walrus@mysql.com + Issuer: C=SE, L=Uppsala, O=MySQL AB, CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com Validity - Not Before: Aug 2 22:08:07 2002 GMT - Not After : Aug 2 22:08:07 2003 GMT - Subject: C=RU, L=orenburg, O=MySQL AB, OU=client, CN=walrus/Email=walrus@mysql.com + Not Before: Aug 7 11:41:56 2003 GMT + Not After : Aug 4 11:41:56 2013 GMT + Subject: C=SE, L=Uppsala, O=MySQL AB, CN=MySQL Client/Email=abstract.mysql.developer@mysql.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): - 00:ab:27:e4:1e:f0:34:8b:a9:50:df:0a:b0:55:20: - b3:1f:0f:cf:f1:51:1e:66:48:a6:f8:4e:0d:d4:49: - f4:ea:d3:41:6b:7e:06:78:3c:29:9d:8e:d3:33:4d: - 0b:fc:34:4d:18:88:48:61:af:11:da:db:84:c0:92: - 91:81:6a:b6:21:d5:8e:9b:f2:6f:d8:06:ad:d6:77: - f6:8b:bd:07:d5:b7:fb:c6:f0:64:e6:3f:58:f0:6a: - 1e:81:73:97:6d:9d:c6:ec:b0:5e:1e:c6:57:82:b0: - 98:9c:ae:26:84:43:0d:98:6c:b4:d8:52:13:70:15: - 79:61:40:84:19:ea:f6:63:3f + 00:c4:03:0a:ee:e3:b1:12:fc:ee:b4:19:f4:e1:60: + 1d:e0:28:c3:96:2d:df:82:69:cd:74:7c:54:58:d0: + ae:b3:59:3f:0c:19:1c:99:10:a6:12:c9:cf:3a:64: + 05:43:8e:bf:d2:65:36:80:91:0b:65:b0:27:26:38: + c9:23:d8:36:a2:4a:f0:f7:c0:2f:68:38:70:01:27: + 29:ff:b2:c5:52:e1:6b:f1:c8:d7:c3:5c:ee:f0:37: + 6c:2a:9b:96:1a:05:9e:eb:33:a2:39:5a:77:66:62: + 27:75:1f:2f:6f:38:da:e5:9f:78:af:ca:6b:22:3f: + 57:2b:bc:a6:8f:47:d1:99:6f Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: @@ -28,39 +28,40 @@ Certificate: Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: - A6:D9:70:92:AC:2B:F6:48:A5:FB:29:CF:78:4A:57:B5:3B:43:97:EE + 80:81:A9:22:EB:AB:D6:CA:7E:3F:8D:BB:D1:AC:2A:F4:87:9D:13:29 X509v3 Authority Key Identifier: - keyid:D9:D8:6A:7D:AB:CE:10:62:1A:16:FC:E9:6A:F4:DC:F1:66:AC:D0:B9 - DirName:/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com + keyid:95:4A:41:3E:F1:5C:12:B4:7B:3E:9F:3B:0C:23:66:90:3D:7F:4E:D8 + DirName:/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com serial:00 Signature Algorithm: md5WithRSAEncryption - 15:96:43:10:89:e0:a6:82:a4:91:0f:7e:2e:d8:80:54:ba:63: - e2:8f:b0:aa:ea:be:35:2c:8f:0d:03:a9:86:2e:32:51:33:8a: - cc:b2:5e:b3:12:cb:b7:42:06:40:89:ce:92:87:40:f1:6a:79: - 0c:3e:00:1d:06:bf:3c:c1:da:f6:3b:e1:42:e6:55:4c:31:e1: - b9:79:f3:99:14:f6:68:9e:67:2b:e3:71:88:6b:2b:e2:08:bd: - 67:79:ea:0e:7d:34:0d:41:22:3a:f4:8f:4d:51:07:6f:5a:44: - 34:05:d1:b3:ca:cf:09:2b:43:25:a1:7f:ac:f4:54:f1:e3:93: - 47:44 + 6d:8a:af:34:07:ac:95:72:a4:78:fe:f8:b8:30:9a:e0:d9:74: + 82:34:5c:fd:11:15:dd:63:fd:65:20:04:7e:b5:8f:2e:26:ef: + ab:b9:10:5f:9b:40:65:76:ab:ed:bd:bf:d5:bc:89:7f:19:d8: + a7:b5:9e:24:bd:c7:ac:8e:16:35:83:c8:ce:8d:85:7c:b4:36: + 28:dd:3a:97:e5:b2:dd:8f:88:4d:5b:50:bd:97:28:61:8e:e7: + 05:5c:c2:bb:46:a1:ac:7e:ee:ac:7d:72:d5:a7:07:4e:1d:68: + 4e:80:e2:35:7d:db:24:73:be:bc:0d:ca:f4:ae:4e:21:52:3b: + ae:81 -----BEGIN CERTIFICATE----- -MIIDajCCAtOgAwIBAgIBAjANBgkqhkiG9w0BAQQFADB6MQswCQYDVQQGEwJSVTET -MBEGA1UECBMKU29tZS1TdGF0ZTERMA8GA1UEBxMIT3JlbmJ1cmcxETAPBgNVBAoT -CE15U1FMIEFCMQ8wDQYDVQQDEwZXYWxydXMxHzAdBgkqhkiG9w0BCQEWEHdhbHJ1 -c0BteXNxbC5jb20wHhcNMDIwODAyMjIwODA3WhcNMDMwODAyMjIwODA3WjB2MQsw -CQYDVQQGEwJSVTERMA8GA1UEBxMIb3JlbmJ1cmcxETAPBgNVBAoTCE15U1FMIEFC -MQ8wDQYDVQQLEwZjbGllbnQxDzANBgNVBAMTBndhbHJ1czEfMB0GCSqGSIb3DQEJ -ARYQd2FscnVzQG15c3FsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA -qyfkHvA0i6lQ3wqwVSCzHw/P8VEeZkim+E4N1En06tNBa34GeDwpnY7TM00L/DRN -GIhIYa8R2tuEwJKRgWq2IdWOm/Jv2Aat1nf2i70H1bf7xvBk5j9Y8GoegXOXbZ3G -7LBeHsZXgrCYnK4mhEMNmGy02FITcBV5YUCEGer2Yz8CAwEAAaOCAQIwgf8wCQYD -VR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlm -aWNhdGUwHQYDVR0OBBYEFKbZcJKsK/ZIpfspz3hKV7U7Q5fuMIGkBgNVHSMEgZww -gZmAFNnYan2rzhBiGhb86Wr03PFmrNC5oX6kfDB6MQswCQYDVQQGEwJSVTETMBEG -A1UECBMKU29tZS1TdGF0ZTERMA8GA1UEBxMIT3JlbmJ1cmcxETAPBgNVBAoTCE15 -U1FMIEFCMQ8wDQYDVQQDEwZXYWxydXMxHzAdBgkqhkiG9w0BCQEWEHdhbHJ1c0Bt -eXNxbC5jb22CAQAwDQYJKoZIhvcNAQEEBQADgYEAFZZDEIngpoKkkQ9+LtiAVLpj -4o+wquq+NSyPDQOphi4yUTOKzLJesxLLt0IGQInOkodA8Wp5DD4AHQa/PMHa9jvh -QuZVTDHhuXnzmRT2aJ5nK+NxiGsr4gi9Z3nqDn00DUEiOvSPTVEHb1pENAXRs8rP -CStDJaF/rPRU8eOTR0Q= +MIIDkTCCAvqgAwIBAgIBAjANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCU0Ux +EDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhB +YnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0 +Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wHhcNMDMwODA3MTE0MTU2WhcNMTMw +ODA0MTE0MTU2WjB8MQswCQYDVQQGEwJTRTEQMA4GA1UEBxMHVXBwc2FsYTERMA8G +A1UEChMITXlTUUwgQUIxFTATBgNVBAMTDE15U1FMIENsaWVudDExMC8GCSqGSIb3 +DQEJARYiYWJzdHJhY3QubXlzcWwuZGV2ZWxvcGVyQG15c3FsLmNvbTCBnzANBgkq +hkiG9w0BAQEFAAOBjQAwgYkCgYEAxAMK7uOxEvzutBn04WAd4CjDli3fgmnNdHxU +WNCus1k/DBkcmRCmEsnPOmQFQ46/0mU2gJELZbAnJjjJI9g2okrw98AvaDhwAScp +/7LFUuFr8cjXw1zu8DdsKpuWGgWe6zOiOVp3ZmIndR8vbzja5Z94r8prIj9XK7ym +j0fRmW8CAwEAAaOCARQwggEQMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9w +ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBSAgaki66vWyn4/ +jbvRrCr0h50TKTCBtQYDVR0jBIGtMIGqgBSVSkE+8VwStHs+nzsMI2aQPX9O2KGB +jqSBizCBiDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoT +CE15U1FMIEFCMSEwHwYDVQQDExhBYnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAv +BgkqhkiG9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb22C +AQAwDQYJKoZIhvcNAQEEBQADgYEAbYqvNAeslXKkeP74uDCa4Nl0gjRc/REV3WP9 +ZSAEfrWPLibvq7kQX5tAZXar7b2/1byJfxnYp7WeJL3HrI4WNYPIzo2FfLQ2KN06 +l+Wy3Y+ITVtQvZcoYY7nBVzCu0ahrH7urH1y1acHTh1oToDiNX3bJHO+vA3K9K5O +IVI7roE= -----END CERTIFICATE----- diff --git a/SSL/client-key.pem b/SSL/client-key.pem index feff11bfdb7..58fa805e620 100644 --- a/SSL/client-key.pem +++ b/SSL/client-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQCrJ+Qe8DSLqVDfCrBVILMfD8/xUR5mSKb4Tg3USfTq00FrfgZ4 -PCmdjtMzTQv8NE0YiEhhrxHa24TAkpGBarYh1Y6b8m/YBq3Wd/aLvQfVt/vG8GTm -P1jwah6Bc5dtncbssF4exleCsJicriaEQw2YbLTYUhNwFXlhQIQZ6vZjPwIDAQAB -AoGAChyxPaKzeAzo2kSnZmAoNQ2aG4fPY/um4cS6zHASKE2S7+biOvhS/RwTHlTP -AHeWlnx2yk6tn2CY10fRkPPdDsnyj7FpuZmjhmFtprOn+1Mwft7gNTMdKN2EV46/ -hMQxm8/Wu9ejm6IhOeg3Q7lBFwE9tY0kgMzU4zDI3A0HDQECQQDUcxFgxIrOi4Gw -EGxmJgopL+NjG7/4PdT2FM5z1bbwOtfsD1fHKWSiODbfpK8eMwBReI4wfDQ7ViND -xmuDykFDAkEAzj3QH9s8Ej3Vgt88326OhY1W5jTH6M0XkuZ0YatELz3MvLwFhIF4 -puouLJQVo3pQBLV+Tmnh2LQqkii7xA7oVQJBALZxzvW0M6QmyAvEPuMGPema94KQ -PS7ZIr7lpVpyqTTqw600i+Q8VvC8p9stmTmtANP2XN2kfFKMqaI1jvVRxvMCQDJE -8sOxBjVUCQS7MPUs12RKDRJTbx6ZTtOphFiCDD6Pi6W9FoMzo5rbnaGT/qo4F+Tt -7/lg6YGOeInjj9C76XkCQQC2m6j8NeX9E4Pimp1GDE93N2JJ+biJxLI8yFqruv7N -B2M/28JKLGLjam6YVJy4eSA9clXVqwWNxii3fb8qQ7u6 +MIICXQIBAAKBgQDEAwru47ES/O60GfThYB3gKMOWLd+Cac10fFRY0K6zWT8MGRyZ +EKYSyc86ZAVDjr/SZTaAkQtlsCcmOMkj2DaiSvD3wC9oOHABJyn/ssVS4WvxyNfD +XO7wN2wqm5YaBZ7rM6I5WndmYid1Hy9vONrln3ivymsiP1crvKaPR9GZbwIDAQAB +AoGAcR7IaoGhKbIrGGl6d67+zuT3q24h9aOV3Mn7653TlNHGnvbHGFcRYPpyy+H5 +X7m8XnHm+F+80hzNGzPecP9Q12oPOyoZgeQn6bTK73OFkNcX7FAkNdyH4xVhf2aK +YOzTcQfq3gRCqXtVIg4qBShTMjJLE31R8H430Or62XmJgFECQQDjP+Kz+ecQwuTB +HADLm+GQgceIB1kLgdQoZ3deUxGvqtVImuDRViSM0F2srfJ4GfkEDhc27UI5f6ir +ZTOw4ww7AkEA3M9wCPgWNtbOXbYjaNA0IzHcjMDxQDVvJAmb3EiZlKQp4EfrESxR +ly/u08TyfwrK6q5WS7xE0ad8+95G1af4XQJBAI9+3ME20SB1YItMCniHYwSj3oHX +2fN5NKWax/Zoz+c0IV+qZMHq+kNso2oRoOUTyXk1CJWndcTnBnPMALr2c9cCQQCZ +VL7Cq6uZVx6kemcqUHH0AprZbt3YLYLI7pc5p3xmeHzPzoEQQstBhjp8+aU+zPrN +blRkcQ8E2x5yNA7SLLrNAkAhzkA+EK8hc0f9W3ncy+py0Rn0i5Ay0N3T715vkThf +CfOHE3L91dLlmYpL5xVqOpugY/2sHyxwctv97DgS6tHZ -----END RSA PRIVATE KEY----- diff --git a/SSL/client-req.pem b/SSL/client-req.pem index ef11a22165f..b3667fb5ec6 100644 --- a/SSL/client-req.pem +++ b/SSL/client-req.pem @@ -1,30 +1,12 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,8CE2AB38FB50D4B9 - -rrnYZLUKlzV4U7+wqe5CWzTd4RLJb5h4M77aBRQfuHGejSaRsskN2ffpO8uQEAYM -WTJSRC+NO+jDMBZhzt1ktWqCs8d6l6azHoBybIrMJsbUhwybm+OiOfp23RrbNoS/ -S4fsgNdAAGhsRvKDdsItCyYvdH8nTzn+g9r/z2V4tOOXd6MYuT42XA6Uz2tis2SZ -GWEGa7mAweApzSiibE+pzjPS+fdX4E12n6NCVYLhn1JuvzVva/KFSebs4Wh75miC -WvRgkt/5eDQn+vkV67hE3I6p9pPcLh1+PMfaQ25U8VM/r7ejnVFWm7teGH6GKPKJ -cU+PYfblyWcgtiO/fwfGMIqSyNtHj/C3VFVie5D1MTJzBopiPGEcfz00LjBccjjh -j1meTRVN8pMZTgkxlnIFwbU6TPPvx8a9urFVQIJ4z8r2EMvYh5Cqpq87+lH9Pn0C -vzCl78Tz5QLghXNnMbbdD2aPP0PwPEXgh86iZxo06g85n0l26WUzYJlWzBYD4DrF -SbnEUAftTujEOm6MqJNLpJN6UPOtq/HvSaHl1bykGK+zU4gqHj0ur03HlF0l4xNg -OfsoNsJV+O9RUUJ0+D5eqUALJjN8TCV1wNMXOVzr/ue3QCVdlWVfZY4RPffwK9Yp -Fh52T7a2v+shhqZUQNtFDAg50Ac7deUthSWNmi5N680POnJg9KdtBdMhYLa1j3rP -D9oasSK0ugevHuQ6wUiD/95CzZlJXE9K4kTTYmaRk5MTWXhFQxdqHZo1v+pGtaNI -f+/E7q7BiNesSt31U/vkX0Tm3oJ1dgOnS8M2uxiYiKH2mJ/E32tZKw== ------END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE REQUEST----- -MIIB0jCCATsCAQAwgZExCzAJBgNVBAYTAkVFMRMwEQYDVQQIEwpTb21lLVN0YXRl -MRAwDgYDVQQHEwdUYWxsaW5uMSYwJAYDVQQKEx1NeVNRTCBkZW1vIGNsaWVudCBj -ZXJ0aWZpY2F0ZTEUMBIGA1UEAxMLVG9udSBTYW11ZWwxHTAbBgkqhkiG9w0BCQEW -DnRvbnVAbXlzcWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo1FLN -TruWFjrwiWuQTNvgMHVaAnJiv+3avgnogNuAVDDWde3jEKUVRFspkRL+DLd2Telf -VlxFPK2ycS1qesu8BIAIdNZ99nxcdts1xPb12NSJn53MP04/c8E+QX5OCb/qGtmi -Ew3RDNrY9Ju4VCEXrtezAmGHqQH/9P6cevxnQwIDAQABoAAwDQYJKoZIhvcNAQEE -BQADgYEAvENK1JAQfC8xnrFGw2IxfUmUwlRidiRtYTgtVfTr7vA+m4WaaKioni6E -PQXjcvl6kfyRoxc4qWsGi3T7QM2RnvCtbwR2NGSIKX1cBTS31RMr12NSAeXn6Twz -ZwSZ55EHj9N2hArTPNlVjxvDQX3D6/ZBi6JnHAxXigzDqhArgjU= +MIIBvDCCASUCAQAwfDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAP +BgNVBAoTCE15U1FMIEFCMRUwEwYDVQQDEwxNeVNRTCBDbGllbnQxMTAvBgkqhkiG +9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wgZ8wDQYJ +KoZIhvcNAQEBBQADgY0AMIGJAoGBAMQDCu7jsRL87rQZ9OFgHeAow5Yt34JpzXR8 +VFjQrrNZPwwZHJkQphLJzzpkBUOOv9JlNoCRC2WwJyY4ySPYNqJK8PfAL2g4cAEn +Kf+yxVLha/HI18Nc7vA3bCqblhoFnuszojlad2ZiJ3UfL2842uWfeK/KayI/Vyu8 +po9H0ZlvAgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQAnKdk68dGJXvlj/GXwBUWN +oXWF7hq4fDmwyhmcFUqk8qZKPKFUxkcER0GLzYeUgvD2URSfaS3/YW0d7K7kXGwP +rB5edb+suaYf6mjm/w37xw/EJI9rdSKcB/3SSu8mALds7sUHDAO+MO0WkA/9d7t0 +LOsUqcDvMkKpZuYwNILwLw== -----END CERTIFICATE REQUEST----- diff --git a/SSL/server-cert.pem b/SSL/server-cert.pem index b15bd04a25c..9ce296482db 100644 --- a/SSL/server-cert.pem +++ b/SSL/server-cert.pem @@ -3,24 +3,24 @@ Certificate: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: md5WithRSAEncryption - Issuer: C=RU, ST=Some-State, L=Orenburg, O=MySQL AB, CN=Walrus/Email=walrus@mysql.com + Issuer: C=SE, L=Uppsala, O=MySQL AB, CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com Validity - Not Before: Aug 2 21:59:26 2002 GMT - Not After : Aug 2 21:59:26 2003 GMT - Subject: C=RU, L=Orenburg, O=MySQL AB, CN=server/Email=walrus@mysql.com + Not Before: Aug 7 11:39:27 2003 GMT + Not After : Aug 4 11:39:27 2013 GMT + Subject: C=SE, L=Uppsala, O=MySQL AB, CN=MySQL Server/Email=abstract.mysql.developer@mysql.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): - 00:bd:7d:f1:91:51:38:fe:4b:79:b5:ff:e0:41:ae: - 0e:a8:bb:7b:60:42:95:01:75:e7:22:74:55:7d:74: - 4d:50:51:0c:5e:09:4b:2b:0c:8e:3f:9f:14:3f:5e: - d9:25:36:9b:cc:77:35:30:e9:8c:bf:3b:bd:da:62: - 85:4c:90:c8:de:71:2c:0a:7b:dc:e6:85:fd:b4:24: - 88:a7:8f:03:3d:15:7c:59:3d:f8:73:f0:36:2a:b8: - 80:7c:d8:c7:d6:1f:6d:b2:b7:b7:48:9f:24:56:81: - 2c:2e:9c:b9:95:48:50:56:9f:1a:60:96:c4:c0:eb: - 8d:2d:55:38:3f:6b:82:bc:b3 + 00:e9:86:7a:55:84:88:4c:be:a4:f8:92:73:30:12: + 49:0b:7a:85:87:39:34:39:0d:7d:0b:8d:18:c2:17: + 95:13:52:d2:3f:55:10:57:c8:3f:5a:f5:b2:fa:8b: + d0:67:49:cc:aa:82:fc:9f:ce:00:b4:73:f3:36:d2: + 3a:d3:c2:b0:0e:14:c3:d4:b2:21:74:a1:f0:31:81: + 60:87:98:73:5c:10:c1:b1:1a:4d:f1:f3:b0:98:3f: + f0:d7:97:9b:2b:fd:d5:21:79:b2:2f:eb:64:15:c9: + 9b:9d:fc:9e:2d:d4:f8:04:5b:ea:a9:75:4b:42:c3: + 3d:0e:4d:2a:a8:b8:ca:99:8d Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: @@ -28,38 +28,40 @@ Certificate: Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: - C9:D0:D2:F7:17:79:27:1C:4B:C9:E7:92:D5:5E:8C:7E:F2:FE:A7:B7 + 6E:E4:9B:6A:C5:EA:E4:E6:C7:EF:D7:1E:C8:63:45:60:2B:1B:D4:D4 X509v3 Authority Key Identifier: - keyid:D9:D8:6A:7D:AB:CE:10:62:1A:16:FC:E9:6A:F4:DC:F1:66:AC:D0:B9 - DirName:/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com + keyid:95:4A:41:3E:F1:5C:12:B4:7B:3E:9F:3B:0C:23:66:90:3D:7F:4E:D8 + DirName:/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com serial:00 Signature Algorithm: md5WithRSAEncryption - 62:77:bc:16:dc:4c:70:63:4d:03:ce:19:5e:c4:6c:31:0e:57: - 26:d8:6e:25:08:f2:01:ae:98:59:0a:ba:b7:32:c0:39:69:b8: - 4b:aa:59:7c:97:72:4e:50:02:ee:ef:d6:d6:62:b8:25:36:91: - b6:3b:8f:6f:2f:3c:d8:9d:b7:cf:8f:f6:29:50:e9:31:54:77: - 2b:7b:21:72:0f:60:4c:d4:1c:bb:c4:46:e5:fd:a7:5f:ea:46: - e4:df:e9:95:77:2d:91:f8:3b:33:78:83:5d:10:de:98:7c:38: - 91:27:f6:52:8a:b6:54:f1:0f:7a:f0:1d:da:a5:22:d2:75:cc: - 4c:c3 + 7c:b6:9c:fc:ea:9e:e6:88:32:f5:24:81:9b:89:c0:13:fa:75: + 18:51:af:77:ae:b8:4e:12:5f:48:ab:0c:e6:c5:a4:87:93:6e: + 98:97:f5:f3:d3:0b:e0:fc:5e:34:3e:f2:93:58:73:97:b6:a7: + 66:96:81:cd:73:48:f3:75:24:64:61:13:78:3e:ed:df:7c:4d: + fa:2e:3a:64:99:12:24:9e:a2:51:5c:23:85:0b:0c:bb:f5:8e: + 89:80:27:ba:7c:d2:68:90:ff:1f:68:2e:1b:fd:06:bc:c8:41: + d7:b2:be:9c:94:5c:6d:1e:96:3b:75:bc:12:f0:44:bd:36:00: + 84:cd -----BEGIN CERTIFICATE----- -MIIDWTCCAsKgAwIBAgIBATANBgkqhkiG9w0BAQQFADB6MQswCQYDVQQGEwJSVTET -MBEGA1UECBMKU29tZS1TdGF0ZTERMA8GA1UEBxMIT3JlbmJ1cmcxETAPBgNVBAoT -CE15U1FMIEFCMQ8wDQYDVQQDEwZXYWxydXMxHzAdBgkqhkiG9w0BCQEWEHdhbHJ1 -c0BteXNxbC5jb20wHhcNMDIwODAyMjE1OTI2WhcNMDMwODAyMjE1OTI2WjBlMQsw -CQYDVQQGEwJSVTERMA8GA1UEBxMIT3JlbmJ1cmcxETAPBgNVBAoTCE15U1FMIEFC -MQ8wDQYDVQQDEwZzZXJ2ZXIxHzAdBgkqhkiG9w0BCQEWEHdhbHJ1c0BteXNxbC5j -b20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL198ZFROP5LebX/4EGuDqi7 -e2BClQF15yJ0VX10TVBRDF4JSysMjj+fFD9e2SU2m8x3NTDpjL87vdpihUyQyN5x -LAp73OaF/bQkiKePAz0VfFk9+HPwNiq4gHzYx9YfbbK3t0ifJFaBLC6cuZVIUFaf -GmCWxMDrjS1VOD9rgryzAgMBAAGjggECMIH/MAkGA1UdEwQCMAAwLAYJYIZIAYb4 -QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBTJ -0NL3F3knHEvJ55LVXox+8v6ntzCBpAYDVR0jBIGcMIGZgBTZ2Gp9q84QYhoW/Olq -9NzxZqzQuaF+pHwwejELMAkGA1UEBhMCUlUxEzARBgNVBAgTClNvbWUtU3RhdGUx -ETAPBgNVBAcTCE9yZW5idXJnMREwDwYDVQQKEwhNeVNRTCBBQjEPMA0GA1UEAxMG -V2FscnVzMR8wHQYJKoZIhvcNAQkBFhB3YWxydXNAbXlzcWwuY29tggEAMA0GCSqG -SIb3DQEBBAUAA4GBAGJ3vBbcTHBjTQPOGV7EbDEOVybYbiUI8gGumFkKurcywDlp -uEuqWXyXck5QAu7v1tZiuCU2kbY7j28vPNidt8+P9ilQ6TFUdyt7IXIPYEzUHLvE -RuX9p1/qRuTf6ZV3LZH4OzN4g10Q3ph8OJEn9lKKtlTxD3rwHdqlItJ1zEzD +MIIDkTCCAvqgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCU0Ux +EDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCMSEwHwYDVQQDExhB +YnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAvBgkqhkiG9w0BCQEWImFic3RyYWN0 +Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wHhcNMDMwODA3MTEzOTI3WhcNMTMw +ODA0MTEzOTI3WjB8MQswCQYDVQQGEwJTRTEQMA4GA1UEBxMHVXBwc2FsYTERMA8G +A1UEChMITXlTUUwgQUIxFTATBgNVBAMTDE15U1FMIFNlcnZlcjExMC8GCSqGSIb3 +DQEJARYiYWJzdHJhY3QubXlzcWwuZGV2ZWxvcGVyQG15c3FsLmNvbTCBnzANBgkq +hkiG9w0BAQEFAAOBjQAwgYkCgYEA6YZ6VYSITL6k+JJzMBJJC3qFhzk0OQ19C40Y +wheVE1LSP1UQV8g/WvWy+ovQZ0nMqoL8n84AtHPzNtI608KwDhTD1LIhdKHwMYFg +h5hzXBDBsRpN8fOwmD/w15ebK/3VIXmyL+tkFcmbnfyeLdT4BFvqqXVLQsM9Dk0q +qLjKmY0CAwEAAaOCARQwggEQMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9w +ZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRu5Jtqxerk5sfv +1x7IY0VgKxvU1DCBtQYDVR0jBIGtMIGqgBSVSkE+8VwStHs+nzsMI2aQPX9O2KGB +jqSBizCBiDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoT +CE15U1FMIEFCMSEwHwYDVQQDExhBYnN0cmFjdCBNeVNRTCBEZXZlbG9wZXIxMTAv +BgkqhkiG9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb22C +AQAwDQYJKoZIhvcNAQEEBQADgYEAfLac/Oqe5ogy9SSBm4nAE/p1GFGvd664ThJf +SKsM5sWkh5NumJf189ML4PxeND7yk1hzl7anZpaBzXNI83UkZGETeD7t33xN+i46 +ZJkSJJ6iUVwjhQsMu/WOiYAnunzSaJD/H2guG/0GvMhB17K+nJRcbR6WO3W8EvBE +vTYAhM0= -----END CERTIFICATE----- diff --git a/SSL/server-key.pem b/SSL/server-key.pem index 5afd717e07c..4292dc79929 100644 --- a/SSL/server-key.pem +++ b/SSL/server-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQC9ffGRUTj+S3m1/+BBrg6ou3tgQpUBdecidFV9dE1QUQxeCUsr -DI4/nxQ/XtklNpvMdzUw6Yy/O73aYoVMkMjecSwKe9zmhf20JIinjwM9FXxZPfhz -8DYquIB82MfWH22yt7dInyRWgSwunLmVSFBWnxpglsTA640tVTg/a4K8swIDAQAB -AoGARciG2NRHn+aduPe1V5rJDTyWD/oVM8d+ykJ7ZUsaWdSvMEZN51mlXSqxYzED -2N+GesL/1LZ9vcM7hJw5qNu9DQOc7CtMT4k/bmhPJsT226roKKVbw/ocOEY5dK8+ -T9/x8qgo7zC3Qk/bKgjj61m8cQ7Mz/J7ZCEMmDNNrORCzRECQQDrcvJlsBTALilr -MaAqNyaa0tykEabzg2mUFx5uvmzlwNx9ApSidoU5Xop9c6u00zgCDpsDlcwjhOs1 -jcqRkBTrAkEAzggY7BeN3FnW8tsV0Wq4LL6vK30pe0JIylxrKsFjY4LTo9t/8TKK -6ZOEETVtM7sepIkxECw5RCBi9sxi3NClWQJAbrA5WKjw+HA7NJO98lq/IWYkKFXM -IQsUpXRA8FtBormKbpK6Aa6qbxANF3E7teTencj0Azl3IPOqCCFCrDAKRQJAc6bv -9ncyVqLHmgOJN8ikIdnYEp1rj5khqxY9wf5UgCOMEcrBAu/QMlVwKQjIh+VdyhaI -x/9LFgboBomsZS9p4QJBAIXaX/WoqL/wgBGS2UroianFFXL6/Bt//CUoGpYgKQYQ -+x+8heMRppmM0to2J7j9nGE83ikMWfPUwMi4TbyWH3Q= +MIICXgIBAAKBgQDphnpVhIhMvqT4knMwEkkLeoWHOTQ5DX0LjRjCF5UTUtI/VRBX +yD9a9bL6i9BnScyqgvyfzgC0c/M20jrTwrAOFMPUsiF0ofAxgWCHmHNcEMGxGk3x +87CYP/DXl5sr/dUhebIv62QVyZud/J4t1PgEW+qpdUtCwz0OTSqouMqZjQIDAQAB +AoGBALTq11nrjIEQbdSZ+R1z/R0kddB2U+wjdA3/6P9tr7PBxVsFdtzbKaI5mcib +iwCKX0J2qmrP+SHUdsexBZxLR4KV/Z55v9Pym99Dy+DxDA95zURyCMKRBIzlU5uN +F7USEQoltLUCsmZwNWdit0gfxSWdddkHNuI0uxTzHwuDcUlNAkEA/76zVremngNL +DlekM9NPn/8E/TXBHN1b1jdUKd7WymSJykdcm3viU98dFNZFWF8B0jiTcuBKXgpR +vTShNab/swJBAOnCGp554BLhioTyyk8qjRLt3xEsjsDljJULHVLYWcUqIkMf97GL +VLBhl6ZEI9i0WduqvgZ+Bacd0uHqIHz1Yb8CQQDm1CjqTDiGxlIoT9JVNJTZxEOs +h6gVdXY+kxHT+N3FL5luiZp8fAR7zxVgiUVtzdLG+2madfapiobcT3RyCJkhAkBI +64AaR7KasTjg2Ew7/e4cJZAcb2XozrLYG6t+GHeIhehCQEqoW+qDSy5fc4orI7eU +SuMUa2OgCjGqv7p6wKFJAkEAznmum/MbVOBpC4FsdnIGkxyFKIbh2OLY2aUb2KkK +Ouf4S8Y5Ldgszi0fnDPRaxWJzewwZKvcff2zj+mYZeAXbA== -----END RSA PRIVATE KEY----- diff --git a/SSL/server-req.pem b/SSL/server-req.pem index 4cd6610e735..7c3db0660ad 100644 --- a/SSL/server-req.pem +++ b/SSL/server-req.pem @@ -1,30 +1,12 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,6CBD09E71246DC01 - -byRzq5+j3r8FX2kQerTUZT5Bw/N6zrN3cmH6NHGJcrqD+vcPdtWf+Rk+mpNXgSQn -ldkfmniU/htzJ0cUV+KE229Qx10Hx9mIJIbf0Y/rBCUBuaXWVrQB36W9w3rkNPFA -EEuRMkreOJF42RD16+NBJv+RcHIGzGejXecJKUGF5DKlN0U8YHXnkXTQl54kIdr0 -H7rTrvJygwPk9/ik0M9/vmwduAMvTaHDmvgeolpMlJkxwz8vYkbUnFFJZhB6XNCb -1w3lJ0EmRJicK5BnZmCEmgt8xiv0PAtg00jBbwddQbn1reAyViBtBT9iXdusHXS5 -Po63rSt7r3MO8aetcMQ6FkklH+ChuS/vFoNY57AwrzF4uEI4GSoZP0ESrRC5Ar5W -Lzg/HrQAWbPCRlb6Jj3db1woRzFS8joOashROsZdeV/5P4Emhc6J7QMTvB1OHAhQ -ugOJazJtxjg0DN8+9cM1wtHI7N89PLHhOg13LZNLeeehzIlPwKI2JLqXUc6oR407 -i+S7GCqu7wU+if0Enux8Dj7yrvnTUiqVCL2dyKTS3sBq0Cm2UhbecHclor13y6no -y1o50TKKD6Zig2hZmSpqKznMxGMVIT36BE0aOMQUmk+aVnRuROclwTTL0ZNLzA+g -QRTRfQ6iNMf34ypqAMdAMPzDGLPycKuFdxVQxFEVaM2/mrdWFwVAqFsLvzyGvdrh -nkNyRgTWR/pfH9b3mXLqf6gMPNs764WhFIcZIDk9a4XBBUm2YDb2CxDzDCo/EUMA -jvIiU0Jt132SEHHF/wAka6d2DnwZ3vexRp6Tebv/uy9IlMLPE+68dw== ------END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE REQUEST----- -MIIB0jCCATsCAQAwgZExCzAJBgNVBAYTAkVFMRMwEQYDVQQIEwpTb21lLVN0YXRl -MRAwDgYDVQQHEwdUYWxsaW5uMSYwJAYDVQQKEx1NeVNRTCBzZXJ2ZXIgZGVtbyBj -ZXJ0aWZpY2F0ZTEUMBIGA1UEAxMLVG9udSBTYW11ZWwxHTAbBgkqhkiG9w0BCQEW -DnRvbnVAbXlzcWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCerI3Y -HZyy/YiWLLpCU/pdvYWK5crTD8ABPPKSRk/ZgK4qic/v6NRl/Pb1OiZMKdsG+jSh -h/OXtTyU8YQFrK1XJdkC2wBx4KmqtB0pNl6ppA3yRbmDdCtF8+IjvOdc5hG29t3E -rO1lQiw5RyrJ619FAxCrI7zKXIKat7NtZxjSxwIDAQABoAAwDQYJKoZIhvcNAQEE -BQADgYEAlrUnGX4LYIiVjztHA4gUcOSVeEHCci2qEUq+7yY1JhAw54YDa2MLTTwa -cH+rXLHjN0MTNfv9tRxdSX+trk3pyvhgFjssD100dJkF83RfVv2tKg9kscVOGQp7 -MkwOnJjfAjQBlTbTOQM46BTjv2FgvsppkO3ViryI//YxKvj/628= +MIIBvDCCASUCAQAwfDELMAkGA1UEBhMCU0UxEDAOBgNVBAcTB1VwcHNhbGExETAP +BgNVBAoTCE15U1FMIEFCMRUwEwYDVQQDEwxNeVNRTCBTZXJ2ZXIxMTAvBgkqhkiG +9w0BCQEWImFic3RyYWN0Lm15c3FsLmRldmVsb3BlckBteXNxbC5jb20wgZ8wDQYJ +KoZIhvcNAQEBBQADgY0AMIGJAoGBAOmGelWEiEy+pPiSczASSQt6hYc5NDkNfQuN +GMIXlRNS0j9VEFfIP1r1svqL0GdJzKqC/J/OALRz8zbSOtPCsA4Uw9SyIXSh8DGB +YIeYc1wQwbEaTfHzsJg/8NeXmyv91SF5si/rZBXJm538ni3U+ARb6ql1S0LDPQ5N +Kqi4ypmNAgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQCagJxGHBC+G5aSh3OguFn6 +z+qAC7u3B181kPBgNv20zMgLeq7YiAh3iNx4XO2+QXRGzMznFKx1tFr/mavCpgLs +p3+dCvQt5FHEFFK1D1pDeXy4146X07hOTtC9jc/jSWeVnH4ujuX5gMtZqisOyYWV +/gpw6dBtkTYlhS+y86kM/Q== -----END CERTIFICATE REQUEST----- diff --git a/VC++Files/client/mysql.dsp b/VC++Files/client/mysql.dsp index c0fd1e785d5..2e9e1729bed 100644 --- a/VC++Files/client/mysql.dsp +++ b/VC++Files/client/mysql.dsp @@ -25,7 +25,7 @@ CFG=mysql - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysql - Win32 Release" @@ -49,7 +49,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # ADD LINK32 mysqlclient.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:console /debug /machine:I386 /out:"../client_release/mysql.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes @@ -68,14 +68,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.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:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysql.exe" /pdbtype:sept /libpath:"..\lib_debug\\" diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp index 11189ecb065..2c762cd8a24 100644 --- a/VC++Files/client/mysqladmin.dsp +++ b/VC++Files/client/mysqladmin.dsp @@ -25,7 +25,7 @@ CFG=mysqladmin - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqladmin - Win32 Release" @@ -49,7 +49,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # ADD LINK32 mysqlclient.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:console /machine:I386 /out:"../client_release/mysqladmin.exe" /libpath:"..\lib_release\\" @@ -67,14 +67,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.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:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqladmin.exe" /pdbtype:sept /libpath:"..\lib_debug\\" diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp index 0f4c46acd2a..685c9ae1a15 100644 --- a/VC++Files/client/mysqlclient.dsp +++ b/VC++Files/client/mysqlclient.dsp @@ -25,7 +25,7 @@ CFG=mysqlclient - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlclient - Win32 Release" @@ -48,7 +48,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib" @@ -65,14 +65,14 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib" diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index 4fae9a5769a..d36664e09ce 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -25,7 +25,7 @@ CFG=mysqldump - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqldump - Win32 Release" @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # ADD LINK32 mysqlclient.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:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" @@ -67,16 +67,16 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.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:console /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.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:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ENDIF diff --git a/VC++Files/client/mysqlimport.dsp b/VC++Files/client/mysqlimport.dsp index 8eb08f1411f..a8b239d226f 100644 --- a/VC++Files/client/mysqlimport.dsp +++ b/VC++Files/client/mysqlimport.dsp @@ -25,7 +25,7 @@ CFG=mysqlimport - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlimport - Win32 Release" @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # ADD LINK32 mysqlclient.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:console /machine:I386 /out:"../client_release/mysqlimport.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /incremental:yes @@ -68,14 +68,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.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 setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlimport.exe" /pdbtype:sept /libpath:"..\lib_debug\\" diff --git a/VC++Files/client/mysqlshow.dsp b/VC++Files/client/mysqlshow.dsp index 78627246050..26705465fec 100644 --- a/VC++Files/client/mysqlshow.dsp +++ b/VC++Files/client/mysqlshow.dsp @@ -25,7 +25,7 @@ CFG=mysqlshow - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlshow - Win32 Release" @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MT /W3 /GX- /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # ADD LINK32 mysqlclient.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:console /machine:I386 /out:"../client_release/mysqlshow.exe" /libpath:"..\lib_release\\" @@ -67,16 +67,16 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /GX- /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.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:console /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD LINK32 mysqlclient.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:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlshow.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ENDIF diff --git a/VC++Files/comp_err/comp_err.dsp b/VC++Files/comp_err/comp_err.dsp index 71582b84763..deaf0627262 100644 --- a/VC++Files/comp_err/comp_err.dsp +++ b/VC++Files/comp_err/comp_err.dsp @@ -24,7 +24,7 @@ CFG=comp_err - Win32 Release # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -33,8 +33,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c @@ -44,7 +44,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 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:console /machine:I386 # 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"Release/comp-err.exe" # Begin Target diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp index 7e6f3037400..9985ec7e454 100644 --- a/VC++Files/innobase/innobase.dsp +++ b/VC++Files/innobase/innobase.dsp @@ -87,8 +87,8 @@ LIB32=xilink6.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "innobase___Win32_nt" -# PROP Intermediate_Dir "innobase___Win32_nt" +# PROP Output_Dir "nt" +# PROP Intermediate_Dir "nt" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c # ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c @@ -111,8 +111,8 @@ LIB32=xilink6.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "innobase___Win32_Max_nt" -# PROP Intermediate_Dir "innobase___Win32_Max_nt" +# PROP Output_Dir "max_nt" +# PROP Intermediate_Dir "max_nt" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c # ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c diff --git a/VC++Files/isamchk/isamchk.dsp b/VC++Files/isamchk/isamchk.dsp index e1e0f8aac3a..0e8e2b04bd7 100644 --- a/VC++Files/isamchk/isamchk.dsp +++ b/VC++Files/isamchk/isamchk.dsp @@ -25,7 +25,7 @@ CFG=isamchk - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "isamchk - Win32 Release" @@ -49,7 +49,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /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 setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe" # SUBTRACT LINK32 /pdb:none @@ -68,14 +68,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x41d /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/isamchk.exe" /pdbtype:sept # SUBTRACT LINK32 /verbose /pdb:none diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index d4f7ed6df82..8ab15a03110 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -76,7 +76,7 @@ PostBuild_Cmds=xcopy release\libmysql.lib ..\lib_release /y # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 691c66a074d..593c53a57ba 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -25,7 +25,7 @@ CFG=libmysqld - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe MTL=midl.exe RSC=rc.exe @@ -38,8 +38,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c @@ -51,7 +51,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 /dll /machine:I386 # 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\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.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 /dll /pdb:none /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" @@ -69,7 +69,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MT /W3 /Gm /Zi /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x416 /d "_DEBUG" @@ -77,7 +77,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 /dll /debug /machine:I386 /pdbtype:sept # 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_debug\dbug.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\innodb.lib /nologo /dll /pdb:none /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" diff --git a/VC++Files/libmysqltest/myTest.dsp b/VC++Files/libmysqltest/myTest.dsp index 744b2c04993..1d3a790edd5 100644 --- a/VC++Files/libmysqltest/myTest.dsp +++ b/VC++Files/libmysqltest/myTest.dsp @@ -25,7 +25,7 @@ CFG=myTest - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myTest - Win32 Release" @@ -49,7 +49,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # ADD LINK32 libmysql.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:console /machine:I386 /libpath:"..\lib_release" @@ -67,14 +67,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "..\include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "..\include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libmysql.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:console /incremental:no /debug /machine:I386 /pdbtype:sept /libpath:"..\lib_debug" diff --git a/VC++Files/my_print_defaults/my_print_defaults.dsp b/VC++Files/my_print_defaults/my_print_defaults.dsp index b485a20a844..25f5332eb0f 100644 --- a/VC++Files/my_print_defaults/my_print_defaults.dsp +++ b/VC++Files/my_print_defaults/my_print_defaults.dsp @@ -25,7 +25,7 @@ CFG=my_print_defaults - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "my_print_defaults - Win32 Release" @@ -37,8 +37,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c @@ -47,9 +47,9 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 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:console /machine:I386 -# 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 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 /nologo /subsystem:console /machine:I386 +LINK32=xilink6.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 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:console /machine:I386 +# 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 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 /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "my_print_defaults - Win32 Debug" @@ -64,16 +64,16 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MT /W3 /Gm /GX /ZI /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MT /W3 /GX /Z7 /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 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:console /debug /machine:I386 /pdbtype:sept -# 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 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 /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /pdbtype:sept +LINK32=xilink6.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 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:console /debug /machine:I386 /pdbtype:sept +# 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 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 /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /pdbtype:sept !ENDIF diff --git a/VC++Files/myisamlog/myisamlog.dsp b/VC++Files/myisamlog/myisamlog.dsp index bbb6739cb16..6df65add63c 100644 --- a/VC++Files/myisamlog/myisamlog.dsp +++ b/VC++Files/myisamlog/myisamlog.dsp @@ -25,7 +25,7 @@ CFG=myisamlog - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "myisamlog - Win32 Release" @@ -37,8 +37,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c @@ -48,7 +48,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 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:console /machine:I386 # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /pdb:"release/myisamchk.pdb" /machine:I386 /out:"../client_release/myisamlog.exe" # SUBTRACT LINK32 /pdb:none @@ -74,7 +74,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /pdb:"debug/myisamchk.pdb" /debug /machine:I386 /out:"../client_debug/myisamlog.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index d6903f4dbc7..4ff8c1df3fc 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -605,9 +605,6 @@ Package=<5> Package=<4> {{{ - Begin Project Dependency - Project_Dep_Name strings - End Project Dependency }}} ############################################################################### diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp index 5aea3a396e8..914bbcf70a3 100644 --- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp +++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp @@ -25,7 +25,7 @@ CFG=mysqlbinlog - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlbinlog - Win32 Release" @@ -37,8 +37,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "eelease" +# PROP Intermediate_Dir "eelease" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c @@ -48,7 +48,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 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:console /machine:I386 # ADD LINK32 mysqlclient.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:console /machine:I386 /out:"../client_release/mysqlbinlog.exe" /libpath:"..\lib_release\\" # SUBTRACT LINK32 /pdb:none /debug @@ -67,13 +67,13 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /I "../sql" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /I "../sql" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.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:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlbinlog.exe" /pdbtype:sept /libpath:"..\lib_debug\\" diff --git a/VC++Files/mysqlcheck/mysqlcheck.dsp b/VC++Files/mysqlcheck/mysqlcheck.dsp index 9b821261672..f8487119da3 100644 --- a/VC++Files/mysqlcheck/mysqlcheck.dsp +++ b/VC++Files/mysqlcheck/mysqlcheck.dsp @@ -25,7 +25,7 @@ CFG=mysqlcheck - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlcheck - Win32 Release" @@ -38,7 +38,7 @@ RSC=rc.exe # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Intermediate_Dir "release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c @@ -48,8 +48,8 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 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:console /machine:I386 +LINK32=xilink6.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 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:console /machine:I386 # ADD LINK32 mysqlclient.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:console /machine:I386 /out:"../client_release/mysqlcheck.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqlcheck - Win32 Debug" @@ -65,15 +65,15 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "MYSQL_SERVER" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # 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 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:console /debug /machine:I386 /pdbtype:sept +LINK32=xilink6.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 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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 mysqlclient.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:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqlcheck.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ENDIF diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp index f28815c0f15..4a14401ed29 100644 --- a/VC++Files/mysqldemb/mysqldemb.dsp +++ b/VC++Files/mysqldemb/mysqldemb.dsp @@ -38,7 +38,7 @@ RSC=rc.exe # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c @@ -65,7 +65,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "../zlib" /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../zlib" /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" diff --git a/VC++Files/mysqlmanager/MySqlManager.dsp b/VC++Files/mysqlmanager/MySqlManager.dsp index a5338b8f5ce..c6108acfc8f 100644 --- a/VC++Files/mysqlmanager/MySqlManager.dsp +++ b/VC++Files/mysqlmanager/MySqlManager.dsp @@ -25,7 +25,7 @@ CFG=MySqlManager - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe MTL=midl.exe RSC=rc.exe @@ -52,7 +52,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 # ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"../client_release/MySqlManager.exe" # SUBTRACT LINK32 /nodefaultlib @@ -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 /GR /GX /Zi /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /GR /GX /Z7 /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 @@ -81,7 +81,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\" # SUBTRACT LINK32 /pdb:none diff --git a/VC++Files/mysqlserver/mysqlserver.dsp b/VC++Files/mysqlserver/mysqlserver.dsp index 0ef59eb226e..d8df71ebbb2 100644 --- a/VC++Files/mysqlserver/mysqlserver.dsp +++ b/VC++Files/mysqlserver/mysqlserver.dsp @@ -25,7 +25,7 @@ CFG=mysqlserver - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqlserver - Win32 Release" @@ -37,8 +37,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c @@ -47,7 +47,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo @@ -64,13 +64,13 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo diff --git a/VC++Files/mysqlshutdown/mysqlshutdown.dsp b/VC++Files/mysqlshutdown/mysqlshutdown.dsp index fd78c6ddb21..d4dd389e99d 100644 --- a/VC++Files/mysqlshutdown/mysqlshutdown.dsp +++ b/VC++Files/mysqlshutdown/mysqlshutdown.dsp @@ -25,7 +25,7 @@ CFG=mysqlshutdown - Win32 Release # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe MTL=midl.exe RSC=rc.exe @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /GX- /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -52,7 +52,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 /machine:I386 # 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 /nologo /subsystem:windows /machine:I386 /out:"../client_release/mysqlshutdown.exe" @@ -72,7 +72,7 @@ LINK32=link.exe # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /W3 /GX- /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c +# ADD CPP /nologo /G6 /W3 /Z7 /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -81,7 +81,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 /machine:I386 /out:"../client_release/mysqlshutdown.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 /nologo /subsystem:windows /machine:I386 /out:"../client_debug/mysqlshutdown.exe" diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp index 8d1928f4c6d..9f7a6bbf2e9 100644 --- a/VC++Files/mysys/mysys.dsp +++ b/VC++Files/mysys/mysys.dsp @@ -66,7 +66,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /ZI /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 @@ -86,8 +86,8 @@ LIB32=xilink6.exe -lib # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "mysys___Win32_Max" -# PROP Intermediate_Dir "mysys___Win32_Max" +# PROP Output_Dir "max" +# PROP Intermediate_Dir "max" # PROP Target_Dir "" # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c # SUBTRACT BASE CPP /YX diff --git a/VC++Files/pack_isam/pack_isam.dsp b/VC++Files/pack_isam/pack_isam.dsp index 25e4ef4a2e0..cdcba702e15 100644 --- a/VC++Files/pack_isam/pack_isam.dsp +++ b/VC++Files/pack_isam/pack_isam.dsp @@ -25,7 +25,7 @@ CFG=pack_isam - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "pack_isam - Win32 Release" @@ -48,7 +48,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 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:console /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 setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe" @@ -66,14 +66,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"../client_debug/pack_isam.exe" /pdbtype:sept diff --git a/VC++Files/perror/perror.dsp b/VC++Files/perror/perror.dsp index 6d5c96b2a84..99bd8f67ae2 100644 --- a/VC++Files/perror/perror.dsp +++ b/VC++Files/perror/perror.dsp @@ -25,7 +25,7 @@ CFG=perror - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe MTL=midl.exe RSC=rc.exe @@ -38,8 +38,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c @@ -52,7 +52,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 /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:console /machine:I386 /out:"../client_release/perror.exe" # SUBTRACT LINK32 /pdb:none @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 @@ -80,7 +80,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:no /debug /machine:I386 /pdbtype:sept # SUBTRACT LINK32 /pdb:none diff --git a/VC++Files/replace/replace.dsp b/VC++Files/replace/replace.dsp index f0c4848156a..2fe763ff388 100644 --- a/VC++Files/replace/replace.dsp +++ b/VC++Files/replace/replace.dsp @@ -25,7 +25,7 @@ CFG=replace - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "replace - Win32 Release" @@ -49,7 +49,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /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 setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/replace.exe" @@ -67,14 +67,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x40b /d "_DEBUG" # ADD RSC /l 0x40b /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /machine:I386 /out:"../client_debug/replace.exe" /pdbtype:sept # SUBTRACT LINK32 /debug diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 8192623f957..f8724fb0b06 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -28,7 +28,7 @@ CFG=mysqld - Win32 Release # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "mysqld - Win32 Release" @@ -52,7 +52,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # 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\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe" # SUBTRACT LINK32 /debug @@ -71,14 +71,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x410 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # 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_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept @@ -105,7 +105,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /machine:I386 # 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.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" # SUBTRACT LINK32 /pdb:none /debug @@ -133,7 +133,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe" # SUBTRACT BASE LINK32 /pdb:none /debug # 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\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe" @@ -162,7 +162,7 @@ LINK32=link.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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 Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.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 diff --git a/VC++Files/test1/test1.dsp b/VC++Files/test1/test1.dsp index fb70ceda692..df4b31d684e 100644 --- a/VC++Files/test1/test1.dsp +++ b/VC++Files/test1/test1.dsp @@ -25,7 +25,7 @@ CFG=test1 - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "test1 - Win32 Release" @@ -49,7 +49,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # 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 /nologo /subsystem:console /machine:I386 @@ -67,14 +67,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 libmysql.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:console /debug /machine:I386 /pdbtype:sept /libpath:"..\lib_debug" # SUBTRACT LINK32 /incremental:no diff --git a/VC++Files/thr_test/thr_test.dsp b/VC++Files/thr_test/thr_test.dsp index a7854a66049..0c80de42521 100644 --- a/VC++Files/thr_test/thr_test.dsp +++ b/VC++Files/thr_test/thr_test.dsp @@ -25,7 +25,7 @@ CFG=thr_test - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "thr_test - Win32 Release" @@ -49,7 +49,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /machine:I386 # 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 /nologo /subsystem:console /machine:I386 # SUBTRACT LINK32 /nodefaultlib @@ -68,14 +68,14 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Gm /ZI /Od /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE RSC /l 0x40b /d "_DEBUG" # ADD RSC /l 0x40b /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LINK32=link.exe +LINK32=xilink6.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:console /debug /machine:I386 /pdbtype:sept # 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 /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept diff --git a/VC++Files/vio/vio.dsp b/VC++Files/vio/vio.dsp index 50c920a465d..c250e693995 100644 --- a/VC++Files/vio/vio.dsp +++ b/VC++Files/vio/vio.dsp @@ -25,7 +25,7 @@ CFG=vio - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "vio - Win32 Release" @@ -37,8 +37,8 @@ RSC=rc.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c @@ -47,7 +47,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\vio.lib" @@ -64,13 +64,13 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /G6 /MTd /W3 /ZI /Od /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\vio.lib" diff --git a/VC++Files/zlib/zlib.dsp b/VC++Files/zlib/zlib.dsp index fd9d6b2bd68..40aaadaa4e1 100644 --- a/VC++Files/zlib/zlib.dsp +++ b/VC++Files/zlib/zlib.dsp @@ -25,7 +25,7 @@ CFG=zlib - Win32 Debug # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" -CPP=cl.exe +CPP=xicl6.exe RSC=rc.exe !IF "$(CFG)" == "zlib - Win32 Release" @@ -48,7 +48,7 @@ RSC=rc.exe BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_release\zlib.lib" @@ -65,13 +65,13 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Zi /Od /D "_DEBUG" /D "__WIN32__" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "_DEBUG" /D "__WIN32__" /D "_WINDOWS" /FD /c # ADD BASE RSC /l 0x409 # ADD RSC /l 0x409 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo -LIB32=link.exe -lib +LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"..\lib_debug\zlib.lib" diff --git a/acconfig.h b/acconfig.h index 0b822d67cf5..b254b3263fd 100644 --- a/acconfig.h +++ b/acconfig.h @@ -213,6 +213,9 @@ /* Define if the system files define ulong */ #undef HAVE_ULONG +/* Define if the system files define in_addr_t */ +#undef HAVE_IN_ADDR_T + /* UNIXWARE7 threads are not posix */ #undef HAVE_UNIXWARE7_THREADS diff --git a/acinclude.m4 b/acinclude.m4 index 01edc6050da..577adba5769 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -244,6 +244,28 @@ fi ]) +AC_DEFUN(MYSQL_CHECK_IN_ADDR_T, +[AC_MSG_CHECKING(for type in_addr_t) +AC_CACHE_VAL(ac_cv_in_addr_t, +[AC_TRY_RUN([#include +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + in_addr_t foo; + exit(0); +}], ac_cv_in_addr_t=yes, ac_cv_in_addr_t=no, ac_cv_in_addr_t=no)]) +AC_MSG_RESULT($ac_cv_in_addr_t) +if test "$ac_cv_in_addr_t" = "yes" +then + AC_DEFINE(HAVE_IN_ADDR_T) +fi +]) + + AC_DEFUN(MYSQL_PTHREAD_YIELD, [AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg, [AC_TRY_LINK([#define _GNU_SOURCE diff --git a/client/mysql.cc b/client/mysql.cc index b249ccbfbc5..37c83411091 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1811,10 +1811,11 @@ print_field_types(MYSQL_RES *result) MYSQL_FIELD *field; while ((field = mysql_fetch_field(result))) { - tee_fprintf(PAGER,"'%s.%s.%s.%s' %d %d %d %d %d\n", + tee_fprintf(PAGER,"Catalog: '%s'\nDatabase: '%s'\nTable: '%s'\nName: '%s'\nType: %d\nLength: %d\nMax length: %d\nIs_null: %d\nFlags: %d\nDecimals: %d\n\n", field->catalog, field->db, field->table, field->name, (int) field->type, - field->length, field->max_length, + field->length, field->max_length, + !IS_NOT_NULL(field->flags), field->flags, field->decimals); } tee_puts("", PAGER); @@ -2650,10 +2651,10 @@ com_status(String *buffer __attribute__((unused)), (void) mysql_fetch_row(result); // Read eof } #ifdef HAVE_OPENSSL - if (mysql.net.vio && mysql.net.vio->ssl_ && - SSL_get_cipher(mysql.net.vio->ssl_)) + if (mysql.net.vio && mysql.net.vio->ssl_arg && + SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg)) tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n", - SSL_get_cipher(mysql.net.vio->ssl_)); + SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg)); else #endif /* HAVE_OPENSSL */ tee_puts("SSL:\t\t\tNot in use", stdout); diff --git a/client/mysqladmin.c b/client/mysqladmin.c index 018bcbc1963..f263d321a7b 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -769,9 +769,12 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) return 1; } if (argv[1][0]) - make_scrambled_password(crypted_pw,argv[1], - (find_type(argv[0], &command_typelib, 2) == - ADMIN_OLD_PASSWORD), &rand_st); + { + if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) + make_scrambled_password_323(crypted_pw, argv[1]); + else + make_scrambled_password(crypted_pw, argv[1]); + } else crypted_pw[0]=0; /* No password */ sprintf(buff,"set password='%s',sql_log_off=0",crypted_pw); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 9fdda0a3853..942c55f3078 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -182,7 +182,16 @@ public: void process(Append_block_log_event *ae) { if (ae->file_id >= file_names.elements) - die("Skiped CreateFile event for file_id: %u",ae->file_id); + { + /* + There is no Create_file event (a bad binlog or a big + --position). Assuming it's a big --position, we just do nothing and + print a warning. + */ + fprintf(stderr,"Warning: ignoring Append_block as there is no \ +Create_file event for file_id: %u\n",ae->file_id); + return; + } Create_file_log_event* ce= *((Create_file_log_event**)file_names.buffer + ae->file_id); append_to_file(ce->fname,O_APPEND|O_BINARY|O_WRONLY,ae->block,ae->block_len); @@ -567,45 +576,49 @@ Could not read entry at offset %s : Error in log format or read error", } if (rec_count >= offset) { - // see if we should skip this event (only care about queries for now) - if (one_database) - { - if (ev->get_type_code() == QUERY_EVENT) - { - //const char * log_dbname = ev->get_db(); - const char * log_dbname = ((Query_log_event*)ev)->db; - //printf("entry: %llu, database: %s\n", rec_count, log_dbname); - - if ((log_dbname != NULL) && (strcmp(log_dbname, database))) - { - //printf("skipping, %s is not %s\n", log_dbname, database); - rec_count++; - delete ev; - continue; // next - } -#ifndef DBUG_OFF - else - { - printf("no skip\n"); - } -#endif - } -#ifndef DBUG_OFF - else - { - const char * query_type = ev->get_type_str(); - printf("not query -- %s\n", query_type); - } -#endif - } if (!short_form) fprintf(result_file, "# at %s\n",llstr(old_off,llbuff)); switch (ev->get_type_code()) { + case QUERY_EVENT: + if (one_database) + { + const char * log_dbname = ((Query_log_event*)ev)->db; + if ((log_dbname != NULL) && (strcmp(log_dbname, database))) + { + rec_count++; + delete ev; + continue; // next + } + } + ev->print(result_file, short_form, last_db); + break; case CREATE_FILE_EVENT: { Create_file_log_event* ce= (Create_file_log_event*)ev; - ce->print(result_file, short_form, last_db,true); + if (one_database) + { + /* + We test if this event has to be ignored. If yes, we don't save this + event; this will have the good side-effect of ignoring all related + Append_block and Exec_load. + Note that Load event from 3.23 is not tested. + */ + const char * log_dbname = ce->db; + if ((log_dbname != NULL) && (strcmp(log_dbname, database))) + { + rec_count++; + delete ev; + continue; // next + } + } + /* + We print the event, but with a leading '#': this is just to inform the + user of the original command; the command we want to execute will be a + derivation of this original command (we will change the filename and + use LOCAL), prepared in the 'case EXEC_LOAD_EVENT' below. + */ + ce->print(result_file, short_form, last_db, true); load_processor.process(ce); ev= 0; break; @@ -619,9 +632,20 @@ Could not read entry at offset %s : Error in log format or read error", ev->print(result_file, short_form, last_db); Execute_load_log_event *exv= (Execute_load_log_event*)ev; Create_file_log_event *ce= load_processor.grab_event(exv->file_id); - ce->print(result_file, short_form, last_db,true); - my_free((char*)ce->fname,MYF(MY_WME)); - delete ce; + /* + if ce is 0, it probably means that we have not seen the Create_file + event (a bad binlog, or most probably --position is after the + Create_file event). Print a warning comment. + */ + if (ce) + { + ce->print(result_file, short_form, last_db,true); + my_free((char*)ce->fname,MYF(MY_WME)); + delete ce; + } + else + fprintf(stderr,"Warning: ignoring Exec_load as there is no \ +Create_file event for file_id: %u\n",exv->file_id); break; } default: @@ -633,7 +657,7 @@ Could not read entry at offset %s : Error in log format or read error", delete ev; } if (fd >= 0) - my_close(fd, MYF(MY_WME)); + my_close(fd, MYF(MY_WME)); end_io_cache(file); } diff --git a/client/mysqldump.c b/client/mysqldump.c index b317c7e5d13..5e57f6480db 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -297,7 +297,7 @@ static int dump_all_tables_in_db(char *db); static int init_dumping(char *); static int dump_databases(char **); static int dump_all_databases(); -static char *quote_name(char *name, char *buff); +static char *quote_name(const char *name, char *buff, my_bool force); static void print_quoted_xml(FILE *output, char *fname, char *str, uint len); static void print_version(void) @@ -347,7 +347,7 @@ static void write_header(FILE *sql_file, char *db_name) fprintf(sql_file, "-- MySQL dump %s\n--\n", DUMP_VERSION); fprintf(sql_file, "-- Host: %s Database: %s\n", current_host ? current_host : "localhost", db_name ? db_name : ""); - fputs("---------------------------------------------------------\n", + fputs("-- ------------------------------------------------------\n", sql_file); fprintf(sql_file, "-- Server version\t%s\n", mysql_get_server_info(&mysql_connection)); @@ -631,33 +631,43 @@ static my_bool test_if_special_chars(const char *str) return 0; } /* test_if_special_chars */ -static char *quote_name(char *name, char *buff) + +static char *quote_name(const char *name, char *buff, my_bool force) { - char *end; - if (!opt_quoted && !test_if_special_chars(name)) - return name; - buff[0]=QUOTE_CHAR; - end=strmov(buff+1,name); - end[0]=QUOTE_CHAR; - end[1]=0; + char *to= buff; + if (!force && !opt_quoted && !test_if_special_chars(name)) + return (char*) name; + *to++= QUOTE_CHAR; + while (*name) + { + if (*name == QUOTE_CHAR) + *to= QUOTE_CHAR; + *to++= *name++; + } + to[0]=QUOTE_CHAR; + to[1]=0; return buff; } /* quote_name */ /* -** getStructure -- retrievs database structure, prints out corresponding -** CREATE statement and fills out insert_pat. -** Return values: number of fields in table, 0 if error + getStructure -- retrievs database structure, prints out corresponding + CREATE statement and fills out insert_pat. + + RETURN + number of fields in table, 0 if error */ + static uint getTableStructure(char *table, char* db) { MYSQL_RES *tableRes; MYSQL_ROW row; my_bool init=0; uint numFields; - char *strpos, *table_name; + char *strpos, *result_table, *opt_quoted_table; const char *delayed; - char name_buff[NAME_LEN+3],table_buff[NAME_LEN+3]; + char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3]; + char table_buff2[NAME_LEN*2+3]; FILE *sql_file = md_result_file; DBUG_ENTER("getTableStructure"); @@ -667,7 +677,8 @@ static uint getTableStructure(char *table, char* db) fprintf(stderr, "-- Retrieving table structure for table %s...\n", table); sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d", (opt_quoted || opt_keywords)); - table_name=quote_name(table,table_buff); + result_table= quote_name(table, table_buff, 1); + opt_quoted_table= quote_name(table, table_buff2, 0); if (!mysql_query(sock,insert_pat)) { /* using SHOW CREATE statement */ @@ -691,7 +702,7 @@ static uint getTableStructure(char *table, char* db) end= strmov(end, ","); } } - end= strmov(--end, "\" */"); + end= strmov(end-1, "\" */"); if (mysql_query(sock, buff)) { fprintf(stderr, "%s: Can't set the compatible mode '%s' (%s)\n", @@ -701,11 +712,11 @@ static uint getTableStructure(char *table, char* db) } } - sprintf(buff,"show create table `%s`",table); + sprintf(buff,"show create table %s", result_table); if (mysql_query(sock, buff)) { - fprintf(stderr, "%s: Can't get CREATE TABLE for table '%s' (%s)\n", - my_progname, table, mysql_error(sock)); + fprintf(stderr, "%s: Can't get CREATE TABLE for table %s (%s)\n", + my_progname, result_table, mysql_error(sock)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -724,10 +735,10 @@ static uint getTableStructure(char *table, char* db) write_header(sql_file, db); } if (!opt_xml) - fprintf(sql_file, "\n--\n-- Table structure for table '%s'\n--\n\n", - table); + fprintf(sql_file, "\n--\n-- Table structure for table %s\n--\n\n", + result_table); if (opt_drop) - fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name); + fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", opt_quoted_table); tableRes=mysql_store_result(sock); row=mysql_fetch_row(tableRes); @@ -735,11 +746,11 @@ static uint getTableStructure(char *table, char* db) fprintf(sql_file, "%s;\n", row[1]); mysql_free_result(tableRes); } - sprintf(insert_pat,"show fields from %s",table_name); + sprintf(insert_pat,"show fields from %s", result_table); if (mysql_query(sock,insert_pat) || !(tableRes=mysql_store_result(sock))) { - fprintf(stderr, "%s: Can't get info about table: '%s'\nerror: %s\n", - my_progname, table, mysql_error(sock)); + fprintf(stderr, "%s: Can't get info about table: %s\nerror: %s\n", + my_progname, result_table, mysql_error(sock)); if (path) my_fclose(sql_file, MYF(MY_WME)); safe_exit(EX_MYSQLERR); @@ -747,10 +758,11 @@ static uint getTableStructure(char *table, char* db) } if (cFlag) - sprintf(insert_pat, "INSERT %sINTO %s (", delayed, table_name); + sprintf(insert_pat, "INSERT %sINTO %s (", delayed, opt_quoted_table); else { - sprintf(insert_pat, "INSERT %sINTO %s VALUES ", delayed, table_name); + sprintf(insert_pat, "INSERT %sINTO %s VALUES ", delayed, + opt_quoted_table); if (!extended_insert) strcat(insert_pat,"("); } @@ -765,7 +777,7 @@ static uint getTableStructure(char *table, char* db) } init=1; if (cFlag) - strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME],name_buff)); + strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME], name_buff, 0)); } numFields = (uint) mysql_num_rows(tableRes); mysql_free_result(tableRes); @@ -775,11 +787,11 @@ static uint getTableStructure(char *table, char* db) /* fprintf(stderr, "%s: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n", my_progname, mysql_error(sock)); */ - sprintf(insert_pat,"show fields from %s",table_name); + sprintf(insert_pat,"show fields from %s", result_table); if (mysql_query(sock,insert_pat) || !(tableRes=mysql_store_result(sock))) { - fprintf(stderr, "%s: Can't get info about table: '%s'\nerror: %s\n", - my_progname, table, mysql_error(sock)); + fprintf(stderr, "%s: Can't get info about table: %s\nerror: %s\n", + my_progname, result_table, mysql_error(sock)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -801,17 +813,17 @@ static uint getTableStructure(char *table, char* db) write_header(sql_file, db); } if (!opt_xml) - fprintf(sql_file, "\n--\n-- Table structure for table '%s'\n--\n\n", - table); + fprintf(sql_file, "\n--\n-- Table structure for table %s\n--\n\n", + result_table); if (opt_drop) - fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",table_name); - fprintf(sql_file, "CREATE TABLE %s (\n", table_name); + fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n",result_table); + fprintf(sql_file, "CREATE TABLE %s (\n", result_table); } if (cFlag) - sprintf(insert_pat, "INSERT %sINTO %s (", delayed, table_name); + sprintf(insert_pat, "INSERT %sINTO %s (", delayed, result_table); else { - sprintf(insert_pat, "INSERT %sINTO %s VALUES ", delayed, table_name); + sprintf(insert_pat, "INSERT %sINTO %s VALUES ", delayed, result_table); if (!extended_insert) strcat(insert_pat,"("); } @@ -829,15 +841,17 @@ static uint getTableStructure(char *table, char* db) } init=1; if (cFlag) - strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME],name_buff)); + strpos=strmov(strpos,quote_name(row[SHOW_FIELDNAME], name_buff, 0)); if (!tFlag) { if (opt_keywords) - fprintf(sql_file, " %s.%s %s", table_name, - quote_name(row[SHOW_FIELDNAME],name_buff), row[SHOW_TYPE]); + fprintf(sql_file, " %s.%s %s", result_table, + quote_name(row[SHOW_FIELDNAME],name_buff, 0), + row[SHOW_TYPE]); else fprintf(sql_file, " %s %s", quote_name(row[SHOW_FIELDNAME], - name_buff), row[SHOW_TYPE]); + name_buff, 0), + row[SHOW_TYPE]); if (row[SHOW_DEFAULT]) { fputs(" DEFAULT ", sql_file); @@ -856,11 +870,11 @@ static uint getTableStructure(char *table, char* db) /* Make an sql-file, if path was given iow. option -T was given */ char buff[20+FN_REFLEN]; uint keynr,primary_key; - sprintf(buff,"show keys from %s",table_name); + sprintf(buff,"show keys from %s", result_table); if (mysql_query(sock, buff)) { - fprintf(stderr, "%s: Can't get keys for table '%s' (%s)\n", - my_progname, table, mysql_error(sock)); + fprintf(stderr, "%s: Can't get keys for table %s (%s)\n", + my_progname, result_table, mysql_error(sock)); if (path) my_fclose(sql_file, MYF(MY_WME)); safe_exit(EX_MYSQLERR); @@ -897,15 +911,15 @@ static uint getTableStructure(char *table, char* db) putc(')', sql_file); if (atoi(row[1])) /* Test if duplicate key */ /* Duplicate allowed */ - fprintf(sql_file, ",\n KEY %s (",quote_name(row[2],name_buff)); + fprintf(sql_file, ",\n KEY %s (",quote_name(row[2],name_buff,0)); else if (keynr == primary_key) fputs(",\n PRIMARY KEY (",sql_file); /* First UNIQUE is primary */ else - fprintf(sql_file, ",\n UNIQUE %s (",quote_name(row[2],name_buff)); + fprintf(sql_file, ",\n UNIQUE %s (",quote_name(row[2],name_buff,0)); } else putc(',', sql_file); - fputs(quote_name(row[4],name_buff), sql_file); + fputs(quote_name(row[4], name_buff, 0), sql_file); if (row[7]) fprintf(sql_file, " (%s)",row[7]); /* Sub key */ } @@ -916,23 +930,23 @@ static uint getTableStructure(char *table, char* db) /* Get MySQL specific create options */ if (create_options) { - sprintf(buff,"show table status like '%s'",table); + sprintf(buff,"show table status like %s",result_table); if (mysql_query(sock, buff)) { if (mysql_errno(sock) != ER_PARSE_ERROR) { /* If old MySQL version */ if (verbose) fprintf(stderr, - "-- Warning: Couldn't get status information for table '%s' (%s)\n", - table,mysql_error(sock)); + "-- Warning: Couldn't get status information for table %s (%s)\n", + result_table,mysql_error(sock)); } } else if (!(tableRes=mysql_store_result(sock)) || !(row=mysql_fetch_row(tableRes))) { fprintf(stderr, - "Error: Couldn't read status information for table '%s' (%s)\n", - table,mysql_error(sock)); + "Error: Couldn't read status information for table %s (%s)\n", + result_table,mysql_error(sock)); } else { @@ -1016,6 +1030,7 @@ static char *field_escape(char *to,const char *from,uint length) static void dumpTable(uint numFields, char *table) { char query[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3]; + char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table; MYSQL_RES *res; MYSQL_FIELD *field; MYSQL_ROW row; @@ -1023,6 +1038,8 @@ static void dumpTable(uint numFields, char *table) if (verbose) fprintf(stderr, "-- Sending SELECT query...\n"); + result_table= quote_name(table,table_buff, 1); + opt_quoted_table= quote_name(table, table_buff2, 0); if (path) { char filename[FN_REFLEN], tmp_path[FN_REFLEN]; @@ -1049,7 +1066,7 @@ static void dumpTable(uint numFields, char *table) end= add_load_option(end, lines_terminated, " LINES TERMINATED BY"); *end= '\0'; - sprintf(buff," FROM %s",quote_name(table,table_buff)); + sprintf(buff," FROM %s", result_table); end= strmov(end,buff); if (where) end= strxmov(end, " WHERE ",where,NullS); @@ -1062,10 +1079,10 @@ static void dumpTable(uint numFields, char *table) else { if (!opt_xml) - fprintf(md_result_file,"\n--\n-- Dumping data for table '%s'\n--\n", - table); + fprintf(md_result_file,"\n--\n-- Dumping data for table %s\n--\n", + result_table); sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s", - quote_name(table,table_buff)); + result_table); if (where) { if (!opt_xml) @@ -1092,18 +1109,17 @@ static void dumpTable(uint numFields, char *table) fprintf(stderr, "-- Retrieving rows...\n"); if (mysql_num_fields(res) != numFields) { - fprintf(stderr,"%s: Error in field count for table: '%s' ! Aborting.\n", - my_progname,table); + fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n", + my_progname, result_table); safe_exit(EX_CONSCHECK); return; } if (opt_disable_keys) - fprintf(md_result_file,"/*!40000 ALTER TABLE %s DISABLE KEYS */;\n", - quote_name(table, table_buff)); + fprintf(md_result_file, "\n/*!40000 ALTER TABLE %s DISABLE KEYS */;\n", + opt_quoted_table); if (opt_lock) - fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", - quote_name(table,table_buff)); + fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table); total_length=net_buffer_length; /* Force row break */ row_break=0; @@ -1131,13 +1147,13 @@ static void dumpTable(uint numFields, char *table) { if (!(field = mysql_fetch_field(res))) { - sprintf(query,"%s: Not enough fields from table '%s'! Aborting.\n", - my_progname,table); + sprintf(query,"%s: Not enough fields from table %s! Aborting.\n", + my_progname, result_table); fputs(query,stderr); safe_exit(EX_CONSCHECK); return; } - if (extended_insert) + if (extended_insert && !opt_xml) { ulong length = lengths[i]; if (i == 0) @@ -1222,7 +1238,7 @@ static void dumpTable(uint numFields, char *table) if (opt_xml) fprintf(md_result_file, "\t\n"); - if (extended_insert) + if (extended_insert && !opt_xml) { ulong row_length; dynstr_append(&extended_row,")"); @@ -1259,11 +1275,11 @@ static void dumpTable(uint numFields, char *table) fflush(md_result_file); if (mysql_errno(sock)) { - sprintf(query,"%s: Error %d: %s when dumping table '%s' at row: %ld\n", + sprintf(query,"%s: Error %d: %s when dumping table %s at row: %ld\n", my_progname, mysql_errno(sock), mysql_error(sock), - table, + result_table, rownr); fputs(query,stderr); safe_exit(EX_CONSCHECK); @@ -1273,7 +1289,7 @@ static void dumpTable(uint numFields, char *table) fputs("UNLOCK TABLES;\n", md_result_file); if (opt_disable_keys) fprintf(md_result_file,"/*!40000 ALTER TABLE %s ENABLE KEYS */;\n", - quote_name(table,table_buff)); + opt_quoted_table); if (opt_autocommit) fprintf(md_result_file, "commit;\n"); mysql_free_result(res); @@ -1404,7 +1420,7 @@ static int init_dumping(char *database) (opt_quoted ? "`" : "")); } } - if (extended_insert) + if (extended_insert && !opt_xml) if (init_dynamic_string(&extended_row, "", 1024, 1024)) exit(EX_EOM); return 0; @@ -1415,7 +1431,7 @@ static int dump_all_tables_in_db(char *database) { char *table; uint numrows; - char table_buff[NAME_LEN+3]; + char table_buff[NAME_LEN*2+3]; if (init_dumping(database)) return 1; @@ -1427,7 +1443,7 @@ static int dump_all_tables_in_db(char *database) init_dynamic_string(&query, "LOCK TABLES ", 256, 1024); for (numrows=0 ; (table = getTableName(1)) ; numrows++) { - dynstr_append(&query, quote_name(table, table_buff)); + dynstr_append(&query, quote_name(table, table_buff, 1)); dynstr_append(&query, " READ /*!32311 LOCAL */,"); } if (numrows && mysql_real_query(sock, query.str, query.length-1)) @@ -1459,7 +1475,7 @@ static int dump_all_tables_in_db(char *database) static int dump_selected_tables(char *db, char **table_names, int tables) { uint numrows; - char table_buff[NAME_LEN+3]; + char table_buff[NAME_LEN*+3]; if (init_dumping(db)) return 1; @@ -1471,7 +1487,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) init_dynamic_string(&query, "LOCK TABLES ", 256, 1024); for (i=0 ; i < tables ; i++) { - dynstr_append(&query, quote_name(table_names[i], table_buff)); + dynstr_append(&query, quote_name(table_names[i], table_buff, 1)); dynstr_append(&query, " READ /*!32311 LOCAL */,"); } if (mysql_real_query(sock, query.str, query.length-1)) @@ -1643,9 +1659,8 @@ int main(int argc, char **argv) fprintf(md_result_file, "\n--\n-- Position to start replication from\n--\n\n"); fprintf(md_result_file, - "CHANGE MASTER TO MASTER_LOG_FILE='%s' ;\n", row[0]); - fprintf(md_result_file, "CHANGE MASTER TO MASTER_LOG_POS=%s ;\n", - row[1]); + "CHANGE MASTER TO MASTER_LOG_FILE='%s', \ +MASTER_LOG_POS=%s ;\n",row[0],row[1]); } mysql_free_result(master); } @@ -1676,7 +1691,7 @@ int main(int argc, char **argv) if (md_result_file != stdout) my_fclose(md_result_file, MYF(0)); my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); - if (extended_insert) + if (extended_insert & !opt_xml) dynstr_free(&extended_row); my_end(0); return(first_error); diff --git a/client/mysqlimport.c b/client/mysqlimport.c index d049d69011b..5ad6d1dc429 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -45,16 +45,15 @@ static char *opt_password=0, *current_user=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, *opt_columns=0, *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; -static uint opt_mysql_port=0; +static uint opt_mysql_port= 0, opt_protocol= 0; static my_string opt_mysql_unix_port=0; -static my_string opt_ignore_lines=0; +static longlong opt_ignore_lines= -1; static CHARSET_INFO *charset_info= &my_charset_latin1; #include #ifdef HAVE_SMEM static char *shared_memory_base_name=0; #endif -static uint opt_protocol=0; static struct my_option my_long_options[] = { @@ -97,7 +96,7 @@ static struct my_option my_long_options[] = {"ignore", 'i', "If duplicate unique key was found, keep old row.", (gptr*) &ignore, (gptr*) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.", - (gptr*) &opt_ignore_lines, (gptr*) &opt_ignore_lines, 0, GET_STR, + (gptr*) &opt_ignore_lines, (gptr*) &opt_ignore_lines, 0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR, @@ -259,7 +258,7 @@ static int get_options(int *argc, char ***argv) static int write_to_table(char *filename, MYSQL *sock) { char tablename[FN_REFLEN], hard_path[FN_REFLEN], - sql_statement[FN_REFLEN*2+256], *end; + sql_statement[FN_REFLEN*16+256], *end; my_bool local_file; DBUG_ENTER("write_to_table"); DBUG_PRINT("enter",("filename: %s",filename)); @@ -311,8 +310,9 @@ static int write_to_table(char *filename, MYSQL *sock) " OPTIONALLY ENCLOSED BY"); end= add_load_option(end, escaped, " ESCAPED BY"); end= add_load_option(end, lines_terminated, " LINES TERMINATED BY"); - if (opt_ignore_lines) - end= strmov(strmov(strmov(end, " IGNORE "), opt_ignore_lines), " LINES"); + if (opt_ignore_lines >= 0) + end= strmov(longlong10_to_str(opt_ignore_lines, + strmov(end, " IGNORE "),10), " LINES"); if (opt_columns) end= strmov(strmov(strmov(end, " ("), opt_columns), ")"); *end= '\0'; diff --git a/client/mysqltest.c b/client/mysqltest.c index 3b814b27810..fd8cf7ecc8b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -42,7 +42,7 @@ **********************************************************************/ -#define MTEST_VERSION "1.29" +#define MTEST_VERSION "1.30" #include #include @@ -204,6 +204,7 @@ Q_WAIT_FOR_SLAVE_TO_STOP, Q_REQUIRE_VERSION, Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS, Q_ENABLE_INFO, Q_DISABLE_INFO, +Q_EXEC, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ Q_COMMENT_WITH_COMMAND @@ -226,6 +227,13 @@ const char *command_names[]= "connection", "query", "connect", + /* the difference between sleep and real_sleep is that sleep will use + the delay from command line (--sleep) if there is one. + real_sleep always uses delay from it's argument. + the logic is that sometimes delays are cpu-dependent (and --sleep + can be used to set this delay. real_sleep is used for cpu-independent + delays + */ "sleep", "real_sleep", "inc", @@ -267,6 +275,7 @@ const char *command_names[]= "disable_warnings", "enable_info", "disable_info", + "exec", 0 }; @@ -501,15 +510,6 @@ void init_parser() memset(&var_reg,0, sizeof(var_reg)); } -int hex_val(int c) -{ - if (my_isdigit(charset_info,c)) - return c - '0'; - else if ((c = my_tolower(charset_info,c)) >= 'a' && c <= 'f') - return c - 'a' + 10; - else - return -1; -} int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname) { @@ -664,7 +664,7 @@ static VAR* var_obtain(char* name, int len) if ((v = (VAR*)hash_search(&var_hash, name, len))) return v; v = var_init(0, name, len, "", 0); - hash_insert(&var_hash, (byte*)v); + my_hash_insert(&var_hash, (byte*)v); return v; } @@ -840,6 +840,66 @@ int do_source(struct st_query* q) return open_file(name); } +/* + Execute given command. + + SYNOPSIS + do_exec() + q called command + + DESCRIPTION + If one uses --exec command [args] command in .test file + we will execute the command and record its output. + + RETURN VALUES + 0 ok + 1 error +*/ + +int do_exec(struct st_query* q) +{ + int error= 0; + DYNAMIC_STRING *ds; + DYNAMIC_STRING ds_tmp; + char buf[1024]; + FILE *res_file; + char *cmd= q->first_argument; + + while (*cmd && my_isspace(charset_info, *cmd)) + cmd++; + if (!*cmd) + die("Missing argument in exec\n"); + + if (q->record_file[0]) + { + init_dynamic_string(&ds_tmp, "", 16384, 65536); + ds= &ds_tmp; + } + else + ds= &ds_res; + + if (!(res_file= popen(cmd, "r")) && q->abort_on_error) + die("popen() failed\n"); + while (fgets(buf, sizeof(buf), res_file)) + dynstr_append(ds, buf); + pclose(res_file); + if (record) + { + if (!q->record_file[0] && !result_file) + die("At line %u: Missing result file", start_lineno); + if (!result_file) + str_to_file(q->record_file, ds->str, ds->length); + } + else if (q->record_file[0]) + { + error= check_result(ds, q->record_file, q->require_file); + } + if (ds == &ds_tmp) + dynstr_free(&ds_tmp); + + return error; +} + int var_query_set(VAR* v, const char* p, const char** p_end) { char* end = (char*)((p_end && *p_end) ? *p_end : p + strlen(p)); @@ -862,7 +922,28 @@ int var_query_set(VAR* v, const char* p, const char** p_end) } if ((row = mysql_fetch_row(res)) && row[0]) - eval_expr(v, row[0], 0); + { + /* + Concatenate all row results with tab in between to allow us to work + with results from many columns (for example from SHOW VARIABLES) + */ + DYNAMIC_STRING result; + uint i; + ulong *lengths; + char *end; + + init_dynamic_string(&result, "", 16384, 65536); + lengths= mysql_fetch_lengths(res); + for (i=0; i < mysql_num_fields(res); i++) + { + if (row[0]) + dynstr_append_mem(&result, row[i], lengths[i]); + dynstr_append_mem(&result, "\t", 1); + } + end= result.str + result.length-1; + eval_expr(v, result.str, (const char**) &end); + dynstr_free(&result); + } else eval_expr(v, "", 0); @@ -919,8 +1000,6 @@ int eval_expr(VAR* v, const char* p, const char** p_end) return 0; } - if (p_end) - *p_end = 0; die("Invalid expr: %s", p); return 1; } @@ -1217,7 +1296,7 @@ static char *get_string(char **to_ptr, char **from_ptr, VAR *var=var_get(start, &end, 0, 1); if (var && to == (char*) end+1) { - DBUG_PRINT("info",("var: %s -> %s", start, var->str_val)); + DBUG_PRINT("info",("var: '%s' -> '%s'", start, var->str_val)); DBUG_RETURN(var->str_val); /* return found variable value */ } } @@ -1547,56 +1626,6 @@ int do_while(struct st_query* q) } -int safe_copy_unescape(char* dest, char* src, int size) -{ - register char* p_dest = dest, *p_src = src; - register int c, val; - enum { ST_NORMAL, ST_ESCAPED, ST_HEX2} state = ST_NORMAL ; - - size--; /* just to make life easier */ - - for (; p_dest - size < dest && p_src - size < src && - (c = *p_src) != '\n' && c; ++p_src) - { - switch(state) { - case ST_NORMAL: - if (c == '\\') - state = ST_ESCAPED; - else - *p_dest++ = c; - break; - case ST_ESCAPED: - if ((val = hex_val(c)) > 0) - { - *p_dest = val; - state = ST_HEX2; - } - else - { - state = ST_NORMAL; - *p_dest++ = c; - } - break; - case ST_HEX2: - if ((val = hex_val(c)) > 0) - { - *p_dest = (*p_dest << 4) + val; - p_dest++; - } - else - *p_dest++ = c; - - state = ST_NORMAL; - break; - - } - } - - *p_dest = 0; - return (p_dest - dest); -} - - int read_line(char* buf, int size) { int c; @@ -2149,7 +2178,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) if (!(flags & QUERY_REAP)) DBUG_RETURN(0); - if (mysql_read_query_result(mysql) || + if ((*mysql->methods->read_query_result)(mysql) || (!(last_result = res = mysql_store_result(mysql)) && mysql_field_count(mysql))) { @@ -2371,7 +2400,7 @@ static void var_from_env(const char *name, const char *def_val) tmp = def_val; v = var_init(0, name, 0, tmp, 0); - hash_insert(&var_hash, (byte*)v); + my_hash_insert(&var_hash, (byte*)v); } @@ -2387,9 +2416,9 @@ static void init_var_hash(MYSQL *mysql) var_from_env("MYSQL_TEST_DIR", "/tmp"); var_from_env("BIG_TEST", opt_big_test ? "1" : "0"); v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0); - hash_insert(&var_hash, (byte*) v); + my_hash_insert(&var_hash, (byte*) v); v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0); - hash_insert(&var_hash, (byte*) v); + my_hash_insert(&var_hash, (byte*) v); DBUG_VOID_RETURN; } @@ -2584,6 +2613,9 @@ int main(int argc, char **argv) case Q_PING: (void) mysql_ping(&cur_con->mysql); break; + case Q_EXEC: + (void) do_exec(q); + break; default: processed = 0; break; } } diff --git a/configure.in b/configure.in index f376e77e09a..eb8daea18d4 100644 --- a/configure.in +++ b/configure.in @@ -38,12 +38,12 @@ do case $host_os in netware* | modesto*) echo "$i/errmsg.sys: $i/errmsg.txt - \$(top_builddir)/extra/comp_err.linux \$^ $i/errmsg.sys" \ + \$(top_builddir)/extra/comp_err.linux -C\$(srcdir)/charsets/ \$^ $i/errmsg.sys" \ >> $AVAILABLE_LANGUAGES_ERRORS_RULES ;; *) echo "$i/errmsg.sys: $i/errmsg.txt - \$(top_builddir)/extra/comp_err \$^ $i/errmsg.sys" \ + \$(top_builddir)/extra/comp_err -C\$(srcdir)/charsets/ \$^ $i/errmsg.sys" \ >> $AVAILABLE_LANGUAGES_ERRORS_RULES ;; esac @@ -1337,7 +1337,12 @@ then if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so then MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - with_named_thread="-Kthread -lsocket -lnsl" + if expr "$CC" : ".*gcc.*" + then + with_named_thread="-pthread -lsocket -lnsl" + else + with_named_thread="-Kthread -lsocket -lnsl" + fi if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null then AC_DEFINE(HAVE_UNIXWARE7_THREADS) @@ -1373,7 +1378,12 @@ then if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so then MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - with_named_thread="-Kthread -lsocket -lnsl" + if expr "$CC" : ".*gcc.*" + then + with_named_thread="-pthread -lsocket -lnsl" + else + with_named_thread="-Kthread -lsocket -lnsl" + fi if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null then AC_DEFINE(HAVE_UNIXWARE7_THREADS) @@ -1719,8 +1729,10 @@ MYSQL_CHECK_ULONG MYSQL_CHECK_UCHAR # Do the system files define uint MYSQL_CHECK_UINT -#Check for fp_except in ieeefp.h +# Check for fp_except in ieeefp.h MYSQL_CHECK_FP_EXCEPT +# Check for IN_ADDR_T +MYSQL_CHECK_IN_ADDR_T # Do the c++ compiler have a bool type MYSQL_CXX_BOOL # Check some common bugs with gcc 2.8.# on sparc diff --git a/extra/comp_err.c b/extra/comp_err.c index 806fb5052b4..07369aa565e 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -24,11 +24,13 @@ #define MAXLENGTH 1000 #define MAX_ROWS 1000 #define MAX_FILES 10 +#define MAX_CHARSET_NAME 64 int row_count; uint file_pos[MAX_ROWS],file_row_pos[MAX_FILES]; my_string saved_row[MAX_ROWS]; uchar file_head[]= { 254,254,2,1 }; +char charset_name[MAX_CHARSET_NAME]; static void get_options(int *argc,char **argv[]); static int count_rows(FILE *from,pchar c, pchar c2); @@ -40,11 +42,12 @@ static int copy_rows(FILE *to); int main(int argc,char *argv[]) { + uint csnum= 0; int i,error,files,length; uchar head[32]; FILE *from,*to; MY_INIT(argv[0]); - + get_options(&argc,&argv); error=1; row_count=files=0; @@ -61,6 +64,20 @@ int main(int argc,char *argv[]) } VOID(count_rows(from,'"','}')); /* Calculate start-info */ + if (!charset_name[0]) + { + fprintf(stderr,"Character set is not specified in '%s'\n",*argv); + fclose(from); + goto end; + } + + if (!(csnum= get_charset_number(charset_name, MY_CS_PRIMARY))) + { + fprintf(stderr,"Unknown character '%s' in '%s'\n",charset_name, *argv); + fclose(from); + goto end; + } + if (remember_rows(from,'}') < 0) /* Remember rows */ { fprintf(stderr,"Can't find textrows in '%s'\n",*argv); @@ -91,7 +108,8 @@ int main(int argc,char *argv[]) { int2store(head+10+i+i,file_row_pos[i]); } - + head[30]= csnum; + fseek(to,0l,0); if (fwrite(head,1,32,to) != 32) goto end; @@ -134,6 +152,10 @@ static void get_options(register int *argc,register char **argv[]) case 'V': printf("%s (Compile errormessage) Ver 1.3\n",progname); break; + case 'C': + charsets_dir= pos+1; + *(pos--)= '\0'; + break; case 'I': case '?': printf(" %s (Compile errormessage) Ver 1.3\n",progname); @@ -168,8 +190,19 @@ static int count_rows(FILE *from, pchar c, pchar c2) DBUG_ENTER("count_rows"); pos=ftell(from); count=0; + + charset_name[0]= '\0'; while (fgets(rad,MAXLENGTH,from) != NULL) { + if (!strncmp(rad,"character-set=",14)) + { + char *b= rad+14, *e; + for (e=b ; e[0] && e-b < MAX_CHARSET_NAME && + e[0] != ' ' && e[0] != '\r' && + e[0] != '\n' && e[0] != '\t' ; e++); + e[0]= '\0'; + strcpy(charset_name, b); + } if (rad[0] == c || rad[0] == c2) break; count++; diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index a5ce489c0fd..e580603bcb8 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -26,6 +26,7 @@ #include const char *config_file="my"; /* Default config file */ +uint verbose= 0, opt_defaults_file_used= 0; static struct my_option my_long_options[] = { @@ -47,6 +48,8 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Increase the output level", + 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} @@ -54,7 +57,7 @@ static struct my_option my_long_options[] = static void usage(my_bool version) { - printf("%s Ver 1.5 for %s at %s\n",my_progname,SYSTEM_TYPE, + printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); if (version) return; @@ -72,12 +75,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument __attribute__((unused))) { switch (optid) { + case 'c': + opt_defaults_file_used= 1; + break; case 'n': exit(0); case 'I': case '?': usage(0); exit(0); + case 'v': + verbose++; + break; case 'V': usage(1); exit(0); @@ -103,7 +112,7 @@ static int get_options(int *argc,char ***argv) int main(int argc, char **argv) { - int count; + int count, error; char **load_default_groups, *tmp_arguments[2], **argument, **arguments; MY_INIT(argv[0]); @@ -125,13 +134,26 @@ int main(int argc, char **argv) arguments=tmp_arguments; arguments[0]=my_progname; arguments[1]=0; - load_defaults(config_file, (const char **) load_default_groups, - &count, &arguments); + if ((error= load_defaults(config_file, (const char **) load_default_groups, + &count, &arguments))) + { + if (verbose && opt_defaults_file_used) + { + if (error == 1) + fprintf(stderr, "WARNING: Defaults file '%s' not found!\n", + config_file); + /* This error is not available now. For the future */ + if (error == 2) + fprintf(stderr, "WARNING: Defaults file '%s' is not a regular file!\n", + config_file); + } + error= 2; + } for (argument= arguments+1 ; *argument ; argument++) puts(*argument); my_free((char*) load_default_groups,MYF(0)); free_defaults(arguments); - exit(0); + exit(error); } diff --git a/extra/resolveip.c b/extra/resolveip.c index cef79180720..a9e5f16e576 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -36,6 +36,10 @@ extern int h_errno; #endif +#ifndef HAVE_IN_ADDR_T +#define in_addr_t u_long +#endif + static my_bool silent; @@ -91,8 +95,6 @@ static int get_options(int *argc,char ***argv) { int ho_error; - /* load_defaults("my",load_default_groups,argc,argv); */ - if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) exit(ho_error); @@ -109,7 +111,7 @@ static int get_options(int *argc,char ***argv) int main(int argc, char **argv) { struct hostent *hpaddr; - u_long taddr; + in_addr_t taddr; char *ip,**q; int error=0; diff --git a/include/config-win.h b/include/config-win.h index 6b40a0f2ed3..884b2edfb63 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -280,9 +280,9 @@ inline double ulonglong2double(ulonglong value) #define HAVE_CREATESEMAPHORE #define HAVE_ISNAN #define HAVE_FINITE -#define HAVE_ISAM /* We want to have support for ISAM in 4.0 */ #define HAVE_QUERY_CACHE #define SPRINTF_RETURNS_INT +#define HAVE_SETFILEPOINTER #define HAVE_VIO #ifdef NOT_USED diff --git a/include/errmsg.h b/include/errmsg.h index 1f4e6e12f00..a354c125e36 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -86,3 +86,4 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2045 #define CR_CONN_UNKNOW_PROTOCOL 2046 #define CR_INVALID_CONN_HANDLE 2047 +#define CR_MYSQL_SERVER_INIT_MISSED 2048 diff --git a/include/hash.h b/include/hash.h index 6c805bc2da7..3c2ae32c70e 100644 --- a/include/hash.h +++ b/include/hash.h @@ -49,7 +49,7 @@ void hash_free(HASH *tree); byte *hash_element(HASH *hash,uint idx); gptr hash_search(HASH *info,const byte *key,uint length); gptr hash_next(HASH *info,const byte *key,uint length); -my_bool hash_insert(HASH *info,const byte *data); +my_bool my_hash_insert(HASH *info,const byte *data); my_bool hash_delete(HASH *hash,byte *record); my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length); void hash_replace(HASH *hash, uint idx, byte *new_row); diff --git a/include/m_ctype.h b/include/m_ctype.h index 4ae6734a48c..b1557e5293b 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -63,6 +63,7 @@ typedef struct unicase_info_st #define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ #define MY_CS_UNICODE 128 /* is a charset is full unicode */ #define MY_CS_NONTEXT 256 /* if a charset is not sprintf() compatible */ +#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ #define MY_CHARSET_UNDEFINED 0 @@ -74,6 +75,12 @@ typedef struct my_uni_idx_st uchar *tab; } MY_UNI_IDX; +typedef struct +{ + uint beg; + uint end; + uint mblen; +} my_match_t; enum my_lex_states { @@ -115,12 +122,18 @@ typedef struct my_collation_handler_st int (*strcasecmp)(struct charset_info_st *, const char *, const char *); + uint (*instr)(struct charset_info_st *, + const char *big, uint b_length, + const char *small, uint s_length, + my_match_t *match, uint nmatch); + /* Hash calculation */ void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len, ulong *nr1, ulong *nr2); } MY_COLLATION_HANDLER; -extern MY_COLLATION_HANDLER my_collation_bin_handler; +extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; +extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; @@ -131,6 +144,7 @@ typedef struct my_charset_handler_st int (*mbcharlen)(struct charset_info_st *, uint); uint (*numchars)(struct charset_info_st *, const char *b, const char *e); uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos); + uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length); /* Unicode convertion */ int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc, @@ -240,6 +254,13 @@ extern void my_hash_sort_simple(CHARSET_INFO *cs, const uchar *key, uint len, ulong *nr1, ulong *nr2); +extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length); + +extern uint my_instr_simple(struct charset_info_st *, + const char *big, uint b_length, + const char *small, uint s_length, + my_match_t *match, uint nmatch); + /* Functions for 8bit */ extern void my_caseup_str_8bit(CHARSET_INFO *, char *); @@ -304,6 +325,10 @@ int my_wildcmp_mb(CHARSET_INFO *, int escape, int w_one, int w_many); uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos); +uint my_instr_mb(struct charset_info_st *, + const char *big, uint b_length, + const char *small, uint s_length, + my_match_t *match, uint nmatch); extern my_bool my_parse_charset_xml(const char *bug, uint len, diff --git a/include/m_string.h b/include/m_string.h index 5863bb51b73..062d0b4cf65 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -122,6 +122,16 @@ extern void bmove_align(gptr dst,const gptr src,uint len); #define bmove512(A,B,C) memcpy(A,B,C) #endif +#ifdef HAVE_purify +#include +#define memcpy_overlap(A,B,C) \ +DBUG_ASSERT((A) == (B) || ((A)+(C)) <= (B) || ((B)+(C)) <= (A)); \ +bmove((byte*) key,(byte*) from,(size_t) length); +#else +#define memcpy_overlap(A,B,C) memcpy((A), (B), (C)) +#endif /* HAVE_purify */ + + /* Prototypes for string functions */ #if !defined(bfill) && !defined(HAVE_BFILL) diff --git a/include/my_pthread.h b/include/my_pthread.h index d8374cad314..424452a9298 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -1,4 +1,3 @@ - /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -111,7 +110,6 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ #endif #define pthread_self() win_pthread_self #define HAVE_LOCALTIME_R 1 -#define HAVE_GMTIME_R 1 #define _REENTRANT 1 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 diff --git a/include/my_sys.h b/include/my_sys.h index 688e8bfc9e3..6f04b766aec 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -209,11 +209,13 @@ extern CHARSET_INFO *default_charset_info; extern CHARSET_INFO *all_charsets[256]; extern CHARSET_INFO compiled_charsets[]; -extern uint get_charset_number(const char *cs_name); +extern uint get_charset_number(const char *cs_name, uint cs_flags); +extern uint get_collation_number(const char *name); extern const char *get_charset_name(uint cs_number); + extern CHARSET_INFO *get_charset(uint cs_number, 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, +extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint cs_flags, myf my_flags); extern void free_charsets(void); extern char *get_charsets_dir(char *buf); @@ -507,6 +509,8 @@ typedef struct st_keycache ulonglong size; } KEY_CACHE; +typedef uint32 ha_checksum; + #include /* Prototypes for mysys and my_func functions */ @@ -681,6 +685,8 @@ extern int _my_b_get(IO_CACHE *info); extern int _my_b_async_read(IO_CACHE *info,byte *Buffer,uint Count); extern int _my_b_write(IO_CACHE *info,const byte *Buffer,uint Count); extern int my_b_append(IO_CACHE *info,const byte *Buffer,uint Count); +extern int my_b_safe_write(IO_CACHE *info,const byte *Buffer,uint Count); + extern int my_block_write(IO_CACHE *info, const byte *Buffer, uint Count, my_off_t pos); extern int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock); @@ -742,17 +748,18 @@ extern void set_prealloc_root(MEM_ROOT *root, char *ptr); extern char *strdup_root(MEM_ROOT *root,const char *str); extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); -extern void load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); +extern int load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv); extern void free_defaults(char **argv); extern void print_defaults(const char *conf_file, const char **groups); extern my_bool my_compress(byte *, ulong *, ulong *); extern my_bool my_uncompress(byte *, ulong *, ulong *); extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); -extern ulong checksum(const byte *mem, uint count); +extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count); extern uint my_bit_log2(ulong value); -uint my_count_bits(ulonglong v); +extern uint my_count_bits(ulonglong v); extern void my_sleep(ulong m_seconds); +extern ulong crc32(ulong crc, const uchar *buf, uint len); #ifdef __WIN__ extern my_bool have_tcpip; /* Is set if tcpip is used */ diff --git a/include/myisam.h b/include/myisam.h index e85d3057672..0ffcdae8567 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -53,8 +53,6 @@ extern "C" { #define mi_portable_sizeof_char_ptr 8 -typedef uint32 ha_checksum; - /* Param to/from mi_info */ typedef struct st_mi_isaminfo /* Struct from h_info */ diff --git a/include/mysql.h b/include/mysql.h index 8e8ffc2b788..9a8d2b07220 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -142,7 +142,7 @@ enum mysql_option MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, - MYSQL_OPT_GUESS_CONNECTION + MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP }; struct st_mysql_options { @@ -180,6 +180,7 @@ struct st_mysql_options { my_bool separate_thread; #endif enum mysql_option methods_to_use; + char *client_ip; }; enum mysql_status @@ -229,7 +230,9 @@ typedef struct st_mysql enum mysql_status status; my_bool free_me; /* If free in mysql_close */ my_bool reconnect; /* set to 1 if automatic reconnect */ - char scramble_buff[21]; /* New protocol requires longer scramble*/ + + /* session-wide random string */ + char scramble[SCRAMBLE_LENGTH+1]; /* Set if this is the original connection, not a master or a slave we have @@ -248,7 +251,6 @@ typedef struct st_mysql LIST *stmts; /* list of all statements */ const struct st_mysql_methods *methods; - struct st_mysql_res *result; void *thd; } MYSQL; @@ -357,6 +359,9 @@ int STDCALL mysql_send_query(MYSQL *mysql, const char *q, unsigned long length); int STDCALL mysql_real_query(MYSQL *mysql, const char *q, unsigned long length); +MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); +MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); + /* perform query on master */ my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, unsigned long length); @@ -412,8 +417,6 @@ const char * STDCALL mysql_get_host_info(MYSQL *mysql); unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); -MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, - const char *wild); MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg); @@ -427,6 +430,8 @@ MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); +MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, + const char *wild); unsigned long STDCALL mysql_escape_string(char *to,const char *from, unsigned long from_length); unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, @@ -457,6 +462,7 @@ int STDCALL mysql_manager_command(MYSQL_MANAGER* con, int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf, int res_buf_size); +my_bool STDCALL mysql_read_query_result(MYSQL *mysql); /* @@ -497,10 +503,12 @@ typedef struct st_mysql_bind /* Following are for internal use. Set by mysql_bind_param */ unsigned char *inter_buffer; /* for the current data position */ unsigned long offset; /* offset position for char/binary fetch */ + unsigned long internal_length; /* Used if length is 0 */ unsigned int param_number; /* For null count and error messages */ my_bool long_data_used; /* If used with mysql_send_long_data */ my_bool binary_data; /* data buffer is binary */ my_bool null_field; /* NULL data cache flag */ + my_bool internal_is_null; /* Used if is_null is 0 */ void (*store_param_func)(NET *net, struct st_mysql_bind *param); void (*fetch_result)(struct st_mysql_bind *, unsigned char **row); } MYSQL_BIND; @@ -535,22 +543,30 @@ typedef struct st_mysql_stmt } MYSQL_STMT; -#define mysql_read_query_result(mysql) (*(mysql)->methods->read_query_result)(mysql) -#define mysql_store_result(mysql) (*(mysql)->methods->store_result)(mysql) -#define mysql_use_result(mysql) (*(mysql)->methods->use_result)(mysql) - typedef struct st_mysql_methods { - my_bool STDCALL (*read_query_result)(MYSQL *mysql); - my_bool STDCALL (*advanced_command)(MYSQL *mysql, + my_bool (STDCALL *read_query_result)(MYSQL *mysql); + my_bool (STDCALL *advanced_command)(MYSQL *mysql, enum enum_server_command command, const char *header, unsigned long header_length, const char *arg, - unsigned long arg_length, my_bool skip_check); - MYSQL_RES * STDCALL (*store_result)(MYSQL *mysql); - MYSQL_RES * STDCALL (*use_result)(MYSQL *mysql); - void STDCALL (*fetch_lengths)(unsigned long *to, MYSQL_ROW column, uint field_count); + unsigned long arg_length, + my_bool skip_check); + MYSQL_DATA *(STDCALL *read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, + unsigned int fields); + MYSQL_RES * (STDCALL *use_result)(MYSQL *mysql); + void (STDCALL *fetch_lengths)(unsigned long *to, + MYSQL_ROW column, unsigned int field_count); +#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) + MYSQL_FIELD * (STDCALL *list_fields)(MYSQL *mysql); + my_bool (STDCALL *read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); + int (STDCALL *stmt_execute)(MYSQL_STMT *stmt); + MYSQL_DATA *(STDCALL *read_binary_rows)(MYSQL_STMT *stmt); + int (STDCALL *unbuffered_fetch)(MYSQL *mysql, char **row); + void (STDCALL *free_embedded_thd)(MYSQL *mysql); + const char *(STDCALL *read_statistic)(MYSQL *mysql); +#endif } MYSQL_METHODS; MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query, @@ -570,13 +586,13 @@ my_bool STDCALL mysql_rollback(MYSQL * mysql); my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); int STDCALL mysql_fetch(MYSQL_STMT *stmt); int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, - my_ulonglong column, + unsigned int column, unsigned long offset); my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt, unsigned int param_number, const char *data, unsigned long length); -MYSQL_RES *STDCALL mysql_prepare_result(MYSQL_STMT *stmt); +MYSQL_RES *STDCALL mysql_get_metadata(MYSQL_STMT *stmt); MYSQL_RES *STDCALL mysql_param_result(MYSQL_STMT *stmt); my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt); @@ -615,6 +631,8 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); unsigned long net_safe_read(MYSQL* mysql); void mysql_once_init(void); +extern my_bool server_inited; + #ifdef __NETWARE__ #pragma pack(pop) /* restore alignment */ #endif diff --git a/include/mysql_com.h b/include/mysql_com.h index b1c94e5c735..d5a70e4dfe8 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -49,8 +49,15 @@ enum enum_server_command }; -#define SCRAMBLE_LENGTH 8 -#define SCRAMBLE41_LENGTH 20 +/* + Length of random string sent by server on handshake; this is also length of + obfuscated password, recieved from client +*/ +#define SCRAMBLE_LENGTH 20 +#define SCRAMBLE_LENGTH_323 8 +/* length of password stored in the db: new passwords are preceeded with '*' */ +#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1) +#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2) #define NOT_NULL_FLAG 1 /* Field can't be NULL */ @@ -302,38 +309,41 @@ extern "C" { extern unsigned long max_allowed_packet; extern unsigned long net_buffer_length; -void randominit(struct rand_struct *,unsigned long seed1, - unsigned long seed2); +/* + These functions are used for authentication by client and server and + implemented in sql/password.c +*/ + +void randominit(struct rand_struct *, unsigned long seed1, + unsigned long seed2); 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); -char get_password_version(const char* password); -void create_random_string(int length,struct rand_struct *rand_st,char* target); -my_bool validate_password(const char* password, const char* message, - unsigned long* salt); -void password_hash_stage1(char *to, const char *password); -void password_hash_stage2(char *to,const char *salt); -void password_crypt(const char* from,char* to, const char* password,int length); -void get_hash_and_password(unsigned long* salt, unsigned char pversion,char* hash, - unsigned char* bin_password); -void get_salt_from_password(unsigned long *res,const char *password); -void create_key_from_old_password(const char* password,char* key); -void make_password_from_salt(char *to, unsigned long *hash_res, - unsigned char password_version); -char *scramble(char *to,const char *message,const char *password, - my_bool old_ver); -my_bool check_scramble(const char *, const char *message, - unsigned long *salt,my_bool old_ver); +void create_random_string(char *to, uint length, struct rand_struct *rand_st); + +void hash_password(unsigned long *to, const char *password, uint password_len); +void make_scrambled_password_323(char *to, const char *password); +void scramble_323(char *to, const char *message, const char *password); +my_bool check_scramble_323(const char *, const char *message, + unsigned long *salt); +void get_salt_from_password_323(unsigned long *res, const char *password); +void make_password_from_salt_323(char *to, const unsigned long *salt); + +void make_scrambled_password(char *to, const char *password); +void scramble(char *to, const char *message, const char *password); +my_bool check_scramble(const char *reply, const char *message, + const unsigned char *hash_stage2); +void get_salt_from_password(unsigned char *res, const char *password); +void make_password_from_salt(char *to, const unsigned char *hash_stage2); + +/* end of password.c */ + char *get_tty_password(char *opt_message); -void hash_password(unsigned long *result, const char *password); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); /* Some other useful functions */ void my_init(void); -void load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv); +int load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv); my_bool my_thread_init(void); void my_thread_end(void); diff --git a/include/mysqld_error.h b/include/mysqld_error.h index d2240b7a28e..7646d3e7494 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -289,4 +289,10 @@ #define ER_CANT_AGGREGATE_NCOLLATIONS 1270 #define ER_VARIABLE_IS_NOT_STRUCT 1271 #define ER_UNKNOWN_COLLATION 1272 -#define ER_ERROR_MESSAGES 273 +#define ER_SLAVE_IGNORED_SSL_PARAMS 1273 +#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1274 +#define ER_WARN_FIELD_RESOLVED 1275 +#define ER_BAD_SLAVE_UNTIL_COND 1276 +#define ER_MISSING_SKIP_SLAVE 1277 +#define ER_UNTIL_COND_IGNORED 1278 +#define ER_ERROR_MESSAGES 279 diff --git a/include/sql_common.h b/include/sql_common.h index 9fea46be298..1f442339c4f 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -28,14 +28,19 @@ my_ulonglong net_field_length_ll(uchar **packet); MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, my_bool default_value, uint server_capabilities); void free_rows(MYSQL_DATA *cur); -MYSQL_DATA *read_rows (MYSQL *mysql,MYSQL_FIELD *fields, - uint field_count); my_bool mysql_autenticate(MYSQL *mysql, const char *passwd); void free_old_query(MYSQL *mysql); void end_server(MYSQL *mysql); my_bool mysql_reconnect(MYSQL *mysql); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); +my_bool STDCALL +cli_advanced_command(MYSQL *mysql, enum enum_server_command command, + const char *header, ulong header_length, + const char *arg, ulong arg_length, my_bool skip_check); + +void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, + const char *sqlstate); #ifdef __cplusplus } #endif diff --git a/include/thr_alarm.h b/include/thr_alarm.h index 439f046252f..8ff4472f700 100644 --- a/include/thr_alarm.h +++ b/include/thr_alarm.h @@ -100,7 +100,7 @@ typedef struct st_alarm { #define thr_alarm_init(A) (*(A))=0 #define thr_alarm_in_use(A) (*(A)!= 0) void init_thr_alarm(uint max_alarm); -bool thr_alarm(thr_alarm_t *alarmed, uint sec, ALARM *buff); +my_bool thr_alarm(thr_alarm_t *alarmed, uint sec, ALARM *buff); void thr_alarm_kill(pthread_t thread_id); void thr_end_alarm(thr_alarm_t *alarmed); void end_thr_alarm(my_bool free_structures); diff --git a/include/violite.h b/include/violite.h index 9205f5b799a..37c5abbbe67 100644 --- a/include/violite.h +++ b/include/violite.h @@ -37,18 +37,24 @@ enum enum_vio_type VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY }; -#ifndef __WIN__ -#define HANDLE void * -#endif - Vio* vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost); #ifdef __WIN__ Vio* vio_new_win32pipe(HANDLE hPipe); -Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE handle_map, - HANDLE event_server_wrote, HANDLE event_server_read, - HANDLE event_client_wrote, HANDLE event_client_read); -#endif +Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, + HANDLE handle_map, + HANDLE event_server_wrote, + HANDLE event_server_read, + HANDLE event_client_wrote, + HANDLE event_client_read); +int vio_read_pipe(Vio *vio, gptr buf, int size); +int vio_write_pipe(Vio *vio, const gptr buf, int size); +int vio_close_pipe(Vio * vio); +#else +#define HANDLE void * +#endif /* __WIN__ */ + void vio_delete(Vio* vio); +int vio_close(Vio* vio); #ifdef EMBEDDED_LIBRARY void vio_reset(Vio *vio); @@ -57,71 +63,73 @@ void vio_reset(Vio* vio, enum enum_vio_type type, my_socket sd, HANDLE hPipe, my_bool localhost); #endif -/* - * vio_read and vio_write should have the same semantics - * as read(2) and write(2). - */ int vio_read(Vio *vio, gptr buf, int size); int vio_write(Vio *vio, const gptr buf, int size); -/* - * Whenever the socket is set to blocking mode or not. - */ int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode); my_bool vio_is_blocking(Vio *vio); -/* - * setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible. - */ +/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */ int vio_fastsend(Vio *vio); -/* - * setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible. - */ +/* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */ int vio_keepalive(Vio *vio, my_bool onoff); -/* - * Whenever we should retry the last read/write operation. - */ +/* Whenever we should retry the last read/write operation. */ my_bool vio_should_retry(Vio *vio); -/* - * When the workday is over... - */ -int vio_close(Vio* vio); -/* - * Short text description of the socket for those, who are curious.. - */ +/* Short text description of the socket for those, who are curious.. */ const char* vio_description(Vio *vio); - /* Return the type of the connection */ enum enum_vio_type vio_type(Vio* vio); - /* Return last error number */ -int vio_errno(Vio*vio); - +int vio_errno(Vio*vio); /* Get socket number */ my_socket vio_fd(Vio*vio); - -/* - * Remote peer's address and name in text form. - */ -my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port); - +/* Remote peer's address and name in text form */ +my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port); /* Remotes in_addr */ +void vio_in_addr(Vio *vio, struct in_addr *in); +my_bool vio_poll_read(Vio *vio,uint timeout); +void vio_timeout(Vio *vio,uint timeout); -void vio_in_addr(Vio *vio, struct in_addr *in); +#ifdef HAVE_OPENSSL +#define HEADER_DES_LOCL_H dummy_something +#include +#include -my_bool vio_poll_read(Vio *vio,uint timeout); +struct st_VioSSLAcceptorFd +{ + SSL_CTX *ssl_context; + SSL_METHOD *ssl_method; + struct st_VioSSLAcceptorFd *session_id_context; +}; -#ifdef __cplusplus -} -#endif +/* One copy for client */ +struct st_VioSSLConnectorFd +{ + SSL_CTX *ssl_context; + /* function pointers which are only once for SSL client */ + SSL_METHOD *ssl_method; +}; + +int sslaccept(struct st_VioSSLAcceptorFd*, Vio *, long timeout); +int sslconnect(struct st_VioSSLConnectorFd*, Vio *, long timeout); + +struct st_VioSSLConnectorFd +*new_VioSSLConnectorFd(const char *key_file, const char *cert_file, + const char *ca_file, const char *ca_path, + const char *cipher); +struct st_VioSSLAcceptorFd +*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, + const char *ca_file,const char *ca_path, + const char *cipher); +Vio *new_VioSSL(struct st_VioSSLAcceptorFd *fd, Vio *sd, int state); +#endif /* HAVE_OPENSSL */ #ifdef HAVE_SMEM int vio_read_shared_memory(Vio *vio, gptr buf, int size); int vio_write_shared_memory(Vio *vio, const gptr buf, int size); int vio_close_shared_memory(Vio * vio); #endif -#ifdef __WIN__ -int vio_read_pipe(Vio *vio, gptr buf, int size); -int vio_write_pipe(Vio *vio, const gptr buf, int size); -int vio_close_pipe(Vio * vio); + +#ifdef __cplusplus +} #endif #if defined(HAVE_VIO) && !defined(DONT_MAP_VIO) @@ -138,77 +146,9 @@ int vio_close_pipe(Vio * vio); #define vio_close(vio) ((vio)->vioclose)(vio) #define vio_peer_addr(vio, buf, prt) (vio)->peer_addr(vio, buf, prt) #define vio_in_addr(vio, in) (vio)->in_addr(vio, in) +#define vio_timeout(vio, seconds) (vio)->timeout(vio, seconds) #endif /* defined(HAVE_VIO) && !defined(DONT_MAP_VIO) */ -#ifdef HAVE_OPENSSL -#define HEADER_DES_LOCL_H dummy_something -#include -#include -#include "my_net.h" /* needed because of struct in_addr */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -void vio_ssl_delete(Vio* vio); - -int vio_ssl_read(Vio* vio,gptr buf, int size); -int vio_ssl_write(Vio* vio,const gptr buf,int size); - -/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible. */ - int vio_ssl_fastsend(Vio* vio); -/* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible. */ -int vio_ssl_keepalive(Vio* vio, my_bool onoff); -/* Whenever we should retry the last read/write operation. */ -my_bool vio_ssl_should_retry(Vio* vio); -/* When the workday is over... */ -int vio_ssl_close(Vio* vio); -/* Return last error number */ -int vio_ssl_errno(Vio *vio); -my_bool vio_ssl_peer_addr(Vio* vio, char *buf, uint16 *port); -void vio_ssl_in_addr(Vio *vio, struct in_addr *in); -int vio_ssl_blocking(Vio * vio, my_bool set_blocking_mode, my_bool *old_mode); - -/* Single copy for server */ -enum vio_ssl_acceptorfd_state -{ - state_connect = 1, - state_accept = 2 -}; - -struct st_VioSSLAcceptorFd -{ - SSL_CTX* ssl_context_; - SSL_METHOD* ssl_method_; - struct st_VioSSLAcceptorFd* session_id_context_; -}; - -/* One copy for client */ -struct st_VioSSLConnectorFd -{ - SSL_CTX* ssl_context_; - /* function pointers which are only once for SSL client */ - SSL_METHOD* ssl_method_; -}; - -int sslaccept(struct st_VioSSLAcceptorFd*, Vio*, long timeout); -int sslconnect(struct st_VioSSLConnectorFd*, Vio*, long timeout); - -struct st_VioSSLConnectorFd -*new_VioSSLConnectorFd(const char* key_file, const char* cert_file, - const char* ca_file, const char* ca_path, - const char* cipher); -struct st_VioSSLAcceptorFd -*new_VioSSLAcceptorFd(const char* key_file, const char* cert_file, - const char* ca_file,const char* ca_path, - const char* cipher); -Vio* new_VioSSL(struct st_VioSSLAcceptorFd* fd, Vio* sd,int state); - -#ifdef __cplusplus -} -#endif -#endif /* HAVE_OPENSSL */ - /* This enumerator is used in parser - should be always visible */ enum SSL_type { @@ -237,7 +177,7 @@ struct st_vio void (*viodelete)(Vio*); int (*vioerrno)(Vio*); int (*read)(Vio*, gptr, int); - int (*write)(Vio*, const gptr, int); + int (*write)(Vio*, gptr, int); int (*vioblocking)(Vio*, my_bool, my_bool *); my_bool (*is_blocking)(Vio*); int (*viokeepalive)(Vio*, my_bool); @@ -246,20 +186,18 @@ struct st_vio void (*in_addr)(Vio*, struct in_addr*); my_bool (*should_retry)(Vio*); int (*vioclose)(Vio*); - -#ifdef HAVE_OPENSSL - SSL* ssl_; -#endif /* HAVE_OPENSSL */ + void (*timeout)(Vio*, unsigned int timeout); + void *ssl_arg; #ifdef HAVE_SMEM - HANDLE handle_file_map; - char *handle_map; - HANDLE event_server_wrote; - HANDLE event_server_read; - HANDLE event_client_wrote; - HANDLE event_client_read; - long shared_memory_remain; - char *shared_memory_pos; - NET *net; + HANDLE handle_file_map; + char *handle_map; + HANDLE event_server_wrote; + HANDLE event_server_read; + HANDLE event_client_wrote; + HANDLE event_client_read; + long shared_memory_remain; + char *shared_memory_pos; + NET *net; #endif /* HAVE_SMEM */ #endif /* HAVE_VIO */ }; diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index d8a0959e47f..1af9336ce72 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -2376,8 +2376,15 @@ btr_index_rec_validate( type = dict_index_get_nth_type(index, i); - if (len != UNIV_SQL_NULL && dtype_is_fixed_size(type) - && len != dtype_get_fixed_size(type)) { + if ((dict_index_get_nth_field(index, i)->prefix_len == 0 + && len != UNIV_SQL_NULL && dtype_is_fixed_size(type) + && len != dtype_get_fixed_size(type)) + || + (dict_index_get_nth_field(index, i)->prefix_len > 0 + && len != UNIV_SQL_NULL && dtype_is_fixed_size(type) + && len != + dict_index_get_nth_field(index, i)->prefix_len)) { + fprintf(stderr, "InnoDB: Record in index %s in table %s, page %lu, at offset %lu\n" "InnoDB: field %lu len is %lu, should be %lu\n", diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 924fa3ecf95..a576a886b97 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -1596,6 +1596,13 @@ dict_index_build_internal_clust( break; } + if (dict_index_get_nth_field(new_index, i)->prefix_len + > 0) { + new_index->trx_id_offset = 0; + + break; + } + new_index->trx_id_offset += fixed_size; } diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c index 20bf4972f64..8727c5156e4 100644 --- a/innobase/fsp/fsp0fsp.c +++ b/innobase/fsp/fsp0fsp.c @@ -2656,7 +2656,13 @@ fseg_free_page_low( ulint not_full_n_used; ulint state; ulint i; - char errbuf[200]; + char errbuf[200]; + +#ifdef __WIN__ + dulint desm; + dulint segm; +#endif + ut_ad(seg_inode && mtr); ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) == @@ -2736,7 +2742,10 @@ fseg_free_page_low( fprintf(stderr, "InnoDB: Dump of the segment inode: %s\n", errbuf); - fprintf(stderr, + +#ifndef __WIN__ + + fprintf(stderr, "InnoDB: Serious error: InnoDB is trying to free space %lu page %lu,\n" "InnoDB: which does not belong to segment %lu %lu but belongs\n" "InnoDB: to segment %lu %lu.\n", @@ -2750,6 +2759,26 @@ fseg_free_page_low( ut_dulint_get_low( mtr_read_dulint(seg_inode + FSEG_ID, MLOG_8BYTES, mtr))); +#else + +/* More pedantic usage to avoid VC++ 6.0 compiler errors due to inline + function expansion issues */ + + desm = mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES, mtr); + segm = mtr_read_dulint(seg_inode + FSEG_ID, MLOG_8BYTES, mtr); + + fprintf(stderr, +"InnoDB: Serious error: InnoDB is trying to free space %lu page %lu,\n" +"InnoDB: which does not belong to segment %lu %lu but belongs\n" +"InnoDB: to segment %lu %lu.\n", + space, page, + ut_dulint_get_high(desm), + ut_dulint_get_low(desm), + ut_dulint_get_high(segm), + ut_dulint_get_low(segm)); + +#endif + fprintf(stderr, "InnoDB: If the InnoDB recovery crashes here, see section 6.1\n" "InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n"); diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index e31fd1d9efe..f4f50320906 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -226,13 +226,8 @@ os_file_get_last_error(void) "InnoDB: the directory. It may also be you have created a subdirectory\n" "InnoDB: of the same name as a data file.\n"); } else { - if (strerror((int)err) != NULL) { - fprintf(stderr, - "InnoDB: Error number %lu means '%s'.\n", err, strerror((int)err)); - } - fprintf(stderr, - "InnoDB: See also section 13.2 at http://www.innodb.com/ibman.html\n" + "InnoDB: See section 13.2 at http://www.innodb.com/ibman.html\n" "InnoDB: about operating system error numbers.\n"); } } diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 81bbf5053c0..d0f6965f94e 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2170,7 +2170,7 @@ row_sel_store_mysql_rec( ulint len; byte* blob_buf; ulint i; - + ut_ad(prebuilt->mysql_template); if (prebuilt->blob_heap != NULL) { @@ -2178,9 +2178,9 @@ row_sel_store_mysql_rec( prebuilt->blob_heap = NULL; } - /* Mark all columns as not SQL NULL */ + /* Mark all columns as SQL NULL */ - memset(mysql_rec, '\0', prebuilt->null_bitmap_len); + memset(mysql_rec, 255, prebuilt->null_bitmap_len); for (i = 0; i < prebuilt->n_template; i++) { @@ -2235,16 +2235,21 @@ row_sel_store_mysql_rec( data = blob_buf; } - + row_sel_field_store_in_mysql_format( mysql_rec + templ->mysql_col_offset, templ->mysql_col_len, data, len, templ->type, templ->is_unsigned); if (extern_field_heap) { - mem_heap_free(extern_field_heap); + mem_heap_free(extern_field_heap); extern_field_heap = NULL; - } + } + + if (templ->mysql_null_bit_mask) { + mysql_rec[templ->mysql_null_byte_offset] &= + ~(byte) (templ->mysql_null_bit_mask); + } } else { /* MySQL seems to assume the field for an SQL NULL value is set to zero. Not taking this into account @@ -2252,19 +2257,13 @@ row_sel_store_mysql_rec( bug number 154 in the MySQL bug database: GROUP BY and DISTINCT could treat NULL values inequal. */ - memset(mysql_rec + templ->mysql_col_offset, '\0', + memset(mysql_rec + templ->mysql_col_offset, + ((templ->type == DATA_VARCHAR || + templ->type == DATA_VARMYSQL || + templ->type == DATA_BINARY) ? ' ' : '\0'), templ->mysql_col_len); - - if (!templ->mysql_null_bit_mask) { - fprintf(stderr, -"InnoDB: Error: trying to return an SQL NULL field in a non-null\n" -"innoDB: column! Table name %s\n", prebuilt->table->name); - } else { - mysql_rec[templ->mysql_null_byte_offset] |= - (byte) (templ->mysql_null_bit_mask); - } } - } + } return(TRUE); } diff --git a/isam/_search.c b/isam/_search.c index 1ceeab1e824..7b61abfb46b 100644 --- a/isam/_search.c +++ b/isam/_search.c @@ -119,7 +119,7 @@ int _nisam_search(register N_INFO *info, register N_KEYDEF *keyinfo, uchar *key, { keypos=_nisam_get_last_key(info,keyinfo,buff,lastkey,keypos); if (!(nextflag & SEARCH_SMALLER) && - _nisam_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND)) + _nisam_key_cmp(keyinfo->seg, lastkey, key, key_len, SEARCH_FIND)) { my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */ goto err; diff --git a/isam/isamchk.c b/isam/isamchk.c index dc772290e13..939a4be732f 100644 --- a/isam/isamchk.c +++ b/isam/isamchk.c @@ -1328,7 +1328,7 @@ int extend; print_error("Found wrong record at %lu",(ulong) start_recpos); got_error=1; } - crc^=checksum(record,info->s->base.reclength); + crc^=_nisam_checksum(record,info->s->base.reclength); link_used+=info->s->pack.ref_length; used+=block_info.rec_len+info->s->pack.ref_length; } diff --git a/isam/isamdef.h b/isam/isamdef.h index 0884b18e997..54656b6842e 100644 --- a/isam/isamdef.h +++ b/isam/isamdef.h @@ -358,6 +358,7 @@ extern int _nisam_read_pack_record(N_INFO *info,ulong filepos,byte *buf); extern int _nisam_read_rnd_pack_record(N_INFO*, byte *,ulong, int); extern int _nisam_pack_rec_unpack(N_INFO *info,byte *to,byte *from, uint reclength); +extern ulong _nisam_checksum(const byte *mem, uint count); typedef struct st_sortinfo { uint key_length; diff --git a/isam/open.c b/isam/open.c index 48fab27cac1..be62fd86192 100644 --- a/isam/open.c +++ b/isam/open.c @@ -415,6 +415,9 @@ static void setup_functions(register ISAM_SHARE *share) share->read_rnd=_nisam_read_rnd_dynamic_record; share->delete_record=_nisam_delete_dynamic_record; share->compare_record=_nisam_cmp_dynamic_record; + + /* add bits used to pack data to pack_reclength for faster allocation */ + share->base.pack_reclength+= share->base.pack_bits; if (share->base.blobs) { share->update_record=_nisam_update_blob_record; @@ -453,3 +456,22 @@ static void setup_key_functions(register N_KEYDEF *keyinfo) } return; } + +/* + Calculate a long checksum for a memoryblock. Used to verify pack_isam + + SYNOPSIS + checksum() + mem Pointer to memory block + count Count of bytes +*/ + +ulong _nisam_checksum(const byte *mem, uint count) +{ + ulong crc; + for (crc= 0; count-- ; mem++) + crc= ((crc << 1) + *((uchar*) mem)) + + test(crc & ((ulong) 1L << (8*sizeof(ulong)-1))); + return crc; +} + diff --git a/isam/pack_isam.c b/isam/pack_isam.c index fd12aac1e09..9108070f918 100644 --- a/isam/pack_isam.c +++ b/isam/pack_isam.c @@ -738,7 +738,7 @@ static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts) { if (! error) { - crc^=checksum(record,reclength); + crc^=_nisam_checksum(record,reclength); for (pos=record,count=huff_counts ; count < end_count ; count++, diff --git a/isam/test_all.res b/isam/test_all.res index f6280dd9f98..5de37e44585 100644 --- a/isam/test_all.res +++ b/isam/test_all.res @@ -1,367 +1,30 @@ +echo "test2 -L -K -W -P" test2 -L -K -W -P -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 -Key cacheing used -Write cacheing used -Locking used +echo "test2 -L -K -W -P -A" test2 -L -K -W -P -A -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 -Key cacheing used -Write cacheing used -Asyncron io with locking used +echo "test2 -L -K -W -P -S -R1 -m500" test2 -L -K -W -P -S -R1 -m500 -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 475 -Update records: 44 -Same-key-read: 4 -Delete records: 475 -Record pointer size: 1 -Key cacheing used -Write cacheing used -Locking used -test2 -L -K -R1 -m2000 ; Should give error 135 -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Read first - delete - next -> last -- Read last - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 1647 -Update records: 125 -Same-key-read: 8 -Delete records: 1647 -Record pointer size: 1 -Key cacheing used -Locking used +echo "test2 -L -K -R1 -m2000 ; Should give error 135" +test2 -L -K -R1 -m2000 +echo "test2 -L -K -P -S -R3 -m50 -b1000000" test2 -L -K -P -S -R3 -m50 -b1000000 -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 50 -Update records: 5 -Same-key-read: 2 -Delete records: 50 -Record pointer size: 3 -Key cacheing used -Locking used +echo "test2 -L -B" test2 -L -B -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 903 -Update records: 86 -Same-key-read: 5 -Delete records: 903 -Locking used -blobs used +echo "test2 -L -K -W -P -m50 -l" test2 -L -K -W -P -m50 -l -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 50 -Update records: 5 -Same-key-read: 2 -Delete records: 50 -Key cacheing used -Write cacheing used -Locking used -Commands Used count Errors Recover errors -open 14 0 0 -write 700 0 0 -update 70 0 0 -delete 700 0 0 -close 14 0 0 -extra 84 0 0 -Total 1582 0 0 +isamlog +echo "test2 -L -K -W -P -m50 -l -b100" test2 -L -K -W -P -m50 -l -b100 -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 50 -Update records: 5 -Same-key-read: 2 -Delete records: 50 -Key cacheing used -Write cacheing used -Locking used -Commands Used count Errors Recover errors -open 15 0 0 -write 750 0 0 -update 75 0 0 -delete 750 0 0 -close 15 0 0 -extra 90 0 0 -Total 1695 0 0 +isamlog +echo "time test2" time test2 -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 +echo "time test2 -K" time test2 -K -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 -Key cacheing used +echo "time test2 -L" time test2 -L -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 -Locking used +echo "time test2 -L -K" time test2 -L -K -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 -Key cacheing used -Locking used +echo "time test2 -L -K -W" time test2 -L -K -W -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 -Key cacheing used -Write cacheing used -Locking used +echo "time test2 -L -K -W -S" time test2 -L -K -W -S -- Creating isam-file -- Writing key:s -- Delete -- Update -- Same key: first - next -> last - prev -> first -- All keys: first - next -> last - prev -> first -- Test if: Read first - next - prev - prev - next == first -- Test if: Read last - prev - next - next - prev == last -- Test read key-part -- Read key (first) - next - delete - next -> last -- Read last of key - prev - delete - prev -> first -- Test if: Read rrnd - same -- Test nisam_records_in_range -- nisam_info -- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE) -- Removing keys - -Following test have been made: -Write records: 907 -Update records: 87 -Same-key-read: 6 -Delete records: 907 -Key cacheing used -Write cacheing used -Locking used diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index 0125bd2b98d..3e026fe589a 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -42,7 +42,7 @@ link_sources: rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../strings/$$f $(srcdir)/$$f; \ done; \ - for f in $$vs; do \ + for f in $$vs $(vioheaders); do \ rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../vio/$$f $(srcdir)/$$f; \ done; \ diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index 9a5869c47ff..1d431fa3624 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -47,6 +47,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ mystringsextra= strto.c dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo mysysheaders = mysys_priv.h my_static.h +vioheaders = vio_priv.h mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ my_create.lo my_delete.lo mf_tempfile.lo my_open.lo \ my_read.lo my_write.lo errors.lo \ @@ -88,7 +89,7 @@ clean-local: `echo $(vio_objects) | sed "s;\.lo;.c;g"` \ `echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \ $(CHARSET_SRCS) $(CHARSET_OBJS) \ - $(mystringsextra) $(mysysheaders) \ + $(mystringsextra) $(mysysheaders) $(vioheaders)\ ../linked_client_sources net.c conf_to_src_SOURCES = conf_to_src.c diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index 43f341c7b1c..b9c47c1dd55 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -41,3 +41,20 @@ my_bool send_file_to_server(MYSQL *mysql, const char *filename); #define reset_sigpipe(mysql) #endif +void mysql_read_default_options(struct st_mysql_options *options, + const char *filename,const char *group); +MYSQL * STDCALL +cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, + const char *passwd, const char *db, + uint port, const char *unix_socket,ulong client_flag); + +void STDCALL cli_mysql_close(MYSQL *mysql); + +MYSQL_FIELD * STDCALL cli_list_fields(MYSQL *mysql); +my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt); +MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, + uint fields); +int STDCALL cli_stmt_execute(MYSQL_STMT *stmt); +MYSQL_DATA *cli_read_binary_rows(MYSQL_STMT *stmt); +int STDCALL cli_unbuffered_fetch(MYSQL *mysql, char **row); +const char * STDCALL cli_read_statistic(MYSQL *mysql); diff --git a/libmysql/dll.c b/libmysql/dll.c index f0a67d8f091..e9334d68a0c 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -112,17 +112,18 @@ int _export FAR PASCAL libmain(HANDLE hModule,short cbHeapSize, #ifdef OS2 -// -// This function is called automatically by _DLL_InitTerm -// Every dll runtime enviroment is not tz enabled, so tzset() -// must be called to enable TZ handling -// Also timezone is fixed. -// +/* + This function is called automatically by _DLL_InitTerm + Every dll runtime enviroment is not tz enabled, so tzset() + must be called to enable TZ handling + Also timezone is fixed. +*/ + extern "C" unsigned long _System DllMain(unsigned long modhandle, unsigned long flag) { if (flag == 0) { - tzset(); // Set tzname + tzset(); /* Set tzname */ time_t currentTime = time(NULL); struct tm *ts = localtime(¤tTime); if (ts->tm_isdst > 0) diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index bbb85885886..148625129b5 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -26,24 +26,24 @@ const char *client_errors[]= { "Unbekannter MySQL Fehler", "Kann UNIX-Socket nicht anlegen (%d)", - "Keine Verbindung zu lokalem MySQL Server, socket: '%-.64s' (%d)", - "Keine Verbindung zu MySQL Server auf %-.64s (%d)", + "Keine Verbindung zu lokalem MySQL Server, socket: '%-.100s' (%d)", + "Keine Verbindung zu MySQL Server auf %-.100s (%d)", "Kann TCP/IP-Socket nicht anlegen (%d)", - "Unbekannter MySQL Server Host (%-.64s) (%d)", + "Unbekannter MySQL Server Host (%-.100s) (%d)", "MySQL Server nicht vorhanden", "Protokolle ungleich. Server Version = % d Client Version = %d", "MySQL client got out of memory", "Wrong host info", "Localhost via UNIX socket", - "%-.64s via TCP/IP", + "%-.100s via TCP/IP", "Error in server handshake", "Lost connection to MySQL server during query", "Commands out of sync; You can't run this command now", - "Verbindung ueber Named Pipe; Host: %-.64s", + "Verbindung ueber Named Pipe; Host: %-.100s", "Kann nicht auf Named Pipe warten. Host: %-.64s pipe: %-.32s (%lu)", "Kann Named Pipe nicht oeffnen. Host: %-.64s pipe: %-.32s (%lu)", "Kann den Status der Named Pipe nicht setzen. Host: %-.64s pipe: %-.32s (%lu)", - "Can't initialize character set %-.64s (path: %-.64s)", + "Can't initialize character set %-.32s (path: %-.100s)", "Got packet bigger than 'max_allowed_packet'", "Embedded server", "Error on SHOW SLAVE STATUS:", @@ -71,7 +71,8 @@ const char *client_errors[]= "Can't open shared memory. Server abandoded and don't sent the answer event (%lu)", "Can't open shared memory. Can't send the request event to server (%lu)", "Wrong or unknown protocol", - "Invalid connection handle" + "Invalid connection handle", + "mysql_server_init wasn't called" }; /* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ @@ -81,24 +82,24 @@ const char *client_errors[]= { "Erro desconhecido do MySQL", "Não pode criar 'UNIX socket' (%d)", - "Não pode se conectar ao servidor MySQL local através do 'socket' '%-.64s' (%d)", - "Não pode se conectar ao servidor MySQL em '%-.64s' (%d)", + "Não pode se conectar ao servidor MySQL local através do 'socket' '%-.100s' (%d)", + "Não pode se conectar ao servidor MySQL em '%-.100s' (%d)", "Não pode criar 'socket TCP/IP' (%d)", - "'Host' servidor MySQL '%-.64s' (%d) desconhecido", + "'Host' servidor MySQL '%-.100s' (%d) desconhecido", "Servidor MySQL desapareceu", "Incompatibilidade de protocolos. Versão do Servidor: %d - Versão do Cliente: %d", "Cliente do MySQL com falta de memória", "Informação inválida de 'host'", "Localhost via 'UNIX socket'", - "%-.64s via 'TCP/IP'", + "%-.100s via 'TCP/IP'", "Erro na negociação de acesso ao servidor", "Conexão perdida com servidor MySQL durante 'query'", "Comandos fora de sincronismo. Você não pode executar este comando agora", - "%-.64s via 'named pipe'", + "%-.100s via 'named pipe'", "Não pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", "Não pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", "Não pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", - "Não pode inicializar conjunto de caracteres %-.64s (caminho %-.64s)", + "Não pode inicializar conjunto de caracteres %-.32s (caminho %-.100s)", "Obteve pacote maior do que 'max_allowed_packet'", "Embedded server" "Error on SHOW SLAVE STATUS:", @@ -126,7 +127,8 @@ const char *client_errors[]= "Can't open shared memory. Server abandoded and don't sent the answer event (%lu)", "Can't open shared memory. Can't send the request event to server (%lu)", "Wrong or unknown protocol", - "Invalid connection handle" + "Invalid connection handle", + "mysql_server_init wasn't called" }; #else /* ENGLISH */ @@ -134,24 +136,24 @@ const char *client_errors[]= { "Unknown MySQL error", "Can't create UNIX socket (%d)", - "Can't connect to local MySQL server through socket '%-.64s' (%d)", - "Can't connect to MySQL server on '%-.64s' (%d)", + "Can't connect to local MySQL server through socket '%-.100s' (%d)", + "Can't connect to MySQL server on '%-.100s' (%d)", "Can't create TCP/IP socket (%d)", - "Unknown MySQL Server Host '%-.64s' (%d)", + "Unknown MySQL Server Host '%-.100s' (%d)", "MySQL server has gone away", "Protocol mismatch. Server Version = %d Client Version = %d", "MySQL client run out of memory", "Wrong host info", "Localhost via UNIX socket", - "%-.64s via TCP/IP", + "%-.100s via TCP/IP", "Error in server handshake", "Lost connection to MySQL server during query", "Commands out of sync; You can't run this command now", - "%-.64s via named pipe", + "%-.100s via named pipe", "Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)", "Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)", "Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)", - "Can't initialize character set %-.64s (path: %-.64s)", + "Can't initialize character set %-.32s (path: %-.100s)", "Got packet bigger than 'max_allowed_packet'", "Embedded server", "Error on SHOW SLAVE STATUS:", @@ -179,7 +181,8 @@ const char *client_errors[]= "Can't open shared memory. Server abandoded and don't sent the answer event (%lu)", "Can't open shared memory. Can't send the request event to server (%lu)", "Wrong or unknown protocol", - "Invalid connection handle" + "Invalid connection handle", + "mysql_server_init wasn't called" }; #endif diff --git a/libmysql/get_password.c b/libmysql/get_password.c index e6221ea556e..0e3b2dcb0ae 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -78,7 +78,7 @@ char *get_tty_password(char *opt_message) char *pos=to,*end=to+sizeof(to)-1; int i=0; DBUG_ENTER("get_tty_password"); - fprintf(stdout,opt_message ? opt_message : "Enter password: "); + _cputs(opt_message ? opt_message : "Enter password: "); for (;;) { char tmp; diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 19cfedce51d..0e937a6e0c9 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -155,9 +155,16 @@ void STDCALL mysql_server_end() { /* If library called my_init(), free memory allocated by it */ if (!org_my_init_done) + { my_end(0); +#ifndef THREAD + /* Remove TRACING, if enabled by mysql_debug() */ + DBUG_POP(); +#endif + } else mysql_thread_end(); + mysql_client_init= org_my_init_done= 0; } #endif /*EMBEDDED_LIBRARY*/ @@ -272,7 +279,7 @@ my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, DBUG_ENTER("mysql_master_query"); if (mysql_master_send_query(mysql, q, length)) DBUG_RETURN(1); - DBUG_RETURN(mysql_read_query_result(mysql)); + DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); } my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, @@ -294,7 +301,7 @@ my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q, DBUG_ENTER("mysql_slave_query"); if (mysql_slave_send_query(mysql, q, length)) DBUG_RETURN(1); - DBUG_RETURN(mysql_read_query_result(mysql)); + DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); } @@ -594,6 +601,8 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db) { char buff[512],*end=buff; + NET *net= &mysql->net; + ulong pkt_length; DBUG_ENTER("mysql_change_user"); if (!user) @@ -604,41 +613,54 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, /* Store user into the buffer */ end=strmov(end,user)+1; - /* - We always start with old type handshake the only difference is message sent - If server handles secure connection type we'll not send the real scramble - */ - if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + /* write scrambled password according to server capabilities */ + if (passwd[0]) { - if (passwd[0]) + if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION) { - /* Prepare false scramble */ - bfill(end, SCRAMBLE_LENGTH, 'x'); - end+=SCRAMBLE_LENGTH; - *end=0; - + *end++= SCRAMBLE_LENGTH; + scramble(end, mysql->scramble, passwd); + end+= SCRAMBLE_LENGTH; + } + else + { + scramble_323(end, mysql->scramble, passwd); + end+= SCRAMBLE_LENGTH_323 + 1; } - else /* For empty password */ - *end=0; /* zero length scramble */ } else - { - /* - Real scramble is only sent to old servers. This can be blocked - by calling mysql_options(MYSQL *, MYSQL_SECURE_CONNECT, (char*) &1); - */ - end=scramble(end, mysql->scramble_buff, passwd, - (my_bool) (mysql->protocol_version == 9)); - } + *end++= '\0'; /* empty password */ /* Add database if needed */ - end=strmov(end+1,db ? db : ""); + end= strmov(end, db ? db : "") + 1; /* Write authentication package */ simple_command(mysql,COM_CHANGE_USER, buff,(ulong) (end-buff),1); - if (mysql_autenticate(mysql, passwd)) + pkt_length= net_safe_read(mysql); + + if (pkt_length == packet_error) goto error; + if (pkt_length == 1 && net->read_pos[0] == 254 && + mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + { + /* + By sending this very specific reply server asks us to send scrambled + password in old format. The reply contains scramble_323. + */ + scramble_323(buff, mysql->scramble, passwd); + if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net)) + { + net->last_errno= CR_SERVER_LOST; + strmov(net->sqlstate, unknown_sqlstate); + strmov(net->last_error,ER(net->last_errno)); + goto error; + } + /* Read what server thinks about out new auth message report */ + if (net_safe_read(mysql) == packet_error) + goto error; + } + /* Free old connect information */ my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR)); my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR)); @@ -951,6 +973,19 @@ mysql_list_tables(MYSQL *mysql, const char *wild) DBUG_RETURN (mysql_store_result(mysql)); } +MYSQL_FIELD * STDCALL cli_list_fields(MYSQL *mysql) +{ + MYSQL_DATA *query; + if (!(query= cli_read_rows(mysql,(MYSQL_FIELD*) 0, + protocol_41(mysql) ? 8 : 6))) + return NULL; + + mysql->field_count= query->rows; + return unpack_fields(query,&mysql->field_alloc, + query->rows, 1, mysql->server_capabilities); +} + + /************************************************************************** List all fields in a table If wild is given then only the fields matching wild is returned @@ -961,34 +996,27 @@ mysql_list_tables(MYSQL *mysql, const char *wild) MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild) { - MYSQL_RES *result; - MYSQL_DATA *query; + MYSQL_RES *result; + MYSQL_FIELD *fields; char buff[257],*end; DBUG_ENTER("mysql_list_fields"); DBUG_PRINT("enter",("table: '%s' wild: '%s'",table,wild ? wild : "")); - LINT_INIT(query); - end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128); + free_old_query(mysql); if (simple_command(mysql,COM_FIELD_LIST,buff,(ulong) (end-buff),1) || - !(query = read_rows(mysql,(MYSQL_FIELD*) 0, - protocol_41(mysql) ? 8 : 6))) + !(fields= (*mysql->methods->list_fields)(mysql))) DBUG_RETURN(NULL); - free_old_query(mysql); if (!(result = (MYSQL_RES *) my_malloc(sizeof(MYSQL_RES), MYF(MY_WME | MY_ZEROFILL)))) - { - free_rows(query); DBUG_RETURN(NULL); - } + result->methods= mysql->methods; result->field_alloc=mysql->field_alloc; mysql->fields=0; - result->field_count = (uint) query->rows; - result->fields= unpack_fields(query,&result->field_alloc, - result->field_count, 1, - mysql->server_capabilities); + result->field_count = mysql->field_count; + result->fields= fields; result->eof=1; DBUG_RETURN(result); } @@ -1009,8 +1037,8 @@ mysql_list_processes(MYSQL *mysql) free_old_query(mysql); pos=(uchar*) mysql->net.read_pos; field_count=(uint) net_field_length(&pos); - if (!(fields = read_rows(mysql,(MYSQL_FIELD*) 0, - protocol_41(mysql) ? 7 : 5))) + if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0, + protocol_41(mysql) ? 7 : 5))) DBUG_RETURN(NULL); if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0, mysql->server_capabilities))) @@ -1074,12 +1102,8 @@ mysql_dump_debug_info(MYSQL *mysql) DBUG_RETURN(simple_command(mysql,COM_DEBUG,0,0,0)); } -const char * STDCALL -mysql_stat(MYSQL *mysql) +const char * STDCALL cli_read_statistic(MYSQL *mysql) { - DBUG_ENTER("mysql_stat"); - if (simple_command(mysql,COM_STATISTICS,0,0,0)) - return mysql->net.last_error; mysql->net.read_pos[mysql->packet_length]=0; /* End of stat string */ if (!mysql->net.read_pos[0]) { @@ -1088,7 +1112,16 @@ mysql_stat(MYSQL *mysql) strmov(mysql->net.last_error, ER(mysql->net.last_errno)); return mysql->net.last_error; } - DBUG_RETURN((char*) mysql->net.read_pos); + return (char*) mysql->net.read_pos; +} + +const char * STDCALL +mysql_stat(MYSQL *mysql) +{ + DBUG_ENTER("mysql_stat"); + if (simple_command(mysql,COM_STATISTICS,0,0,0)) + return mysql->net.last_error; + DBUG_RETURN((*mysql->methods->read_statistic)(mysql)); } @@ -1466,8 +1499,8 @@ static void set_stmt_error(MYSQL_STMT * stmt, int errcode, Copy error message to statement handler */ -static void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, - const char *sqlstate) +void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, + const char *sqlstate) { DBUG_ENTER("set_stmt_error_msg"); DBUG_PRINT("enter", ("error: %d/%s '%s'", errcode, sqlstate, err)); @@ -1541,7 +1574,7 @@ static my_bool my_realloc_str(NET *net, ulong length) 1 error */ -static my_bool read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) +my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) { uchar *pos; uint field_count; @@ -1564,25 +1597,16 @@ static my_bool read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) mysql->server_status|= SERVER_STATUS_IN_TRANS; mysql->extra_info= net_field_length_ll(&pos); - if (!(fields_data= read_rows(mysql, (MYSQL_FIELD*) 0, 7))) + if (!(fields_data= (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,7))) DBUG_RETURN(1); if (!(stmt->fields= unpack_fields(fields_data,&stmt->mem_root, field_count,0, mysql->server_capabilities))) DBUG_RETURN(1); } - if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, - sizeof(MYSQL_BIND)* - (param_count + - field_count)))) - { - set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); - DBUG_RETURN(0); - } - stmt->bind= (stmt->params + param_count); stmt->field_count= (uint) field_count; stmt->param_count= (ulong) param_count; - mysql->status= MYSQL_STATUS_READY; + DBUG_RETURN(0); } @@ -1626,14 +1650,25 @@ mysql_prepare(MYSQL *mysql, const char *query, ulong length) } init_alloc_root(&stmt->mem_root,8192,0); - if (read_prepare_result(mysql, stmt)) + if ((*mysql->methods->read_prepare_result)(mysql, stmt)) { stmt_close(stmt, 1); DBUG_RETURN(0); } + + if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, + sizeof(MYSQL_BIND)* + (stmt->param_count + + stmt->field_count)))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(0); + } + stmt->bind= stmt->params + stmt->param_count; stmt->state= MY_ST_PREPARE; stmt->mysql= mysql; mysql->stmts= list_add(mysql->stmts, &stmt->list); + mysql->status= MYSQL_STATUS_READY; stmt->list.data= stmt; DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count)); DBUG_RETURN(stmt); @@ -1693,10 +1728,10 @@ unsigned int alloc_stmt_fields(MYSQL_STMT *stmt) */ MYSQL_RES * STDCALL -mysql_prepare_result(MYSQL_STMT *stmt) +mysql_get_metadata(MYSQL_STMT *stmt) { MYSQL_RES *result; - DBUG_ENTER("mysql_prepare_result"); + DBUG_ENTER("mysql_get_metadata"); if (!stmt->field_count || !stmt->fields) { @@ -1736,7 +1771,6 @@ mysql_param_result(MYSQL_STMT *stmt) } - /******************************************************************** Prepare-execute, and param handling *********************************************************************/ @@ -1751,6 +1785,7 @@ static void store_param_type(NET *net, uint type) net->write_pos+=2; } + /**************************************************************************** Functions to store parameter data from a prepared statement. @@ -1766,7 +1801,6 @@ static void store_param_type(NET *net, uint type) 1 Error (Can't alloc net->buffer) ****************************************************************************/ - static void store_param_tinyint(NET *net, MYSQL_BIND *param) { *(net->write_pos++)= (uchar) *param->buffer; @@ -1950,36 +1984,21 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length) mysql->last_used_con= mysql; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ - if ((*mysql->methods->advanced_command)(mysql, COM_EXECUTE, buff, - MYSQL_STMT_HEADER, packet, - length, 1) || - mysql_read_query_result(mysql)) + if (cli_advanced_command(mysql, COM_EXECUTE, buff, + MYSQL_STMT_HEADER, packet, + length, 1) || + (*mysql->methods->read_query_result)(mysql)) { set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); DBUG_RETURN(1); } - stmt->state= MY_ST_EXECUTE; - mysql_free_result(stmt->result); - stmt->result= (MYSQL_RES *)0; - stmt->result_buffered= 0; - stmt->current_row= 0; DBUG_RETURN(0); } - -/* - Execute the prepare query -*/ - -int STDCALL mysql_execute(MYSQL_STMT *stmt) +int STDCALL cli_stmt_execute(MYSQL_STMT *stmt) { - DBUG_ENTER("mysql_execute"); + DBUG_ENTER("cli_stmt_execute"); - if (stmt->state == MY_ST_UNKNOWN) - { - set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); - DBUG_RETURN(1); - } if (stmt->param_count) { NET *net= &stmt->mysql->net; @@ -2040,6 +2059,30 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt) DBUG_RETURN((int) execute(stmt,0,0)); } +/* + Execute the prepare query +*/ + +int STDCALL mysql_execute(MYSQL_STMT *stmt) +{ + DBUG_ENTER("mysql_execute"); + + if (stmt->state == MY_ST_UNKNOWN) + { + set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); + DBUG_RETURN(1); + } + if ((*stmt->mysql->methods->stmt_execute)(stmt)) + DBUG_RETURN(1); + + stmt->state= MY_ST_EXECUTE; + mysql_free_result(stmt->result); + stmt->result= (MYSQL_RES *)0; + stmt->result_buffered= 0; + stmt->current_row= 0; + DBUG_RETURN(0); +} + /* Return total parameters count in the statement @@ -2063,8 +2106,6 @@ my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt) static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */ static my_bool int_is_null_false= 0; -static my_bool int_is_null_dummy; -static unsigned long param_length_is_dummy; /* Setup the parameter data buffers from application @@ -2400,7 +2441,10 @@ static void send_data_long(MYSQL_BIND *param, longlong value) char tmp[22]; /* Enough for longlong */ uint length= (uint)(longlong10_to_str(value,(char *)tmp,10)-tmp); ulong copy_length= min((ulong)length-param->offset, param->buffer_length); - memcpy(buffer, (char *)tmp+param->offset, copy_length); + if ((long) copy_length < 0) + copy_length=0; + else + memcpy(buffer, (char *)tmp+param->offset, copy_length); *param->length= length; if (copy_length != param->buffer_length) @@ -2448,7 +2492,10 @@ static void send_data_double(MYSQL_BIND *param, double value) char tmp[128]; uint length= my_sprintf(tmp,(tmp,"%g",value)); ulong copy_length= min((ulong)length-param->offset, param->buffer_length); - memcpy(buffer, (char *)tmp+param->offset, copy_length); + if ((long) copy_length < 0) + copy_length=0; + else + memcpy(buffer, (char *)tmp+param->offset, copy_length); *param->length= length; if (copy_length != param->buffer_length) @@ -2513,15 +2560,19 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length) case MYSQL_TYPE_BLOB: *param->length= length; length= min(length-param->offset, param->buffer_length); - memcpy(buffer, value+param->offset, length); + if ((long) length > 0) + memcpy(buffer, value+param->offset, length); break; default: *param->length= length; length= min(length-param->offset, param->buffer_length); - memcpy(buffer, value+param->offset, length); + if ((long) length < 0) + length= 0; + else + memcpy(buffer, value+param->offset, length); if (length != param->buffer_length) buffer[length]= '\0'; - } + } } @@ -2583,15 +2634,16 @@ static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime, /* Fetch data to buffers */ -static void fetch_results(MYSQL_BIND *param, uint field_type, uchar **row, - my_bool field_is_unsigned) +static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) { ulong length; - + enum enum_field_types field_type= field->type; + switch (field_type) { case MYSQL_TYPE_TINY: { char value= (char) **row; + uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); longlong data= ((field_is_unsigned) ? (longlong) (unsigned char) value: (longlong) value); send_data_long(param,data); @@ -2602,6 +2654,7 @@ static void fetch_results(MYSQL_BIND *param, uint field_type, uchar **row, case MYSQL_TYPE_YEAR: { short value= sint2korr(*row); + uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); longlong data= ((field_is_unsigned) ? (longlong) (unsigned short) value: (longlong) value); send_data_long(param,data); @@ -2611,6 +2664,7 @@ static void fetch_results(MYSQL_BIND *param, uint field_type, uchar **row, case MYSQL_TYPE_LONG: { long value= sint4korr(*row); + uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); longlong data= ((field_is_unsigned) ? (longlong) (unsigned long) value: (longlong) value); send_data_long(param,data); @@ -2759,24 +2813,6 @@ static void fetch_result_str(MYSQL_BIND *param, uchar **row) *row+= length; } -static uint default_binary_field_length(uint field_type) -{ - switch(field_type) { - case MYSQL_TYPE_TINY: - return 1; - case MYSQL_TYPE_SHORT: - return 2; - case MYSQL_TYPE_LONG: - case MYSQL_TYPE_FLOAT: - return 4; - case MYSQL_TYPE_LONGLONG: - case MYSQL_TYPE_DOUBLE: - return 8; - default: - return 0; - } -} - /* Setup the bind buffers for resultset processing @@ -2816,10 +2852,10 @@ my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) This is to make the excute code easier */ if (!param->is_null) - param->is_null= &int_is_null_dummy; + param->is_null= ¶m->internal_is_null; if (!param->length) - param->length= ¶m_length_is_dummy; + param->length= ¶m->internal_length; param->param_number= param_count++; param->offset= 0; @@ -2923,10 +2959,7 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row) if (field->type == bind->buffer_type) (*bind->fetch_result)(bind, &row); else - { - my_bool field_is_unsigned= (field->flags & UNSIGNED_FLAG) ? 1: 0; - fetch_results(bind, field->type, &row, field_is_unsigned); - } + fetch_results(bind, field, &row); } if (!((bit<<=1) & 255)) { @@ -2937,6 +2970,14 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row) return 0; } +int STDCALL cli_unbuffered_fetch(MYSQL *mysql, char **row) +{ + if (packet_error == net_safe_read(mysql)) + return 1; + + *row= (mysql->net.read_pos[0] == 254) ? NULL : (mysql->net.read_pos+1); + return 0; +} /* Fetch and return row data to bound buffers, if any @@ -2948,8 +2989,8 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt) uchar *row; DBUG_ENTER("mysql_fetch"); - stmt->last_fetched_column= 0; /* reset */ - if (stmt->result_buffered) /* buffered */ + stmt->last_fetched_column= 0; /* reset */ + if (stmt->result_buffered) /* buffered */ { MYSQL_RES *res; @@ -2964,22 +3005,22 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt) row= (uchar *)res->data_cursor->data; res->data_cursor= res->data_cursor->next; } - else /* un-buffered */ + else /* un-buffered */ { - if (packet_error == net_safe_read(mysql)) + if((*mysql->methods->unbuffered_fetch)(mysql, ( char **)&row)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); DBUG_RETURN(1); } - if (mysql->net.read_pos[0] == 254) + if (!row) { mysql->status= MYSQL_STATUS_READY; stmt->current_row= 0; goto no_data; } - row= mysql->net.read_pos+1; - } + } + stmt->current_row= row; DBUG_RETURN(stmt_fetch_row(stmt, row)); @@ -2990,107 +3031,55 @@ no_data: /* - Fetch only specified column data to buffers + Fetch datat for one specified column data + + SYNOPSIS + mysql_fetch_column() + stmt Prepared statement handler + bind Where date should be placed. Should be filled in as + when calling mysql_bind_param() + column Column to fetch (first column is 0) + ulong offset Offset in result data (to fetch blob in pieces) + This is normally 0 + RETURN + 0 ok + 1 error */ int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, - my_ulonglong icol, - ulong offset) + uint column, ulong offset) { - uchar *row; - my_bool null_data; - + MYSQL_BIND *param= stmt->bind+column; DBUG_ENTER("mysql_fetch_column"); - if (!(row= stmt->current_row)) + if (!stmt->current_row) goto no_data; #ifdef CHECK_EXTRA_ARGUMENTS - if (!bind || icol >= stmt->field_count) + if (column >= stmt->field_count) { - set_stmt_errmsg(stmt, "Invalid column descriptor or offset",1, - unknown_sqlstate); + set_stmt_errmsg(stmt, "Invalid column descriptor",1, unknown_sqlstate); DBUG_RETURN(1); } #endif - /* column '0' == first column */ - if (stmt->res_buffers) - { - /* - Already buffers are parsed and cached to stmt->bind - during mysql_fetch() call. - */ - MYSQL_BIND *param= stmt->bind+icol; - null_data= param->null_field; - row= param->inter_buffer; - } - else - { - if (stmt->last_fetched_column == icol+1) - { - /* - Data buffer is already parsed during the last call, get - the cached information - */ - if (!stmt->last_fetched_buffer) - null_data= 1; - else - { - null_data= 0; - row= stmt->last_fetched_buffer; - } - } - else - { - /* - Advance the data buffer to icol position and cache - the information for subsequent calls - */ - uint bit= icol > 6 ? 1 : 4; - stmt->last_fetched_column= icol+1; - - if (row[icol/8] & (bit << icol & 7)) - { - stmt->last_fetched_buffer= 0; - null_data= 1; - } - else - { - uint length, i; - - null_data= 0; - row+= (stmt->field_count+9)/8; /* skip null bits */ - - for (i=0; i < icol; i++) - { - if (!(length= default_binary_field_length((uint)(stmt->fields[i]. - type)))) - length= net_field_length(&row); - row+= length; - } - stmt->last_fetched_buffer= row; - } - } - } - if (null_data) + if (param->null_field) { if (bind->is_null) *bind->is_null= 1; } else { - MYSQL_FIELD *field= stmt->fields+icol; - my_bool field_is_unsigned= (field->flags & UNSIGNED_FLAG) ? 1: 0; - + MYSQL_FIELD *field= stmt->fields+column; + uchar *row= param->inter_buffer; bind->offset= offset; if (bind->is_null) *bind->is_null= 0; if (bind->length) /* Set the length if non char/binary types */ - *bind->length= default_binary_field_length(field->type); + *bind->length= *param->length; else - bind->length= ¶m_length_is_dummy; - fetch_results(bind, field->type, &row, field_is_unsigned); + bind->length= ¶m->internal_length; /* Needed for fetch_result() */ + fetch_results(bind, field, &row); } DBUG_RETURN(0); @@ -3104,7 +3093,7 @@ no_data: Read all rows of data from server (binary format) */ -static MYSQL_DATA *read_binary_rows(MYSQL_STMT *stmt) +MYSQL_DATA *cli_read_binary_rows(MYSQL_STMT *stmt) { ulong pkt_len; uchar *cp; @@ -3200,7 +3189,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) } result->methods= mysql->methods; stmt->result_buffered= 1; - if (!(result->data= read_binary_rows(stmt))) + if (!(result->data= (*stmt->mysql->methods->read_binary_rows)(stmt))) { my_free((gptr) result,MYF(0)); DBUG_RETURN(0); @@ -3504,7 +3493,18 @@ my_bool STDCALL mysql_next_result(MYSQL *mysql) mysql->affected_rows= ~(my_ulonglong) 0; if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) - DBUG_RETURN(mysql_read_query_result(mysql)); + DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); DBUG_RETURN(0); } + +MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql) +{ + return (*mysql->methods->use_result)(mysql); +} + +my_bool STDCALL mysql_read_query_result(MYSQL *mysql) +{ + return (*mysql->methods->read_query_result)(mysql); +} + diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index b22ff9e5001..09b03bce79a 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -22,6 +22,7 @@ MYSQLSHAREdir = $(pkgdatadir) MYSQLBASEdir= $(prefix) DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ + -DNO_EMBEDDED_ACCESS_CHECKS \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" diff --git a/libmysqld/embedded_priv.h b/libmysqld/embedded_priv.h index dfc06e38ab2..833cc1b1f80 100644 --- a/libmysqld/embedded_priv.h +++ b/libmysqld/embedded_priv.h @@ -26,4 +26,7 @@ C_MODE_START extern void lib_connection_phase(NET *net, int phase); extern void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db); extern void *create_embedded_thd(int client_flag, char *db); +extern MYSQL_METHODS embedded_methods; +void free_old_query(MYSQL *mysql); +extern my_bool server_inited; C_MODE_END diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index aaa31908360..c9f98a701ef 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -26,7 +26,6 @@ static int fake_argc= 1; static char *fake_argv[]= {(char *)"", 0}; static const char *fake_groups[] = { "server", "embedded", 0 }; -static char inited, org_my_init_done; #if defined (__WIN__) #include "../sql/mysqld.cpp" @@ -34,33 +33,32 @@ static char inited, org_my_init_done; #include "../sql/mysqld.cc" #endif -#define SCRAMBLE_LENGTH 8 +int check_user(THD *thd, enum enum_server_command command, + const char *passwd, uint passwd_len, const char *db, + bool check_count); C_MODE_START #include +#undef ER #include "errmsg.h" #include -static int check_connections1(THD * thd); -static int check_connections2(THD * thd); -static bool check_user(THD *thd, enum_server_command command, - const char *user, const char *passwd, const char *db, - bool check_count); -char * get_mysql_home(){ return mysql_home;}; -char * get_mysql_real_data_home(){ return mysql_real_data_home;}; +static my_bool org_my_init_done; +my_bool server_inited; -my_bool +static my_bool STDCALL emb_advanced_command(MYSQL *mysql, enum enum_server_command command, const char *header, ulong header_length, const char *arg, ulong arg_length, my_bool skip_check) { my_bool result= 1; THD *thd=(THD *) mysql->thd; + NET *net= &mysql->net; /* Check that we are calling the client functions in right order */ if (mysql->status != MYSQL_STATUS_READY) { - strmov(thd->net.last_error, - ER(thd->net.last_errno=CR_COMMANDS_OUT_OF_SYNC)); + strmov(net->last_error, + ER(net->last_errno=CR_COMMANDS_OUT_OF_SYNC)); return 1; } @@ -70,23 +68,194 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, mysql->field_count= 0; thd->store_globals(); // Fix if more than one connect + /* + We have to call free_old_query before we start to fill mysql->fields + for new query. In the case of embedded server we collect field data + during query execution (not during data retrieval as it is in remote + client). So we have to call free_old_query here + */ free_old_query(mysql); + + thd->extra_length= arg_length; + thd->extra_data= (char *)arg; + if (header) + { + arg= header; + arg_length= header_length; + } + result= dispatch_command(command, thd, (char *) arg, arg_length + 1); if (!skip_check) result= thd->net.last_errno ? -1 : 0; - if ((mysql->net.last_errno= thd->net.last_errno)) + if ((net->last_errno= thd->net.last_errno)) { - memcpy(mysql->net.last_error, thd->net.last_error, - sizeof(mysql->net.last_error)); - memcpy(mysql->net.sqlstate, thd->net.sqlstate, - sizeof(mysql->net.sqlstate)); + memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error)); + memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate)); + } + else + { + net->last_error[0]= 0; + strmov(net->sqlstate, not_error_sqlstate); } mysql->warning_count= ((THD*)mysql->thd)->total_warn_count; return result; } +static MYSQL_DATA * STDCALL +emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields __attribute__((unused)), + unsigned int fields __attribute__((unused))) +{ + MYSQL_DATA *result= ((THD*)mysql->thd)->data; + if (!result) + { + if (!(result=(MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA), + MYF(MY_WME | MY_ZEROFILL)))) + { + NET *net = &mysql->net; + net->last_errno=CR_OUT_OF_MEMORY; + strmov(net->sqlstate, unknown_sqlstate); + strmov(net->last_error,ER(net->last_errno)); + return NULL; + } + return result; + } + *result->prev_ptr= NULL; + ((THD*)mysql->thd)->data= NULL; + return result; +} + +static MYSQL_FIELD * STDCALL emb_list_fields(MYSQL *mysql) +{ + return mysql->fields; +} + +static my_bool STDCALL emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) +{ + THD *thd= (THD*)mysql->thd; + if (mysql->net.last_errno) + return 1; + stmt->stmt_id= thd->client_stmt_id; + stmt->param_count= thd->client_param_count; + stmt->field_count= mysql->field_count; + + if (stmt->field_count != 0) + { + if (!(mysql->server_status & SERVER_STATUS_AUTOCOMMIT)) + mysql->server_status|= SERVER_STATUS_IN_TRANS; + + stmt->fields= mysql->fields; + stmt->mem_root= mysql->field_alloc; + mysql->fields= NULL; + } + + return 0; +} + +/************************************************************************** + Get column lengths of the current row + If one uses mysql_use_result, res->lengths contains the length information, + else the lengths are calculated from the offset between pointers. +**************************************************************************/ + +static void STDCALL emb_fetch_lengths(ulong *to, MYSQL_ROW column, unsigned int field_count) +{ + MYSQL_ROW end; + + for (end=column + field_count; column != end ; column++,to++) + *to= *column ? *(uint *)((*column) - sizeof(uint)) : 0; +} + +static my_bool STDCALL emb_mysql_read_query_result(MYSQL *mysql) +{ + if (mysql->net.last_errno) + return -1; + + if (mysql->field_count) + mysql->status=MYSQL_STATUS_GET_RESULT; + + return 0; +} + +static int STDCALL emb_stmt_execute(MYSQL_STMT *stmt) +{ + DBUG_ENTER("emb_stmt_execute"); + THD *thd= (THD*)stmt->mysql->thd; + thd->client_param_count= stmt->param_count; + thd->client_params= stmt->params; + if (thd->data) + { + free_rows(thd->data); + thd->data= 0; + } + if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0, + (const char*)&stmt->stmt_id,sizeof(stmt->stmt_id),1) + || emb_mysql_read_query_result(stmt->mysql)) + { + NET *net= &stmt->mysql->net; + set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} + +MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt) +{ + return emb_read_rows(stmt->mysql, 0, 0); +} + +int STDCALL emb_unbuffered_fetch(MYSQL *mysql, char **row) +{ + MYSQL_DATA *data= ((THD*)mysql->thd)->data; + if (!data || !data->data) + { + *row= NULL; + if (data) + { + free_rows(data); + ((THD*)mysql->thd)->data= NULL; + } + } + else + { + *row= (char *)data->data->data; + data->data= data->data->next; + } + return 0; +} + +static void STDCALL emb_free_embedded_thd(MYSQL *mysql) +{ + THD *thd= (THD*)mysql->thd; + if (thd->data) + free_rows(thd->data); + thread_count--; + delete thd; +} + +static const char * STDCALL emb_read_statistic(MYSQL *mysql) +{ + THD *thd= (THD*)mysql->thd; + return thd->net.last_error; +} + +MYSQL_METHODS embedded_methods= +{ + emb_mysql_read_query_result, + emb_advanced_command, + emb_read_rows, + mysql_store_result, + emb_fetch_lengths, + emb_list_fields, + emb_read_prepare_result, + emb_stmt_execute, + emb_read_binary_rows, + emb_unbuffered_fetch, + emb_free_embedded_thd, + emb_read_statistic +}; + C_MODE_END void THD::clear_error() @@ -96,34 +265,6 @@ void THD::clear_error() net.report_error= 0; } -static bool check_user(THD *thd,enum_server_command command, const char *user, - const char *passwd, const char *db, bool check_count) -{ - thd->db=0; - - if (!(thd->user = my_strdup(user, MYF(0)))) - { - send_error(thd,ER_OUT_OF_RESOURCES); - return 1; - } - thd->master_access= ~0L; // No user checking - thd->priv_user= thd->user; - mysql_log.write(thd,command, - (thd->priv_user == thd->user ? - (char*) "%s@%s on %s" : - (char*) "%s@%s as anonymous on %s"), - user, - thd->host_or_ip, - db ? db : (char*) ""); - thd->db_access=0; - if (db && db[0]) - return test(mysql_change_db(thd,db)); - else - send_ok(thd); // Ready to handle questions - return 0; // ok -} - - /* Make a copy of array and the strings array points to */ @@ -182,9 +323,9 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) /* Only call MY_INIT() if it hasn't been called before */ - if (!inited) + if (!server_inited) { - inited=1; + server_inited=1; org_my_init_done=my_init_done; } if (!org_my_init_done) @@ -218,7 +359,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) error_handler_hook = my_message_sql; - opt_noacl = 1; // No permissions +#ifndef NO_EMBEDDED_ACCESS_CHECKS if (acl_init((THD *)0, opt_noacl)) { mysql_server_end(); @@ -226,11 +367,16 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) } if (!opt_noacl) (void) grant_init((THD *)0); + +#endif + init_max_user_conn(); init_update_queries(); #ifdef HAVE_DLOPEN +#ifndef NO_EMBEDDED_ACCESS_CHECKS if (!opt_noacl) +#endif udf_init(); #endif @@ -264,6 +410,15 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups) sql_print_error("Warning: Can't create thread to manage maintenance"); } + if (opt_init_file) + { + if (read_init_file(opt_init_file)) + { + mysql_server_end(); + return 1; + } + } + /* Update mysqld variables from client variables if set The client variables are set also by get_one_option() in mysqld.cc @@ -297,6 +452,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db) { THD *thd = (THD *)mysql->thd; thd->mysql= mysql; + mysql->server_version= server_version; } void *create_embedded_thd(int client_flag, char *db) @@ -323,48 +479,95 @@ void *create_embedded_thd(int client_flag, char *db) thd->db= db; thd->db_length= db ? strip_sp(db) : 0; +#ifndef NO_EMBEDDED_ACCESS_CHECKS thd->db_access= DB_ACLS; thd->master_access= ~NO_ACCESS; +#endif thd->net.query_cache_query= 0; + thd->data= 0; + + thread_count++; return thd; } +#ifndef NO_EMBEDDED_ACCESS_CHECKS +int check_embedded_connection(MYSQL *mysql) +{ + THD *thd= (THD*)mysql->thd; + int result; + char scramble_buff[SCRAMBLE_LENGTH]; + int passwd_len; + + thd->host= mysql->options.client_ip ? + mysql->options.client_ip : (char*)my_localhost; + thd->ip= thd->host; + thd->host_or_ip= thd->host; + + if (acl_check_host(thd->host,thd->ip)) + { + result= ER_HOST_NOT_PRIVILEGED; + goto err; + } + + thd->user= mysql->user; + if (mysql->passwd && mysql->passwd[0]) + { + memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble + thd->scramble[SCRAMBLE_LENGTH]= 0; + scramble(scramble_buff, thd->scramble, mysql->passwd); + passwd_len= SCRAMBLE_LENGTH; + } + else + passwd_len= 0; + + if((result= check_user(thd, COM_CONNECT, + scramble_buff, passwd_len, thd->db, true))) + goto err; + + return 0; +err: + { + NET *net= &mysql->net; + memcpy(net->last_error, thd->net.last_error, sizeof(net->last_error)); + memcpy(net->sqlstate, thd->net.sqlstate, sizeof(net->sqlstate)); + } + return result; +} +#endif + C_MODE_END bool Protocol::send_fields(List *list, uint flag) { List_iterator_fast it(*list); Item *item; - MYSQL_FIELD *field, *client_field; + MYSQL_FIELD *client_field; MYSQL *mysql= thd->mysql; + MEM_ROOT *field_alloc; DBUG_ENTER("send_fields"); + if (!mysql) // bootstrap file handling + DBUG_RETURN(0); + field_count= list->elements; - if (!(mysql->result=(MYSQL_RES*) my_malloc(sizeof(MYSQL_RES)+ - sizeof(ulong) * (field_count + 1), - MYF(MY_WME | MY_ZEROFILL)))) - goto err; - mysql->result->lengths= (ulong *)(mysql->result + 1); - - mysql->field_count=field_count; - alloc= &mysql->field_alloc; - field= (MYSQL_FIELD *)alloc_root(alloc, sizeof(MYSQL_FIELD) * field_count); - if (!field) + field_alloc= &mysql->field_alloc; + if (!(client_field= thd->mysql->fields= + (MYSQL_FIELD *)alloc_root(field_alloc, + sizeof(MYSQL_FIELD) * field_count))) goto err; - client_field= field; while ((item= it++)) { Send_field server_field; item->make_field(&server_field); - client_field->db= strdup_root(alloc, server_field.db_name); - client_field->table= strdup_root(alloc, server_field.table_name); - client_field->name= strdup_root(alloc, server_field.col_name); - client_field->org_table= strdup_root(alloc, server_field.org_table_name); - client_field->org_name= strdup_root(alloc, server_field.org_col_name); + client_field->db= strdup_root(field_alloc, server_field.db_name); + client_field->table= strdup_root(field_alloc, server_field.table_name); + client_field->name= strdup_root(field_alloc, server_field.col_name); + client_field->org_table= strdup_root(field_alloc, server_field.org_table_name); + client_field->org_name= strdup_root(field_alloc, server_field.org_col_name); client_field->length= server_field.length; client_field->type= server_field.type; client_field->flags= server_field.flags; @@ -385,31 +588,16 @@ bool Protocol::send_fields(List *list, uint flag) String tmp(buff, sizeof(buff), default_charset_info), *res; if (!(res=item->val_str(&tmp))) - client_field->def= strdup_root(alloc, ""); + client_field->def= strdup_root(field_alloc, ""); else - client_field->def= strdup_root(alloc, tmp.ptr()); + client_field->def= strdup_root(field_alloc, tmp.ptr()); } else client_field->def=0; client_field->max_length= 0; ++client_field; } - mysql->result->fields = field; - - if (!(mysql->result->data= (MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA), - MYF(MY_WME | MY_ZEROFILL)))) - goto err; - - init_alloc_root(&mysql->result->data->alloc,8192,0); /* Assume rowlength < 8192 */ - mysql->result->data->alloc.min_malloc=sizeof(MYSQL_ROWS); - mysql->result->data->rows=0; - mysql->result->data->fields=field_count; - mysql->result->field_count=field_count; - mysql->result->data->prev_ptr= &mysql->result->data->data; - - mysql->result->field_alloc= mysql->field_alloc; - mysql->result->current_field=0; - mysql->result->current_row=0; + thd->mysql->field_count= field_count; DBUG_RETURN(prepare_for_send(list)); err: @@ -424,21 +612,60 @@ bool Protocol::send_records_num(List *list, ulonglong records) bool Protocol::write() { + if (!thd->mysql) // bootstrap file handling + return false; + *next_field= 0; return false; } +bool Protocol_prep::write() +{ + MYSQL_ROWS *cur; + MYSQL_DATA *data= thd->data; + + if (!data) + { + if (!(data= (MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA), + MYF(MY_WME | MY_ZEROFILL)))) + return true; + + alloc= &data->alloc; + init_alloc_root(alloc,8192,0); /* Assume rowlength < 8192 */ + alloc->min_malloc=sizeof(MYSQL_ROWS); + data->rows=0; + data->fields=field_count; + data->prev_ptr= &data->data; + thd->data= data; + } + + data->rows++; + if (!(cur= (MYSQL_ROWS *)alloc_root(alloc, sizeof(MYSQL_ROWS)+packet->length()))) + { + my_error(ER_OUT_OF_RESOURCES,MYF(0)); + return true; + } + cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS)); + memcpy(cur->data, packet->ptr()+1, packet->length()-1); + + *data->prev_ptr= cur; + data->prev_ptr= &cur->next; + cur->next= 0; + + return false; +} + void send_ok(THD *thd,ha_rows affected_rows,ulonglong id,const char *message) { DBUG_ENTER("send_ok"); MYSQL *mysql= current_thd->mysql; + if (!mysql) // bootstrap file handling + DBUG_VOID_RETURN; mysql->affected_rows= affected_rows; mysql->insert_id= id; if (message) - { strmake(thd->net.last_error, message, sizeof(thd->net.last_error)-1); - } DBUG_VOID_RETURN; } @@ -449,13 +676,27 @@ send_eof(THD *thd, bool no_flush) void Protocol_simple::prepare_for_resend() { - MYSQL_ROWS *cur; - MYSQL_DATA *result= thd->mysql->result->data; + MYSQL_ROWS *cur; + MYSQL_DATA *data= thd->data; DBUG_ENTER("send_data"); - alloc= &result->alloc; - result->rows++; + if (!data) + { + if (!(data= (MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA), + MYF(MY_WME | MY_ZEROFILL)))) + goto err; + + alloc= &data->alloc; + init_alloc_root(alloc,8192,0); /* Assume rowlength < 8192 */ + alloc->min_malloc=sizeof(MYSQL_ROWS); + data->rows=0; + data->fields=field_count; + data->prev_ptr= &data->data; + thd->data= data; + } + + data->rows++; if (!(cur= (MYSQL_ROWS *)alloc_root(alloc, sizeof(MYSQL_ROWS)+(field_count + 1) * sizeof(char *)))) { my_error(ER_OUT_OF_RESOURCES,MYF(0)); @@ -463,11 +704,11 @@ void Protocol_simple::prepare_for_resend() } cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS)); - *result->prev_ptr= cur; - result->prev_ptr= &cur->next; + *data->prev_ptr= cur; + data->prev_ptr= &cur->next; next_field=cur->data; - next_mysql_field= thd->mysql->result->fields; - + next_mysql_field= thd->mysql->fields; +err: DBUG_VOID_RETURN; } @@ -480,15 +721,20 @@ bool Protocol_simple::store_null() bool Protocol::net_store_data(const char *from, uint length) { - if (!(*next_field=alloc_root(alloc, length + 1))) + char *field_buf; + if (!thd->mysql) // bootstrap file handling + return false; + + if (!(field_buf=alloc_root(alloc, length + sizeof(uint) + 1))) return true; + *(uint *)field_buf= length; + *next_field= field_buf + sizeof(uint); memcpy(*next_field, from, length); (*next_field)[length]= 0; if (next_mysql_field->max_length < length) next_mysql_field->max_length=length; ++next_field; ++next_mysql_field; - return false; } @@ -509,3 +755,91 @@ bool Protocol::convert_str(const char *from, uint length) return false; } #endif + +bool setup_params_data(st_prep_stmt *stmt) +{ + THD *thd= stmt->thd; + List ¶ms= thd->lex.param_list; + List_iterator param_iterator(params); + Item_param *param; + ulong param_no= 0; + MYSQL_BIND *client_param= thd->client_params; + + DBUG_ENTER("setup_params_data"); + + for (;(param= (Item_param *)param_iterator++); client_param++) + { + setup_param_functions(param, client_param->buffer_type); + if (!param->long_data_supplied) + { + if (*client_param->is_null) + param->maybe_null= param->null_value= 1; + else + { + uchar *buff= (uchar*)client_param->buffer; + param->maybe_null= param->null_value= 0; + param->setup_param_func(param,&buff, + client_param->length ? + *client_param->length : + client_param->buffer_length); + } + } + param_no++; + } + DBUG_RETURN(0); +} + +bool setup_params_data_withlog(st_prep_stmt *stmt) +{ + THD *thd= stmt->thd; + List ¶ms= thd->lex.param_list; + List_iterator param_iterator(params); + Item_param *param; + MYSQL_BIND *client_param= thd->client_params; + + DBUG_ENTER("setup_params_data"); + + String str, *res, *query= new String(stmt->query->alloced_length()); + query->copy(*stmt->query); + + ulong param_no= 0; + uint32 length= 0; + + for (;(param= (Item_param *)param_iterator++); client_param++) + { + setup_param_functions(param, client_param->buffer_type); + if (param->long_data_supplied) + res= param->query_val_str(&str); + + else + { + if (*client_param->is_null) + { + param->maybe_null= param->null_value= 1; + res= &my_null_string; + } + else + { + uchar *buff= (uchar*)client_param->buffer; + param->maybe_null= param->null_value= 0; + param->setup_param_func(param,&buff, + client_param->length ? + *client_param->length : + client_param->buffer_length); + res= param->query_val_str(&str); + } + } + if (query->replace(param->pos_in_query+length, 1, *res)) + DBUG_RETURN(1); + + length+= res->length()-1; + param_no++; + } + + if (alloc_query(stmt->thd, (char *)query->ptr(), query->length()+1)) + DBUG_RETURN(1); + + query->free(); + DBUG_RETURN(0); +} + diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 357c13c5826..59c18368279 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -24,6 +24,7 @@ #include #include #include +#include "client_settings.h" #ifdef HAVE_PWD_H #include #endif @@ -46,8 +47,6 @@ #define INADDR_NONE -1 #endif -#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_TRANSACTIONS | CLIENT_PROTOCOL_41) - #if defined(MSDOS) || defined(__WIN__) #define ERRNO WSAGetLastError() #define perror(A) @@ -58,22 +57,6 @@ #define closesocket(A) close(A) #endif -void free_old_query(MYSQL *mysql); -my_bool -emb_advanced_command(MYSQL *mysql, enum enum_server_command command, - const char *header, ulong header_length, - const char *arg, ulong arg_length, my_bool skip_check); - -/* From client.c */ -void mysql_read_default_options(struct st_mysql_options *options, - const char *filename,const char *group); -MYSQL * STDCALL -cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, - const char *passwd, const char *db, - uint port, const char *unix_socket,ulong client_flag); - -void STDCALL cli_mysql_close(MYSQL *mysql); - #ifdef HAVE_GETPWUID struct passwd *getpwuid(uid_t); char* getlogin(void); @@ -163,58 +146,35 @@ static inline int mysql_init_charset(MYSQL *mysql) return 0; } -/************************************************************************** - Get column lengths of the current row - If one uses mysql_use_result, res->lengths contains the length information, - else the lengths are calculated from the offset between pointers. -**************************************************************************/ - -static void emb_fetch_lengths(ulong *to, MYSQL_ROW column, uint field_count) -{ - MYSQL_ROW end; - - for (end=column + field_count; column != end ; column++,to++) - { - *to= *column ? strlen(*column) : 0; - } -} - - -/* -** Note that the mysql argument must be initialized with mysql_init() -** before calling mysql_real_connect ! -*/ - -static my_bool STDCALL emb_mysql_read_query_result(MYSQL *mysql); -static MYSQL_RES * STDCALL emb_mysql_store_result(MYSQL *mysql); -static MYSQL_RES * STDCALL emb_mysql_use_result(MYSQL *mysql); - -static MYSQL_METHODS embedded_methods= -{ - emb_mysql_read_query_result, - emb_advanced_command, - emb_mysql_store_result, - emb_mysql_use_result, - emb_fetch_lengths -}; +int check_embedded_connection(MYSQL *mysql); MYSQL * STDCALL mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag) { - char *db_name; + char *db_name; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + char name_buff[USERNAME_LENGTH]; +#endif DBUG_ENTER("mysql_real_connect"); DBUG_PRINT("enter",("host: %s db: %s user: %s", host ? host : "(Null)", db ? db : "(Null)", user ? user : "(Null)")); - if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION) - cli_mysql_real_connect(mysql, host, user, - passwd, db, port, unix_socket, client_flag); - if ((mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION) && - host && strcmp(host,LOCAL_HOST)) +#if defined(EMBEDDED_LIBRARY) || !defined(DBUG_OFF) + if (!server_inited) + { + mysql->net.last_errno=CR_MYSQL_SERVER_INIT_MISSED; + strmov(mysql->net.last_error,ER(mysql->net.last_errno)); + goto error; + } +#endif + + if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION || + (mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION && + host && strcmp(host,LOCAL_HOST))) cli_mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag); @@ -235,6 +195,29 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, if (!db || !db[0]) db=mysql->options.db; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + if (!user || !user[0]) + user=mysql->options.user; + + if (!passwd) + { + passwd=mysql->options.password; +#if !defined(DONT_USE_MYSQL_PWD) + if (!passwd) + passwd=getenv("MYSQL_PWD"); /* get it from environment */ +#endif + } + if (!user || !user[0]) + { + read_user_name(name_buff); + if (!name_buff[0]) + user= name_buff; + } + + mysql->user=my_strdup(user,MYF(0)); + mysql->passwd= passwd ? my_strdup(passwd,MYF(0)) : NULL; +#endif /*!NO_EMBEDDED_ACCESS_CHECKS*/ + port=0; unix_socket=0; db_name = db ? my_strdup(db,MYF(MY_WME)) : NULL; @@ -243,6 +226,11 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, init_embedded_mysql(mysql, client_flag, db_name); +#ifndef NO_EMBEDDED_ACCESS_CHECKS + if (check_embedded_connection(mysql)) + goto error; +#endif + if (mysql_init_charset(mysql)) goto error; @@ -266,7 +254,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, goto error; if (mysql->fields) { - if (!(res= mysql_use_result(mysql))) + if (!(res= (*mysql->methods->use_result)(mysql))) goto error; mysql_free_result(res); } @@ -277,7 +265,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, DBUG_RETURN(mysql); error: - DBUG_PRINT("error",("message: %u (%s)",mysql->net.last_errno,mysql->net.last_error)); + DBUG_PRINT("error",("message: %u (%s)", mysql->net.last_errno, + mysql->net.last_error)); { /* Free alloced memory */ my_bool free_me=mysql->free_me; @@ -289,105 +278,3 @@ error: DBUG_RETURN(0); } -/************************************************************************* -** Send a QUIT to the server and close the connection -** If handle is alloced by mysql connect free it. -*************************************************************************/ - -void STDCALL mysql_close(MYSQL *mysql) -{ - DBUG_ENTER("mysql_close"); - if (mysql->methods != &embedded_methods) - { - cli_mysql_close(mysql); - DBUG_VOID_RETURN; - } - - if (mysql) /* Some simple safety */ - { - my_free(mysql->options.user,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.host,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.password,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.unix_socket,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.db,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR)); - if (mysql->options.init_commands) - { - DYNAMIC_ARRAY *init_commands= mysql->options.init_commands; - char **ptr= (char**)init_commands->buffer; - char **end= ptr + init_commands->elements; - for (; ptroptions,sizeof(mysql->options)); -#ifdef HAVE_OPENSSL - ((VioConnectorFd*)(mysql->connector_fd))->delete(); - mysql->connector_fd = 0; -#endif /* HAVE_OPENSSL */ - if (mysql->free_me) - my_free((gptr) mysql,MYF(0)); - } - DBUG_VOID_RETURN; -} - -static my_bool STDCALL emb_mysql_read_query_result(MYSQL *mysql) -{ - if (mysql->net.last_errno) - return -1; - - if (mysql->field_count) - { - mysql->status=MYSQL_STATUS_GET_RESULT; - mysql->affected_rows= mysql->result->row_count= mysql->result->data->rows; - mysql->result->data_cursor= mysql->result->data->data; - } - - return 0; -} - -/************************************************************************** -** Alloc result struct for buffered results. All rows are read to buffer. -** mysql_data_seek may be used. -**************************************************************************/ -static MYSQL_RES * STDCALL emb_mysql_store_result(MYSQL *mysql) -{ - MYSQL_RES *result= mysql->result; - if (!result) - return 0; - - result->methods= mysql->methods; - mysql->result= NULL; - *result->data->prev_ptr= 0; - result->eof= 1; - result->lengths= (ulong*)(result + 1); - mysql->affected_rows= result->row_count= result->data->rows; - result->data_cursor= result->data->data; - - mysql->status=MYSQL_STATUS_READY; /* server is ready */ - return result; -} - -/************************************************************************** -** Alloc struct for use with unbuffered reads. Data is fetched by domand -** when calling to mysql_fetch_row. -** mysql_data_seek is a noop. -** -** No other queries may be specified with the same MYSQL handle. -** There shouldn't be much processing per row because mysql server shouldn't -** have to wait for the client (and will not wait more than 30 sec/packet). -**************************************************************************/ - -static MYSQL_RES * STDCALL emb_mysql_use_result(MYSQL *mysql) -{ - DBUG_ENTER("mysql_use_result"); - if (mysql->options.separate_thread) - DBUG_RETURN(0); - - DBUG_RETURN(emb_mysql_store_result(mysql)); -} diff --git a/myisam/ft_dump.c b/myisam/ft_dump.c index 57ae67c7a02..183068789fe 100644 --- a/myisam/ft_dump.c +++ b/myisam/ft_dump.c @@ -130,7 +130,11 @@ int main(int argc,char *argv[]) if (subkeys >= 0) weight=*(float*)&subkeys; +#ifdef HAVE_SNPRINTF snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1); +#else + sprintf(buf,"%.*s",(int) keylen,info->lastkey+1); +#endif my_casedn_str(default_charset_info,buf); total++; lengths[keylen]++; diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c index b1d7d67ae79..690ad0fc453 100644 --- a/myisam/ft_nlq_search.c +++ b/myisam/ft_nlq_search.c @@ -68,6 +68,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) uint keylen, r, doc_cnt; FT_SUPERDOC sdoc, *sptr; TREE_ELEMENT *selem; + double gweight=1; MI_INFO *info=aio->info; uchar *keybuff=aio->keybuff; MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr; @@ -89,7 +90,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root); info->update|= HA_STATE_AKTIV; /* for _mi_test_if_changed() */ - while (!r) + while (!r && gweight) { if (keylen && @@ -138,6 +139,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) doc_cnt++; + gweight=word->weight*GWS_IN_USE; + if (gweight < 0 || doc_cnt > 2000000) + gweight=0; + if (_mi_test_if_changed(info) == 0) r=_mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length, SEARCH_BIGGER, key_root); @@ -145,13 +150,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) r=_mi_search(info, keyinfo, info->lastkey, info->lastkey_length, SEARCH_BIGGER, key_root); } - if (doc_cnt) - { - word->weight*=GWS_IN_USE; - if (word->weight < 0) - word->weight=0; + word->weight=gweight; - } DBUG_RETURN(0); } diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 60053674647..cb2b56d93de 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -36,7 +36,7 @@ /* Functions defined in this file */ static int check_k_link(MI_CHECK *param, MI_INFO *info,uint nr); -static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, +static int chk_index(MI_CHECK *param, MI_INFO *info,MI_KEYDEF *keyinfo, my_off_t page, uchar *buff, ha_rows *keys, ha_checksum *key_checksum, uint level); static uint isam_key_length(MI_INFO *info,MI_KEYDEF *keyinfo); @@ -1498,6 +1498,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) File new_file; my_off_t index_pos[MI_MAX_POSSIBLE_KEY]; uint r_locks,w_locks; + int old_lock; MYISAM_SHARE *share=info->s; MI_STATE_INFO old_state; DBUG_ENTER("sort_index"); @@ -1541,8 +1542,11 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED); share->state.version=(ulong) time((time_t*) 0); - old_state=share->state; /* save state if not stored */ - r_locks=share->r_locks; w_locks=share->w_locks; + old_state= share->state; /* save state if not stored */ + r_locks= share->r_locks; + w_locks= share->w_locks; + old_lock= info->lock_type; + /* Put same locks as old file */ share->r_locks= share->w_locks= share->tot_locks= 0; (void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE); @@ -1553,12 +1557,13 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) MYF(0)) || mi_open_keyfile(share)) goto err2; - info->lock_type=F_UNLCK; /* Force mi_readinfo to lock */ + info->lock_type= F_UNLCK; /* Force mi_readinfo to lock */ _mi_readinfo(info,F_WRLCK,0); /* Will lock the table */ - info->lock_type=F_WRLCK; - share->r_locks=r_locks; share->w_locks=w_locks; + info->lock_type= old_lock; + share->r_locks= r_locks; + share->w_locks= w_locks; share->tot_locks= r_locks+w_locks; - share->state=old_state; /* Restore old state */ + share->state= old_state; /* Restore old state */ info->state->key_file_length=param->new_file_pos; info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); @@ -3818,6 +3823,9 @@ void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, tmp=records; else tmp= (records + (count+1)/2) / (count+1); + /* for some weird keys (e.g. FULLTEXT) tmp can be <1 here. + let's ensure it is not */ + set_if_bigger(tmp,1); if (tmp >= (ulonglong) ~(ulong) 0) tmp=(ulonglong) ~(ulong) 0; *rec_per_key_part=(ulong) tmp; diff --git a/myisam/mi_checksum.c b/myisam/mi_checksum.c index a760b03a032..cdbb634c5ff 100644 --- a/myisam/mi_checksum.c +++ b/myisam/mi_checksum.c @@ -28,30 +28,29 @@ ha_checksum mi_checksum(MI_INFO *info, const byte *buf) { const byte *pos; const byte *end; + ulong length; switch (rec->type) { case FIELD_BLOB: { - ulong length=_mi_calc_blob_length(rec->length- + length=_mi_calc_blob_length(rec->length- mi_portable_sizeof_char_ptr, buf); memcpy((char*) &pos, buf+rec->length- mi_portable_sizeof_char_ptr, sizeof(char*)); - end=pos+length; break; } case FIELD_VARCHAR: { - uint length; length=uint2korr(buf); - pos=buf+2; end=pos+length; + pos=buf+2; break; } default: - pos=buf; end=buf+rec->length; + length=rec->length; + pos=buf; break; } - for ( ; pos != end ; pos++) - crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); + crc=my_checksum(crc, pos ? pos : "", length); } return crc; } @@ -59,9 +58,5 @@ ha_checksum mi_checksum(MI_INFO *info, const byte *buf) ha_checksum mi_static_checksum(MI_INFO *info, const byte *pos) { - ha_checksum crc; - const byte *end=pos+info->s->base.reclength; - for (crc=0; pos != end; pos++) - crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); - return crc; + return my_checksum(0, pos, info->s->base.reclength); } diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 26bb23c3a7f..0982e5bdaf6 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -303,7 +303,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, keydef->seg[0].type == (int) HA_KEYTYPE_NUM) keydef->seg[0].flag&= ~HA_SPACE_PACK; - /* Only use HA_PACK_KEY if the first segment is a variable length key */ + /* Only use HA_PACK_KEY when first segment is a variable length key */ if (!(keydef->seg[0].flag & (HA_SPACE_PACK | HA_BLOB_PART | HA_VAR_LENGTH))) { diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index faf86c3ffbd..86d648a5af0 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -17,6 +17,7 @@ /* Functions to handle space-packed-records and blobs */ #include "myisamdef.h" +#include /* Enough for comparing if number is zero */ static char zero_string[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; @@ -58,11 +59,11 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record) { byte *rec_buff; int error; - ulong reclength,extra; + ulong reclength,reclength2,extra; extra= (ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+ MI_DYN_DELETE_BLOCK_HEADER+1); - reclength= (info->s->base.pack_reclength + info->s->base.pack_bits + + reclength= (info->s->base.pack_reclength + _my_calc_total_blob_length(info,record)+ extra); #ifdef NOT_USED /* We now support big rows */ if (reclength > MI_DYN_MAX_ROW_LENGTH) @@ -76,10 +77,13 @@ int _mi_write_blob_record(MI_INFO *info, const byte *record) my_errno=ENOMEM; return(-1); } - reclength=_mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), - record); + reclength2= _mi_rec_pack(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), + record); + DBUG_PRINT("info",("reclength: %lu reclength2: %lu", + reclength, reclength2)); + DBUG_ASSERT(reclength2 <= reclength); error=write_dynamic_record(info,rec_buff+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER), - reclength); + reclength2); my_afree(rec_buff); return(error); } diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c index 22772a3dd2e..a707eb294a9 100644 --- a/myisam/mi_locking.c +++ b/myisam/mi_locking.c @@ -35,6 +35,7 @@ int mi_lock_database(MI_INFO *info, int lock_type) MYISAM_SHARE *share=info->s; uint flag; DBUG_ENTER("mi_lock_database"); + DBUG_PRINT("info",("lock_type: %d", lock_type)); if (share->options & HA_OPTION_READ_ONLY_DATA || info->lock_type == lock_type) @@ -53,6 +54,7 @@ int mi_lock_database(MI_INFO *info, int lock_type) { switch (lock_type) { case F_UNLCK: + DBUG_PRINT("info", ("old lock: %d", info->lock_type)); if (info->lock_type == F_RDLCK) count= --share->r_locks; else @@ -74,6 +76,8 @@ int mi_lock_database(MI_INFO *info, int lock_type) } if (!count) { + DBUG_PRINT("info",("changed: %u w_locks: %u", + (uint) share->changed, share->w_locks)); if (share->changed && !share->w_locks) { share->state.process= share->last_process=share->this_process; @@ -106,19 +110,22 @@ int mi_lock_database(MI_INFO *info, int lock_type) if (error) mi_mark_crashed(info); } - if (share->r_locks) - { /* Only read locks left */ - flag=1; - if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, - MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) - error=my_errno; - } - else if (!share->w_locks) - { /* No more locks */ - flag=1; - if (my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, - MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) - error=my_errno; + if (info->lock_type != F_EXTRA_LCK) + { + if (share->r_locks) + { /* Only read locks left */ + flag=1; + if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF, + MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) + error=my_errno; + } + else if (!share->w_locks) + { /* No more locks */ + flag=1; + if (my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF, + MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error) + error=my_errno; + } } } info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); @@ -347,6 +354,8 @@ int _mi_writeinfo(register MI_INFO *info, uint operation) int error,olderror; MYISAM_SHARE *share=info->s; DBUG_ENTER("_mi_writeinfo"); + DBUG_PRINT("info",("operation: %u tot_locks: %u", operation, + share->tot_locks)); error=0; if (share->tot_locks == 0) @@ -374,9 +383,7 @@ int _mi_writeinfo(register MI_INFO *info, uint operation) my_errno=olderror; } else if (operation) - { share->changed= 1; /* Mark keyfile changed */ - } DBUG_RETURN(error); } /* _mi_writeinfo */ diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 5d8f384a5af..c4b24acdb77 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -633,7 +633,7 @@ byte *mi_alloc_rec_buff(MI_INFO *info, ulong length, byte **buf) /* to simplify initial init of info->rec_buf in mi_open and mi_extra */ if (length == (ulong) -1) { - length= max(info->s->base.pack_reclength+info->s->base.pack_bits, + length= max(info->s->base.pack_reclength, info->s->base.max_key_length); /* Avoid unnecessary realloc */ if (newptr && length == old_length) @@ -688,6 +688,8 @@ void mi_setup_functions(register MYISAM_SHARE *share) share->compare_unique=_mi_cmp_dynamic_unique; share->calc_checksum= mi_checksum; + /* add bits used to pack data to pack_reclength for faster allocation */ + share->base.pack_reclength+= share->base.pack_bits; if (share->base.blobs) { share->update_record=_mi_update_blob_record; @@ -776,6 +778,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite) uchar *ptr=buff; uint i, keys= (uint) state->header.keys, key_blocks=state->header.max_block_size; + DBUG_ENTER("mi_state_info_write"); memcpy_fixed(ptr,&state->header,sizeof(state->header)); ptr+=sizeof(state->header); @@ -826,10 +829,10 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite) } if (pWrite & 1) - return my_pwrite(file,(char*) buff, (uint) (ptr-buff), 0L, - MYF(MY_NABP | MY_THREADSAFE)); - else - return my_write(file, (char*) buff, (uint) (ptr-buff), MYF(MY_NABP)); + DBUG_RETURN(my_pwrite(file,(char*) buff, (uint) (ptr-buff), 0L, + MYF(MY_NABP | MY_THREADSAFE))); + DBUG_RETURN(my_write(file, (char*) buff, (uint) (ptr-buff), + MYF(MY_NABP))); } diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index 66cfd169026..1bd39aa900b 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -165,7 +165,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) diff_length=(int) rec_reflength - (int) share->base.rec_reflength; if (fix_keys) share->rec_reflength=rec_reflength; - share->base.min_block_length=share->min_pack_length+share->pack.ref_length; + share->base.min_block_length=share->min_pack_length+1; + if (share->min_pack_length > 254) + share->base.min_block_length+=2; if (!(share->decode_trees=(MI_DECODE_TREE*) my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+ @@ -741,6 +743,12 @@ static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, { ulong length=get_bits(bit_buff,rec->space_length_bits); uint pack_length=(uint) (end-to)-mi_portable_sizeof_char_ptr; + if (bit_buff->blob_pos+length > bit_buff->end) + { + bit_buff->error=1; + bzero((byte*) to,(end-to)); + return; + } decode_bytes(rec,bit_buff,bit_buff->blob_pos,bit_buff->blob_pos+length); _my_store_blob_length((byte*) to,pack_length,length); memcpy_fixed((char*) to+pack_length,(char*) &bit_buff->blob_pos, diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 7e8577c0656..7f4c90d1bc1 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -810,9 +810,10 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, register uchar **page_pos, register uchar *key) { reg1 HA_KEYSEG *keyseg; - uchar *start_key,*page=*page_pos,*page_end,*from,*from_end; + uchar *start_key,*page,*page_end,*from,*from_end; uint length,tmp; + page= *page_pos; page_end=page+MI_MAX_KEY_BUFF+1; start_key=key; @@ -868,7 +869,9 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, length-=tmp; from=page; from_end=page_end; } - memcpy((byte*) key,(byte*) from,(size_t) length); + DBUG_PRINT("info",("key: %lx from: %lx length: %u", + key, from, length)); + memcpy_overlap((byte*) key, (byte*) from, (size_t) length); key+=length; from+=length; } @@ -1590,6 +1593,9 @@ _mi_calc_bin_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, uint length,key_length,ref_length; s_temp->totlength=key_length=_mi_keylength(keyinfo,key)+nod_flag; +#ifdef HAVE_purify + s_temp->n_length= s_temp->n_ref_length=0; /* For valgrind */ +#endif s_temp->key=key; s_temp->prev_key=org_key; if (prev_key) /* If not first key in block */ diff --git a/myisam/mi_test_all.sh b/myisam/mi_test_all.sh index a2d57ea1a83..07e71d65675 100755 --- a/myisam/mi_test_all.sh +++ b/myisam/mi_test_all.sh @@ -3,7 +3,9 @@ # Execute some simple basic test on MyISAM libary to check if things # works at all. +valgrind="valgrind --alignment=8 --leak-check=yes" silent="-s" + if test -f mi_test1$MACH ; then suffix=$MACH else suffix=""; fi mi_test1$suffix $silent myisamchk$suffix -se test1 diff --git a/myisam/mi_update.c b/myisam/mi_update.c index 53c09a1d35c..d1d41ac351a 100644 --- a/myisam/mi_update.c +++ b/myisam/mi_update.c @@ -96,7 +96,14 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec) if (_mi_ft_cmp(info,i,oldrec, newrec)) { if ((int) i == info->lastinx) + { + /* + We are changeing the index we are reading on. Mark that + the index data has changed and we need to do a full search + when doing read-next + */ key_changed|=HA_STATE_WRITTEN; + } changed|=((ulonglong) 1 << i); if (_mi_ft_update(info,i,(char*) old_key,oldrec,newrec,pos)) goto err; @@ -123,25 +130,36 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec) } /* If we are running with external locking, we must update the index file - that something has changed + that something has changed. */ if (changed || !my_disable_locking) - key_changed|= HA_STATE_KEY_CHANGED; + key_changed|= HA_STATE_CHANGED; if (share->calc_checksum) { info->checksum=(*share->calc_checksum)(info,newrec); - key_changed|= HA_STATE_KEY_CHANGED; /* Must update index file */ + /* Store new checksum in index file header */ + key_changed|= HA_STATE_CHANGED; } { - /* Don't update index file if data file is not extended */ + /* + Don't update index file if data file is not extended and no status + information changed + */ MI_STATUS_INFO state; + ha_rows org_split; + my_off_t org_delete_link; + memcpy((char*) &state, (char*) info->state, sizeof(state)); + org_split= share->state.split; + org_delete_link= share->state.dellink; if ((*share->update_record)(info,pos,newrec)) goto err; if (!key_changed && - memcmp((char*) &state, (char*) info->state, sizeof(state))) - key_changed|= HA_STATE_KEY_CHANGED; /* Must update index file */ + (memcmp((char*) &state, (char*) info->state, sizeof(state)) || + org_split != share->state.split || + org_delete_link != share->state.dellink)) + key_changed|= HA_STATE_CHANGED; /* Must update index file */ } if (auto_key_changed) update_auto_increment(info,newrec); @@ -165,7 +183,7 @@ err: DBUG_PRINT("error",("key: %d errno: %d",i,my_errno)); save_errno=my_errno; if (changed) - key_changed|= HA_STATE_KEY_CHANGED; + key_changed|= HA_STATE_CHANGED; if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL) { info->errkey= (int) i; diff --git a/myisam/mi_write.c b/myisam/mi_write.c index 6985dac7832..8e0b7e3530c 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -930,4 +930,3 @@ void mi_end_bulk_insert(MI_INFO *info) info->bulk_insert=0; } } - diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 43ade35bfd5..b2fdb2ccf3f 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -804,15 +804,18 @@ static int myisamchk(MI_CHECK *param, my_string filename) !(param->testflag & T_CHECK_ONLY_CHANGED)))) need_to_check=1; - if ((param->testflag & T_STATISTICS) && - (share->state.changed & STATE_NOT_ANALYZED)) - need_to_check=1; - if ((param->testflag & T_SORT_INDEX) && - (share->state.changed & STATE_NOT_SORTED_PAGES)) - need_to_check=1; - if ((param->testflag & T_REP_BY_SORT) && - (share->state.changed & STATE_NOT_OPTIMIZED_KEYS)) - need_to_check=1; + if (info->s->base.keys && info->state->records) + { + if ((param->testflag & T_STATISTICS) && + (share->state.changed & STATE_NOT_ANALYZED)) + need_to_check=1; + if ((param->testflag & T_SORT_INDEX) && + (share->state.changed & STATE_NOT_SORTED_PAGES)) + need_to_check=1; + if ((param->testflag & T_REP_BY_SORT) && + (share->state.changed & STATE_NOT_OPTIMIZED_KEYS)) + need_to_check=1; + } if ((param->testflag & T_CHECK_ONLY_CHANGED) && (share->state.changed & (STATE_CHANGED | STATE_CRASHED | STATE_CRASHED_ON_REPAIR))) @@ -892,6 +895,11 @@ static int myisamchk(MI_CHECK *param, my_string filename) param->error_printed=0; goto end2; } + /* + _mi_readinfo() has locked the table. + We mark the table as locked (without doing file locks) to be able to + use functions that only works on locked tables (like row caching). + */ mi_lock_database(info, F_EXTRA_LCK); datafile=info->dfile; @@ -1410,23 +1418,24 @@ static int mi_sort_records(MI_CHECK *param, if (!(((ulonglong) 1 << sort_key) & share->state.key_map)) { - mi_check_print_error(param,"Can't sort table '%s' on key %d; No such key", + mi_check_print_warning(param, + "Can't sort table '%s' on key %d; No such key", name,sort_key+1); param->error_printed=0; - DBUG_RETURN(-1); + DBUG_RETURN(0); /* Nothing to do */ } if (keyinfo->flag & HA_FULLTEXT) { - mi_check_print_error(param,"Can't sort table '%s' on FULLTEXT key %d", - name,sort_key+1); + mi_check_print_warning(param,"Can't sort table '%s' on FULLTEXT key %d", + name,sort_key+1); param->error_printed=0; - DBUG_RETURN(-1); + DBUG_RETURN(0); /* Nothing to do */ } if (share->data_file_type == COMPRESSED_RECORD) { - mi_check_print_error(param,"Can't sort read-only table '%s'", name); + mi_check_print_warning(param,"Can't sort read-only table '%s'", name); param->error_printed=0; - DBUG_RETURN(-1); + DBUG_RETURN(0); /* Nothing to do */ } if (!(param->testflag & T_SILENT)) { diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c index 4bb7cc55d30..ca164fcdaca 100644 --- a/myisam/myisamlog.c +++ b/myisam/myisamlog.c @@ -414,8 +414,16 @@ static int examine_log(my_string file_name, char **table_names) VOID(tree_walk(&tree,(tree_walk_action) test_if_open,(void*) &open_param, left_root_right)); file_info.id=open_param.max_id+1; + /* + * In the line below +10 is added to accomodate '<' and '>' chars + * plus '\0' at the end, so that there is place for 7 digits. + * It is improbable that same table can have that many entries in + * the table cache. + * The additional space is needed for the sprintf commands two lines + * below. + */ file_info.show_name=my_memdup(isam_file_name, - (uint) strlen(isam_file_name)+6, + (uint) strlen(isam_file_name)+10, MYF(MY_WME)); if (file_info.id > 1) sprintf(strend(file_info.show_name),"<%d>",file_info.id); diff --git a/myisam/myisampack.c b/myisam/myisampack.c index 21b73ce244d..5ca57248204 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -243,7 +243,7 @@ static struct my_option my_long_options[] = {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', - "Force packing of table even if it gets bigger or if tempfile exists.", + "Force packing of table even if it gets bigger or if tempfile exists.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"join", 'j', "Join all given tables into 'new_table_name'. All tables MUST have identical layouts.", diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index fb97dd5b1de..2babb6fba66 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -21,8 +21,9 @@ benchdir_root= $(prefix) testdir = $(benchdir_root)/mysql-test EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh EXTRA_DIST = $(EXTRA_SCRIPTS) -test_SCRIPTS = mysql-test-run install_test_db -CLEANFILES = $(test_SCRIPTS) +test_SCRIPTS = mysql-test-run install_test_db +test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem +CLEANFILES = $(test_SCRIPTS) $(test_DATA) dist-hook: mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \ @@ -32,6 +33,8 @@ dist-hook: $(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) $(srcdir)/std_data/*.pem $(distdir)/std_data + install-data-local: $(mkinstalldirs) \ @@ -49,6 +52,11 @@ install-data-local: $(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 + $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data + +std_data/%.pem: + @CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data + SUFFIXES = .sh diff --git a/mysql-test/include/check_var_limit.inc b/mysql-test/include/check_var_limit.inc new file mode 100644 index 00000000000..f955aeb345e --- /dev/null +++ b/mysql-test/include/check_var_limit.inc @@ -0,0 +1,9 @@ +# +# Check that second part of $LIMIT is between $MIN_LIMIT and $MAX_LIMIT +# This is useful to check that a variable from SHOW_VARIABLES is within +# certain limits. Check query_cache_merge.test for an example of using this. +# +-- require r/check_var_limit.require +disable_query_log; +eval select SUBSTRING_INDEX("$LIMIT", "\\t", -1) BETWEEN $MIN_LIMIT AND $MAX_LIMIT as "limit"; +enable_query_log; diff --git a/mysql-test/include/have_openssl_2.inc b/mysql-test/include/have_openssl_2.inc deleted file mode 100644 index 9671ce29573..00000000000 --- a/mysql-test/include/have_openssl_2.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/have_openssl_2.require -disable_query_log; -SHOW STATUS LIKE "Ssl_cipher"; -enable_query_log; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 874abdc0c86..0f45b8af1b0 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -16,6 +16,9 @@ USE_MANAGER=0 MY_TZ=GMT-3 TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work +# For query_cache test +ulimit -n 1024 + #++ # Program Definitions #-- @@ -210,7 +213,6 @@ CHARACTER_SET=latin1 DBUSER="" START_WAIT_TIMEOUT=10 STOP_WAIT_TIMEOUT=10 -TEST_REPLICATION=0 MYSQL_TEST_SSL_OPTS="" while test $# -gt 0; do @@ -254,12 +256,6 @@ while test $# -gt 0; do --start-and-exit) START_AND_EXIT=1 ;; - --skip-innodb) - EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-innodb" - EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-innodb" ;; - --skip-bdb) - EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-bdb" - EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-bdb" ;; --skip-rpl) NO_SLAVE=1 ;; --skip-test=*) SKIP_TEST=`$ECHO "$1" | $SED -e "s;--skip-test=;;"`;; --do-test=*) DO_TEST=`$ECHO "$1" | $SED -e "s;--do-test=;;"`;; @@ -288,9 +284,6 @@ while test $# -gt 0; do --user-test=*) USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` ;; - --rpl) - TEST_REPLICATION=1 - ;; --mysqld=*) TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"` EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP" @@ -435,6 +428,11 @@ if [ x$SOURCE_DIST = x1 ] ; then else MYSQL_TEST="$BASEDIR/client/mysqltest" fi + if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then + MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK" + else + MYSQL_DUMP="$BASEDIR/client/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK" + fi if [ -n "$STRACE_CLIENT" ]; then MYSQL_TEST="strace -o $MYSQL_TEST_DIR/var/log/mysqltest.strace $MYSQL_TEST" fi @@ -456,6 +454,7 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi MYSQL_TEST="$BASEDIR/bin/mysqltest" + MYSQL_DUMP="$BASEDIR/bin/mysqldump --no-defaults -uroot --socket=$MASTER_MYSOCK" MYSQLADMIN="$BASEDIR/bin/mysqladmin" WAIT_PID="$BASEDIR/bin/mysql_waitpid" MYSQL_MANAGER="$BASEDIR/bin/mysqlmanager" @@ -473,6 +472,8 @@ else fi fi +export MYSQL_DUMP + if [ -z "$MASTER_MYSQLD" ] then MASTER_MYSQLD=$MYSQLD @@ -839,7 +840,6 @@ start_master() /bin/sh $master_init_script fi cd $BASEDIR # for gcov - #start master if [ -z "$DO_BENCH" ] then master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \ @@ -858,6 +858,7 @@ start_master() --tmpdir=$MYSQL_TMP_DIR \ --language=$LANGUAGE \ --innodb_data_file_path=ibdata1:50M \ + --open-files-limit=1024 \ $MASTER_40_ARGS \ $SMALL_SERVER \ $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" @@ -1376,6 +1377,9 @@ fi $ECHO "Starting Tests" +# +# This can probably be deleted +# if [ "$DO_BENCH" = 1 ] then BENCHDIR=$BASEDIR/sql-bench/ @@ -1407,17 +1411,10 @@ then if [ x$RECORD = x1 ]; then $ECHO "Will not run in record mode without a specific test case." else - if [ x$TEST_REPLICATION = x1 ]; then - for tf in `ls -1 $TESTDIR/*.$TESTSUFFIX | $SORT` - do - run_testcase $tf - done - else - for tf in $TESTDIR/*.$TESTSUFFIX - do - run_testcase $tf - done - fi + for tf in $TESTDIR/*.$TESTSUFFIX + do + run_testcase $tf + done $RM -f $TIMEFILE # Remove for full test fi else diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index fd2f7b7e49b..f619775aa97 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1114,3 +1114,34 @@ a b select * from t2; a b drop table t1,t2; +create table t1 (x int not null, index(x)) type=bdb; +insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +select * from t1 where x <= 10 and x >= 7; +x +7 +8 +9 +10 +select * from t1 where x <= 10 and x >= 7 order by x; +x +7 +8 +9 +10 +select * from t1 where x <= 10 and x >= 7 order by x desc; +x +10 +9 +8 +7 +select * from t1 where x <= 8 and x >= 5 order by x desc; +x +8 +7 +6 +5 +select * from t1 where x < 8 and x > 5 order by x desc; +x +7 +6 +drop table t1; diff --git a/mysql-test/r/check_var_limit.require b/mysql-test/r/check_var_limit.require new file mode 100644 index 00000000000..01a59782180 --- /dev/null +++ b/mysql-test/r/check_var_limit.require @@ -0,0 +1,2 @@ +limit +1 diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 9c848c3434f..c0608af0de2 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -30,6 +30,7 @@ show tables; Tables_in_test update mysql.user set password=old_password("gambling2") where user="test"; flush privileges; +set password=old_password('gambling3'); show tables; Tables_in_mysql columns_priv diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index b51836f39e0..06ddd5e2280 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -312,3 +312,65 @@ SET SESSION table_type=default; drop table t1; create table t1 select x'4132'; drop table t1; +create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob); +insert into t1(a)values(1); +insert into t1(a,b,c,d,e,f,g,h) +values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data'); +select * from t1; +a b c d e f g h +1 NULL NULL NULL NULL NULL NULL NULL +2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data +select a, +ifnull(b,cast(-7 as signed)) as b, +ifnull(c,cast(7 as unsigned)) as c, +ifnull(d,cast('2000-01-01' as date)) as d, +ifnull(e,cast('b' as char)) as e, +ifnull(f,cast('2000-01-01' as datetime)) as f, +ifnull(g,cast('5:4:3' as time)) as g, +ifnull(h,cast('yet another binary data' as binary)) as h, +addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd +from t1; +a b c d e f g h dd +1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00 +2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00 +create table t2 +select +a, +ifnull(b,cast(-7 as signed)) as b, +ifnull(c,cast(7 as unsigned)) as c, +ifnull(d,cast('2000-01-01' as date)) as d, +ifnull(e,cast('b' as char)) as e, +ifnull(f,cast('2000-01-01' as datetime)) as f, +ifnull(g,cast('5:4:3' as time)) as g, +ifnull(h,cast('yet another binary data' as binary)) as h, +addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd +from t1; +explain t2; +Field Type Null Key Default Extra +a int(11) YES NULL +b bigint(11) 0 +c bigint(10) 0 +d date 0000-00-00 +e char(1) +f datetime 0000-00-00 00:00:00 +g time 00:00:00 +h mediumblob +dd time 00:00:00 +select * from t2; +a b c d e f g h dd +1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00 +2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00 +drop table t1, t2; +drop database if exists test_$1; +create database test_$1; +use test_$1; +select database(); +database() +test_$1 +drop database test_$1; +select database(); +database() +NULL +select database(); +database() +NULL diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index a1a1bd75db6..ebc84db7115 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -1433,7 +1433,7 @@ CYR CAPIT EM М М CYR CAPIT EN Ð Ð î Ð CYR CAPIT O О О ï О CYR CAPIT PE П П ð П -CYR CAPIT ER Р Р ò +CYR CAPIT ER Р Р ò Р CYR CAPIT ES С С ó С CYR CAPIT TE Т Т ô Т CYR CAPIT U У У õ У @@ -1574,7 +1574,7 @@ CYR CAPIT EM CYR CAPIT EN î Ð î  CYR CAPIT O ï О ï  CYR CAPIT PE ð П ð  -CYR CAPIT ER ò Р ò  +CYR CAPIT ER ò Р ò  CYR CAPIT ES ó С ó ! CYR CAPIT TE ô Т ô " CYR CAPIT U õ У õ # diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result index 4b3b464dea1..298e774186d 100644 --- a/mysql-test/r/ctype_mb.result +++ b/mysql-test/r/ctype_mb.result @@ -19,3 +19,34 @@ SELECT * FROM t1; c1 c2 c3 aaaabbbbcccc aaaabbbbcccc aaaabbbbcccc DROP TABLE t1; +CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8, KEY key_a(a(3))); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(4) character set utf8 default NULL, + KEY `key_a` (`a`(3)) +) TYPE=MyISAM CHARSET=latin1 +SHOW KEYS FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 key_a 1 a A NULL 9 NULL YES BTREE +ALTER TABLE t1 CHANGE a a CHAR(4); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(4) default NULL, + KEY `key_a` (`a`(3)) +) TYPE=MyISAM CHARSET=latin1 +SHOW KEYS FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 key_a 1 a A NULL 3 NULL YES BTREE +ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(4) character set utf8 default NULL, + KEY `key_a` (`a`(3)) +) TYPE=MyISAM CHARSET=latin1 +SHOW KEYS FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 key_a 1 a A NULL 9 NULL YES BTREE +DROP TABLE t1; diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index 624eab4cf0b..5a53c1db2e1 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -16,16 +16,16 @@ EFF0EEE1E0 DROP TABLE t1; CREATE TABLE ÔÁÂÌÉÃÁ ( -ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL -); +ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ" +) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ"; 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 + `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' COMMENT 'ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ' +) TYPE=MyISAM CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ' SHOW FIELDS FROM ÔÁÂÌÉÃÁ; Field Type Null Key Default Extra ÐÏÌÅ char(32) @@ -36,8 +36,8 @@ Tables_in_test SHOW CREATE TABLE òàáëèöà; Table Create Table òàáëèöà CREATE TABLE `òàáëèöà` ( - `ïîëå` char(32) character set koi8r NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 + `ïîëå` char(32) character set koi8r NOT NULL default '' COMMENT 'êîììåíòàðèé ïîëÿ' +) TYPE=MyISAM CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû' SHOW FIELDS FROM òàáëèöà; Field Type Null Key Default Extra ïîëå char(32) @@ -48,8 +48,8 @@ Tables_in_test SHOW CREATE TABLE таблица; Table Create Table таблица CREATE TABLE `таблица` ( - `поле` char(32) character set koi8r NOT NULL default '' -) TYPE=MyISAM CHARSET=latin1 + `поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий полÑ' +) TYPE=MyISAM CHARSET=latin1 COMMENT='комментарий таблицы' SHOW FIELDS FROM таблица; Field Type Null Key Default Extra поле char(32) @@ -70,3 +70,11 @@ SHOW TABLES IN Tables_in_òåñò SET CHARACTER SET koi8r; DROP DATABASE ÔÅÓÔ; +SET NAMES koi8r; +SELECT hex('ÔÅÓÔ'); +hex('ÔÅÓÔ') +D4C5D3D4 +SET character_set_connection=cp1251; +SELECT hex('ÔÅÓÔ'); +hex('ÔÅÓÔ') +F2E5F1F2 diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result new file mode 100644 index 00000000000..db626c8acb1 --- /dev/null +++ b/mysql-test/r/ctype_ucs.result @@ -0,0 +1,272 @@ +DROP TABLE IF EXISTS t1; +SET CHARACTER SET koi8r; +CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2); +INSERT INTO t1 VALUES (_koi8r'ò'), (X'2004'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +0420 +2004 +DELETE FROM t1; +INSERT INTO t1 VALUES (X'042000200020'), (X'200400200020'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +0420 +2004 +DROP TABLE t1; +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'0421'); +LPAD(_ucs2 X'0420',10,_ucs2 X'0421') +óóóóóóóóóò +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'04210422'); +LPAD(_ucs2 X'0420',10,_ucs2 X'04210422') +óôóôóôóôóò +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423'); +LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423') +óôõóôõóôõò +SELECT LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423'); +LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423') +òóôõæèãþûý +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'0421'); +RPAD(_ucs2 X'0420',10,_ucs2 X'0421') +òóóóóóóóóó +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'04210422'); +RPAD(_ucs2 X'0420',10,_ucs2 X'04210422') +òóôóôóôóôó +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423'); +RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423') +òóôõóôõóôõ +SELECT RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423'); +RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423') +òóôõæèãþûý +CREATE TABLE t1 SELECT +LPAD(_ucs2 X'0420',10,_ucs2 X'0421') l, +RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `l` char(10) character set ucs2 NOT NULL default '', + `r` char(10) character set ucs2 NOT NULL default '' +) TYPE=MyISAM CHARSET=latin1 +DROP TABLE t1; +SET NAMES koi8r; +SET character_set_connection=ucs2; +create table t1 (a varchar(10) character set ucs2, 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 21 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 21 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 +abcd +select * from t1 where a like "test%"; +a +test +select * from t1 where a like "te_t"; +a +test +select * from t1 where a like "%a%"; +a +select * from t1 where a like "%abcd%"; +a +abcd +select * from t1 where a like "%abc\d%"; +a +abcd +drop table t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ucs2); +INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏÌÄÖ'),('æÙ×ÁÐÒÏÌÄÖ'),('Æù×ÁÐÒÏÌÄÖ'),('ÆÙ÷ÁÐÒÏÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×áÐÒÏÌÄÖ'),('ÆÙ×ÁðÒÏÌÄÖ'),('ÆÙ×ÁÐòÏÌÄÖ'),('ÆÙ×ÁÐÒïÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏìÄÖ'),('ÆÙ×ÁÐÒÏÌäÖ'),('ÆÙ×ÁÐÒÏÌÄö'),('æù÷áðòïìäö'); +SELECT * FROM t1 WHERE a LIKE '%Æù×Á%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE '%Æù×%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE 'Æù×Á%'; +a +ÆÙ×Á +æÙ×Á +Æù×Á +ÆÙ÷Á +ÆÙ×á +æù÷á +ÆÙ×ÁÐÒÏÌÄÖ +æÙ×ÁÐÒÏÌÄÖ +Æù×ÁÐÒÏÌÄÖ +ÆÙ÷ÁÐÒÏÌÄÖ +ÆÙ×áÐÒÏÌÄÖ +ÆÙ×ÁðÒÏÌÄÖ +ÆÙ×ÁÐòÏÌÄÖ +ÆÙ×ÁÐÒïÌÄÖ +ÆÙ×ÁÐÒÏìÄÖ +ÆÙ×ÁÐÒÏÌäÖ +ÆÙ×ÁÐÒÏÌÄö +æù÷áðòïìäö +SELECT * FROM t1 WHERE a LIKE 'Æù×Á%' COLLATE ucs2_bin; +a +Æù×Á +Æù×ÁÐÒÏÌÄÖ +DROP TABLE t1; +CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word)) +TYPE=MyISAM CHARACTER SET ucs2 COLLATE ucs2_general_ci; +INSERT INTO t1 (word) VALUES ("cat"); +SELECT * FROM t1 WHERE word LIKE "c%"; +word +cat +SELECT * FROM t1 WHERE word LIKE "ca_"; +word +cat +SELECT * FROM t1 WHERE word LIKE "cat"; +word +cat +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630025'; +word +cat +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630061005F'; +word +cat +DROP TABLE t1; +SET NAMES latin1; +CREATE TABLE t1 ( +word VARCHAR(64), +bar INT(11) default 0, +PRIMARY KEY (word)) +TYPE=MyISAM +CHARSET ucs2 +COLLATE ucs2_general_ci ; +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a"); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort +SELECT * FROM t1 ORDER BY word; +word bar +a 0 +aar 0 +aardvar 0 +aardvara 0 +aardvark 0 +aardvarz 0 +EXPLAIN SELECT word FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 128 NULL 6 Using index +SELECT word FROM t1 ORDER by word; +word +a +aar +aardvar +aardvara +aardvark +aardvarz +DROP TABLE t1; +CREATE TABLE t1 ( +word VARCHAR(64) , +PRIMARY KEY (word)) +TYPE=MyISAM +CHARSET ucs2 +COLLATE ucs2_general_ci; +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a"); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY WORD; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 128 NULL 6 Using index +SELECT * FROM t1 ORDER BY word; +word +a +aar +aardvar +aardvara +aardvark +aardvarz +DROP TABLE t1; +CREATE TABLE t1 ( +word TEXT, +bar INT(11) AUTO_INCREMENT, +PRIMARY KEY (bar)) +TYPE=MyISAM +CHARSET ucs2 +COLLATE ucs2_general_ci ; +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a" ); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort +SELECT * FROM t1 ORDER BY word; +word bar +a 2 +aar 1 +aardvar 3 +aardvara 5 +aardvark 4 +aardvarz 6 +EXPLAIN SELECT word FROM t1 ORDER BY word; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort +SELECT word FROM t1 ORDER BY word; +word +a +aar +aardvar +aardvara +aardvark +aardvarz +DROP TABLE t1; diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index ffb305a81cf..1730b17eaed 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -1,4 +1,5 @@ drop table if exists t1; +set names ujis; create table t1 (c text character set ujis); insert into t1 values (0xa4a2),(0xa4a3); select hex(left(c,1)) from t1 group by c; @@ -6,3 +7,60 @@ hex(left(c,1)) A4A2 A4A3 drop table t1; +select locate(0xa2a1,0xa1a2a1a3); +locate(0xa2a1,0xa1a2a1a3) +2 +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3); +locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3) +0 +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin); +locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin) +0 +select locate('he','hello'); +locate('he','hello') +1 +select locate('he','hello',2); +locate('he','hello',2) +0 +select locate('lo','hello',2); +locate('lo','hello',2) +4 +select locate('HE','hello'); +locate('HE','hello') +1 +select locate('HE','hello',2); +locate('HE','hello',2) +0 +select locate('LO','hello',2); +locate('LO','hello',2) +4 +select locate('HE','hello' collate ujis_bin); +locate('HE','hello' collate ujis_bin) +0 +select locate('HE','hello' collate ujis_bin,2); +locate('HE','hello' collate ujis_bin,2) +0 +select locate('LO','hello' collate ujis_bin,2); +locate('LO','hello' collate ujis_bin,2) +0 +select locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3); +locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3) +2 +select 0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%'); +0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%') +1 +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%'); +_ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') +0 +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin; +_ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin +0 +select 'a' like 'a'; +'a' like 'a' +1 +select 'A' like 'a'; +'A' like 'a' +1 +select 'A' like 'a' collate ujis_bin; +'A' like 'a' collate ujis_bin +0 diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result new file mode 100644 index 00000000000..1f07de17b14 --- /dev/null +++ b/mysql-test/r/ctype_utf8.result @@ -0,0 +1,61 @@ +set names utf8; +select left(_utf8 0xD0B0D0B1D0B2,1); +left(_utf8 0xD0B0D0B1D0B2,1) +а +select right(_utf8 0xD0B0D0B2D0B2,1); +right(_utf8 0xD0B0D0B2D0B2,1) +в +select locate('he','hello'); +locate('he','hello') +1 +select locate('he','hello',2); +locate('he','hello',2) +0 +select locate('lo','hello',2); +locate('lo','hello',2) +4 +select locate('HE','hello'); +locate('HE','hello') +1 +select locate('HE','hello',2); +locate('HE','hello',2) +0 +select locate('LO','hello',2); +locate('LO','hello',2) +4 +select locate('HE','hello' collate utf8_bin); +locate('HE','hello' collate utf8_bin) +0 +select locate('HE','hello' collate utf8_bin,2); +locate('HE','hello' collate utf8_bin,2) +0 +select locate('LO','hello' collate utf8_bin,2); +locate('LO','hello' collate utf8_bin,2) +0 +select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2); +locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2) +2 +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2); +locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2) +2 +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2); +locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2) +2 +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin); +locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin) +0 +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin); +locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin) +0 +select 'a' like 'a'; +'a' like 'a' +1 +select 'A' like 'a'; +'A' like 'a' +1 +select 'A' like 'a' collate utf8_bin; +'A' like 'a' collate utf8_bin +0 +select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%'); +_utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%') +1 diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index f9e52174469..d24ac5e898a 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -196,3 +196,22 @@ drop table t1,t2; SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1; x 1 +create table t1 select 1 as a; +select 2 as a from (select * from t1) b; +ERROR 3D000: No Database Selected +use test; +select 2 as a from (select * from t1) b; +a +2 +drop table t1; +select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id; +ERROR 42000: 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 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1 +create table t1 (a int); +insert into t1 values (1),(2),(3); +update (select * from t1) as t1 set a = 5; +ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use +delete from (select * from t1); +ERROR 42000: 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 '(select * from t1)' at line 1 +insert into (select * from t1) values (5); +ERROR 42000: 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 '(select * from t1) values (5)' at line 1 +drop table t1; diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index c7ce157a670..5e713f59100 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -427,3 +427,40 @@ name a e drop table t1; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +NAME varchar(75) DEFAULT '' NOT NULL, +LINK_ID int(11) DEFAULT '0' NOT NULL, +PRIMARY KEY (ID), +KEY NAME (NAME), +KEY LINK_ID (LINK_ID) +); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0); +CREATE TABLE t2 ( +ID int(11) NOT NULL auto_increment, +NAME varchar(150) DEFAULT '' NOT NULL, +PRIMARY KEY (ID), +KEY NAME (NAME) +); +SELECT DISTINCT +t2.id AS key_link_id, +t2.name AS link +FROM t1 +LEFT JOIN t2 ON t1.link_id=t2.id +GROUP BY t1.id +ORDER BY link; +key_link_id link +NULL NULL +drop table t1,t2; +CREATE TABLE t1 ( +html varchar(5) default NULL, +rin int(11) default '0', +out int(11) default '0' +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('1',1,0); +SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; +html prod +1 0.00 +drop table t1; diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result index 367b28e9bf7..3748af1b8f9 100644 --- a/mysql-test/r/drop.result +++ b/mysql-test/r/drop.result @@ -44,3 +44,13 @@ mysql test drop database mysqltest; ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist +drop table t1; +flush tables with read lock; +create table t1(n int); +ERROR HY000: Can't execute the query because you have a conflicting read lock +unlock tables; +create table t1(n int); +show tables; +Tables_in_test +t1 +drop table t1; diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index c4d2eacf363..57eef44b3bb 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -40,3 +40,9 @@ uncompress(compress("")) select uncompressed_length(""); uncompressed_length("") 0 +select compress(NULL); +compress(NULL) +NULL +select uncompress(NULL); +uncompress(NULL) +NULL diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result index 461ae1e7e09..5ee0f0f3e93 100644 --- a/mysql-test/r/func_crypt.result +++ b/mysql-test/r/func_crypt.result @@ -1,15 +1,79 @@ select length(encrypt('foo', 'ff')) <> 0; length(encrypt('foo', 'ff')) <> 0 1 -select password("a",""), password("a",NULL), password("","a"), password(NULL,"a"); -password("a","") password("a",NULL) password("","a") password(NULL,"a") -*2517f7235d68d4ba2e5019c93420523101157a792c01 NULL NULL -select password("aaaaaaaaaaaaaaaa","a"), password("a","aaaaaaaaaaaaaaaa"); -password("aaaaaaaaaaaaaaaa","a") password("a","aaaaaaaaaaaaaaaa") -*2cd3b9a44e9a9994789a30f935c92f45a96c5472f381 *37c7c5c794ff144819f2531bf03c57772cd84e40db09 -select old_password('test'), length(password("1")), length(encrypt('test')), encrypt('test','aa'); -old_password('test') length(password("1")) length(encrypt('test')) encrypt('test','aa') -378b243e220ca493 45 13 aaqPiZY5xR5l. -select old_password(""), old_password(NULL), password(""), password(NULL); -old_password("") old_password(NULL) password("") password(NULL) - NULL NULL +select password('abc'); +password('abc') +*0D3CED9BEC10A777AEC23CCC353A8C08A633045E +select password(''); +password('') + +select old_password('abc'); +old_password('abc') +7cd2b5942be28759 +select old_password(''); +old_password('') + +select password('gabbagabbahey'); +password('gabbagabbahey') +*B0F99D2963660DD7E16B751EC9EE2F17B6A68FA6 +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +select length(password('1')); +length(password('1')) +41 +select length(encrypt('test')); +length(encrypt('test')) +13 +select encrypt('test','aa'); +encrypt('test','aa') +aaqPiZY5xR5l. +select old_password(NULL); +old_password(NULL) +NULL +select password(NULL); +password(NULL) +NULL +set global old_passwords=on; +select password(''); +password('') + +select old_password(''); +old_password('') + +select password('idkfa'); +password('idkfa') +*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +set old_passwords=on; +select password('idkfa'); +password('idkfa') +5c078dc54ca0fcca +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +set global old_passwords=off; +select password('idkfa'); +password('idkfa') +5c078dc54ca0fcca +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +set old_passwords=off; +select password('idkfa '); +password('idkfa ') +*2DC31D90647B4C1ABC9231563D2236E96C9A2DB2 +select password('idkfa'); +password('idkfa') +*B669C9DAC3AA6F2254B03CDEF8DFDD6B2D1054BA +select password(' idkfa'); +password(' idkfa') +*12B099E56BB7FE8D43C78FD834A9D1D11178D045 +select old_password('idkfa'); +old_password('idkfa') +5c078dc54ca0fcca +select old_password(' i d k f a '); +old_password(' i d k f a ') +5c078dc54ca0fcca diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index a4493e7c95c..5c3c2f10000 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -167,6 +167,11 @@ t2.URL_ID = t1.URL_ID group by REQ_ID; REQ_ID URL 1 X 5 X,X,X +select REQ_ID, Group_Concat(URL) as URL, Min(t1.URL_ID) urll, +Max(t1.URL_ID) urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID; +REQ_ID URL urll urlg +1 X 4 4 +5 X,X,X 4 5 drop table t1; drop table t2; create table t1 (id int, name varchar(16)); @@ -178,3 +183,16 @@ select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') a with distinct: cutoff at length of shortname 1:longername,1:evenlongername drop table t1; +create table t1(id int); +create table t2(id int); +insert into t1 values(0),(1); +select group_concat(t1.id) FROM t1,t2; +group_concat(t1.id) +NULL +drop table t1; +drop table t2; +create table t1 (bar varchar(32)); +insert into t1 values('test'),('test2'); +select * from t1 having group_concat(bar)=''; +bar +drop table t1; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 8fad9d16dc2..3af75b3c5bc 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -551,7 +551,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select min(a1) from t1 where a1 between a3 and 'KKK'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 14 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 14 Using where explain select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08; id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result index 8d22994ef2b..35742136ee6 100644 --- a/mysql-test/r/func_regexp.result +++ b/mysql-test/r/func_regexp.result @@ -52,3 +52,27 @@ select * from t1 where xxx REGEXP '^this is some text: to test - out\\.reg exp [ xxx this is some text: to test - out.reg exp (22/45) drop table t1; +select _latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin; +_latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin +1 +select _koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin; +_koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin +0 +select _latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin; +_latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin +0 +select _koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin; +_koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin +1 +select _latin1 0xF7 regexp _latin1 '[[:alpha:]]'; +_latin1 0xF7 regexp _latin1 '[[:alpha:]]' +0 +select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]'; +_koi8r 0xF7 regexp _koi8r '[[:alpha:]]' +1 +select _latin1'a' regexp _latin1'A' collate latin1_general_ci; +_latin1'a' regexp _latin1'A' collate latin1_general_ci +1 +select _latin1'a' regexp _latin1'A' collate latin1_bin; +_latin1'a' regexp _latin1'A' collate latin1_bin +0 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 82f68cdaa84..ac25277351c 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -410,7 +410,7 @@ collation(concat(_latin2'a',_latin2'b')) coercibility(concat(_latin2'a',_latin2' latin2_general_ci 3 select collation(lpad(_latin2'a',4,_latin2'b')), coercibility(lpad(_latin2'a',4,_latin2'b')); collation(lpad(_latin2'a',4,_latin2'b')) coercibility(lpad(_latin2'a',4,_latin2'b')) -binary 3 +latin2_general_ci 3 select collation(rpad(_latin2'a',4,_latin2'b')), coercibility(rpad(_latin2'a',4,_latin2'b')); collation(rpad(_latin2'a',4,_latin2'b')) coercibility(rpad(_latin2'a',4,_latin2'b')) latin2_general_ci 3 diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result index e3a0d066a85..851c308ba3e 100644 --- a/mysql-test/r/func_test.result +++ b/mysql-test/r/func_test.result @@ -1,3 +1,4 @@ +drop table if exists t1,t2; select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ; 0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a") 1 1 1 0 0 1 -1 1 0 @@ -123,3 +124,11 @@ select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin; ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like' select _koi8r'a' LIKE _latin1'A'; ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like' +CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) TYPE=MyISAM; +INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','\r\n\r\n \r\n \r\n \r\n \r\n
 \r\n

How \r\n To: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected.

\r\n
','\r\n \r\n \r\n \r\n \r\n\r\n \r\n
  \r\n \r\n

1. Select \r\n the On/Setup button to access the DynaVox Setup Menu.
\r\n 2. Select Button Features.
\r\n 3. Below the OK button is the Usage Counts button.
\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.
\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.
\r\n c. Select the Usage Counts Option Ring once and it will toggle \r\n to the alternative option.
\r\n 4. Once the correct setting has been chosen, select OK to leave the Button \r\n Features menu.
\r\n 5. Select OK out of the Setup menu and return to the communication \r\n page.

\r\n

For \r\n further information on Usage Counts, see the Button Features \r\n Menu Entry in the DynaVox/DynaMyte Reference Manual.

\r\n
',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL); +CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) TYPE=MyISAM; +INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1); +SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank; +rank rank rank +2 2 NULL +DROP TABLE t1,t2; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 7d3aeb62227..89426edb000 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -91,19 +91,39 @@ show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' -REVOKE insert,insert (a) on t1 from mysqltest_1@localhost; -GRANT references on t1 to mysqltest_1@localhost; +REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' -GRANT SELECT, REFERENCES, REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +GRANT REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +GRANT select,references on t1 to mysqltest_1@localhost; select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; table_priv column_priv Select,References References -delete from mysql.user where user='mysqltest_1'; -delete from mysql.db where user='mysqltest_1'; -delete from mysql.tables_priv where user='mysqltest_1'; -delete from mysql.columns_priv where user='mysqltest_1'; +grant all on test.* to mysqltest_3@localhost with grant option; +revoke all on test.* from mysqltest_3@localhost; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +GRANT USAGE ON `test`.* TO 'mysqltest_3'@'localhost' WITH GRANT OPTION +revoke grant option on test.* from mysqltest_3@localhost; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +grant all on test.t1 to mysqltest_2@localhost with grant option; +revoke all on test.t1 from mysqltest_2@localhost; +show grants for mysqltest_2@localhost; +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +GRANT USAGE ON `test`.`t1` TO 'mysqltest_2'@'localhost' WITH GRANT OPTION +revoke grant option on test.t1 from mysqltest_2@localhost; +show grants for mysqltest_2@localhost; +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; flush privileges; drop table t1; GRANT FILE on mysqltest.* to mysqltest_1@localhost; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 3cb9c59cc57..c286b4d8fc4 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -586,4 +586,15 @@ select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(q id sqty cqty 1 5 2 2 9 2 +select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category; +count(*) category +2 NULL +1 one +1 two +select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category; +count(*) category +1 1 +1 2 +1 3 +1 4 drop table t1; diff --git a/mysql-test/r/have_openssl_2.require b/mysql-test/r/have_openssl_2.require deleted file mode 100644 index 032b60d544a..00000000000 --- a/mysql-test/r/have_openssl_2.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -Ssl_cipher EDH-RSA-DES-CBC3-SHA diff --git a/mysql-test/r/have_ujis.require b/mysql-test/r/have_ujis.require index b4de2234ec7..43a309ad74e 100644 --- a/mysql-test/r/have_ujis.require +++ b/mysql-test/r/have_ujis.require @@ -1,2 +1,2 @@ Collation Charset Id Default Compiled Sortlen -ujis_japanese_ci ujis 12 Yes Yes 0 +ujis_japanese_ci ujis 12 Yes Yes 1 diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 8592393fd42..718e554b904 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -251,6 +251,18 @@ n 6 rollback; drop table t1; +create table t1 (n int not null primary key) type=innodb; +start transaction; +insert into t1 values (4); +flush tables with read lock; +commit; +ERROR HY000: Can't execute the query because you have a conflicting read lock +unlock tables; +commit; +select * from t1; +n +4 +drop table t1; create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) type=innodb; begin; insert into t1 values(1,'hamdouni'); @@ -1342,3 +1354,40 @@ id label 3524 Societe Test 3525 Fournisseur Test drop table t1,t2; +create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) type=innodb; +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12"); +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" ); +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1; +c1 c2 stamp +drop table t1; +create table t1 (a int, b varchar(200), c text not null) checksum=1 type=myisam; +create table t2 (a int, b varchar(200), c text not null) checksum=0 type=innodb; +create table t3 (a int, b varchar(200), c text not null) checksum=1 type=innodb; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +insert t3 select * from t1; +checksum table t1, t2, t3, t4 quick; +Table Checksum +test.t1 968604391 +test.t2 NULL +test.t3 NULL +test.t4 NULL +checksum table t1, t2, t3, t4; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +checksum table t1, t2, t3, t4 extended; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +drop table t1,t2,t3; diff --git a/mysql-test/r/innodb_cache.result b/mysql-test/r/innodb_cache.result index c422dca36f1..7706e60d143 100644 --- a/mysql-test/r/innodb_cache.result +++ b/mysql-test/r/innodb_cache.result @@ -10,7 +10,7 @@ a 3 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 0 drop table t1; commit; set autocommit=1; @@ -24,7 +24,7 @@ a 3 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 0 drop table t1; commit; create table t1 (a int not null) type=innodb; @@ -90,14 +90,14 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 3 +Qcache_queries_in_cache 1 show status like "Qcache_hits"; Variable_name Value Qcache_hits 4 commit; show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 3 +Qcache_queries_in_cache 1 drop table if exists t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=InnoDB; select count(*) from t1; diff --git a/mysql-test/r/isam.result b/mysql-test/r/isam.result index b83185b0c01..80d78bc72da 100644 --- a/mysql-test/r/isam.result +++ b/mysql-test/r/isam.result @@ -1,13 +1,5 @@ drop table if exists t1,t2; create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) type=isam; -Warnings: -Warning 1263 Data truncated for column 'b' at row 1 -Warnings: -Warning 1263 Data truncated for column 'b' at row 1 -Warnings: -Warning 1263 Data truncated for column 'b' at row 1 -Warnings: -Warning 1263 Data truncated for column 'b' at row 1 delete from t1 where (a & 1); select sum(length(b)) from t1; sum(length(b)) @@ -87,3 +79,173 @@ t1 0 PRIMARY 1 a A 4 NULL NULL BTREE t1 1 b 1 b A 1 NULL NULL BTREE t1 1 b 2 c A 4 NULL NULL BTREE drop table t1,t2; +create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8 +int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17 +int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int, +i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34 +int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int, +i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51 +int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int, +i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68 +int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int, +i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85 +int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int, +i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102 +int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110 +int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118 +int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126 +int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134 +int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142 +int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150 +int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158 +int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166 +int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174 +int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182 +int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190 +int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198 +int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206 +int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214 +int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222 +int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230 +int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238 +int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246 +int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254 +int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262 +int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270 +int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278 +int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286 +int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294 +int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302 +int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310 +int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318 +int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326 +int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334 +int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342 +int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350 +int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358 +int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366 +int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374 +int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382 +int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390 +int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398 +int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406 +int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414 +int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422 +int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430 +int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438 +int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446 +int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454 +int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462 +int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470 +int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478 +int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486 +int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494 +int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502 +int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510 +int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518 +int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526 +int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534 +int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542 +int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550 +int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558 +int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566 +int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574 +int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582 +int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590 +int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598 +int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606 +int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614 +int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622 +int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630 +int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638 +int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646 +int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654 +int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662 +int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670 +int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678 +int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686 +int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694 +int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702 +int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710 +int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718 +int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726 +int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734 +int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742 +int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750 +int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758 +int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766 +int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774 +int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782 +int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790 +int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798 +int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806 +int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814 +int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822 +int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830 +int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838 +int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846 +int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854 +int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862 +int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870 +int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878 +int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886 +int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894 +int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902 +int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910 +int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918 +int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926 +int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934 +int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942 +int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950 +int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958 +int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966 +int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974 +int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982 +int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990 +int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998 +int, i999 int, i1000 int, b blob) row_format=dynamic; +insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei"); +update t1 set b=repeat('a',256); +update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 508e1844d84..d738431e016 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -28,3 +28,15 @@ NULL NULL 0000-00-00 0000-00-00 NULL 0000-00-00 0000-00-00 0000-00-00 NULL 2003-03-03 2003-03-03 NULL drop table t1; +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +Warnings: +Warning 1260 Record count is fewer than the column count at row 3 +select concat('|',a,'|'), concat('|',b,'|') from t1; +concat('|',a,'|') concat('|',b,'|') +|Field A| |Field B| +|Field 1| |Field 2' +Field 3,'Field 4| +|Field 5' ,'Field 6| NULL +|Field 6| | 'Field 7'| +drop table t1; diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result index af4e2300088..9c6b212a4b6 100644 --- a/mysql-test/r/lowercase_table.result +++ b/mysql-test/r/lowercase_table.result @@ -6,6 +6,15 @@ id Word 1 a 2 b 3 c +SELECT T1.id from T1 LIMIT 1; +id +1 +SELECT T2.id from t1 as T2 LIMIT 1; +id +1 +SELECT T2.id from t1 as t2 LIMIT 1; +id +1 RENAME TABLE T1 TO T2; ALTER TABLE T2 ADD new_col int not null; ALTER TABLE T2 RENAME T3; diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result new file mode 100644 index 00000000000..d6da3604fd2 --- /dev/null +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -0,0 +1,183 @@ +drop table if exists t1, t2; +create table t1 (a int) type=innodb; +create table t2 (a int) type=myisam; +reset master; +begin; +insert into t1 values(1); +insert into t2 select * from t1; +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(1) +master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 244 Query 1 244 use `test`; COMMIT +delete from t1; +delete from t2; +reset master; +begin; +insert into t1 values(2); +insert into t2 select * from t1; +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(2) +master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 244 Query 1 244 use `test`; ROLLBACK +delete from t1; +delete from t2; +reset master; +begin; +insert into t1 values(3); +savepoint my_savepoint; +insert into t1 values(4); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(3) +master-bin.000001 178 Query 1 79 use `test`; savepoint my_savepoint +master-bin.000001 235 Query 1 79 use `test`; insert into t1 values(4) +master-bin.000001 294 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint +master-bin.000001 429 Query 1 429 use `test`; COMMIT +delete from t1; +delete from t2; +reset master; +begin; +insert into t1 values(5); +savepoint my_savepoint; +insert into t1 values(6); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +insert into t1 values(7); +commit; +select a from t1 order by a; +a +5 +7 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(5) +master-bin.000001 178 Query 1 79 use `test`; savepoint my_savepoint +master-bin.000001 235 Query 1 79 use `test`; insert into t1 values(6) +master-bin.000001 294 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 360 Query 1 79 use `test`; rollback to savepoint my_savepoint +master-bin.000001 429 Query 1 79 use `test`; insert into t1 values(7) +master-bin.000001 488 Query 1 488 use `test`; COMMIT +delete from t1; +delete from t2; +reset master; +select get_lock("a",10); +get_lock("a",10) +1 +begin; +insert into t1 values(8); +insert into t2 select * from t1; +select get_lock("a",10); +get_lock("a",10) +1 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(8) +master-bin.000001 178 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 244 Query 1 244 use `test`; ROLLBACK +delete from t1; +delete from t2; +reset master; +insert into t1 values(9); +insert into t2 select * from t1; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(9) +master-bin.000001 138 Query 1 138 use `test`; insert into t2 select * from t1 +delete from t1; +delete from t2; +reset master; +insert into t1 values(10); +begin; +insert into t2 select * from t1; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(10) +master-bin.000001 139 Query 1 139 use `test`; insert into t2 select * from t1 +insert into t1 values(11); +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; insert into t1 values(10) +master-bin.000001 139 Query 1 139 use `test`; insert into t2 select * from t1 +master-bin.000001 205 Query 1 205 use `test`; BEGIN +master-bin.000001 245 Query 1 205 use `test`; insert into t1 values(11) +master-bin.000001 305 Query 1 305 use `test`; COMMIT +alter table t2 type=INNODB; +delete from t1; +delete from t2; +reset master; +begin; +insert into t1 values(12); +insert into t2 select * from t1; +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(12) +master-bin.000001 179 Query 1 79 use `test`; insert into t2 select * from t1 +master-bin.000001 245 Query 1 245 use `test`; COMMIT +delete from t1; +delete from t2; +reset master; +begin; +insert into t1 values(13); +insert into t2 select * from t1; +rollback; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +delete from t1; +delete from t2; +reset master; +begin; +insert into t1 values(14); +savepoint my_savepoint; +insert into t1 values(15); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +commit; +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(14) +master-bin.000001 179 Query 1 179 use `test`; COMMIT +delete from t1; +delete from t2; +reset master; +begin; +insert into t1 values(16); +savepoint my_savepoint; +insert into t1 values(17); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +insert into t1 values(18); +commit; +select a from t1 order by a; +a +16 +18 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 use `test`; BEGIN +master-bin.000001 119 Query 1 79 use `test`; insert into t1 values(16) +master-bin.000001 179 Query 1 79 use `test`; insert into t1 values(18) +master-bin.000001 239 Query 1 239 use `test`; COMMIT +drop table t1,t2; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 15d04422f9d..a7579b538b5 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -332,3 +332,12 @@ create table t2(Z varchar(15)); insert into t2(Z) select concat(a.a,b.a,c.a,d.a) from t1 as a, t1 as b, t1 as c, t1 as d; update t2,t3 set Z =param_scenario_costs; drop table t1,t2,t3; +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,1),(2,1),(3,1); +insert into t2 values (1,1), (3,1); +update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL; +select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL; +a b a b +2 2 NULL NULL +drop table t1,t2; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index d158c39cba8..49475c9cbec 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -285,6 +285,17 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei"); +update t1 set b=repeat('a',256); +update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +delete from t1 where i8=1; +select i1,i2 from t1; +i1 i2 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK drop table t1; CREATE TABLE `t1` ( `post_id` mediumint(8) unsigned NOT NULL auto_increment, @@ -365,8 +376,47 @@ explain select * from t1 use index() where c=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where drop table t1,t2; +create table t1 (a int not null auto_increment primary key, b varchar(255)); +insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100)); +update t1 set b=repeat(left(b,1),200) where a=1; +delete from t1 where (a & 1)= 0; +update t1 set b=repeat('e',200) where a=1; +flush tables; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +update t1 set b=repeat(left(b,1),255) where a between 1 and 5; +update t1 set b=repeat(left(b,1),10) where a between 32 and 43; +update t1 set b=repeat(left(b,1),2) where a between 64 and 66; +update t1 set b=repeat(left(b,1),65) where a between 67 and 70; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +insert into t1 (b) values (repeat('z',100)); +update t1 set b="test" where left(b,1) > 'n'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) TYPE=MyISAM; ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX' -DROP TABLE IF EXISTS t1; -Warnings: -Note 1051 Unknown table 't1' +create table t1 (a int, b varchar(200), c text not null) checksum=1; +create table t2 (a int, b varchar(200), c text not null) checksum=0; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +checksum table t1, t2, t3 quick; +Table Checksum +test.t1 968604391 +test.t2 NULL +test.t3 NULL +checksum table t1, t2, t3; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 NULL +checksum table t1, t2, t3 extended; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 NULL +drop table t1,t2; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result new file mode 100644 index 00000000000..cf1ef55ca69 --- /dev/null +++ b/mysql-test/r/mysqldump.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); + + + +DROP TABLE IF EXISTS t1; +LOCK TABLES t1 WRITE; + + + 1 + + + 2 + +
+UNLOCK TABLES; +
+
+DROP TABLE t1; diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index 0b7a98e3fb3..84e37bf56a9 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -254,3 +254,18 @@ ERROR 42000: This version of MySQL doesn't yet support 'CUBE' select product, country_id , year, sum(profit) from t1 group by product, country_id, year with cube union all select product, country_id , year, sum(profit) from t1 group by product, country_id, year with rollup; ERROR 42000: This version of MySQL doesn't yet support 'CUBE' drop table t1,t2; +CREATE TABLE t1 (i int); +INSERT INTO t1 VALUES(100); +CREATE TABLE t2 (i int); +INSERT INTO t2 VALUES (100),(200); +SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP; +i COUNT(*) +100 1 +NULL 1 +SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP; +i i COUNT(*) +100 100 1 +100 200 1 +100 NULL 2 +NULL NULL 2 +drop table t1,t2; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index afc4b12a341..4cf6bee6123 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -3,29 +3,29 @@ 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"; +grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user1@localhost' to database 'test' +ERROR 42000: Access denied for user: 'ssl_user1'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user2@localhost' to database 'test' +ERROR 42000: Access denied for user: 'ssl_user2'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user3@localhost' to database 'test' +ERROR 42000: Access denied for user: 'ssl_user3'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user4@localhost' to database 'test' +ERROR 42000: 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; diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index 6e3c459b39d..5729d7af166 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -5,12 +5,12 @@ set net_buffer_length=100; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; len 1024 -select repeat('a',200); -repeat('a',200) +select repeat('a',2000); +repeat('a',2000) NULL select @@net_buffer_length, @@max_allowed_packet; @@net_buffer_length @@max_allowed_packet -1024 80 +1024 1024 SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; ERROR 08S01: Got a packet bigger than 'max_allowed_packet' set global max_allowed_packet=default; @@ -20,6 +20,6 @@ set net_buffer_length=default; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; len 100 -select length(repeat('a',200)); -length(repeat('a',200)) -200 +select length(repeat('a',2000)); +length(repeat('a',2000)) +2000 diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 420281b7ef2..d1ef5ab828e 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -2,7 +2,7 @@ flush query cache; flush query cache; reset query cache; flush status; -drop table if exists t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t00,mysqltest.t1; +drop table if exists t1,t2,t3; drop database if exists mysqltest; create table t1 (a int not null); insert into t1 values (1),(2),(3); @@ -709,536 +709,3 @@ Variable_name Value Qcache_queries_in_cache 2 SET OPTION SQL_SELECT_LIMIT=DEFAULT; drop table t1; -flush status; -create table t0(a int); -create table t1(a int); -create table t2(a int); -create table t3(a int); -create table t4(a int); -create table t5(a int); -create table t6(a int); -create table t7(a int); -create table t8(a int); -create table t9(a int); -create table t10(a int); -create table t11(a int); -create table t12(a int); -create table t13(a int); -create table t14(a int); -create table t15(a int); -create table t16(a int); -create table t17(a int); -create table t18(a int); -create table t19(a int); -create table t20(a int); -create table t21(a int); -create table t22(a int); -create table t23(a int); -create table t24(a int); -create table t25(a int); -create table t26(a int); -create table t27(a int); -create table t28(a int); -create table t29(a int); -create table t30(a int); -create table t31(a int); -create table t32(a int); -create table t33(a int); -create table t34(a int); -create table t35(a int); -create table t36(a int); -create table t37(a int); -create table t38(a int); -create table t39(a int); -create table t40(a int); -create table t41(a int); -create table t42(a int); -create table t43(a int); -create table t44(a int); -create table t45(a int); -create table t46(a int); -create table t47(a int); -create table t48(a int); -create table t49(a int); -create table t50(a int); -create table t51(a int); -create table t52(a int); -create table t53(a int); -create table t54(a int); -create table t55(a int); -create table t56(a int); -create table t57(a int); -create table t58(a int); -create table t59(a int); -create table t60(a int); -create table t61(a int); -create table t62(a int); -create table t63(a int); -create table t64(a int); -create table t65(a int); -create table t66(a int); -create table t67(a int); -create table t68(a int); -create table t69(a int); -create table t70(a int); -create table t71(a int); -create table t72(a int); -create table t73(a int); -create table t74(a int); -create table t75(a int); -create table t76(a int); -create table t77(a int); -create table t78(a int); -create table t79(a int); -create table t80(a int); -create table t81(a int); -create table t82(a int); -create table t83(a int); -create table t84(a int); -create table t85(a int); -create table t86(a int); -create table t87(a int); -create table t88(a int); -create table t89(a int); -create table t90(a int); -create table t91(a int); -create table t92(a int); -create table t93(a int); -create table t94(a int); -create table t95(a int); -create table t96(a int); -create table t97(a int); -create table t98(a int); -create table t99(a int); -create table t100(a int); -create table t101(a int); -create table t102(a int); -create table t103(a int); -create table t104(a int); -create table t105(a int); -create table t106(a int); -create table t107(a int); -create table t108(a int); -create table t109(a int); -create table t110(a int); -create table t111(a int); -create table t112(a int); -create table t113(a int); -create table t114(a int); -create table t115(a int); -create table t116(a int); -create table t117(a int); -create table t118(a int); -create table t119(a int); -create table t120(a int); -create table t121(a int); -create table t122(a int); -create table t123(a int); -create table t124(a int); -create table t125(a int); -create table t126(a int); -create table t127(a int); -create table t128(a int); -create table t129(a int); -create table t130(a int); -create table t131(a int); -create table t132(a int); -create table t133(a int); -create table t134(a int); -create table t135(a int); -create table t136(a int); -create table t137(a int); -create table t138(a int); -create table t139(a int); -create table t140(a int); -create table t141(a int); -create table t142(a int); -create table t143(a int); -create table t144(a int); -create table t145(a int); -create table t146(a int); -create table t147(a int); -create table t148(a int); -create table t149(a int); -create table t150(a int); -create table t151(a int); -create table t152(a int); -create table t153(a int); -create table t154(a int); -create table t155(a int); -create table t156(a int); -create table t157(a int); -create table t158(a int); -create table t159(a int); -create table t160(a int); -create table t161(a int); -create table t162(a int); -create table t163(a int); -create table t164(a int); -create table t165(a int); -create table t166(a int); -create table t167(a int); -create table t168(a int); -create table t169(a int); -create table t170(a int); -create table t171(a int); -create table t172(a int); -create table t173(a int); -create table t174(a int); -create table t175(a int); -create table t176(a int); -create table t177(a int); -create table t178(a int); -create table t179(a int); -create table t180(a int); -create table t181(a int); -create table t182(a int); -create table t183(a int); -create table t184(a int); -create table t185(a int); -create table t186(a int); -create table t187(a int); -create table t188(a int); -create table t189(a int); -create table t190(a int); -create table t191(a int); -create table t192(a int); -create table t193(a int); -create table t194(a int); -create table t195(a int); -create table t196(a int); -create table t197(a int); -create table t198(a int); -create table t199(a int); -create table t200(a int); -create table t201(a int); -create table t202(a int); -create table t203(a int); -create table t204(a int); -create table t205(a int); -create table t206(a int); -create table t207(a int); -create table t208(a int); -create table t209(a int); -create table t210(a int); -create table t211(a int); -create table t212(a int); -create table t213(a int); -create table t214(a int); -create table t215(a int); -create table t216(a int); -create table t217(a int); -create table t218(a int); -create table t219(a int); -create table t220(a int); -create table t221(a int); -create table t222(a int); -create table t223(a int); -create table t224(a int); -create table t225(a int); -create table t226(a int); -create table t227(a int); -create table t228(a int); -create table t229(a int); -create table t230(a int); -create table t231(a int); -create table t232(a int); -create table t233(a int); -create table t234(a int); -create table t235(a int); -create table t236(a int); -create table t237(a int); -create table t238(a int); -create table t239(a int); -create table t240(a int); -create table t241(a int); -create table t242(a int); -create table t243(a int); -create table t244(a int); -create table t245(a int); -create table t246(a int); -create table t247(a int); -create table t248(a int); -create table t249(a int); -create table t250(a int); -create table t251(a int); -create table t252(a int); -create table t253(a int); -create table t254(a int); -create table t255(a int); -create table t256(a int); -create table t00 (a int) type=MERGE UNION=(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256) INSERT_METHOD=FIRST; -insert into t0 values (1),(2); -insert into t1 values (1),(2); -insert into t2 values (1),(2); -insert into t3 values (1),(2); -insert into t4 values (1),(2); -insert into t5 values (1),(2); -insert into t6 values (1),(2); -insert into t7 values (1),(2); -insert into t8 values (1),(2); -insert into t9 values (1),(2); -insert into t10 values (1),(2); -insert into t11 values (1),(2); -insert into t12 values (1),(2); -insert into t13 values (1),(2); -insert into t14 values (1),(2); -insert into t15 values (1),(2); -insert into t16 values (1),(2); -insert into t17 values (1),(2); -insert into t18 values (1),(2); -insert into t19 values (1),(2); -insert into t20 values (1),(2); -insert into t21 values (1),(2); -insert into t22 values (1),(2); -insert into t23 values (1),(2); -insert into t24 values (1),(2); -insert into t25 values (1),(2); -insert into t26 values (1),(2); -insert into t27 values (1),(2); -insert into t28 values (1),(2); -insert into t29 values (1),(2); -insert into t30 values (1),(2); -insert into t31 values (1),(2); -insert into t32 values (1),(2); -insert into t33 values (1),(2); -insert into t34 values (1),(2); -insert into t35 values (1),(2); -insert into t36 values (1),(2); -insert into t37 values (1),(2); -insert into t38 values (1),(2); -insert into t39 values (1),(2); -insert into t40 values (1),(2); -insert into t41 values (1),(2); -insert into t42 values (1),(2); -insert into t43 values (1),(2); -insert into t44 values (1),(2); -insert into t45 values (1),(2); -insert into t46 values (1),(2); -insert into t47 values (1),(2); -insert into t48 values (1),(2); -insert into t49 values (1),(2); -insert into t50 values (1),(2); -insert into t51 values (1),(2); -insert into t52 values (1),(2); -insert into t53 values (1),(2); -insert into t54 values (1),(2); -insert into t55 values (1),(2); -insert into t56 values (1),(2); -insert into t57 values (1),(2); -insert into t58 values (1),(2); -insert into t59 values (1),(2); -insert into t60 values (1),(2); -insert into t61 values (1),(2); -insert into t62 values (1),(2); -insert into t63 values (1),(2); -insert into t64 values (1),(2); -insert into t65 values (1),(2); -insert into t66 values (1),(2); -insert into t67 values (1),(2); -insert into t68 values (1),(2); -insert into t69 values (1),(2); -insert into t70 values (1),(2); -insert into t71 values (1),(2); -insert into t72 values (1),(2); -insert into t73 values (1),(2); -insert into t74 values (1),(2); -insert into t75 values (1),(2); -insert into t76 values (1),(2); -insert into t77 values (1),(2); -insert into t78 values (1),(2); -insert into t79 values (1),(2); -insert into t80 values (1),(2); -insert into t81 values (1),(2); -insert into t82 values (1),(2); -insert into t83 values (1),(2); -insert into t84 values (1),(2); -insert into t85 values (1),(2); -insert into t86 values (1),(2); -insert into t87 values (1),(2); -insert into t88 values (1),(2); -insert into t89 values (1),(2); -insert into t90 values (1),(2); -insert into t91 values (1),(2); -insert into t92 values (1),(2); -insert into t93 values (1),(2); -insert into t94 values (1),(2); -insert into t95 values (1),(2); -insert into t96 values (1),(2); -insert into t97 values (1),(2); -insert into t98 values (1),(2); -insert into t99 values (1),(2); -insert into t100 values (1),(2); -insert into t101 values (1),(2); -insert into t102 values (1),(2); -insert into t103 values (1),(2); -insert into t104 values (1),(2); -insert into t105 values (1),(2); -insert into t106 values (1),(2); -insert into t107 values (1),(2); -insert into t108 values (1),(2); -insert into t109 values (1),(2); -insert into t110 values (1),(2); -insert into t111 values (1),(2); -insert into t112 values (1),(2); -insert into t113 values (1),(2); -insert into t114 values (1),(2); -insert into t115 values (1),(2); -insert into t116 values (1),(2); -insert into t117 values (1),(2); -insert into t118 values (1),(2); -insert into t119 values (1),(2); -insert into t120 values (1),(2); -insert into t121 values (1),(2); -insert into t122 values (1),(2); -insert into t123 values (1),(2); -insert into t124 values (1),(2); -insert into t125 values (1),(2); -insert into t126 values (1),(2); -insert into t127 values (1),(2); -insert into t128 values (1),(2); -insert into t129 values (1),(2); -insert into t130 values (1),(2); -insert into t131 values (1),(2); -insert into t132 values (1),(2); -insert into t133 values (1),(2); -insert into t134 values (1),(2); -insert into t135 values (1),(2); -insert into t136 values (1),(2); -insert into t137 values (1),(2); -insert into t138 values (1),(2); -insert into t139 values (1),(2); -insert into t140 values (1),(2); -insert into t141 values (1),(2); -insert into t142 values (1),(2); -insert into t143 values (1),(2); -insert into t144 values (1),(2); -insert into t145 values (1),(2); -insert into t146 values (1),(2); -insert into t147 values (1),(2); -insert into t148 values (1),(2); -insert into t149 values (1),(2); -insert into t150 values (1),(2); -insert into t151 values (1),(2); -insert into t152 values (1),(2); -insert into t153 values (1),(2); -insert into t154 values (1),(2); -insert into t155 values (1),(2); -insert into t156 values (1),(2); -insert into t157 values (1),(2); -insert into t158 values (1),(2); -insert into t159 values (1),(2); -insert into t160 values (1),(2); -insert into t161 values (1),(2); -insert into t162 values (1),(2); -insert into t163 values (1),(2); -insert into t164 values (1),(2); -insert into t165 values (1),(2); -insert into t166 values (1),(2); -insert into t167 values (1),(2); -insert into t168 values (1),(2); -insert into t169 values (1),(2); -insert into t170 values (1),(2); -insert into t171 values (1),(2); -insert into t172 values (1),(2); -insert into t173 values (1),(2); -insert into t174 values (1),(2); -insert into t175 values (1),(2); -insert into t176 values (1),(2); -insert into t177 values (1),(2); -insert into t178 values (1),(2); -insert into t179 values (1),(2); -insert into t180 values (1),(2); -insert into t181 values (1),(2); -insert into t182 values (1),(2); -insert into t183 values (1),(2); -insert into t184 values (1),(2); -insert into t185 values (1),(2); -insert into t186 values (1),(2); -insert into t187 values (1),(2); -insert into t188 values (1),(2); -insert into t189 values (1),(2); -insert into t190 values (1),(2); -insert into t191 values (1),(2); -insert into t192 values (1),(2); -insert into t193 values (1),(2); -insert into t194 values (1),(2); -insert into t195 values (1),(2); -insert into t196 values (1),(2); -insert into t197 values (1),(2); -insert into t198 values (1),(2); -insert into t199 values (1),(2); -insert into t200 values (1),(2); -insert into t201 values (1),(2); -insert into t202 values (1),(2); -insert into t203 values (1),(2); -insert into t204 values (1),(2); -insert into t205 values (1),(2); -insert into t206 values (1),(2); -insert into t207 values (1),(2); -insert into t208 values (1),(2); -insert into t209 values (1),(2); -insert into t210 values (1),(2); -insert into t211 values (1),(2); -insert into t212 values (1),(2); -insert into t213 values (1),(2); -insert into t214 values (1),(2); -insert into t215 values (1),(2); -insert into t216 values (1),(2); -insert into t217 values (1),(2); -insert into t218 values (1),(2); -insert into t219 values (1),(2); -insert into t220 values (1),(2); -insert into t221 values (1),(2); -insert into t222 values (1),(2); -insert into t223 values (1),(2); -insert into t224 values (1),(2); -insert into t225 values (1),(2); -insert into t226 values (1),(2); -insert into t227 values (1),(2); -insert into t228 values (1),(2); -insert into t229 values (1),(2); -insert into t230 values (1),(2); -insert into t231 values (1),(2); -insert into t232 values (1),(2); -insert into t233 values (1),(2); -insert into t234 values (1),(2); -insert into t235 values (1),(2); -insert into t236 values (1),(2); -insert into t237 values (1),(2); -insert into t238 values (1),(2); -insert into t239 values (1),(2); -insert into t240 values (1),(2); -insert into t241 values (1),(2); -insert into t242 values (1),(2); -insert into t243 values (1),(2); -insert into t244 values (1),(2); -insert into t245 values (1),(2); -insert into t246 values (1),(2); -insert into t247 values (1),(2); -insert into t248 values (1),(2); -insert into t249 values (1),(2); -insert into t250 values (1),(2); -insert into t251 values (1),(2); -insert into t252 values (1),(2); -insert into t253 values (1),(2); -insert into t254 values (1),(2); -insert into t255 values (1),(2); -insert into t256 values (1),(2); -select count(*) from t00; -count(*) -514 -select count(*) from t00; -count(*) -514 -show status like "Qcache_queries_in_cache"; -Variable_name Value -Qcache_queries_in_cache 1 -show status like "Qcache_hits"; -Variable_name Value -Qcache_hits 1 -delete from t256; -show status like "Qcache_queries_in_cache"; -Variable_name Value -Qcache_queries_in_cache 0 -drop table t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t00; diff --git a/mysql-test/r/query_cache_merge.result b/mysql-test/r/query_cache_merge.result new file mode 100644 index 00000000000..c6df4266de2 --- /dev/null +++ b/mysql-test/r/query_cache_merge.result @@ -0,0 +1,20 @@ +SET @@global.query_cache_size=1355776; +flush status; +select count(*) from t00; +count(*) +514 +select count(*) from t00; +count(*) +514 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +delete from t256; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00; +SET @@global.query_cache_size=0; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 247221a92f3..9f76676ee1a 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -226,3 +226,63 @@ insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"), select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1; id1 idnull drop table t1; +create table t1 (x int, y int, index(x), index(y)); +insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9); +update t1 set y=x; +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 range x x 5 NULL 4 Using where +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 range x x 5 NULL 4 Using where +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1) +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 1) +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref y y 5 const 1 Using where +1 SIMPLE t2 range x x 5 NULL 2 Using where +explain select count(*) from t1 where x in (1); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range x x 5 NULL 1 Using where; Using index +explain select count(*) from t1 where x in (1,2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range x x 5 NULL 2 Using where; Using index +drop table t1; +CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1)); +INSERT INTO t1 VALUES (0),(0),(1),(1); +CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya)); +INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); +explain select * from t1, t2 where (t1.key1 =0; +master_pos_wait('master-bin.001',3000)>=0 +1 select * from t1 where a=8000; a 8000 diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result index ad92ee5b491..8288bd66a9d 100644 --- a/mysql-test/r/rpl_replicate_do.result +++ b/mysql-test/r/rpl_replicate_do.result @@ -27,5 +27,5 @@ select * from t11; ERROR 42S02: Table 'test.t11' doesn't exist drop table if exists t1,t2,t11; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.000001 1281 slave-relay-bin.000002 1325 master-bin.000001 Yes Yes test.t1 0 0 1281 1325 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_PORT 1 master-bin.000001 1281 slave-relay-bin.000002 1325 master-bin.000001 Yes Yes test.t1 0 0 1281 1325 None 0 No diff --git a/mysql-test/r/rpl_reset_slave.result b/mysql-test/r/rpl_reset_slave.result index 239c4158410..6318e3a0ecd 100644 --- a/mysql-test/r/rpl_reset_slave.result +++ b/mysql-test/r/rpl_reset_slave.result @@ -5,18 +5,18 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No stop slave; change master to master_user='test'; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 test MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 79 4 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 test MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 79 4 None 0 No reset slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No start slave; show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_PORT 1 master-bin.000001 79 slave-relay-bin.000002 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 7c5057c7fb2..73e578baf75 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -15,8 +15,8 @@ insert into temp_table values ("testing temporary tables"); create table t1 (s text); insert into t1 values('Could not break slave'),('Tried hard'); show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 60 master-bin.000001 417 slave-relay-bin.000001 461 master-bin.000001 Yes Yes 0 0 417 461 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_PORT 60 master-bin.000001 417 slave-relay-bin.000001 461 master-bin.000001 Yes Yes 0 0 417 461 None 0 No select * from t1; s Could not break slave @@ -56,8 +56,8 @@ Log_name master-bin.000003 insert into t2 values (65); show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 60 master-bin.000003 290 slave-relay-bin.000001 1088 master-bin.000003 Yes Yes 0 0 290 1088 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_PORT 60 master-bin.000003 290 slave-relay-bin.000001 1088 master-bin.000003 Yes Yes 0 0 290 1088 None 0 No select * from t2; m 34 @@ -80,8 +80,8 @@ select * from t4; a testing temporary tables part 2 show slave status; -Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space -127.0.0.1 root MASTER_PORT 60 master-bin.000004 2886 slave-relay-bin.000001 7891 master-bin.000004 Yes Yes 0 0 2886 7891 +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_PORT 60 master-bin.000004 2886 slave-relay-bin.000001 7891 master-bin.000004 Yes Yes 0 0 2886 7891 None 0 No lock tables t3 read; select count(*) from t3 where n >= 4; count(*) diff --git a/mysql-test/r/rpl_until.result b/mysql-test/r/rpl_until.result new file mode 100644 index 00000000000..ee5ceb28bd8 --- /dev/null +++ b/mysql-test/r/rpl_until.result @@ -0,0 +1,72 @@ +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(n int not null auto_increment primary key); +insert into t1 values (1),(2),(3),(4); +drop table t1; +create table t2(n int not null auto_increment primary key); +insert into t2 values (1),(2); +insert into t2 values (3),(4); +drop table t2; +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1(n int not null auto_increment primary key) +master-bin.000001 172 Query 1 172 use `test`; insert into t1 values (1),(2),(3),(4) +master-bin.000001 244 Query 1 244 use `test`; drop table t1 +master-bin.000001 292 Query 1 292 use `test`; create table t2(n int not null auto_increment primary key) +master-bin.000001 385 Query 1 385 use `test`; insert into t2 values (1),(2) +master-bin.000001 449 Query 1 449 use `test`; insert into t2 values (3),(4) +master-bin.000001 513 Query 1 513 use `test`; drop table t2 +start slave until master_log_file='master-bin.000001', master_log_pos=244; +select * from t1; +n +1 +2 +3 +4 +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 332 master-bin.000001 Yes No 0 0 244 649 Master master-bin.000001 244 No +start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; +select * from t1; +n +1 +2 +3 +4 +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 332 master-bin.000001 Yes No 0 0 244 649 Master master-no-such-bin.000001 291 No +start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537; +select * from t2; +n +1 +2 +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 537 master-bin.000001 Yes No 0 0 449 649 Relay slave-relay-bin.000002 537 No +start slave; +stop slave; +start slave until master_log_file='master-bin.000001', master_log_pos=561; +show slave status; +Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Replicate_do_table Replicate_ignore_table Replicate_wild_do_table Replicate_wild_ignore_table Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Until_condition Until_Log_File Until_Log_pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key +127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 649 master-bin.000001 Yes No 0 0 561 693 Master master-bin.000001 561 No +start slave until master_log_file='master-bin', master_log_pos=561; +ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; +ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +start slave until master_log_file='master-bin.000001'; +ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +start slave until relay_log_file='slave-relay-bin.000002'; +ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; +ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +start slave sql_thread; +start slave until master_log_file='master-bin.000001', master_log_pos=561; +Warnings: +Note 1253 Slave is already running diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result index b715b750b68..71147772ac4 100644 --- a/mysql-test/r/rpl_user_variables.result +++ b/mysql-test/r/rpl_user_variables.result @@ -21,6 +21,7 @@ set @q:='abc'; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')); set @a:=5; insert into t1 values (@a),(@a); +insert into t1 values (@a),(@a),(@a*5); select * from t1; n 12345678901234 @@ -45,6 +46,36 @@ abcn1 abcn1n2 5 5 +NULL +NULL +NULL +select * from t1; +n +12345678901234 +-12345678901234 +0 +-1 +12.5 +-12.5 +This is a test + +abc'def +abc\def +abc'def +NULL +NULL +0 +1 +2 +5 +abc +abcn1 +abcn1n2 +5 +5 +NULL +NULL +NULL show binlog events from 141; Log_name Pos Event_type Server_id Orig_log_pos Info slave-bin.000001 141 User var 2 141 @i1=12345678901234 @@ -63,13 +94,16 @@ slave-bin.000001 719 User var 2 719 @s5='abc'def' slave-bin.000001 761 Query 1 761 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) slave-bin.000001 851 User var 2 851 @n1=NULL slave-bin.000001 877 Query 1 877 use `test`; insert into t1 values (@n1) -slave-bin.000001 939 Query 1 939 use `test`; insert into t1 values (@n2) -slave-bin.000001 1001 Query 1 1001 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) -slave-bin.000001 1089 User var 2 1089 @a=2 -slave-bin.000001 1131 Query 1 1131 use `test`; insert into t1 values (@a+(@b:=@a+1)) -slave-bin.000001 1203 User var 2 1203 @q='abc' -slave-bin.000001 1240 Query 1 1240 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) -slave-bin.000001 1344 User var 2 1344 @a=5 -slave-bin.000001 1386 Query 1 1386 use `test`; insert into t1 values (@a),(@a) +slave-bin.000001 939 User var 2 939 @n2=NULL +slave-bin.000001 965 Query 1 965 use `test`; insert into t1 values (@n2) +slave-bin.000001 1027 Query 1 1027 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) +slave-bin.000001 1115 User var 2 1115 @a=2 +slave-bin.000001 1157 Query 1 1157 use `test`; insert into t1 values (@a+(@b:=@a+1)) +slave-bin.000001 1229 User var 2 1229 @q='abc' +slave-bin.000001 1266 Query 1 1266 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) +slave-bin.000001 1370 User var 2 1370 @a=5 +slave-bin.000001 1412 Query 1 1412 use `test`; insert into t1 values (@a),(@a) +slave-bin.000001 1478 User var 2 1478 @a=NULL +slave-bin.000001 1503 Query 1 1503 use `test`; insert into t1 values (@a),(@a),(@a*5) drop table t1; stop slave; diff --git a/mysql-test/r/sel000033.result b/mysql-test/r/sel000033.result deleted file mode 100644 index 1bfafaf5b27..00000000000 --- a/mysql-test/r/sel000033.result +++ /dev/null @@ -1,14 +0,0 @@ -drop table if exists t1; -create table t1 (id int(10) primary key); -insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9); -select id from t1 where id in (2,5,9) ; -id -2 -5 -9 -select id from t1 where id=2 or id=5 or id=9 ; -id -2 -5 -9 -drop table t1; diff --git a/mysql-test/r/sel000100.result b/mysql-test/r/sel000100.result deleted file mode 100644 index 3ffa4004b84..00000000000 --- a/mysql-test/r/sel000100.result +++ /dev/null @@ -1,38 +0,0 @@ -DROP TABLE IF EXISTS t1,t2; -CREATE TABLE t1 ( -ID int(11) NOT NULL auto_increment, -NAME varchar(75) DEFAULT '' NOT NULL, -LINK_ID int(11) DEFAULT '0' NOT NULL, -PRIMARY KEY (ID), -KEY NAME (NAME), -KEY LINK_ID (LINK_ID) -); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0); -CREATE TABLE t2 ( -ID int(11) NOT NULL auto_increment, -NAME varchar(150) DEFAULT '' NOT NULL, -PRIMARY KEY (ID), -KEY NAME (NAME) -); -SELECT DISTINCT -t2.id AS key_link_id, -t2.name AS link -FROM t1 -LEFT JOIN t2 ON t1.link_id=t2.id -GROUP BY t1.id -ORDER BY link; -key_link_id link -NULL NULL -drop table t1,t2; -CREATE TABLE t1 ( -html varchar(5) default NULL, -rin int(11) default '0', -out int(11) default '0' -) TYPE=MyISAM; -INSERT INTO t1 VALUES ('1',1,0); -SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; -html prod -1 0.00 -drop table t1; diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result index 446dd41e216..4930d20f702 100644 --- a/mysql-test/r/select_safe.result +++ b/mysql-test/r/select_safe.result @@ -67,12 +67,12 @@ analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); -explain select * from t1,t1 as t2 where t1.b=t2.b; +explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL b NULL NULL NULL 21 1 SIMPLE t2 ALL b NULL NULL NULL 16 Using where set MAX_SEEKS_FOR_KEY=1; -explain select * from t1,t1 as t2 where t1.b=t2.b; +explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL b NULL NULL NULL 21 1 SIMPLE t2 ref b b 21 test.t1.b 6 Using where diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 201d1b541ae..2a5955e6d87 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -43,7 +43,7 @@ wait_timeout 28800 show variables like "this_doesn't_exists%"; Variable_name Value show table status from test like "this_doesn't_exists%"; -Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Charset Create_options Comment +Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment show databases; Database mysql @@ -227,6 +227,12 @@ select * from t1; type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob 0 1 NULL NULL NULL NULL NULL NULL NULL NULL 2003-02-07 10:00:01 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL drop table t1; +create table t1 (a int not null); +create table t2 select max(a) from t1; +show columns from t2; +Field Type Null Key Default Extra +max(a) bigint(20) YES NULL +drop table t1,t2; create table t1 (c decimal, d double, f float, r real); show columns from t1; Field Type Null Key Default Extra diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 81eae4a2efe..f8d7da5a92e 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -42,6 +42,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY system NULL NULL NULL NULL 1 3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1275 Field or reference 'a' of SELECT #3 was resolved in SELECT #1 +Note 1275 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 @@ -207,6 +210,8 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where +Warnings: +Note 1275 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1 select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -290,8 +295,11 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 Using where +Warnings: +Note 1275 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1 +Note 1275 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1 select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); create table t7( uq int primary key, name char(25)); insert into t7 values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta"); @@ -305,6 +313,8 @@ explain select * from t6 where exists (select * from t7 where uq = clinic_uq); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t6 ALL NULL NULL NULL NULL 4 Using where 2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 +Warnings: +Note 1275 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1 select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); ERROR 23000: Column: 'a' in field list is ambiguous drop table if exists t1,t2,t3; @@ -348,7 +358,7 @@ SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'); pseudo joce SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo LIKE '%joce%'); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row drop table if exists t1,t2,t3,t4,t5,t6,t7,t8; CREATE TABLE `t1` ( `topic` mediumint(8) unsigned NOT NULL default '0', @@ -378,7 +388,7 @@ SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1; 1 1 SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1; -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row EXPLAIN SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL topic 3 NULL 2 Using index @@ -465,9 +475,9 @@ UNIQUE KEY `maxnumrep` (`maxnumrep`) ) TYPE=MyISAM ROW_FORMAT=FIXED; INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1); select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row drop table t1; create table t1 (a int); insert into t1 values (1),(2),(3); @@ -480,7 +490,7 @@ drop table t1; CREATE TABLE t1 (field char(1) NOT NULL DEFAULT 'b'); INSERT INTO t1 VALUES (); SELECT field FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) a HAVING field='b'); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL default '0', @@ -498,7 +508,7 @@ SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=1) FROM (SELECT numreponse (SELECT numeropost FROM t1 HAVING numreponse=1) INSERT INTO t1 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test'); EXPLAIN SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1'); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row EXPLAIN SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away @@ -525,7 +535,7 @@ a b update t1 set b= (select b from t1); ERROR HY000: You can't specify target table 't1' for update in FROM clause update t1 set b= (select b from t2); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row update t1 set b= (select b from t2 where t1.a = t2.a); select * from t1; a b @@ -548,7 +558,7 @@ a b delete from t1 where b = (select b from t1); ERROR HY000: You can't specify target table 't1' for update in FROM clause delete from t1 where b = (select b from t2); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row delete from t1 where b = (select b from t2 where t1.a = t2.a); select * from t1; a b @@ -574,7 +584,7 @@ a b delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a); ERROR HY000: You can't specify target table 't12' for update in FROM clause delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a); select * from t11; a b @@ -593,7 +603,7 @@ insert into t3 values (1),(2); INSERT INTO t1 (x) VALUES ((SELECT x FROM t1)); ERROR HY000: You can't specify target table 't1' for update in FROM clause INSERT INTO t1 (x) VALUES ((SELECT b FROM t3)); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row INSERT INTO t1 (x) VALUES ((SELECT a FROM t2)); select * from t1; x @@ -635,7 +645,7 @@ x y replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2)); ERROR HY000: You can't specify target table 't1' for update in FROM clause replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2)); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2)); select * from t1; x y @@ -706,7 +716,7 @@ id CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1; INSERT INTO t1 values (1),(1); UPDATE t2 SET id=(SELECT * FROM t1); -ERROR 21000: Subselect returns more than 1 record +ERROR 21000: Subquery returns more than 1 row drop table t2, t1; create table t1 (a int); insert into t1 values (1),(2),(3); @@ -813,6 +823,7 @@ explain select (select a+1) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Warnings: +Note 1275 Field or reference 'a' of SELECT #2 was resolved in SELECT #1 Note 1248 Select 2 was reduced during optimisation select (select a+1) from t1; (select a+1) @@ -833,7 +844,7 @@ a t1.a in (select t2.a from t2) explain SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index -2 DEPENDENT SUBQUERY t2 index_in a a 5 func 2 Using where; Using index +2 DEPENDENT SUBQUERY t2 index_subquery a a 5 func 2 Using index CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -1039,6 +1050,9 @@ t1 CREATE TABLE `t1` ( ) TYPE=MyISAM CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; +select * from t1; +a +2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1176,7 +1190,7 @@ insert into t1 values (1,0), (2,0), (3,0); insert into t2 values (1,1), (2,1), (3,1), (2,2); update ignore t1 set b=(select b from t2 where t1.a=t2.a); Warnings: -Error 1241 Subselect returns more than 1 record +Error 1241 Subquery returns more than 1 row select * from t1; a b 1 1 @@ -1244,7 +1258,7 @@ a explain select * from t2 where t2.a in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index -2 DEPENDENT SUBQUERY t1 simple_in PRIMARY PRIMARY 4 func 1 Using index +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1252,7 +1266,7 @@ a explain select * from t2 where t2.a in (select a from t1 where t1.b <> 30); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 Using where; Using index -2 DEPENDENT SUBQUERY t1 simple_in PRIMARY PRIMARY 4 func 1 Using index; Using where +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1277,7 +1291,7 @@ a explain select * from t2 where t2.a in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_in a a 5 func 1001 Using index +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a 2 @@ -1285,7 +1299,7 @@ a explain select * from t2 where t2.a in (select a from t1 where t1.b <> 30); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_in a a 5 func 1001 Using index; Using where +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 @@ -1308,7 +1322,7 @@ a explain select * from t2 where t2.a in (select a from t1 where t1.b <> 30); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index -2 DEPENDENT SUBQUERY t1 index_in a a 5 func 1001 Using index; Using where +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 Using index; Using where drop table t1, t2, t3; create table t1 (a int, b int); create table t2 (a int, b int); @@ -1348,6 +1362,60 @@ a 2 10 drop table t1,t2,t3; +CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci, +s2 CHAR(5) COLLATE latin1_swedish_ci); +INSERT INTO t1 VALUES ('z','?'); +select * from t1 where s1 > (select max(s2) from t1); +ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>' +select * from t1 where s1 > any (select max(s2) from t1); +ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>' +drop table t1; +create table t1(toid int,rd int); +create table t2(userid int,pmnew int,pmtotal int); +insert into t2 values(1,0,0),(2,0,0); +insert into t1 values(1,0),(1,0),(1,0),(1,12),(1,15),(1,123),(1,12312),(1,12312),(1,123),(2,0),(2,0),(2,1),(2,2); +select userid,pmtotal,pmnew, (select count(rd) from t1 where toid=t2.userid) calc_total, (select count(rd) from t1 where rd=0 and toid=t2.userid) calc_new from t2 where userid in (select distinct toid from t1); +userid pmtotal pmnew calc_total calc_new +1 0 0 9 3 +2 0 0 4 2 +drop table t1, t2; +create table t1 (s1 char(5)); +select (select 'a','b' from t1 union select 'a','b' from t1) from t1; +ERROR 21000: Cardinality error (more/less than 1 columns) +insert into t1 values ('tttt'); +select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1); +s1 +tttt +explain (select * from t1); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +(select * from t1); +s1 +tttt +drop table t1; +create table t1 (s1 char(5), index s1(s1)); +create table t2 (s1 char(5), index s1(s1)); +insert into t1 values ('a1'),('a2'),('a3'); +insert into t2 values ('a1'),('a2'); +select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +s1 s1 NOT IN (SELECT s1 FROM t2) +a1 0 +a2 0 +a3 1 +select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +s1 s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') +a1 0 +a2 1 +a3 1 +explain select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index +explain select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where +drop table t1,t2; create table t2 (a int, b int); create table t3 (a int); insert into t3 values (6),(7),(3); diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index c387d8b2d76..98df44553d2 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -123,9 +123,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 0 const row not found 1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 9 Using where 1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1 -2 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where -3 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where -4 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where -5 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where -6 DEPENDENT SUBQUERY t3 simple_in PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where +2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +5 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where +6 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 32 func 1 Using index; Using where drop table t1, t2, t3, t4; diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index 216fb4d6124..c31d1019d89 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -40,14 +40,12 @@ t9 CREATE TABLE `t9` ( `b` char(16) NOT NULL default '', `c` int(11) NOT NULL default '0', PRIMARY KEY (`a`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' alter table t9 rename t8, add column d int not null; alter table t8 rename t7; rename table t7 to t9; drop table t1; Got one of the listed errors -Warnings: -Note 1008 Can't drop database 'test_mysqltest'; database doesn't exist Got one of the listed errors Got one of the listed errors Got one of the listed errors @@ -64,5 +62,5 @@ t9 CREATE TABLE `t9` ( `c` int(11) NOT NULL default '0', `d` int(11) NOT NULL default '0', PRIMARY KEY (`a`) -) TYPE=MyISAM CHARSET=latin1 +) TYPE=MyISAM CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' drop database mysqltest; diff --git a/mysql-test/r/type_nchar.result b/mysql-test/r/type_nchar.result new file mode 100644 index 00000000000..c495853cd4c --- /dev/null +++ b/mysql-test/r/type_nchar.result @@ -0,0 +1,50 @@ +drop table if exists t1; +create table t1 (c nchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 default NULL +) TYPE=MyISAM CHARSET=latin1 +drop table t1; +create table t1 (c national char(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) character set utf8 default NULL +) TYPE=MyISAM CHARSET=latin1 +drop table t1; +create table t1 (c national varchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) TYPE=MyISAM CHARSET=latin1 +drop table t1; +create table t1 (c nvarchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) TYPE=MyISAM CHARSET=latin1 +drop table t1; +create table t1 (c nchar varchar(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) TYPE=MyISAM CHARSET=latin1 +drop table t1; +create table t1 (c national character varying(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) TYPE=MyISAM CHARSET=latin1 +drop table t1; +create table t1 (c nchar varying(10)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) character set utf8 default NULL +) TYPE=MyISAM CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 1f85e508067..bf47e6ad430 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -103,7 +103,7 @@ a b 2 b select found_rows(); found_rows() -6 +8 explain select a,b from t1 union all select a,b from t2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 @@ -312,6 +312,127 @@ a b 5 f 6 e drop table t1,t2,t3,t4; +create table t1 (a int); +insert into t1 values (1),(2),(3); +create table t2 (a int); +insert into t2 values (3),(4),(5); +(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1; +a +1 +select found_rows(); +found_rows() +6 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2; +a +1 +3 +select found_rows(); +found_rows() +4 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2); +a +1 +3 +4 +5 +select found_rows(); +found_rows() +4 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1); +a +1 +2 +3 +3 +select found_rows(); +found_rows() +4 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1; +ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2; +a +1 +3 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2; +a +1 +2 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2; +a +1 +2 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 100; +a +1 +2 +3 +4 +5 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2; +a +1 +2 +3 +4 +5 +select found_rows(); +found_rows() +5 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2; +a +1 +3 +4 +5 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2; +a +1 +3 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2; +a +3 +4 +select found_rows(); +found_rows() +6 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2; +a +3 +4 +5 +select found_rows(); +found_rows() +5 +SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1; +a +5 +(SELECT * FROM t1 ORDER by a) UNION ALL (SELECT * FROM t2 ORDER BY a) ORDER BY A desc LIMIT 4; +a +5 +4 +3 +3 +(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1; +ERROR 42000: Wrong usage/placement of 'SQL_CALC_FOUND_ROWS' +drop table t1,t2; CREATE TABLE t1 ( id int(3) unsigned default '0') TYPE=MyISAM; INSERT INTO t1 (id) VALUES("1"); CREATE TABLE t2 ( id int(3) unsigned default '0', id_master int(5) default '0', text1 varchar(5) default NULL, text2 varchar(5) default NULL) TYPE=MyISAM; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 23253f60de9..b7c64551dc0 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -5,6 +5,10 @@ set @a := connection_id() + 3; select @a - connection_id(); @a - connection_id() 3 +set @b := 1; +select @b; +@b +1 CREATE TABLE t1 ( i int not null, v int not null,index (i)); insert into t1 values (1,1),(1,3),(2,1); create table t2 (i int not null, unique (i)); diff --git a/mysql-test/std_data/loaddata2.dat b/mysql-test/std_data/loaddata2.dat new file mode 100644 index 00000000000..6e9d6745b8d --- /dev/null +++ b/mysql-test/std_data/loaddata2.dat @@ -0,0 +1,5 @@ +Field A,'Field B' +Field 1,'Field 2' +Field 3,'Field 4' +'Field 5' ,'Field 6' +Field 6, 'Field 7' diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 27755e51b7f..a0fbc56a9da 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -776,3 +776,16 @@ select * from t1; select * from t2; select * from t2; drop table t1,t2; + +# +# The bug #971 +# + +create table t1 (x int not null, index(x)) type=bdb; +insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +select * from t1 where x <= 10 and x >= 7; +select * from t1 where x <= 10 and x >= 7 order by x; +select * from t1 where x <= 10 and x >= 7 order by x desc; +select * from t1 where x <= 8 and x >= 5 order by x desc; +select * from t1 where x < 8 and x > 5 order by x desc; +drop table t1; diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index e6ccc52f0d4..7585ff0f608 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -48,8 +48,9 @@ flush privileges; #connect (con1,localhost,test,gambling2,""); #show tables; connect (con1,localhost,test,gambling2,mysql); +set password=old_password('gambling3'); show tables; -connect (con1,localhost,test,gambling2,test); +connect (con1,localhost,test,gambling3,test); show tables; # Re enable this one day if error handling on connect will take place @@ -63,7 +64,9 @@ show tables; #connect (con1,localhost,test,zorro,); #--error 1045 + # remove user 'test' so that other tests which may use 'test' # do not depend on this test. + delete from mysql.user where user="test"; flush privileges; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index ebb3854309b..0b86b67fdbf 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -219,6 +219,60 @@ drop table t1; # # Bug # 801 # - create table t1 select x'4132'; drop table t1; + +# +# Test types of data for create select with functions +# + +create table t1(a int,b int,c int unsigned,d date,e char,f datetime,g time,h blob); +insert into t1(a)values(1); +insert into t1(a,b,c,d,e,f,g,h) +values(2,-2,2,'1825-12-14','a','2003-1-1 3:2:1','4:3:2','binary data'); +select * from t1; +select a, + ifnull(b,cast(-7 as signed)) as b, + ifnull(c,cast(7 as unsigned)) as c, + ifnull(d,cast('2000-01-01' as date)) as d, + ifnull(e,cast('b' as char)) as e, + ifnull(f,cast('2000-01-01' as datetime)) as f, + ifnull(g,cast('5:4:3' as time)) as g, + ifnull(h,cast('yet another binary data' as binary)) as h, + addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd +from t1; + +create table t2 +select + a, + ifnull(b,cast(-7 as signed)) as b, + ifnull(c,cast(7 as unsigned)) as c, + ifnull(d,cast('2000-01-01' as date)) as d, + ifnull(e,cast('b' as char)) as e, + ifnull(f,cast('2000-01-01' as datetime)) as f, + ifnull(g,cast('5:4:3' as time)) as g, + ifnull(h,cast('yet another binary data' as binary)) as h, + addtime(cast('1:0:0' as time),cast('1:0:0' as time)) as dd +from t1; +explain t2; + +select * from t2; + +drop table t1, t2; + +# +# Bug #1209 +# + +--disable_warnings +drop database if exists test_$1; +--enable_warnings +create database test_$1; +use test_$1; +select database(); +drop database test_$1; +select database(); + +# Connect without a database +connect (user4,localhost,mysqltest_1,,*NO-ONE*); +select database(); diff --git a/mysql-test/t/ctype_mb.test b/mysql-test/t/ctype_mb.test index 5c3e67eec01..96bb634deb3 100644 --- a/mysql-test/t/ctype_mb.test +++ b/mysql-test/t/ctype_mb.test @@ -6,3 +6,14 @@ SHOW CREATE TABLE t1; INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd'); SELECT * FROM t1; DROP TABLE t1; + +CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8, KEY key_a(a(3))); +SHOW CREATE TABLE t1; +SHOW KEYS FROM t1; +ALTER TABLE t1 CHANGE a a CHAR(4); +SHOW CREATE TABLE t1; +SHOW KEYS FROM t1; +ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8; +SHOW CREATE TABLE t1; +SHOW KEYS FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 25df9c0a86b..325a8f075ed 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -13,8 +13,8 @@ DROP TABLE t1; CREATE TABLE ÔÁÂÌÉÃÁ ( - ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL -); + ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ" +) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ"; SHOW TABLES; SHOW CREATE TABLE ÔÁÂÌÉÃÁ; @@ -45,3 +45,8 @@ SHOW TABLES; SHOW TABLES IN òåñò; SET CHARACTER SET koi8r; DROP DATABASE ÔÅÓÔ; + +SET NAMES koi8r; +SELECT hex('ÔÅÓÔ'); +SET character_set_connection=cp1251; +SELECT hex('ÔÅÓÔ'); diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test new file mode 100644 index 00000000000..0457c204e32 --- /dev/null +++ b/mysql-test/t/ctype_ucs.test @@ -0,0 +1,194 @@ +-- source include/have_ucs2.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +SET CHARACTER SET koi8r; + +# +# Check that 0x20 is only trimmed when it is +# a part of real SPACE character, not just a part +# of a multibyte sequence. +# Note, CYRILLIC LETTER ER is used as an example, which +# is stored as 0x0420 in UCS2, thus contains 0x20 in the +# low byte. The second character is THREE-PER-M, U+2004, +# which contains 0x20 in the high byte. +# + +CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2); +INSERT INTO t1 VALUES (_koi8r'ò'), (X'2004'); +SELECT hex(word) FROM t1 ORDER BY word; +DELETE FROM t1; + +# +# Check that real spaces are correctly trimmed. +# + +INSERT INTO t1 VALUES (X'042000200020'), (X'200400200020'); +SELECT hex(word) FROM t1 ORDER BY word; +DROP TABLE t1; + +# +# Check LPAD/RPAD +# +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'0421'); +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'04210422'); +SELECT LPAD(_ucs2 X'0420',10,_ucs2 X'042104220423'); +SELECT LPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423'); + +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'0421'); +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'04210422'); +SELECT RPAD(_ucs2 X'0420',10,_ucs2 X'042104220423'); +SELECT RPAD(_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423'); + +CREATE TABLE t1 SELECT +LPAD(_ucs2 X'0420',10,_ucs2 X'0421') l, +RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r; +SHOW CREATE TABLE t1; +DROP TABLE t1; +###################################################### +# +# Test of like +# + +SET NAMES koi8r; +SET character_set_connection=ucs2; + +create table t1 (a varchar(10) character set ucs2, key(a)); +insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +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"; +select * from t1 where a like "%a%"; +select * from t1 where a like "%abcd%"; +select * from t1 where a like "%abc\d%"; +drop table t1; + +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ucs2); +INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏÌÄÖ'),('æÙ×ÁÐÒÏÌÄÖ'),('Æù×ÁÐÒÏÌÄÖ'),('ÆÙ÷ÁÐÒÏÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×áÐÒÏÌÄÖ'),('ÆÙ×ÁðÒÏÌÄÖ'),('ÆÙ×ÁÐòÏÌÄÖ'),('ÆÙ×ÁÐÒïÌÄÖ'); +INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏìÄÖ'),('ÆÙ×ÁÐÒÏÌäÖ'),('ÆÙ×ÁÐÒÏÌÄö'),('æù÷áðòïìäö'); +SELECT * FROM t1 WHERE a LIKE '%Æù×Á%'; +SELECT * FROM t1 WHERE a LIKE '%Æù×%'; +SELECT * FROM t1 WHERE a LIKE 'Æù×Á%'; +SELECT * FROM t1 WHERE a LIKE 'Æù×Á%' COLLATE ucs2_bin; +DROP TABLE t1; + +# +# Bug 1181 +# +CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word)) +TYPE=MyISAM CHARACTER SET ucs2 COLLATE ucs2_general_ci; +INSERT INTO t1 (word) VALUES ("cat"); +SELECT * FROM t1 WHERE word LIKE "c%"; +SELECT * FROM t1 WHERE word LIKE "ca_"; +SELECT * FROM t1 WHERE word LIKE "cat"; +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630025'; +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630061005F'; +DROP TABLE t1; + +###################################################### + +# +# Bug 1264 +# +# Description: +# +# When using a ucs2 table in MySQL, +# either with ucs2_general_ci or ucs2_bin collation, +# words are returned in an incorrect order when using ORDER BY +# on an _indexed_ CHAR or VARCHAR column. They are sorted with +# the longest word *first* instead of last. I.E. The word "aardvark" +# is in the results before the word "a". +# +# If there is no index for the column, the problem does not occur. +# +# Interestingly, if there is no second column, the words are returned +# in the correct order. +# +# According to EXPLAIN, it looks like when the output includes columns that +# are not part of the index sorted on, it does a filesort, which fails. +# Using a straight index yields correct results. + +SET NAMES latin1; + +# +# Two fields, index +# + +CREATE TABLE t1 ( + word VARCHAR(64), + bar INT(11) default 0, + PRIMARY KEY (word)) + TYPE=MyISAM + CHARSET ucs2 + COLLATE ucs2_general_ci ; + +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a"); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY word; +SELECT * FROM t1 ORDER BY word; +EXPLAIN SELECT word FROM t1 ORDER BY word; +SELECT word FROM t1 ORDER by word; +DROP TABLE t1; + +# +# One field, index +# + +CREATE TABLE t1 ( + word VARCHAR(64) , + PRIMARY KEY (word)) + TYPE=MyISAM + CHARSET ucs2 + COLLATE ucs2_general_ci; + +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a"); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY WORD; +SELECT * FROM t1 ORDER BY word; +DROP TABLE t1; + + +# +# Two fields, no index +# + +CREATE TABLE t1 ( + word TEXT, + bar INT(11) AUTO_INCREMENT, + PRIMARY KEY (bar)) + TYPE=MyISAM + CHARSET ucs2 + COLLATE ucs2_general_ci ; +INSERT INTO t1 (word) VALUES ("aar"); +INSERT INTO t1 (word) VALUES ("a" ); +INSERT INTO t1 (word) VALUES ("aardvar"); +INSERT INTO t1 (word) VALUES ("aardvark"); +INSERT INTO t1 (word) VALUES ("aardvara"); +INSERT INTO t1 (word) VALUES ("aardvarz"); +EXPLAIN SELECT * FROM t1 ORDER BY word; +SELECT * FROM t1 ORDER BY word; +EXPLAIN SELECT word FROM t1 ORDER BY word; +SELECT word FROM t1 ORDER BY word; +DROP TABLE t1; + +# +# END OF Bug 1264 test +# +######################################################## + diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index e41caf55948..bcf6507b4c7 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -7,6 +7,8 @@ drop table if exists t1; --enable_warnings +set names ujis; + # # Test problem with LEFT() # @@ -15,3 +17,27 @@ create table t1 (c text character set ujis); insert into t1 values (0xa4a2),(0xa4a3); select hex(left(c,1)) from t1 group by c; drop table t1; + +# +# +# +select locate(0xa2a1,0xa1a2a1a3); +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3); +select locate(_ujis 0xa2a1,_ujis 0xa1a2a1a3 collate ujis_bin); +select locate('he','hello'); +select locate('he','hello',2); +select locate('lo','hello',2); +select locate('HE','hello'); +select locate('HE','hello',2); +select locate('LO','hello',2); +select locate('HE','hello' collate ujis_bin); +select locate('HE','hello' collate ujis_bin,2); +select locate('LO','hello' collate ujis_bin,2); +select locate(_ujis 0xa1a3,_ujis 0xa1a2a1a3); + +select 0xa1a2a1a3 like concat(_binary'%',0xa2a1,_binary'%'); +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%'); +select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate ujis_bin; +select 'a' like 'a'; +select 'A' like 'a'; +select 'A' like 'a' collate ujis_bin; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test new file mode 100644 index 00000000000..46359e84f1d --- /dev/null +++ b/mysql-test/t/ctype_utf8.test @@ -0,0 +1,35 @@ +# +# Tests with the utf8 character set +# + +set names utf8; + +select left(_utf8 0xD0B0D0B1D0B2,1); +select right(_utf8 0xD0B0D0B2D0B2,1); + +select locate('he','hello'); +select locate('he','hello',2); +select locate('lo','hello',2); +select locate('HE','hello'); +select locate('HE','hello',2); +select locate('LO','hello',2); +select locate('HE','hello' collate utf8_bin); +select locate('HE','hello' collate utf8_bin,2); +select locate('LO','hello' collate utf8_bin,2); + +select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2); +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2); +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2); +select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin); +select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin); + +select 'a' like 'a'; +select 'A' like 'a'; +select 'A' like 'a' collate utf8_bin; +select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%'); + +# +# Fix this, it should return 1: +# +#select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD091,_utf8 '%'); +# diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index c3edbabcd53..a8583aa5ea3 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -94,3 +94,31 @@ drop table t1,t2; # derived table reference # SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1; + +# +# Test for select if database is not selected. +# +# Connect without a database +create table t1 select 1 as a; +connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock); +connection con1; +--error 1046 +select 2 as a from (select * from t1) b; +use test; +select 2 as a from (select * from t1) b; +drop table t1; +--error 1064 +select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id; + +# +# UPDATE/DELETE/INSERT of derived tables +# +create table t1 (a int); +insert into t1 values (1),(2),(3); +-- error 1149 +update (select * from t1) as t1 set a = 5; +-- error 1064 +delete from (select * from t1); +-- error 1064 +insert into (select * from t1) values (5); +drop table t1; diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 0563b432873..56c00e7501c 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -285,3 +285,50 @@ INSERT INTO t1 VALUES (3, 'aaaaa'); INSERT INTO t1 VALUES (2, 'eeeeeee'); select distinct left(name,1) as name from t1; drop table t1; + +# +# Test case from sel000100 +# + +CREATE TABLE t1 ( + ID int(11) NOT NULL auto_increment, + NAME varchar(75) DEFAULT '' NOT NULL, + LINK_ID int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (ID), + KEY NAME (NAME), + KEY LINK_ID (LINK_ID) +); + +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0); +INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0); + +CREATE TABLE t2 ( + ID int(11) NOT NULL auto_increment, + NAME varchar(150) DEFAULT '' NOT NULL, + PRIMARY KEY (ID), + KEY NAME (NAME) +); + +SELECT DISTINCT + t2.id AS key_link_id, + t2.name AS link +FROM t1 +LEFT JOIN t2 ON t1.link_id=t2.id +GROUP BY t1.id +ORDER BY link; +drop table t1,t2; + +# +# test case for #674 +# + +CREATE TABLE t1 ( + html varchar(5) default NULL, + rin int(11) default '0', + out int(11) default '0' +) TYPE=MyISAM; + +INSERT INTO t1 VALUES ('1',1,0); +SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; +drop table t1; diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index a55cbb45fd9..43329a849f8 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -43,3 +43,13 @@ drop database mysqltest; show databases; --error 1008 drop database mysqltest; + +# test create table and FLUSH TABLES WITH READ LOCK +drop table t1; +flush tables with read lock; +--error 1223; +create table t1(n int); +unlock tables; +create table t1(n int); +show tables; +drop table t1; diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 826721a4053..7462c020357 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -23,3 +23,9 @@ select uncompress(""); select uncompress(compress("")); select uncompressed_length(""); +# +# NULL (Bug #1333) +# + +select compress(NULL); +select uncompress(NULL); diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test index c72356bda1a..c1c7090cab3 100644 --- a/mysql-test/t/func_crypt.test +++ b/mysql-test/t/func_crypt.test @@ -4,7 +4,33 @@ select length(encrypt('foo', 'ff')) <> 0; --replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l. # Test new and old password handling functions -select password("a",""), password("a",NULL), password("","a"), password(NULL,"a"); -select password("aaaaaaaaaaaaaaaa","a"), password("a","aaaaaaaaaaaaaaaa"); -select old_password('test'), length(password("1")), length(encrypt('test')), encrypt('test','aa'); -select old_password(""), old_password(NULL), password(""), password(NULL); +select password('abc'); +select password(''); +select old_password('abc'); +select old_password(''); +select password('gabbagabbahey'); +select old_password('idkfa'); +select length(password('1')); +select length(encrypt('test')); +select encrypt('test','aa'); +select old_password(NULL); +select password(NULL); +set global old_passwords=on; +select password(''); +select old_password(''); +select password('idkfa'); +select old_password('idkfa'); +set old_passwords=on; +select password('idkfa'); +select old_password('idkfa'); +set global old_passwords=off; +select password('idkfa'); +select old_password('idkfa'); + +# this test shows that new scrambles honor spaces in passwords: +set old_passwords=off; +select password('idkfa '); +select password('idkfa'); +select password(' idkfa'); +select old_password('idkfa'); +select old_password(' i d k f a '); diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index f426f9ca4ee..b10f6d2af21 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -91,6 +91,11 @@ insert into t2 values (1,4), (5,4), (5,5); --replace_result www.help.com X www.host.com X www.google.com X select REQ_ID, Group_Concat(URL) as URL from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID; +# check min/max function +--replace_result www.help.com X www.host.com X www.google.com X +select REQ_ID, Group_Concat(URL) as URL, Min(t1.URL_ID) urll, +Max(t1.URL_ID) urlg from t1, t2 where t2.URL_ID = t1.URL_ID group by REQ_ID; + drop table t1; drop table t2; @@ -99,3 +104,19 @@ insert into t1 values (1,'longername'),(1,'evenlongername'); select ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'without distinct: how it should be' from t1; select distinct ifnull(group_concat(concat(t1.id, ':', t1.name)), 'shortname') as 'with distinct: cutoff at length of shortname' from t1; drop table t1; + +# check zero rows +create table t1(id int); +create table t2(id int); +insert into t1 values(0),(1); +select group_concat(t1.id) FROM t1,t2; +drop table t1; +drop table t2; + +# check having +create table t1 (bar varchar(32)); +insert into t1 values('test'),('test2'); +select * from t1 having group_concat(bar)=''; +drop table t1; + + diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test index 6e5d601844e..6ecb56ef9c4 100644 --- a/mysql-test/t/func_regexp.test +++ b/mysql-test/t/func_regexp.test @@ -45,3 +45,17 @@ create table t1 (xxx char(128)); insert into t1 (xxx) values('this is some text: to test - out.reg exp (22/45)'); select * from t1 where xxx REGEXP '^this is some text: to test - out\\.reg exp [[(][0-9]+[/\\][0-9]+[])][ ]*$'; drop table t1; + +# +# Check with different character sets and collations +# +select _latin1 0xFF regexp _latin1 '[[:lower:]]' COLLATE latin1_bin; +select _koi8r 0xFF regexp _koi8r '[[:lower:]]' COLLATE koi8r_bin; +select _latin1 0xFF regexp _latin1 '[[:upper:]]' COLLATE latin1_bin; +select _koi8r 0xFF regexp _koi8r '[[:upper:]]' COLLATE koi8r_bin; + +select _latin1 0xF7 regexp _latin1 '[[:alpha:]]'; +select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]'; + +select _latin1'a' regexp _latin1'A' collate latin1_general_ci; +select _latin1'a' regexp _latin1'A' collate latin1_bin; diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test index ae1963dd3f5..95b10c4ffb9 100644 --- a/mysql-test/t/func_test.test +++ b/mysql-test/t/func_test.test @@ -1,3 +1,6 @@ +--disable_warnings +drop table if exists t1,t2; +--enable_warnings # # Testing of comparison functions # @@ -65,3 +68,13 @@ select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'; select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin; --error 1266 select _koi8r'a' LIKE _latin1'A'; + +# +# Test for LEAST() BUG in LEFT JOIN +# +CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) TYPE=MyISAM; +INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','\r\n\r\n \r\n \r\n \r\n \r\n
 \r\n

How \r\n To: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected.

\r\n
','\r\n \r\n \r\n \r\n \r\n\r\n \r\n
  \r\n \r\n

1. Select \r\n the On/Setup button to access the DynaVox Setup Menu.
\r\n 2. Select Button Features.
\r\n 3. Below the OK button is the Usage Counts button.
\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.
\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.
\r\n c. Select the Usage Counts Option Ring once and it will toggle \r\n to the alternative option.
\r\n 4. Once the correct setting has been chosen, select OK to leave the Button \r\n Features menu.
\r\n 5. Select OK out of the Setup menu and return to the communication \r\n page.

\r\n

For \r\n further information on Usage Counts, see the Button Features \r\n Menu Entry in the DynaVox/DynaMyte Reference Manual.

\r\n
',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL); +CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) TYPE=MyISAM; +INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1); +SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank; +DROP TABLE t1,t2; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index f48ada33866..78221fa4e40 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -65,14 +65,24 @@ show grants for mysqltest_1@localhost; select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; REVOKE select (a), update on t1 from mysqltest_1@localhost; show grants for mysqltest_1@localhost; -REVOKE insert,insert (a) on t1 from mysqltest_1@localhost; -GRANT references on t1 to mysqltest_1@localhost; +REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost; show grants for mysqltest_1@localhost; +GRANT select,references on t1 to mysqltest_1@localhost; select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; -delete from mysql.user where user='mysqltest_1'; -delete from mysql.db where user='mysqltest_1'; -delete from mysql.tables_priv where user='mysqltest_1'; -delete from mysql.columns_priv where user='mysqltest_1'; +grant all on test.* to mysqltest_3@localhost with grant option; +revoke all on test.* from mysqltest_3@localhost; +show grants for mysqltest_3@localhost; +revoke grant option on test.* from mysqltest_3@localhost; +show grants for mysqltest_3@localhost; +grant all on test.t1 to mysqltest_2@localhost with grant option; +revoke all on test.t1 from mysqltest_2@localhost; +show grants for mysqltest_2@localhost; +revoke grant option on test.t1 from mysqltest_2@localhost; +show grants for mysqltest_2@localhost; +delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; flush privileges; drop table t1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 1153622a40f..752896ce7b2 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -429,4 +429,6 @@ select id, sum(qty) as sqty, count(qty) as cqty from t1 group by id having sum(q 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; +select count(*), case interval(qty,2,3,4,5,6,7,8) when -1 then NULL when 0 then "zero" when 1 then "one" when 2 then "two" end as category from t1 group by category; +select count(*), interval(qty,2,3,4,5,6,7,8) as category from t1 group by category; drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 6e7eb0ea06f..823ac25cf66 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -133,6 +133,21 @@ select n from t1; rollback; drop table t1; +# +# Test for commit and FLUSH TABLES WITH READ LOCK +# + +create table t1 (n int not null primary key) type=innodb; +start transaction; +insert into t1 values (4); +flush tables with read lock; +--error 1223; +commit; +unlock tables; +commit; +select * from t1; +drop table t1; + # # Testing transactions # @@ -925,3 +940,29 @@ SELECT t2.id, t1.label FROM t2 INNER JOIN (SELECT t1.id_object as id_object FROM t1 WHERE t1.label LIKE '%test%') AS lbl ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); drop table t1,t2; + +# +# Bug #1078 +# +create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) type=innodb; +select * from t1; +--error 1031 +replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12"); +select * from t1; +--error 1031 +replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" ); +select * from t1; +drop table t1; + +create table t1 (a int, b varchar(200), c text not null) checksum=1 type=myisam; +create table t2 (a int, b varchar(200), c text not null) checksum=0 type=innodb; +create table t3 (a int, b varchar(200), c text not null) checksum=1 type=innodb; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +insert t3 select * from t1; +checksum table t1, t2, t3, t4 quick; +checksum table t1, t2, t3, t4; +checksum table t1, t2, t3, t4 extended; +#show table status; +drop table t1,t2,t3; + diff --git a/mysql-test/t/isam.test b/mysql-test/t/isam.test index fc2dbac439c..a31ba864b2f 100644 --- a/mysql-test/t/isam.test +++ b/mysql-test/t/isam.test @@ -70,3 +70,176 @@ show columns from t1; show full columns from t1; show index from t1; drop table t1,t2; + +# +# test of table with huge number of packed fields +# + +create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8 +int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17 +int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int, +i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34 +int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int, +i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51 +int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int, +i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68 +int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int, +i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85 +int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int, +i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102 +int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110 +int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118 +int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126 +int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134 +int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142 +int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150 +int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158 +int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166 +int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174 +int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182 +int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190 +int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198 +int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206 +int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214 +int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222 +int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230 +int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238 +int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246 +int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254 +int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262 +int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270 +int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278 +int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286 +int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294 +int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302 +int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310 +int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318 +int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326 +int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334 +int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342 +int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350 +int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358 +int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366 +int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374 +int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382 +int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390 +int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398 +int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406 +int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414 +int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422 +int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430 +int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438 +int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446 +int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454 +int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462 +int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470 +int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478 +int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486 +int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494 +int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502 +int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510 +int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518 +int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526 +int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534 +int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542 +int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550 +int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558 +int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566 +int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574 +int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582 +int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590 +int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598 +int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606 +int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614 +int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622 +int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630 +int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638 +int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646 +int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654 +int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662 +int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670 +int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678 +int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686 +int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694 +int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702 +int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710 +int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718 +int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726 +int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734 +int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742 +int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750 +int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758 +int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766 +int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774 +int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782 +int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790 +int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798 +int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806 +int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814 +int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822 +int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830 +int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838 +int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846 +int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854 +int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862 +int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870 +int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878 +int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886 +int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894 +int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902 +int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910 +int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918 +int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926 +int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934 +int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942 +int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950 +int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958 +int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966 +int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974 +int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982 +int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990 +int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998 +int, i999 int, i1000 int, b blob) row_format=dynamic; +insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei"); +update t1 set b=repeat('a',256); +update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0; +check table t1; +drop table t1; diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 2f484d30ff7..1720ae69bbb 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -16,6 +16,7 @@ load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated SELECT * from t1; drop table t1; - - - +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +select concat('|',a,'|'), concat('|',b,'|') from t1; +drop table t1; diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test index a8a7a65bd76..d8301017801 100644 --- a/mysql-test/t/lock_tables_lost_commit.test +++ b/mysql-test/t/lock_tables_lost_commit.test @@ -6,8 +6,8 @@ connect (con2,localhost,root,,); connection con1; --disable_warnings drop table if exists t1; ---enable_warnings create table t1(a int) type=innodb; +--enable_warnings lock tables t1 write; insert into t1 values(10); disconnect con1; diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test index 2a3cc5b7e8f..28e45bde5c5 100644 --- a/mysql-test/t/lowercase_table.test +++ b/mysql-test/t/lowercase_table.test @@ -9,6 +9,10 @@ drop table if exists t1,t2,t3; create table T1 (id int primary key, Word varchar(40) not null, Index(Word)); INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c'); SELECT * FROM t1; +SELECT T1.id from T1 LIMIT 1; +SELECT T2.id from t1 as T2 LIMIT 1; +# This gave an error in 4.0, but it's fixed in 4.1 +SELECT T2.id from t1 as t2 LIMIT 1; RENAME TABLE T1 TO T2; ALTER TABLE T2 ADD new_col int not null; ALTER TABLE T2 RENAME T3; diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test new file mode 100644 index 00000000000..314587feda6 --- /dev/null +++ b/mysql-test/t/mix_innodb_myisam_binlog.test @@ -0,0 +1,175 @@ +# Check that binlog is ok when a transaction mixes updates to InnoDB and +# MyISAM. +# It would be nice to make this a replication test, but in 4.0 the +# slave is always with --skip-innodb in the testsuite. I (Guilhem) however +# did some tests manually on a slave; tables are replicated fine and +# Exec_master_log_pos advances as expected. + +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1, t2; +--enable_warnings + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +connection con1; +create table t1 (a int) type=innodb; +create table t2 (a int) type=myisam; + +reset master; + +begin; +insert into t1 values(1); +insert into t2 select * from t1; +commit; + +show binlog events from 79; + +delete from t1; +delete from t2; +reset master; + +begin; +insert into t1 values(2); +insert into t2 select * from t1; +# should say some changes to non-transact1onal tables couldn't be rolled back +rollback; + +show binlog events from 79; + +delete from t1; +delete from t2; +reset master; + +begin; +insert into t1 values(3); +savepoint my_savepoint; +insert into t1 values(4); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +commit; + +show binlog events from 79; + +delete from t1; +delete from t2; +reset master; + +begin; +insert into t1 values(5); +savepoint my_savepoint; +insert into t1 values(6); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +insert into t1 values(7); +commit; +select a from t1 order by a; # check that savepoints work :) + +show binlog events from 79; + +# and when ROLLBACK is not explicit? +delete from t1; +delete from t2; +reset master; + +select get_lock("a",10); +begin; +insert into t1 values(8); +insert into t2 select * from t1; +disconnect con1; + +connection con2; +# We want to SHOW BINLOG EVENTS, to know what was logged. But there is no +# guarantee that logging of the terminated con1 has been done yet (it may not +# even be started, so con1 may have not even attempted to lock the binlog yet; +# so SHOW BINLOG EVENTS may come before con1 does the loggin. To be sure that +# logging has been done, we use a user lock. +select get_lock("a",10); +show binlog events from 79; + +# and when not in a transact1on? +delete from t1; +delete from t2; +reset master; + +insert into t1 values(9); +insert into t2 select * from t1; + +show binlog events from 79; + +# Check that when the query updat1ng the MyISAM table is the first in the +# transact1on, we log it immediately. +delete from t1; +delete from t2; +reset master; + +insert into t1 values(10); # first make t1 non-empty +begin; +insert into t2 select * from t1; +show binlog events from 79; +insert into t1 values(11); +commit; + +show binlog events from 79; + + +# Check that things work like before this BEGIN/ROLLBACK code was added, +# when t2 is INNODB + +alter table t2 type=INNODB; + +delete from t1; +delete from t2; +reset master; + +begin; +insert into t1 values(12); +insert into t2 select * from t1; +commit; + +show binlog events from 79; + +delete from t1; +delete from t2; +reset master; + +begin; +insert into t1 values(13); +insert into t2 select * from t1; +rollback; + +show binlog events from 79; + +delete from t1; +delete from t2; +reset master; + +begin; +insert into t1 values(14); +savepoint my_savepoint; +insert into t1 values(15); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +commit; + +show binlog events from 79; + +delete from t1; +delete from t2; +reset master; + +begin; +insert into t1 values(16); +savepoint my_savepoint; +insert into t1 values(17); +insert into t2 select * from t1; +rollback to savepoint my_savepoint; +insert into t1 values(18); +commit; +select a from t1 order by a; # check that savepoints work :) + +show binlog events from 79; + +drop table t1,t2; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 8e560cab455..6b59778bbce 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -268,3 +268,10 @@ create table t2(Z varchar(15)); insert into t2(Z) select concat(a.a,b.a,c.a,d.a) from t1 as a, t1 as b, t1 as c, t1 as d; update t2,t3 set Z =param_scenario_costs; drop table t1,t2,t3; +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,1),(2,1),(3,1); +insert into t2 values (1,1), (3,1); +update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL; +select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL; +drop table t1,t2; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 5267b57259b..8c43ce1937f 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -295,6 +295,12 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei"); +update t1 set b=repeat('a',256); +update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0; +check table t1; +delete from t1 where i8=1; +select i1,i2 from t1; +check table t1; drop table t1; # @@ -356,6 +362,40 @@ explain select * from t1 where c=1; explain select * from t1 use index() where c=1; drop table t1,t2; +# +# Test bug when updating a split dynamic row where keys are not changed +# + +create table t1 (a int not null auto_increment primary key, b varchar(255)); +insert into t1 (b) values (repeat('a',100)),(repeat('b',100)),(repeat('c',100)); +update t1 set b=repeat(left(b,1),200) where a=1; +delete from t1 where (a & 1)= 0; +update t1 set b=repeat('e',200) where a=1; +flush tables; +check table t1; + +# +# check updating with keys +# + +disable_query_log; +let $1 = 100; +while ($1) +{ + eval insert into t1 (b) values (repeat(char(($1 & 32)+65), $1)); + dec $1; +} +enable_query_log; +update t1 set b=repeat(left(b,1),255) where a between 1 and 5; +update t1 set b=repeat(left(b,1),10) where a between 32 and 43; +update t1 set b=repeat(left(b,1),2) where a between 64 and 66; +update t1 set b=repeat(left(b,1),65) where a between 67 and 70; +check table t1; +insert into t1 (b) values (repeat('z',100)); +update t1 set b="test" where left(b,1) > 'n'; +check table t1; +drop table t1; + # # Test RTREE index # @@ -363,4 +403,14 @@ drop table t1,t2; CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) TYPE=MyISAM; # INSERT INTO t1 VALUES (1,1),(1,1); # DELETE FROM rt WHERE a<1; -DROP TABLE IF EXISTS t1; +# DROP TABLE IF EXISTS t1; + +create table t1 (a int, b varchar(200), c text not null) checksum=1; +create table t2 (a int, b varchar(200), c text not null) checksum=0; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +checksum table t1, t2, t3 quick; +checksum table t1, t2, t3; +checksum table t1, t2, t3 extended; +#show table status; +drop table t1,t2; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test new file mode 100644 index 00000000000..c98fd4050f2 --- /dev/null +++ b/mysql-test/t/mysqldump.test @@ -0,0 +1,10 @@ +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# XML output + +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); +--exec $MYSQL_DUMP -X test t1 +DROP TABLE t1; diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 3b1e3fac7c2..17bf6230f76 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -77,3 +77,14 @@ select product, country_id , year, sum(profit) from t1 group by product, country drop table t1,t2; +# +# Test bug with const tables +# + +CREATE TABLE t1 (i int); +INSERT INTO t1 VALUES(100); +CREATE TABLE t2 (i int); +INSERT INTO t2 VALUES (100),(200); +SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP; +SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP; +drop table t1,t2; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index c1c818efb70..39612f680f3 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -10,8 +10,8 @@ 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"; +grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; connect (con1,localhost,ssl_user1,,); connect (con2,localhost,ssl_user2,,); diff --git a/mysql-test/t/openssl_2.test b/mysql-test/t/openssl_2.test deleted file mode 100644 index a8ee62db7f6..00000000000 --- a/mysql-test/t/openssl_2.test +++ /dev/null @@ -1,5 +0,0 @@ -# We want to test everything with SSL turned on. --- source include/have_openssl_2.inc - -SHOW STATUS LIKE 'Ssl%'; - diff --git a/mysql-test/t/packet.test b/mysql-test/t/packet.test index 5c4e7efcaf3..cbeaa04ca52 100644 --- a/mysql-test/t/packet.test +++ b/mysql-test/t/packet.test @@ -12,8 +12,8 @@ set global net_buffer_length=100; set net_buffer_length=100; # Have to be > 1024 as min value of net_buffer_length is 1024 SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; -# Should return NULL as 200 is bigger than max_allowed_packet -select repeat('a',200); +# Should return NULL as 2000 is bigger than max_allowed_packet +select repeat('a',2000); # # Connection 2 should get error for too big packets @@ -28,4 +28,4 @@ set max_allowed_packet=default; set global net_buffer_length=default; set net_buffer_length=default; SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; -select length(repeat('a',200)); +select length(repeat('a',2000)); diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index b784bcf5076..dcdf70ee612 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -11,7 +11,7 @@ flush query cache; # This crashed in some versions reset query cache; flush status; --disable_warnings -drop table if exists t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t00,mysqltest.t1; +drop table if exists t1,t2,t3; drop database if exists mysqltest; --enable_warnings @@ -487,531 +487,3 @@ select * from t1; show status like "Qcache_queries_in_cache"; SET OPTION SQL_SELECT_LIMIT=DEFAULT; drop table t1; - -# -# more then 255 (257) merged tables test -# -flush status; -create table t0(a int); -create table t1(a int); -create table t2(a int); -create table t3(a int); -create table t4(a int); -create table t5(a int); -create table t6(a int); -create table t7(a int); -create table t8(a int); -create table t9(a int); -create table t10(a int); -create table t11(a int); -create table t12(a int); -create table t13(a int); -create table t14(a int); -create table t15(a int); -create table t16(a int); -create table t17(a int); -create table t18(a int); -create table t19(a int); -create table t20(a int); -create table t21(a int); -create table t22(a int); -create table t23(a int); -create table t24(a int); -create table t25(a int); -create table t26(a int); -create table t27(a int); -create table t28(a int); -create table t29(a int); -create table t30(a int); -create table t31(a int); -create table t32(a int); -create table t33(a int); -create table t34(a int); -create table t35(a int); -create table t36(a int); -create table t37(a int); -create table t38(a int); -create table t39(a int); -create table t40(a int); -create table t41(a int); -create table t42(a int); -create table t43(a int); -create table t44(a int); -create table t45(a int); -create table t46(a int); -create table t47(a int); -create table t48(a int); -create table t49(a int); -create table t50(a int); -create table t51(a int); -create table t52(a int); -create table t53(a int); -create table t54(a int); -create table t55(a int); -create table t56(a int); -create table t57(a int); -create table t58(a int); -create table t59(a int); -create table t60(a int); -create table t61(a int); -create table t62(a int); -create table t63(a int); -create table t64(a int); -create table t65(a int); -create table t66(a int); -create table t67(a int); -create table t68(a int); -create table t69(a int); -create table t70(a int); -create table t71(a int); -create table t72(a int); -create table t73(a int); -create table t74(a int); -create table t75(a int); -create table t76(a int); -create table t77(a int); -create table t78(a int); -create table t79(a int); -create table t80(a int); -create table t81(a int); -create table t82(a int); -create table t83(a int); -create table t84(a int); -create table t85(a int); -create table t86(a int); -create table t87(a int); -create table t88(a int); -create table t89(a int); -create table t90(a int); -create table t91(a int); -create table t92(a int); -create table t93(a int); -create table t94(a int); -create table t95(a int); -create table t96(a int); -create table t97(a int); -create table t98(a int); -create table t99(a int); -create table t100(a int); -create table t101(a int); -create table t102(a int); -create table t103(a int); -create table t104(a int); -create table t105(a int); -create table t106(a int); -create table t107(a int); -create table t108(a int); -create table t109(a int); -create table t110(a int); -create table t111(a int); -create table t112(a int); -create table t113(a int); -create table t114(a int); -create table t115(a int); -create table t116(a int); -create table t117(a int); -create table t118(a int); -create table t119(a int); -create table t120(a int); -create table t121(a int); -create table t122(a int); -create table t123(a int); -create table t124(a int); -create table t125(a int); -create table t126(a int); -create table t127(a int); -create table t128(a int); -create table t129(a int); -create table t130(a int); -create table t131(a int); -create table t132(a int); -create table t133(a int); -create table t134(a int); -create table t135(a int); -create table t136(a int); -create table t137(a int); -create table t138(a int); -create table t139(a int); -create table t140(a int); -create table t141(a int); -create table t142(a int); -create table t143(a int); -create table t144(a int); -create table t145(a int); -create table t146(a int); -create table t147(a int); -create table t148(a int); -create table t149(a int); -create table t150(a int); -create table t151(a int); -create table t152(a int); -create table t153(a int); -create table t154(a int); -create table t155(a int); -create table t156(a int); -create table t157(a int); -create table t158(a int); -create table t159(a int); -create table t160(a int); -create table t161(a int); -create table t162(a int); -create table t163(a int); -create table t164(a int); -create table t165(a int); -create table t166(a int); -create table t167(a int); -create table t168(a int); -create table t169(a int); -create table t170(a int); -create table t171(a int); -create table t172(a int); -create table t173(a int); -create table t174(a int); -create table t175(a int); -create table t176(a int); -create table t177(a int); -create table t178(a int); -create table t179(a int); -create table t180(a int); -create table t181(a int); -create table t182(a int); -create table t183(a int); -create table t184(a int); -create table t185(a int); -create table t186(a int); -create table t187(a int); -create table t188(a int); -create table t189(a int); -create table t190(a int); -create table t191(a int); -create table t192(a int); -create table t193(a int); -create table t194(a int); -create table t195(a int); -create table t196(a int); -create table t197(a int); -create table t198(a int); -create table t199(a int); -create table t200(a int); -create table t201(a int); -create table t202(a int); -create table t203(a int); -create table t204(a int); -create table t205(a int); -create table t206(a int); -create table t207(a int); -create table t208(a int); -create table t209(a int); -create table t210(a int); -create table t211(a int); -create table t212(a int); -create table t213(a int); -create table t214(a int); -create table t215(a int); -create table t216(a int); -create table t217(a int); -create table t218(a int); -create table t219(a int); -create table t220(a int); -create table t221(a int); -create table t222(a int); -create table t223(a int); -create table t224(a int); -create table t225(a int); -create table t226(a int); -create table t227(a int); -create table t228(a int); -create table t229(a int); -create table t230(a int); -create table t231(a int); -create table t232(a int); -create table t233(a int); -create table t234(a int); -create table t235(a int); -create table t236(a int); -create table t237(a int); -create table t238(a int); -create table t239(a int); -create table t240(a int); -create table t241(a int); -create table t242(a int); -create table t243(a int); -create table t244(a int); -create table t245(a int); -create table t246(a int); -create table t247(a int); -create table t248(a int); -create table t249(a int); -create table t250(a int); -create table t251(a int); -create table t252(a int); -create table t253(a int); -create table t254(a int); -create table t255(a int); -create table t256(a int); -create table t00 (a int) type=MERGE UNION=(t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256) INSERT_METHOD=FIRST; -insert into t0 values (1),(2); -insert into t1 values (1),(2); -insert into t2 values (1),(2); -insert into t3 values (1),(2); -insert into t4 values (1),(2); -insert into t5 values (1),(2); -insert into t6 values (1),(2); -insert into t7 values (1),(2); -insert into t8 values (1),(2); -insert into t9 values (1),(2); -insert into t10 values (1),(2); -insert into t11 values (1),(2); -insert into t12 values (1),(2); -insert into t13 values (1),(2); -insert into t14 values (1),(2); -insert into t15 values (1),(2); -insert into t16 values (1),(2); -insert into t17 values (1),(2); -insert into t18 values (1),(2); -insert into t19 values (1),(2); -insert into t20 values (1),(2); -insert into t21 values (1),(2); -insert into t22 values (1),(2); -insert into t23 values (1),(2); -insert into t24 values (1),(2); -insert into t25 values (1),(2); -insert into t26 values (1),(2); -insert into t27 values (1),(2); -insert into t28 values (1),(2); -insert into t29 values (1),(2); -insert into t30 values (1),(2); -insert into t31 values (1),(2); -insert into t32 values (1),(2); -insert into t33 values (1),(2); -insert into t34 values (1),(2); -insert into t35 values (1),(2); -insert into t36 values (1),(2); -insert into t37 values (1),(2); -insert into t38 values (1),(2); -insert into t39 values (1),(2); -insert into t40 values (1),(2); -insert into t41 values (1),(2); -insert into t42 values (1),(2); -insert into t43 values (1),(2); -insert into t44 values (1),(2); -insert into t45 values (1),(2); -insert into t46 values (1),(2); -insert into t47 values (1),(2); -insert into t48 values (1),(2); -insert into t49 values (1),(2); -insert into t50 values (1),(2); -insert into t51 values (1),(2); -insert into t52 values (1),(2); -insert into t53 values (1),(2); -insert into t54 values (1),(2); -insert into t55 values (1),(2); -insert into t56 values (1),(2); -insert into t57 values (1),(2); -insert into t58 values (1),(2); -insert into t59 values (1),(2); -insert into t60 values (1),(2); -insert into t61 values (1),(2); -insert into t62 values (1),(2); -insert into t63 values (1),(2); -insert into t64 values (1),(2); -insert into t65 values (1),(2); -insert into t66 values (1),(2); -insert into t67 values (1),(2); -insert into t68 values (1),(2); -insert into t69 values (1),(2); -insert into t70 values (1),(2); -insert into t71 values (1),(2); -insert into t72 values (1),(2); -insert into t73 values (1),(2); -insert into t74 values (1),(2); -insert into t75 values (1),(2); -insert into t76 values (1),(2); -insert into t77 values (1),(2); -insert into t78 values (1),(2); -insert into t79 values (1),(2); -insert into t80 values (1),(2); -insert into t81 values (1),(2); -insert into t82 values (1),(2); -insert into t83 values (1),(2); -insert into t84 values (1),(2); -insert into t85 values (1),(2); -insert into t86 values (1),(2); -insert into t87 values (1),(2); -insert into t88 values (1),(2); -insert into t89 values (1),(2); -insert into t90 values (1),(2); -insert into t91 values (1),(2); -insert into t92 values (1),(2); -insert into t93 values (1),(2); -insert into t94 values (1),(2); -insert into t95 values (1),(2); -insert into t96 values (1),(2); -insert into t97 values (1),(2); -insert into t98 values (1),(2); -insert into t99 values (1),(2); -insert into t100 values (1),(2); -insert into t101 values (1),(2); -insert into t102 values (1),(2); -insert into t103 values (1),(2); -insert into t104 values (1),(2); -insert into t105 values (1),(2); -insert into t106 values (1),(2); -insert into t107 values (1),(2); -insert into t108 values (1),(2); -insert into t109 values (1),(2); -insert into t110 values (1),(2); -insert into t111 values (1),(2); -insert into t112 values (1),(2); -insert into t113 values (1),(2); -insert into t114 values (1),(2); -insert into t115 values (1),(2); -insert into t116 values (1),(2); -insert into t117 values (1),(2); -insert into t118 values (1),(2); -insert into t119 values (1),(2); -insert into t120 values (1),(2); -insert into t121 values (1),(2); -insert into t122 values (1),(2); -insert into t123 values (1),(2); -insert into t124 values (1),(2); -insert into t125 values (1),(2); -insert into t126 values (1),(2); -insert into t127 values (1),(2); -insert into t128 values (1),(2); -insert into t129 values (1),(2); -insert into t130 values (1),(2); -insert into t131 values (1),(2); -insert into t132 values (1),(2); -insert into t133 values (1),(2); -insert into t134 values (1),(2); -insert into t135 values (1),(2); -insert into t136 values (1),(2); -insert into t137 values (1),(2); -insert into t138 values (1),(2); -insert into t139 values (1),(2); -insert into t140 values (1),(2); -insert into t141 values (1),(2); -insert into t142 values (1),(2); -insert into t143 values (1),(2); -insert into t144 values (1),(2); -insert into t145 values (1),(2); -insert into t146 values (1),(2); -insert into t147 values (1),(2); -insert into t148 values (1),(2); -insert into t149 values (1),(2); -insert into t150 values (1),(2); -insert into t151 values (1),(2); -insert into t152 values (1),(2); -insert into t153 values (1),(2); -insert into t154 values (1),(2); -insert into t155 values (1),(2); -insert into t156 values (1),(2); -insert into t157 values (1),(2); -insert into t158 values (1),(2); -insert into t159 values (1),(2); -insert into t160 values (1),(2); -insert into t161 values (1),(2); -insert into t162 values (1),(2); -insert into t163 values (1),(2); -insert into t164 values (1),(2); -insert into t165 values (1),(2); -insert into t166 values (1),(2); -insert into t167 values (1),(2); -insert into t168 values (1),(2); -insert into t169 values (1),(2); -insert into t170 values (1),(2); -insert into t171 values (1),(2); -insert into t172 values (1),(2); -insert into t173 values (1),(2); -insert into t174 values (1),(2); -insert into t175 values (1),(2); -insert into t176 values (1),(2); -insert into t177 values (1),(2); -insert into t178 values (1),(2); -insert into t179 values (1),(2); -insert into t180 values (1),(2); -insert into t181 values (1),(2); -insert into t182 values (1),(2); -insert into t183 values (1),(2); -insert into t184 values (1),(2); -insert into t185 values (1),(2); -insert into t186 values (1),(2); -insert into t187 values (1),(2); -insert into t188 values (1),(2); -insert into t189 values (1),(2); -insert into t190 values (1),(2); -insert into t191 values (1),(2); -insert into t192 values (1),(2); -insert into t193 values (1),(2); -insert into t194 values (1),(2); -insert into t195 values (1),(2); -insert into t196 values (1),(2); -insert into t197 values (1),(2); -insert into t198 values (1),(2); -insert into t199 values (1),(2); -insert into t200 values (1),(2); -insert into t201 values (1),(2); -insert into t202 values (1),(2); -insert into t203 values (1),(2); -insert into t204 values (1),(2); -insert into t205 values (1),(2); -insert into t206 values (1),(2); -insert into t207 values (1),(2); -insert into t208 values (1),(2); -insert into t209 values (1),(2); -insert into t210 values (1),(2); -insert into t211 values (1),(2); -insert into t212 values (1),(2); -insert into t213 values (1),(2); -insert into t214 values (1),(2); -insert into t215 values (1),(2); -insert into t216 values (1),(2); -insert into t217 values (1),(2); -insert into t218 values (1),(2); -insert into t219 values (1),(2); -insert into t220 values (1),(2); -insert into t221 values (1),(2); -insert into t222 values (1),(2); -insert into t223 values (1),(2); -insert into t224 values (1),(2); -insert into t225 values (1),(2); -insert into t226 values (1),(2); -insert into t227 values (1),(2); -insert into t228 values (1),(2); -insert into t229 values (1),(2); -insert into t230 values (1),(2); -insert into t231 values (1),(2); -insert into t232 values (1),(2); -insert into t233 values (1),(2); -insert into t234 values (1),(2); -insert into t235 values (1),(2); -insert into t236 values (1),(2); -insert into t237 values (1),(2); -insert into t238 values (1),(2); -insert into t239 values (1),(2); -insert into t240 values (1),(2); -insert into t241 values (1),(2); -insert into t242 values (1),(2); -insert into t243 values (1),(2); -insert into t244 values (1),(2); -insert into t245 values (1),(2); -insert into t246 values (1),(2); -insert into t247 values (1),(2); -insert into t248 values (1),(2); -insert into t249 values (1),(2); -insert into t250 values (1),(2); -insert into t251 values (1),(2); -insert into t252 values (1),(2); -insert into t253 values (1),(2); -insert into t254 values (1),(2); -insert into t255 values (1),(2); -insert into t256 values (1),(2); -enable_result_log; -select count(*) from t00; -select count(*) from t00; -show status like "Qcache_queries_in_cache"; -show status like "Qcache_hits"; -delete from t256; -show status like "Qcache_queries_in_cache"; -drop table t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t00; diff --git a/mysql-test/t/query_cache_merge.test b/mysql-test/t/query_cache_merge.test new file mode 100644 index 00000000000..02e316932a3 --- /dev/null +++ b/mysql-test/t/query_cache_merge.test @@ -0,0 +1,38 @@ +# Test query cache with many tables + +--source include/have_query_cache.inc +let $LIMIT=`SHOW VARIABLES LIKE 'open_files_limit'`; +let $MIN_LIMIT=600; +let $MAX_LIMIT=65536; +--source include/check_var_limit.inc + +SET @@global.query_cache_size=1355776; + +# +# more then 255 (257) merged tables test +# + +flush status; +disable_query_log; +--disable_warnings +let $1 = 257; +while ($1) +{ + eval drop table if exists t$1; + eval create table t$1(a int); + eval insert into t$1 values (1),(2); + dec $1; +} +--enable_warnings + +create table t00 (a int) type=MERGE UNION=(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257) INSERT_METHOD=FIRST; +enable_query_log; +select count(*) from t00; +select count(*) from t00; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; +delete from t256; +show status like "Qcache_queries_in_cache"; +drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00; + +SET @@global.query_cache_size=0; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 8d341837acd..7bf6570b558 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -186,3 +186,42 @@ insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"), select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1; drop table t1; +# +# BETWEEN problems +# +create table t1 (x int, y int, index(x), index(y)); +insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9); +update t1 set y=x; +# between with only one end fixed +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0; +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0; +# between with both expressions on both ends +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between t1.y-1 and t1.y+1; +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= t1.y-1 and t2.x <= t1.y+1; +# equation propagation +explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y; +explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y; +# testing IN +explain select count(*) from t1 where x in (1); +explain select count(*) from t1 where x in (1,2); +drop table t1; + +# +# bug #1172 +# +CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1), KEY i2 (key1)); +INSERT INTO t1 VALUES (0),(0),(1),(1); +CREATE TABLE t2 (keya int(11) NOT NULL default '0', KEY j1 (keya)); +INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); +explain select * from t1, t2 where (t1.key1 =3000 is COMMIT). -# Older versions of MySQL would hang forever in MASTER_POS_WAIT -# because COMMIT was said to be position 0 in the master's log (bug). -# Detect this with timeout. -select master_pos_wait('master-bin.001',3000,120)=-1; +select master_pos_wait('master-bin.001',3000)>=0; select * from t1 where a=8000; # The following DROP is a very important cleaning task: diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_until.test new file mode 100644 index 00000000000..69101f8fa2c --- /dev/null +++ b/mysql-test/t/rpl_until.test @@ -0,0 +1,77 @@ +source include/master-slave.inc; + +# prepare version for substitutions +let $VERSION=`select version()`; + +# stop slave before he will start replication also sync with master +# for avoiding undetermenistic behaviour +save_master_pos; +connection slave; +sync_with_master; +stop slave; + +connection master; +# create some events on master +create table t1(n int not null auto_increment primary key); +insert into t1 values (1),(2),(3),(4); +drop table t1; +create table t2(n int not null auto_increment primary key); +insert into t2 values (1),(2); +insert into t2 values (3),(4); +drop table t2; +--replace_result $VERSION VERSION +show binlog events; + +# try to replicate all queries until drop of t1 +connection slave; +start slave until master_log_file='master-bin.000001', master_log_pos=244; +sleep 2; +# here table should be still not deleted +select * from t1; +--replace_result $MASTER_MYPORT MASTER_MYPORT +show slave status; + +# this should fail right after start +start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; +# again this table should be still not deleted +select * from t1; +sleep 2; +--replace_result $MASTER_MYPORT MASTER_MYPORT +show slave status; + +# try replicate all until second insert to t2; +start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537; +sleep 2; +select * from t2; +--replace_result $MASTER_MYPORT MASTER_MYPORT +show slave status; + +# clean up +start slave; +connection master; +save_master_pos; +connection slave; +sync_with_master; +stop slave; + +# this should stop immideately +start slave until master_log_file='master-bin.000001', master_log_pos=561; +sleep 2; +# here the sql slave thread should be stopped +--replace_result $MASTER_MYPORT MASTER_MYPORT +show slave status; + +#testing various error conditions +--error 1276 +start slave until master_log_file='master-bin', master_log_pos=561; +--error 1276 +start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; +--error 1276 +start slave until master_log_file='master-bin.000001'; +--error 1276 +start slave until relay_log_file='slave-relay-bin.000002'; +--error 1276 +start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; + +start slave sql_thread; +start slave until master_log_file='master-bin.000001', master_log_pos=561; diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test index 7eeccaf64f2..35fbec72ac8 100644 --- a/mysql-test/t/rpl_user_variables.test +++ b/mysql-test/t/rpl_user_variables.test @@ -29,13 +29,16 @@ insert into t1 values (@i1), (@i2), (@i3), (@i4); insert into t1 values (@r1), (@r2); insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5); insert into t1 values (@n1); -insert into t1 values (@n2); +insert into t1 values (@n2); # not explicitely set before insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1); insert into t1 values (@a+(@b:=@a+1)); set @q:='abc'; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')); set @a:=5; insert into t1 values (@a),(@a); +connection master1; # see if variable is reset in binlog when thread changes +insert into t1 values (@a),(@a),(@a*5); +select * from t1; save_master_pos; connection slave; sync_with_master; diff --git a/mysql-test/t/sel000033.test b/mysql-test/t/sel000033.test deleted file mode 100644 index 72e096311ce..00000000000 --- a/mysql-test/t/sel000033.test +++ /dev/null @@ -1,20 +0,0 @@ -# sel000033 -# -# Versions -# -------- -# 3.22 -# 3.23 -# -# Description -# ----------- -# test for a bug with in() and unique key - ---disable_warnings -drop table if exists t1; ---enable_warnings -create table t1 (id int(10) primary key); -insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9); - -select id from t1 where id in (2,5,9) ; -select id from t1 where id=2 or id=5 or id=9 ; -drop table t1; diff --git a/mysql-test/t/sel000100.test b/mysql-test/t/sel000100.test deleted file mode 100644 index c9923d178c6..00000000000 --- a/mysql-test/t/sel000100.test +++ /dev/null @@ -1,48 +0,0 @@ ---disable_warnings -DROP TABLE IF EXISTS t1,t2; ---enable_warnings - -CREATE TABLE t1 ( - ID int(11) NOT NULL auto_increment, - NAME varchar(75) DEFAULT '' NOT NULL, - LINK_ID int(11) DEFAULT '0' NOT NULL, - PRIMARY KEY (ID), - KEY NAME (NAME), - KEY LINK_ID (LINK_ID) -); - -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0); -INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0); - -CREATE TABLE t2 ( - ID int(11) NOT NULL auto_increment, - NAME varchar(150) DEFAULT '' NOT NULL, - PRIMARY KEY (ID), - KEY NAME (NAME) -); - -SELECT DISTINCT - t2.id AS key_link_id, - t2.name AS link -FROM t1 -LEFT JOIN t2 ON t1.link_id=t2.id -GROUP BY t1.id -ORDER BY link; - -drop table t1,t2; - -# -# test case for #674 -# -CREATE TABLE t1 ( - html varchar(5) default NULL, - rin int(11) default '0', - out int(11) default '0' -) TYPE=MyISAM; - -INSERT INTO t1 VALUES ('1',1,0); - -SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; - -drop table t1; diff --git a/mysql-test/t/select_safe.test b/mysql-test/t/select_safe.test index 1f46355d39b..3cafd31a879 100644 --- a/mysql-test/t/select_safe.test +++ b/mysql-test/t/select_safe.test @@ -59,9 +59,9 @@ SELECT * from t1; SELECT @@MAX_SEEKS_FOR_KEY; analyze table t1; insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); -explain select * from t1,t1 as t2 where t1.b=t2.b; +explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; set MAX_SEEKS_FOR_KEY=1; -explain select * from t1,t1 as t2 where t1.b=t2.b; +explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; SET MAX_SEEKS_FOR_KEY=DEFAULT; drop table t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index f6f0ac0b82b..633826186be 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -120,6 +120,13 @@ insert into t1 (type_timestamp) values ("2003-02-07 10:00:01"); select * from t1; drop table t1; +# +# Check metadata +# +create table t1 (a int not null); +create table t2 select max(a) from t1; +show columns from t2; +drop table t1,t2; # Check auto conversions of types diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 4f2f03ba941..9ba91c7e0a6 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -607,6 +607,7 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; +select * from t1; SHOW CREATE TABLE t1; drop table t1; @@ -893,15 +894,63 @@ DROP TABLE t1, t2; # # UNION unlocking test # +--disable_warnings create table t1 (a int) type=innodb; create table t2 (a int) type=innodb; create table t3 (a int) type=innodb; +--enable_warnings insert into t1 values (1),(2),(3),(4); insert into t2 values (10),(20),(30),(40); insert into t3 values (1),(2),(10),(50); select a from t3 where t3.a in (select a from t1 where a <= 3 union select * from t2 where a <= 30); drop table t1,t2,t3; +# +# collation test +# +CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci, + s2 CHAR(5) COLLATE latin1_swedish_ci); +INSERT INTO t1 VALUES ('z','?'); +-- error 1266 +select * from t1 where s1 > (select max(s2) from t1); +-- error 1266 +select * from t1 where s1 > any (select max(s2) from t1); +drop table t1; + +# +# aggregate functions reinitialization +# +create table t1(toid int,rd int); +create table t2(userid int,pmnew int,pmtotal int); +insert into t2 values(1,0,0),(2,0,0); +insert into t1 values(1,0),(1,0),(1,0),(1,12),(1,15),(1,123),(1,12312),(1,12312),(1,123),(2,0),(2,0),(2,1),(2,2); +select userid,pmtotal,pmnew, (select count(rd) from t1 where toid=t2.userid) calc_total, (select count(rd) from t1 where rd=0 and toid=t2.userid) calc_new from t2 where userid in (select distinct toid from t1); +drop table t1, t2; + +# +# row union +# +create table t1 (s1 char(5)); +-- error 1240 +select (select 'a','b' from t1 union select 'a','b' from t1) from t1; +insert into t1 values ('tttt'); +select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1); +explain (select * from t1); +(select * from t1); +drop table t1; + +# +# IN optimisation test results +# +create table t1 (s1 char(5), index s1(s1)); +create table t2 (s1 char(5), index s1(s1)); +insert into t1 values ('a1'),('a2'),('a3'); +insert into t2 values ('a1'),('a2'); +select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +explain select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +explain select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +drop table t1,t2; # # correct ALL optimisation # diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index a8daf36ed10..f618c342936 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -49,6 +49,7 @@ check table t9; optimize table t9; repair table t9; alter table t9 add column c int not null; +--replace_result $MYSQL_TEST_DIR TEST_DIR show create table t9; # Test renames @@ -89,5 +90,6 @@ enable_query_log; alter table t9 rename mysqltest.t9; select count(*) from mysqltest.t9; +--replace_result $MYSQL_TEST_DIR TEST_DIR show create table mysqltest.t9; drop database mysqltest; diff --git a/mysql-test/t/type_nchar.test b/mysql-test/t/type_nchar.test new file mode 100644 index 00000000000..e85609e3f0c --- /dev/null +++ b/mysql-test/t/type_nchar.test @@ -0,0 +1,35 @@ +# +# Test nchar/nvarchar +# +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (c nchar(10)); +show create table t1; +drop table t1; + +create table t1 (c national char(10)); +show create table t1; +drop table t1; + +create table t1 (c national varchar(10)); +show create table t1; +drop table t1; + +create table t1 (c nvarchar(10)); +show create table t1; +drop table t1; + +create table t1 (c nchar varchar(10)); +show create table t1; +drop table t1; + +create table t1 (c national character varying(10)); +show create table t1; +drop table t1; + +create table t1 (c nchar varying(10)); +show create table t1; +drop table t1; + diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 8f49f56b991..b64f0b4e2ee 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -193,6 +193,62 @@ select * from t3; select * from t4; drop table t1,t2,t3,t4; +# +# Test of SQL_CALC_FOUND_ROW handling +# +create table t1 (a int); +insert into t1 values (1),(2),(3); +create table t2 (a int); +insert into t2 values (3),(4),(5); + +# Test global limits +(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1; +select found_rows(); +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2; +select found_rows(); + +# Test cases where found_rows() should return number of returned rows +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2); +select found_rows(); +(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1); +select found_rows(); +# This used to work in 4.0 but not anymore in 4.1 +--error 1149 +(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1; +#select found_rows(); + +# In these case found_rows() should work +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2; +select found_rows(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2; +select found_rows(); + +# The following examples will not be exact +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2; +select found_rows(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 100; +select found_rows(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 100 UNION SELECT * FROM t2; +select found_rows(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2; +select found_rows(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION SELECT * FROM t2 LIMIT 2; +select found_rows(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2,2; +select found_rows(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 limit 2,2 UNION SELECT * FROM t2; +select found_rows(); + +# Test some limits with ORDER BY +SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1; +(SELECT * FROM t1 ORDER by a) UNION ALL (SELECT * FROM t2 ORDER BY a) ORDER BY A desc LIMIT 4; + +# Wrong usage +--error 1234 +(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1; + +drop table t1,t2; + # # Test for another bug with UNION and LEFT JOIN # diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index 514eace25a3..947c944c79e 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -8,6 +8,9 @@ set @a := foo; set @a := connection_id() + 3; select @a - connection_id(); +set @b := 1; +select @b; + # Check using and setting variables with SELECT DISTINCT CREATE TABLE t1 ( i int not null, v int not null,index (i)); diff --git a/mysys/Makefile.am b/mysys/Makefile.am index 5b1c859cb2a..9e563755ebd 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -29,7 +29,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\ mf_path.c mf_loadpath.c\ my_open.c my_create.c my_dup.c my_seek.c my_read.c \ my_pread.c my_write.c \ - mf_keycache.c \ + mf_keycache.c my_crc32.c \ mf_iocache.c mf_iocache2.c mf_cache.c mf_tempfile.c \ mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \ my_malloc.c my_realloc.c my_once.c mulalloc.c \ diff --git a/mysys/charset.c b/mysys/charset.c index 7a82f8780a0..7d0516ac81b 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -119,7 +119,7 @@ static void simple_cs_init_functions(CHARSET_INFO *cs) if (cs->state & MY_CS_BINSORT) { - cs->coll= &my_collation_bin_handler; + cs->coll= &my_collation_8bit_bin_handler; } else { @@ -226,7 +226,6 @@ static my_bool create_fromuni(CHARSET_INFO *cs) static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) { to->number= from->number ? from->number : to->number; - to->state|= from->state; if (from->csname) to->csname= my_once_strdup(from->csname,MYF(MY_WME)); @@ -278,12 +277,10 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs) static int add_collation(CHARSET_INFO *cs) { - if (cs->name && (cs->number || (cs->number=get_charset_number(cs->name)))) + if (cs->name && (cs->number || (cs->number=get_collation_number(cs->name)))) { if (!all_charsets[cs->number]) { - if (cs->state & MY_CS_COMPILED) - goto clear; if (!(all_charsets[cs->number]= (CHARSET_INFO*) my_once_alloc(sizeof(CHARSET_INFO),MYF(0)))) return MY_XML_ERROR; @@ -296,6 +293,8 @@ static int add_collation(CHARSET_INFO *cs) if (cs->binary_number == cs->number) cs->state |= MY_CS_BINSORT; + all_charsets[cs->number]->state|= cs->state; + if (!(all_charsets[cs->number]->state & MY_CS_COMPILED)) { simple_cs_init_functions(all_charsets[cs->number]); @@ -304,15 +303,28 @@ static int add_collation(CHARSET_INFO *cs) { all_charsets[cs->number]->state |= MY_CS_LOADED; } + all_charsets[cs->number]->state|= MY_CS_AVAILABLE; } else { + /* + We need the below to make get_charset_name() + and get_charset_number() working even if a + character set has not been really incompiled. + The above functions are used for example + in error message compiler extra/comp_err.c. + If a character set was compiled, this information + will get lost and overwritten in add_compiled_collation(). + */ CHARSET_INFO *dst= all_charsets[cs->number]; - dst->state |= cs->state; + dst->number= cs->number; if (cs->comment) dst->comment= my_once_strdup(cs->comment,MYF(MY_WME)); + if (cs->csname) + dst->csname= my_once_strdup(cs->csname,MYF(MY_WME)); + if (cs->name) + dst->name= my_once_strdup(cs->name,MYF(MY_WME)); } -clear: cs->number= 0; cs->primary_number= 0; cs->binary_number= 0; @@ -389,77 +401,79 @@ char *get_charsets_dir(char *buf) CHARSET_INFO *all_charsets[256]; CHARSET_INFO *default_charset_info = &my_charset_latin1; -#define MY_ADD_CHARSET(x) all_charsets[(x)->number]=(x) +static void add_compiled_collation(CHARSET_INFO *cs) +{ + all_charsets[cs->number]= cs; + cs->state|= MY_CS_AVAILABLE; +} static my_bool init_compiled_charsets(myf flags __attribute__((unused))) { CHARSET_INFO *cs; - MY_ADD_CHARSET(&my_charset_bin); + add_compiled_collation(&my_charset_bin); - MY_ADD_CHARSET(&my_charset_latin1); - MY_ADD_CHARSET(&my_charset_latin1_bin); - MY_ADD_CHARSET(&my_charset_latin1_german2_ci); + add_compiled_collation(&my_charset_latin1); + add_compiled_collation(&my_charset_latin1_bin); + add_compiled_collation(&my_charset_latin1_german2_ci); #ifdef HAVE_CHARSET_big5 - MY_ADD_CHARSET(&my_charset_big5_chinese_ci); - MY_ADD_CHARSET(&my_charset_big5_bin); + add_compiled_collation(&my_charset_big5_chinese_ci); + add_compiled_collation(&my_charset_big5_bin); #endif #ifdef HAVE_CHARSET_cp1250 - MY_ADD_CHARSET(&my_charset_cp1250_czech_ci); + add_compiled_collation(&my_charset_cp1250_czech_ci); #endif #ifdef HAVE_CHARSET_latin2 - MY_ADD_CHARSET(&my_charset_latin2_czech_ci); + add_compiled_collation(&my_charset_latin2_czech_ci); #endif #ifdef HAVE_CHARSET_euckr - MY_ADD_CHARSET(&my_charset_euckr_korean_ci); - MY_ADD_CHARSET(&my_charset_euckr_bin); + add_compiled_collation(&my_charset_euckr_korean_ci); + add_compiled_collation(&my_charset_euckr_bin); #endif #ifdef HAVE_CHARSET_gb2312 - MY_ADD_CHARSET(&my_charset_gb2312_chinese_ci); - MY_ADD_CHARSET(&my_charset_gb2312_bin); + add_compiled_collation(&my_charset_gb2312_chinese_ci); + add_compiled_collation(&my_charset_gb2312_bin); #endif #ifdef HAVE_CHARSET_gbk - MY_ADD_CHARSET(&my_charset_gbk_chinese_ci); - MY_ADD_CHARSET(&my_charset_gbk_bin); + add_compiled_collation(&my_charset_gbk_chinese_ci); + add_compiled_collation(&my_charset_gbk_bin); #endif #ifdef HAVE_CHARSET_sjis - MY_ADD_CHARSET(&my_charset_sjis_japanese_ci); - MY_ADD_CHARSET(&my_charset_sjis_bin); + add_compiled_collation(&my_charset_sjis_japanese_ci); + add_compiled_collation(&my_charset_sjis_bin); #endif #ifdef HAVE_CHARSET_tis620 - MY_ADD_CHARSET(&my_charset_tis620_thai_ci); - MY_ADD_CHARSET(&my_charset_tis620_bin); + add_compiled_collation(&my_charset_tis620_thai_ci); + add_compiled_collation(&my_charset_tis620_bin); #endif #ifdef HAVE_CHARSET_ucs2 - MY_ADD_CHARSET(&my_charset_ucs2_general_ci); - MY_ADD_CHARSET(&my_charset_ucs2_bin); + add_compiled_collation(&my_charset_ucs2_general_ci); + add_compiled_collation(&my_charset_ucs2_bin); #endif #ifdef HAVE_CHARSET_ujis - MY_ADD_CHARSET(&my_charset_ujis_japanese_ci); - MY_ADD_CHARSET(&my_charset_ujis_bin); + add_compiled_collation(&my_charset_ujis_japanese_ci); + add_compiled_collation(&my_charset_ujis_bin); #endif #ifdef HAVE_CHARSET_utf8 - MY_ADD_CHARSET(&my_charset_utf8_general_ci); - MY_ADD_CHARSET(&my_charset_utf8_bin); + add_compiled_collation(&my_charset_utf8_general_ci); + add_compiled_collation(&my_charset_utf8_bin); #endif /* Copy compiled charsets */ for (cs=compiled_charsets; cs->name; cs++) - { - all_charsets[cs->number]=cs; - } + add_compiled_collation(cs); return FALSE; } @@ -513,7 +527,7 @@ void free_charsets(void) } -uint get_charset_number(const char *charset_name) +uint get_collation_number(const char *name) { CHARSET_INFO **cs; if (init_available_charsets(MYF(0))) /* If it isn't initialized */ @@ -522,12 +536,27 @@ uint get_charset_number(const char *charset_name) for (cs= all_charsets; cs < all_charsets+255; ++cs) { if ( cs[0] && cs[0]->name && - !my_strcasecmp(&my_charset_latin1, cs[0]->name, charset_name)) + !my_strcasecmp(&my_charset_latin1, cs[0]->name, name)) return cs[0]->number; } return 0; /* this mimics find_type() */ } +uint get_charset_number(const char *charset_name, uint cs_flags) +{ + CHARSET_INFO **cs; + if (init_available_charsets(MYF(0))) /* If it isn't initialized */ + return 0; + + for (cs= all_charsets; cs < all_charsets+255; ++cs) + { + if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) && + !my_strcasecmp(&my_charset_latin1, cs[0]->csname, charset_name)) + return cs[0]->number; + } + return 0; +} + const char *get_charset_name(uint charset_number) { @@ -555,7 +584,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) cs= all_charsets[cs_number]; - if (cs && !(cs->state & (MY_CS_COMPILED | MY_CS_LOADED))) + if (cs && !(cs->state & MY_CS_COMPILED) && !(cs->state & MY_CS_LOADED)) { strxmov(get_charsets_dir(buf), cs->csname, ".xml", NullS); my_read_charset_file(buf,flags); @@ -593,7 +622,7 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags) CHARSET_INFO *cs; (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ - cs_number=get_charset_number(cs_name); + cs_number=get_collation_number(cs_name); cs= cs_number ? get_internal_charset(cs_number,flags) : NULL; if (!cs && (flags & MY_WME)) @@ -611,23 +640,15 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags) { - CHARSET_INFO *cs=NULL; - CHARSET_INFO **css; + uint cs_number; + CHARSET_INFO *cs; DBUG_ENTER("get_charset_by_csname"); DBUG_PRINT("enter",("name: '%s'", cs_name)); (void) init_available_charsets(MYF(0)); /* If it isn't initialized */ - for (css= all_charsets; css < all_charsets+255; ++css) - { - if ( css[0] && (css[0]->state & cs_flags) && - css[0]->csname && !my_strcasecmp(&my_charset_latin1, - css[0]->csname, cs_name)) - { - cs= css[0]->number ? get_internal_charset(css[0]->number,flags) : NULL; - break; - } - } + cs_number= get_charset_number(cs_name, cs_flags); + cs= cs_number ? get_internal_charset(cs_number, flags) : NULL; if (!cs && (flags & MY_WME)) { diff --git a/mysys/checksum.c b/mysys/checksum.c index 1dd135c7ad9..92ec3d550f1 100644 --- a/mysys/checksum.c +++ b/mysys/checksum.c @@ -19,19 +19,24 @@ #include "my_sys.h" /* - Calculate a long checksum for a memoryblock. Used to verify pack_isam - + Calculate a long checksum for a memoryblock. + SYNOPSIS - checksum() - mem Pointer to memory block - count Count of bytes + my_checksum() + crc start value for crc + pos pointer to memory block + length length of the block */ -ulong checksum(const byte *mem, uint count) +ha_checksum my_checksum(ha_checksum crc, const byte *pos, uint length) { - ulong crc; - for (crc= 0; count-- ; mem++) - crc= ((crc << 1) + *((uchar*) mem)) + - test(crc & ((ulong) 1L << (8*sizeof(ulong)-1))); +#ifdef NOT_USED + const byte *end=pos+length; + for ( ; pos != end ; pos++) + crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8)); return crc; +#else + return (ha_checksum)crc32((uint)crc, (const uchar *)pos, length); +#endif } + diff --git a/mysys/default.c b/mysys/default.c index 9f7181b7da9..8bdf8d4f741 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -15,22 +15,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /**************************************************************************** -** Add all options from files named "group".cnf from the default_directories -** before the command line arguments. -** On Windows defaults will also search in the Windows directory for a file -** called 'group'.ini -** As long as the program uses the last argument for conflicting -** options one only have to add a call to "load_defaults" to enable -** use of default values. -** pre- and end 'blank space' are removed from options and values. The -** following escape sequences are recognized in values: \b \t \n \r \\ -** -** The following arguments are handled automaticly; If used, they must be -** first argument on the command line! -** --no-defaults ; no options are read. -** --defaults-file=full-path-to-default-file ; Only this file will be read. -** --defaults-extra-file=full-path-to-default-file ; Read this file before ~/ -** --print-defaults ; Print the modified command line and exit + Add all options from files named "group".cnf from the default_directories + before the command line arguments. + On Windows defaults will also search in the Windows directory for a file + called 'group'.ini + As long as the program uses the last argument for conflicting + options one only have to add a call to "load_defaults" to enable + use of default values. + pre- and end 'blank space' are removed from options and values. The + following escape sequences are recognized in values: \b \t \n \r \\ + + The following arguments are handled automaticly; If used, they must be + first argument on the command line! + --no-defaults ; no options are read. + --defaults-file=full-path-to-default-file ; Only this file will be read. + --defaults-extra-file=full-path-to-default-file ; Read this file before ~/ + --print-defaults ; Print the modified command line and exit ****************************************************************************/ #include "mysys_priv.h" @@ -66,13 +66,46 @@ NullS, #define windows_ext ".ini" #endif -static my_bool search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc, - const char *dir, const char *config_file, - const char *ext, TYPELIB *group); +static int search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc, + const char *dir, const char *config_file, + const char *ext, TYPELIB *group); static char *remove_end_comment(char *ptr); -void load_defaults(const char *conf_file, const char **groups, + +/* + Read options from configurations files + + SYNOPSIS + load_defaults() + conf_file Basename for configuration file to search for. + If this is a path, then only this file is read. + groups Which [group] entrys to read. + Points to an null terminated array of pointers + argc Pointer to argc of original program + argv Pointer to argv of original program + + IMPLEMENTATION + + Read options from configuration files and put them BEFORE the arguments + that are already in argc and argv. This way the calling program can + easily command line options override options in configuration files + + NOTES + In case of fatal error, the function will print a warning and do + exit(1) + + To free used memory one should call free_defaults() with the argument + that was put in *argv + + RETURN + 0 ok + 1 The given conf_file didn't exists + 2 The given conf_file was not a normal readable file +*/ + + +int load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv) { DYNAMIC_ARRAY args; @@ -80,6 +113,7 @@ void load_defaults(const char *conf_file, const char **groups, TYPELIB group; my_bool found_print_defaults=0; uint args_used=0; + int error= 0; MEM_ROOT alloc; char *ptr,**res; DBUG_ENTER("load_defaults"); @@ -100,7 +134,7 @@ void load_defaults(const char *conf_file, const char **groups, (*argc)--; *argv=res; *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ - DBUG_VOID_RETURN; + DBUG_RETURN(0); } /* Check if we want to force the use a specific default file */ @@ -129,14 +163,14 @@ void load_defaults(const char *conf_file, const char **groups, goto err; if (forced_default_file) { - if (search_default_file(&args, &alloc, "", forced_default_file, "", - &group)) + if ((error= search_default_file(&args, &alloc, "", + forced_default_file, "", &group)) < 0) goto err; } else if (dirname_length(conf_file)) { - if (search_default_file(&args, &alloc, NullS, conf_file, default_ext, - &group)) + if ((error= search_default_file(&args, &alloc, NullS, conf_file, + default_ext, &group)) < 0) goto err; } else @@ -144,29 +178,36 @@ void load_defaults(const char *conf_file, const char **groups, #ifdef __WIN__ char system_dir[FN_REFLEN]; GetWindowsDirectory(system_dir,sizeof(system_dir)); - if (search_default_file(&args, &alloc, system_dir, conf_file, windows_ext, - &group)) + if ((search_default_file(&args, &alloc, system_dir, conf_file, + windows_ext, &group))) goto err; #endif #if defined(__EMX__) || defined(OS2) if (getenv("ETC") && - search_default_file(&args, &alloc, getenv("ETC"), conf_file, - default_ext, &group)) + (search_default_file(&args, &alloc, getenv("ETC"), conf_file, + default_ext, &group)) < 0) goto err; #endif for (dirs=default_directories ; *dirs; dirs++) { - int error=0; if (**dirs) - error=search_default_file(&args, &alloc, *dirs, conf_file, - default_ext, &group); + { + if (search_default_file(&args, &alloc, *dirs, conf_file, + default_ext, &group) < 0) + goto err; + } else if (defaults_extra_file) - error=search_default_file(&args, &alloc, NullS, defaults_extra_file, - default_ext, &group); - if (error) - goto err; + { + if (search_default_file(&args, &alloc, NullS, defaults_extra_file, + default_ext, &group) < 0) + goto err; /* Fatal error */ + } } } + /* + Here error contains <> 0 only if we have a fully specified conf_file + or a forced default file + */ if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+ (args.elements + *argc +1) *sizeof(char*)))) goto err; @@ -202,12 +243,12 @@ void load_defaults(const char *conf_file, const char **groups, for (i=1 ; i < *argc ; i++) printf("%s ", (*argv)[i]); puts(""); - exit(1); + exit(0); } - DBUG_VOID_RETURN; + DBUG_RETURN(error); err: - fprintf(stderr,"Program aborted\n"); + fprintf(stderr,"Fatal error in defaults handling. Program aborted\n"); exit(1); } @@ -220,9 +261,28 @@ void free_defaults(char **argv) } -static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, - const char *dir, const char *config_file, - const char *ext, TYPELIB *group) +/* + Open a configuration file (if exists) and read given options from it + + SYNOPSIS + search_default_file() + args Store pointer to found options here + alloc Allocate strings in this object + dir directory to read + config_file Name of configuration file + ext Extension for configuration file + group groups to read + + RETURN + 0 Success + -1 Fatal error, abort + 1 File not found (Warning) + 2 File is not a regular file (Warning) +*/ + +static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, + const char *dir, const char *config_file, + const char *ext, TYPELIB *group) { char name[FN_REFLEN+10],buff[4096],*ptr,*end,*value,*tmp; FILE *fp; @@ -247,7 +307,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, { MY_STAT stat_info; if (!my_stat(name,&stat_info,MYF(0))) - return 0; + return 1; /* Ignore world-writable regular files. This is mainly done to protect us to not read a file created by @@ -364,7 +424,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, err: my_fclose(fp,MYF(0)); - return 1; + return -1; /* Fatal error */ } diff --git a/mysys/hash.c b/mysys/hash.c index 0b2dbc484bc..b0ddbd90794 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -217,7 +217,7 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length) /* Write a hash-key to the hash-index */ -my_bool hash_insert(HASH *info,const byte *record) +my_bool my_hash_insert(HASH *info,const byte *record) { int flag; uint halfbuff,hash_nr,first_index,idx; diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 0f35ee048bb..d96d4c0db3c 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -988,6 +988,20 @@ end: } +int my_b_safe_write(IO_CACHE *info, const byte *Buffer, uint Count) +{ + /* + Sasha: We are not writing this with the ? operator to avoid hitting + a possible compiler bug. At least gcc 2.95 cannot deal with + several layers of ternary operators that evaluated comma(,) operator + expressions inside - I do have a test case if somebody wants it + */ + if (info->type == SEQ_READ_APPEND) + return my_b_append(info, Buffer, Count); + return my_b_write(info, Buffer, Count); +} + + /* Write a block to disk where part of the data may be inside the record buffer. As all write calls to the data goes through the cache, diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c index 06e8f159f4a..8e46b0808c0 100644 --- a/mysys/my_chsize.c +++ b/mysys/my_chsize.c @@ -30,74 +30,83 @@ MyFlags Flags DESCRIPTION - my_chsize() truncates file if shorter, else fill with the filler character + my_chsize() truncates file if shorter else fill with the filler character RETURN VALUE 0 Ok 1 Error */ - int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags) { + my_off_t oldsize; + char buff[IO_SIZE]; DBUG_ENTER("my_chsize"); DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %d",fd,(ulong) newlength, MyFlags)); -#ifdef HAVE_CHSIZE - if (chsize(fd,(off_t) newlength)) + oldsize = my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE)); + DBUG_PRINT("info",("old_size: %ld", (ulong) oldsize)); + + if (oldsize > newlength) +#if defined(HAVE_SETFILEPOINTER) + /* This is for the moment only true on windows */ { - DBUG_PRINT("error",("errno: %d",errno)); - my_errno=errno; - if (MyFlags & MY_WME) - my_error(EE_CANT_CHSIZE,MYF(ME_BELL+ME_WAITTANG),errno); - DBUG_RETURN(1); + HANDLE win_file= (HANDLE) _get_osfhandle(fd); + long length_low, length_high; + length_low= (long) (ulong) newlength; + length_high= (long) ((ulonglong) newlength >> 32); + if (SetFilePointer(win_file, length_low, &length_high, FILE_BEGIN)) + { + if (SetEndOfFile(win_file)) + DBUG_RETURN(0); + } + my_errno= errno; + goto err; } - DBUG_RETURN(0); -#else - /* if file is shorter, expand with null, else fill unused part with null */ +#elif defined(HAVE_FTRUNCATE) { - my_off_t oldsize; - char buff[IO_SIZE]; - - oldsize = my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE)); - DBUG_PRINT("info",("old_size: %ld", (ulong) oldsize)); - -#ifdef HAVE_FTRUNCATE - if (oldsize > newlength) + if (ftruncate(fd, (off_t) newlength)) { - if (ftruncate(fd, (off_t) newlength)) - { - my_errno=errno; - DBUG_PRINT("error",("errno: %d",errno)); - if (MyFlags & MY_WME) - my_error(EE_CANT_CHSIZE, MYF(ME_BELL+ME_WAITTANG), errno); - DBUG_RETURN(1); - } - DBUG_RETURN(0); - } -#else - if (oldsize > newlength) - { /* Fill diff with null */ - VOID(my_seek(fd, newlength, MY_SEEK_SET, MYF(MY_WME+MY_FAE))); - swap(my_off_t, newlength, oldsize); - } -#endif - /* Full file with 0 until it's as big as requested */ - bfill(buff, IO_SIZE, filler); - while (newlength-oldsize > IO_SIZE) - { - if (my_write(fd,(byte*) buff,IO_SIZE,MYF(MY_NABP))) - goto err; - oldsize+= IO_SIZE; - } - if (my_write(fd,(byte*) buff,(uint) (newlength-oldsize),MYF(MY_NABP))) + my_errno= errno; goto err; + } DBUG_RETURN(0); - err: - if (MyFlags & MY_WME) - my_error(EE_CANT_CHSIZE,MYF(ME_BELL+ME_WAITTANG),my_errno); - DBUG_PRINT("error",("errno: %d",my_errno)); - DBUG_RETURN(1); + } +#elif defined(HAVE_CHSIZE) + { + if (chsize(fd, (off_t) newlength)) + { + my_errno=errno; + goto err; + } + DBUG_RETURN(0); + } +#else + { + /* + Fill space between requested length and true length with 'filler' + We should never come here on any modern machine + */ + VOID(my_seek(fd, newlength, MY_SEEK_SET, MYF(MY_WME+MY_FAE))); + swap(my_off_t, newlength, oldsize); } #endif -} /* my_chsize */ + + /* Full file with 'filler' until it's as big as requested */ + bfill(buff, IO_SIZE, filler); + while (newlength-oldsize > IO_SIZE) + { + if (my_write(fd,(byte*) buff,IO_SIZE,MYF(MY_NABP))) + goto err; + oldsize+= IO_SIZE; + } + if (my_write(fd,(byte*) buff,(uint) (newlength-oldsize),MYF(MY_NABP))) + goto err; + DBUG_RETURN(0); + +err: + DBUG_PRINT("error", ("errno: %d", errno)); + if (MyFlags & MY_WME) + my_error(EE_CANT_CHSIZE, MYF(ME_BELL+ME_WAITTANG), my_errno); + DBUG_RETURN(1); +} /* my_chsize */ diff --git a/mysys/my_crc32.c b/mysys/my_crc32.c new file mode 100644 index 00000000000..5514b01ede2 --- /dev/null +++ b/mysys/my_crc32.c @@ -0,0 +1,36 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + 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 */ + +#include "mysys_priv.h" + +#ifndef HAVE_COMPRESS + +/* minimal set of defines for using crc32() from zlib codebase */ +#define _ZLIB_H +#define ZEXPORT +#define Z_NULL 0 +#define OF(args) args +#undef DYNAMIC_CRC_TABLE +typedef uchar Byte; +typedef uchar Bytef; +typedef uint uInt; +typedef ulong uLong; +typedef ulong uLongf; + +#include "../zlib/crc32.c" + +#endif + diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index cbbf876ac06..edd35749633 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -461,7 +461,7 @@ static char *check_struct_option(char *cur_arg, char *key_name) { char *ptr, *end; - ptr= strcend(cur_arg + 1, '.'); // Skip the first character + ptr= strcend(cur_arg + 1, '.'); /* Skip the first character */ end= strcend(cur_arg, '='); /* @@ -525,8 +525,7 @@ static int setval(const struct my_option *opts, gptr *value, char *argument, break; case GET_STR_ALLOC: if ((*((char**) result_pos))) - my_free((*(char**) result_pos), - MYF(MY_WME | MY_FAE)); + my_free((*(char**) result_pos), MYF(MY_WME | MY_FAE)); if (!(*((char**) result_pos)= my_strdup(argument, MYF(MY_WME)))) return EXIT_OUT_OF_MEMORY; break; diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index b273363aaf1..df9fe1f9bc4 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -24,26 +24,26 @@ /* My memory allocator */ -gptr my_malloc(unsigned int Size, myf MyFlags) +gptr my_malloc(unsigned int size, myf my_flags) { gptr point; DBUG_ENTER("my_malloc"); - DBUG_PRINT("my",("Size: %u MyFlags: %d",Size, MyFlags)); + DBUG_PRINT("my",("size: %u my_flags: %d",size, my_flags)); - if (!Size) - Size=1; /* Safety */ - if ((point = (char*)malloc(Size)) == NULL) + if (!size) + size=1; /* Safety */ + if ((point = (char*)malloc(size)) == NULL) { my_errno=errno; - if (MyFlags & MY_FAE) + if (my_flags & MY_FAE) error_handler_hook=fatal_error_handler_hook; - if (MyFlags & (MY_FAE+MY_WME)) - my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),Size); - if (MyFlags & MY_FAE) + if (my_flags & (MY_FAE+MY_WME)) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); + if (my_flags & MY_FAE) exit(1); } - else if (MyFlags & MY_ZEROFILL) - bzero(point,Size); + else if (my_flags & MY_ZEROFILL) + bzero(point,size); DBUG_PRINT("exit",("ptr: %lx",point)); DBUG_RETURN(point); } /* my_malloc */ @@ -64,29 +64,29 @@ void my_no_flags_free(gptr ptr) /* malloc and copy */ -gptr my_memdup(const byte *from, uint length, myf MyFlags) +gptr my_memdup(const byte *from, uint length, myf my_flags) { gptr ptr; - if ((ptr=my_malloc(length,MyFlags)) != 0) + if ((ptr=my_malloc(length,my_flags)) != 0) memcpy((byte*) ptr, (byte*) from,(size_t) length); return(ptr); } -char *my_strdup(const char *from, myf MyFlags) +char *my_strdup(const char *from, myf my_flags) { gptr ptr; uint length=(uint) strlen(from)+1; - if ((ptr=my_malloc(length,MyFlags)) != 0) + if ((ptr=my_malloc(length,my_flags)) != 0) memcpy((byte*) ptr, (byte*) from,(size_t) length); return((my_string) ptr); } -char *my_strdup_with_length(const byte *from, uint length, myf MyFlags) +char *my_strdup_with_length(const byte *from, uint length, myf my_flags) { gptr ptr; - if ((ptr=my_malloc(length+1,MyFlags)) != 0) + if ((ptr=my_malloc(length+1,my_flags)) != 0) { memcpy((byte*) ptr, (byte*) from,(size_t) length); ((char*) ptr)[length]=0; diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 32528707480..f10a2210064 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -92,7 +92,7 @@ void *my_pthread_getspecific_imp(pthread_key_t key) #ifdef __NETWARE__ /* -don't kill the LibC Reaper thread or the main thread + Don't kill the LibC Reaper thread or the main thread */ #include #undef pthread_exit @@ -105,8 +105,10 @@ void my_pthread_exit(void *status) NXThreadGetContext(tid, &ctx); NXContextGetName(ctx, name, PATH_MAX); - // "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread" - // with a debug build of LibC the reaper can have different names + /* + "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread" + with a debug build of LibC the reaper can have different names + */ if (!strindex(name, "\'s")) { pthread_exit(status); @@ -114,8 +116,10 @@ void my_pthread_exit(void *status) } #endif -/* Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7 - (and DEC OSF/1 3.2 too) */ +/* + Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7 + (and DEC OSF/1 3.2 too) +*/ int my_pthread_create_detached=1; diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c index 49d96c2eb4f..5190fa75dce 100644 --- a/mysys/my_realloc.c +++ b/mysys/my_realloc.c @@ -23,40 +23,41 @@ /* My memory re allocator */ -gptr my_realloc(gptr oldpoint, uint Size, myf MyFlags) +gptr my_realloc(gptr oldpoint, uint size, myf my_flags) { gptr point; DBUG_ENTER("my_realloc"); - DBUG_PRINT("my",("ptr: %lx Size: %u MyFlags: %d",oldpoint, Size, MyFlags)); + DBUG_PRINT("my",("ptr: %lx size: %u my_flags: %d",oldpoint, size, + my_flags)); - if (!oldpoint && (MyFlags & MY_ALLOW_ZERO_PTR)) - DBUG_RETURN(my_malloc(Size,MyFlags)); + if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) + DBUG_RETURN(my_malloc(size,my_flags)); #ifdef USE_HALLOC - if (!(point = malloc(Size))) + if (!(point = malloc(size))) { - if (MyFlags & MY_FREE_ON_ERROR) - my_free(oldpoint,MyFlags); - if (MyFlags & MY_HOLD_ON_ERROR) + if (my_flags & MY_FREE_ON_ERROR) + my_free(oldpoint,my_flags); + if (my_flags & MY_HOLD_ON_ERROR) DBUG_RETURN(oldpoint); my_errno=errno; - if (MyFlags & MY_FAE+MY_WME) - my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),Size); + if (my_flags & MY_FAE+MY_WME) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); } else { - memcpy(point,oldpoint,Size); + memcpy(point,oldpoint,size); free(oldpoint); } #else - if ((point = (char*)realloc(oldpoint,Size)) == NULL) + if ((point = (char*)realloc(oldpoint,size)) == NULL) { - if (MyFlags & MY_FREE_ON_ERROR) + if (my_flags & MY_FREE_ON_ERROR) my_free(oldpoint,MyFLAGS); - if (MyFlags & MY_HOLD_ON_ERROR) + if (my_flags & MY_HOLD_ON_ERROR) DBUG_RETURN(oldpoint); my_errno=errno; - if (MyFlags & (MY_FAE+MY_WME)) - my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), Size); + if (my_flags & (MY_FAE+MY_WME)) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); } #endif DBUG_PRINT("exit",("ptr: %lx",point)); diff --git a/mysys/my_static.h b/mysys/my_static.h index 1a33bcf21f3..08d1a93692f 100644 --- a/mysys/my_static.h +++ b/mysys/my_static.h @@ -19,7 +19,6 @@ a shared library */ -#include "mysys_priv.h" #include #define MAX_SIGNALS 10 /* Max signals under a dont-allow */ diff --git a/mysys/testhash.c b/mysys/testhash.c index a1d14dc225d..72badffdbcd 100644 --- a/mysys/testhash.c +++ b/mysys/testhash.c @@ -83,7 +83,7 @@ static int do_test() n1=rnd(1000); n2=rnd(100); n3=rnd(min(recant*5,MAX_RECORDS)); record= (char*) my_malloc(reclength,MYF(MY_FAE)); sprintf(record,"%6d:%4d:%8d:Pos: %4d ",n1,n2,n3,write_count); - if (hash_insert(&hash,record)) + if (my_hash_insert(&hash,record)) { printf("Error: %d in write at record: %d\n",my_errno,i); goto err; @@ -199,7 +199,7 @@ static int do_test() record=(byte*) my_malloc(reclength,MYF(MY_FAE)); memcpy(record,recpos,reclength); record[reclength-1]=rnd(5)+1; - if (hash_insert(&hash2,record)) + if (my_hash_insert(&hash2,record)) { printf("Got error when inserting record: %*s",reclength,record); goto err; diff --git a/netware/BUILD/compile-netware-max b/netware/BUILD/compile-netware-max new file mode 100755 index 00000000000..ec737d4615c --- /dev/null +++ b/netware/BUILD/compile-netware-max @@ -0,0 +1,23 @@ +#! /bin/sh + +# debug +#set -x + +# stop on errors +set -e + + +path=`dirname $0` +. $path/compile-netware-START + +suffix="max" + +extra_configs=" \ + --with-innodb \ + --with-embedded-server \ + --with-openssl \ + " + +. $path/compile-netware-END + + diff --git a/netware/BUILD/compile-netware-max-debug b/netware/BUILD/compile-netware-max-debug new file mode 100755 index 00000000000..ea3553ae6e1 --- /dev/null +++ b/netware/BUILD/compile-netware-max-debug @@ -0,0 +1,23 @@ +#! /bin/sh + +# debug +#set -x + +# stop on errors +set -e + +path=`dirname $0` +. $path/compile-netware-START + +suffix="max-debug" + +extra_configs=" \ + --with-innodb \ + --with-debug=full \ + --with-embedded-server \ + --with-openssl \ + " + +. $path/compile-netware-END + + diff --git a/netware/BUILD/compile-netware-src b/netware/BUILD/compile-netware-src new file mode 100755 index 00000000000..df7f6fcdd1a --- /dev/null +++ b/netware/BUILD/compile-netware-src @@ -0,0 +1,36 @@ +#! /bin/sh + +# debug +#set -x + +# stop on errors +set -e + +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; + make -k distclean; +fi + +# remove other files +rm -f NEW-RPMS/* +rm -f */.deps/*.P +rm -rf Makefile.in.bk + +# zip source +files=`pwd | sed -e "s/.*\\\(mysql-.*\)/\1/"` +file=`pwd | sed -e "s/.*\\mysql-\(.*\)/mysql-src-\1-pc-netware-i686/"` +cd .. +if test -e "$file.zip"; then rm -f $file.zip; fi +zip -r $file.zip $files -x \*.zip -x \*.tar.gz +if test -e "./$files/$file.zip"; then mv -f ./$files/$file.zip ./$files/$file.zip.old; fi +mv -f $file.zip ./$files/$file.zip + diff --git a/netware/BUILD/knetware.imp b/netware/BUILD/knetware.imp new file mode 100644 index 00000000000..d9a9372b34f --- /dev/null +++ b/netware/BUILD/knetware.imp @@ -0,0 +1,2 @@ +kYieldIfTimeSliceUp + diff --git a/netware/BUILD/openssl.imp b/netware/BUILD/openssl.imp new file mode 100644 index 00000000000..8972ff5d58c --- /dev/null +++ b/netware/BUILD/openssl.imp @@ -0,0 +1,9 @@ +WS2_32_shutdown +WS2_32_closesocket +WSASetLastError +WS2_32_recv +WSASetLastError +WS2_32_send +WSAGetLastError +GetProcessSwitchCount +RunningProcess diff --git a/netware/static_init_db.sql b/netware/static_init_db.sql new file mode 100644 index 00000000000..63ee623dac4 --- /dev/null +++ b/netware/static_init_db.sql @@ -0,0 +1,34 @@ +CREATE DATABASE mysql; +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 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 (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, name varchar(64) NOT NULL, help_category_id smallint unsigned 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, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories'; + +CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords'; + +CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; diff --git a/regex/cclass.h b/regex/cclass.h index e0f752f38b8..b877b5dee6b 100644 --- a/regex/cclass.h +++ b/regex/cclass.h @@ -18,4 +18,5 @@ extern struct cclass { const char *name; const char *chars; const char *multis; + uint mask; } cclasses[]; diff --git a/regex/regcomp.c b/regex/regcomp.c index d95a0ddf5d0..6af99456c28 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -36,19 +36,19 @@ struct parse { static char nuls[10]; /* place to point scanner in event of error */ struct cclass cclasses[CCLASS_LAST+1]= { - { "alnum", "","" }, - { "alpha", "","" }, - { "blank", "","" }, - { "cntrl", "","" }, - { "digit", "","" }, - { "graph", "","" }, - { "lower", "","" }, - { "print", "","" }, - { "punct", "","" }, - { "space", "","" }, - { "upper", "","" }, - { "xdigit", "","" }, - { NULL,NULL,NULL } + { "alnum", "","", _U | _L | _NMR}, + { "alpha", "","", _U | _L }, + { "blank", "","", _B }, + { "cntrl", "","", _CTR }, + { "digit", "","", _NMR }, + { "graph", "","", _PNT | _U | _L | _NMR}, + { "lower", "","", _L }, + { "print", "","", _PNT | _U | _L | _NMR | _B }, + { "punct", "","", _PNT }, + { "space", "","", _SPC }, + { "upper", "","", _U }, + { "xdigit", "","", _X }, + { NULL,NULL,NULL, 0 } }; /* @@ -747,9 +747,7 @@ register cset *cs; register char *sp = p->next; register struct cclass *cp; register size_t len; - register char *u; - register char c; - + while (MORE() && my_isalpha(p->charset,PEEK())) NEXT(); len = p->next - sp; @@ -762,11 +760,26 @@ register cset *cs; return; } - u = (char*) cp->chars; - while ((c = *u++) != '\0') - CHadd(cs, c); - for (u = (char*) cp->multis; *u != '\0'; u += strlen(u) + 1) - MCadd(p, cs, u); +#ifndef USE_ORIG_REGEX_CODE + { + register size_t i; + for (i=1 ; i<256 ; i++) + if (p->charset->ctype[i+1] & cp->mask) + CHadd(cs, i); + } +#else + { + register char *u = (char*) cp->chars; + register char c; + + while ((c = *u++) != '\0') + CHadd(cs, c); + + for (u = (char*) cp->multis; *u != '\0'; u += strlen(u) + 1) + MCadd(p, cs, u); + } +#endif + } /* diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index b8cf4ccb3a7..8ba05910596 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -35,7 +35,7 @@ # @c example_for_help_topic # @example # .... -# @example +# @end example # # # Original version by Victor Vagin @@ -44,13 +44,16 @@ use strict; use Getopt::Long; -my $insert_portion_size= 25; -my $error_prefix= "help parsing error:"; +my $insert_portion_size= 15; +my $error_prefix= "---- help parsing errors :"; my $path_to_lex_file= "../sql/lex.h"; my $verbose_option= 0; my $help_option= 0; +my $cur_line= 0; +my $count_errors= 0; + GetOptions( "help",\$help_option, "verbose",\$verbose_option, @@ -92,6 +95,17 @@ my %keywords; $categories{Contents}->{__parent_category__}= ""; +sub print_error +{ + my ($text)= @_; + if ($count_errors==0) + { + print STDERR "$error_prefix\n"; + } + print STDERR "line $cur_line : $text"; + $count_errors++; +} + sub add_topic_to_category { my ($topic_name)= @_; @@ -104,7 +118,7 @@ sub add_topic_to_category my $old_parent= $category->{__parent_category__}; if ($old_parent ne $current_parent_category) { - print STDERR "$error_prefix wrong parent for $current_category\n"; + print_error "wrong parent for $current_category\n"; } } @@ -118,7 +132,7 @@ sub add_topic_to_category my $old_category= $topics{$topic_name}->{category}; if ($old_category ne $category) { - print STDERR "$error_prefix wrong category for $topic_name\n"; + print_error "wrong category for $topic_name\n"; } } @@ -133,7 +147,7 @@ sub add_example if (exists($topics{$topic_name}->{example})) { - print STDERR "$error_prefix double example for $topic_name\n"; + print_error "double example for $topic_name\n"; } $topics{$topic_name}->{example}= $example; @@ -148,7 +162,7 @@ sub add_description if (exists($topics{$topic_name}->{description})) { - print STDERR "$error_prefix double description for $topic_name\n"; + print_error "double description for $topic_name\n"; } $topics{$topic_name}->{description}= $description; add_topic_to_category($topic_name); @@ -164,7 +178,7 @@ sub add_keyword push(@{$topics{$topic_name}->{keywords}},$keyword); if (exists($keywords{$keyword}->{$topic_name})) { - print STDERR "$error_prefix double keyword $keyword for $topic_name\n"; + print_error "double keyword $keyword for $topic_name\n"; } $keywords{$keyword}->{$topic_name}= $topics{$topic_name}; } @@ -195,10 +209,12 @@ sub prepare_name $a =~ s/\@table \@code/ /g; $a =~ s/\(\)//g; $a =~ s/\"/\\\"/g; - + $a =~ s/((\w|\s)+)\(([\+-=><\/%*!<>\s]+)\)/$3/gxs; $a =~ s/([\+-=><\/%*!<>\s]+)\(((\w|\s)+)\)/$1/gxs; $a =~ s/((\w|\s)+)\((.+)\)/$1/gxs; + + $a =~ s/((\s)+)$//g; return $a; } @@ -278,12 +294,13 @@ sub parse_example while (<>) { + $cur_line++; last if ($_=~/\@end example/); $text .= $_; } $text= prepare_example($text); - + $topic_name= prepare_name($topic_name); add_example($topic_name,$text) if ($topic_name ne ""); } @@ -319,11 +336,13 @@ sub parse_description while (<>) { + $cur_line++; last if ($_=~/\@c end_description_for_help_topic/); $text .= $_; } $text= prepare_description($text); + $topic_name= prepare_name($topic_name); add_description($topic_name,$text); } @@ -354,6 +373,7 @@ while (<>) parse_example (); parse_description (); parse_category (); + $cur_line++; } # test results of parsing: @@ -542,3 +562,9 @@ if (scalar(@keywords_names)) } printf ";\n\n"; } + +if ($count_errors) +{ + print STDERR "$count_errors errors !!!\n"; + exit 1; +} diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1731a7555e0..9d166fc1baa 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -61,7 +61,7 @@ case $system in esac -mkdir $BASE $BASE/bin \ +mkdir $BASE $BASE/bin $BASE/docs \ $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 @@ -73,9 +73,20 @@ if [ $BASE_SYSTEM != "netware" ] ; then 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 \ - LICENSE.doc README.NW Docs/mysqlbug.txt +for i in ChangeLog \ + Docs/manual.html \ + Docs/manual.txt \ + Docs/manual_toc.html \ + Docs/mysql.info +do + if [ -f $i ] + then + $CP $i $BASE/docs + fi +done + +for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ + MySQLEULA.txt LICENSE.doc README.NW do if [ -f $i ] then diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index df7ac29ee0d..02eb5366b01 100755 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -13,7 +13,8 @@ DEBUG=0 SILENT=0 SUFFIX="" DIRNAME="" -OUTTAR=0 +OUTTAR="0" +OUTZIP="0" # # This script must run from MySQL top directory @@ -62,7 +63,8 @@ show_usage() echo " --suffix Suffix name for the package" echo " --dirname Directory name to copy files (intermediate)" echo " --silent Do not list verbosely files processed" - echo " --tar Create tar.gz package instead of .zip" + echo " --tar Create tar.gz package" + echo " --zip Create zip package" echo " --help Show this help message" exit 0 @@ -75,12 +77,14 @@ show_usage() parse_arguments() { for arg do case "$arg" in + --add-tar) ADDTAR=1 ;; --debug) DEBUG=1;; --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;; --silent) SILENT=1 ;; --tar) OUTTAR=1 ;; + --zip) OUTZIP=1 ;; --help) show_usage ;; *) echo "Unknown argument '$arg'" @@ -98,15 +102,50 @@ parse_arguments "$@" for i in $TMP $TMPDIR $TEMPDIR $TEMP /tmp do - if [ "$i" ]; then + if [ "$i" ]; then print_debug "Setting TMP to '$i'" - TMP=$i + TMP=$i break fi done - + # +# Convert argument file from unix to DOS text +# + +if [ `which recode` ] +then + + print_debug "Using 'recode' to convert from unix to dos text" + + unix_to_dos() + { + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" + + chmod u+w $arg + recode lat1..ibmpc $arg + done + } + +else + + print_debug "Using 'sed' to convert from unix to dos text" + + unix_to_dos() + { + for arg do + print_debug "Replacing LF -> CRLF from '$arg'" + + sed -e 's/$/\r/' $arg > $arg.tmp + rm -f $arg + mv $arg.tmp $arg + done + } + +fi + # # Create a tmp dest directory to copy files @@ -123,14 +162,9 @@ $CP -r $SOURCE/VC++Files $BASE ( find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print )|( - while read v + 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 + unix_to_dos $v done ) @@ -147,7 +181,7 @@ rm -r -f "$BASE/share/Makefile.am" # Clean up if we did this from a bk tree # -if [ -d $BASE/SCCS ] +if [ -d $BASE/SCCS ] then find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f fi @@ -169,9 +203,9 @@ copy_dir_files() mkdir $BASE/$arg fi for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ - README INSTALL* LICENSE - do - if [ -f $i ] + README INSTALL* LICENSE + do + if [ -f $i ] then $CP $SOURCE/$arg/$i $BASE/$arg/$i fi @@ -195,21 +229,19 @@ copy_dir_dirs() { for arg do - basedir=$arg - - if [ ! -d $BASE/$arg ]; then - mkdir $BASE/$arg - fi - - copy_dir_files $arg - - cd $SOURCE/$arg/ - for i in * - do - if [ -d $SOURCE/$basedir/$i ] && [ "$i" != "SCCS" ]; then - copy_dir_files $basedir/$i - fi - done + cd $SOURCE + ( + find $arg -type d \ + -and -not -path \*SCCS\* \ + -and -not -path \*.deps\* \ + -and -not -path \*autom4te.cache -print + )|( + while read v + do + copy_dir_files $v + done + ) + done } @@ -220,7 +252,7 @@ copy_dir_dirs() { for i in client dbug extra heap include isam \ libmysql libmysqld merge myisam \ myisammrg mysys regex sql strings sql-common \ - vio zlib + tools vio zlib do copy_dir_files $i done @@ -249,31 +281,49 @@ touch $BASE/innobase/ib_config.h # cd $SOURCE -for i in COPYING ChangeLog README \ +for i in COPYING COPYING.LIB ChangeLog README \ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ Docs/manual_toc.html Docs/manual.html \ - Docs/mysqld_error.txt Docs/INSTALL-BINARY - + Docs/manual.txt Docs/mysqld_error.txt \ + Docs/INSTALL-BINARY + do print_debug "Copying file '$i'" - if [ -f $i ] + if [ -f $i ] then $CP $i $BASE/$i fi done +# +# Raw dirs from source tree +# + +for i in Docs/Flags scripts sql-bench SSL \ + tests +do + print_debug "Copying directory '$i'" + if [ -d $i ] + then + $CP -R $i $BASE/$i + fi +done + # # Fix some windows files # ./extra/replace std:: "" -- $BASE/sql/sql_yacc.cpp +unix_to_dos $BASE/README +mv $BASE/README $BASE/README.txt + # # Initialize the initial data directory # -if [ -f scripts/mysql_install_db ]; then +if [ -f scripts/mysql_install_db ]; then print_debug "Initializing the 'data' directory" scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data fi @@ -334,9 +384,15 @@ which_1 () # Create the result zip/tar file # -set_tarzip_options() +if [ "$OUTTAR" = "0" ]; then + if [ "$OUTZIP" = "0" ]; then + OUTZIP=1 + fi +fi + +set_tarzip_options() { - for arg + for arg do if [ "$arg" = "tar" ]; then ZIPFILE1=gnutar @@ -360,43 +416,60 @@ set_tarzip_options() done } -if [ "$OUTTAR" = "1" ]; then - set_tarzip_options 'tar' -else - 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 # # Create the archive # +create_archive() +{ -print_debug "Using $tar to create archive" + print_debug "Using $tar to create archive" -cd $TMP + cd $TMP -rm -f $SOURCE/$NEW_NAME$EXT -$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME -cd $SOURCE + rm -f $SOURCE/$NEW_NAME$EXT + $tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME + cd $SOURCE -if [ "$NEED_COMPRESS" = "1" ] -then - print_debug "Compressing archive" - gzip -9 $NEW_NAME$EXT - EXT="$EXT.gz" + if [ "$NEED_COMPRESS" = "1" ] + then + print_debug "Compressing archive" + gzip -9 $NEW_NAME$EXT + EXT="$EXT.gz" + fi + + if [ "$SILENT" = "0" ] ; then + echo "$NEW_NAME$EXT created successfully !!" + fi +} + +if [ "$OUTTAR" = "1" ]; then + set_tarzip_options 'tar' + + 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 + + create_archive +fi + +if [ "$OUTZIP" = "1" ]; then + set_tarzip_options 'zip' + + tar=`which_1 $ZIPFILE1 $ZIPFILE2` + if test "$?" = "1" -o "$tar" = "" + then + echo "Search failed for '$ZIPFILE1', '$ZIPFILE2', cannot create zip!" + fi + + create_archive fi print_debug "Removing temporary directory" rm -r -f $BASE -if [ "$SILENT" = "0" ] ; then - echo "$NEW_NAME$EXT created successfully !!" -fi # End of script diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 3cc5b3a5016..e8cc9322eaf 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -86,6 +86,8 @@ client_libs='@CLIENT_LIBS@' libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs" libs=`echo $libs | sed -e 's; +;;'` +libs_r="$ldflags -L'$pkglibdir' -lmysqlclient_r $client_libs" +libs_r=`echo $libs_r | sed -e 's; +;;'` cflags="-I'$pkgincludedir'" embedded_libs="$ldflags -L'$pkglibdir' -lmysqld @LIBS@ @innodb_system_libs@" @@ -95,6 +97,7 @@ Usage: $0 [OPTIONS] Options: --cflags [$cflags] --libs [$libs] + --libs_r [$libs_r] --socket [$socket] --port [$port] --version [$version] @@ -109,6 +112,7 @@ while test $# -gt 0; do case $1 in --cflags) echo "$cflags" ;; --libs) echo "$libs" ;; + --libs_r) echo "$libs_r" ;; --socket) echo "$socket" ;; --port) echo "$port" ;; --version) echo "$version" ;; diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 2739c45e750..c4cdc7b52d7 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -108,7 +108,7 @@ then c_u="$c_u CREATE TABLE user (" c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," - c_u="$c_u Password char(45) binary DEFAULT '' NOT NULL," + c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL," c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 43dc6d89481..220bf4036db 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -1,10 +1,22 @@ +-- This script converts any old privilege tables to privilege tables suitable +-- for MySQL 4.0. + +-- You can safely ignore all 'Duplicate column' and 'Unknown column' errors" +-- as this just means that your tables where already up to date. +-- This script is safe to run even if your tables are already up to date! + +-- On unix, you should use the mysql_fix_privilege_tables script to execute +-- this sql script. +-- On windows you should do 'mysql --force < mysql_fix_privilege_tables.sql' + +USE mysql; ALTER TABLE user type=MyISAM; ALTER TABLE db type=MyISAM; ALTER TABLE host type=MyISAM; ALTER TABLE func type=MyISAM; ALTER TABLE columns_priv type=MyISAM; ALTER TABLE tables_priv type=MyISAM; -ALTER TABLE user change Password Password char(45) not null; +ALTER TABLE user change Password Password char(41) not null; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) DEFAULT '' NOT NULL, diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 309463441b5..65731c2bcb7 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -33,6 +33,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/^[^=]*=//'` ;; + --skip-name-resolve) ip_only=1 ;; --verbose) verbose=1 ;; --rpm) in_rpm=1 ;; --windows) windows=1 ;; @@ -127,7 +128,7 @@ fi if test ! -x $mysqld then - if test "$in_rpm" -eq 1 + if test "$in_rpm" = 1 then echo "FATAL ERROR $mysqld not found!" exit 1 @@ -138,13 +139,8 @@ then fi fi -# Try to determine the fully qualified domain name (FQDN) -HOSTNAME="@HOSTNAME@" -if $HOSTNAME -f > /dev/null 2>&1 ; then - hostname=`$HOSTNAME -f` -else - hostname=`$HOSTNAME` -fi +# Try to determine the hostname +hostname=`@HOSTNAME@` # Check if hostname is valid if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a $force -eq 0 @@ -171,6 +167,12 @@ then fi fi +if test "$ip_only" = 1 +then + ip=`echo "$resolved" | awk '/ /{print $6}'` + hostname=$ip +fi + # Create database directories mysql & test if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi @@ -185,7 +187,7 @@ then c_d="yes" fi -if test $verbose -eq 1 +if test $verbose = 1 then create_option="verbose" else diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d7e3eedb84e..1c056e963cb 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -148,7 +148,7 @@ else fi args= -parse_arguments `$print_defaults $defaults mysqld server mysqld_safe safe_mysqld` +parse_arguments `$print_defaults --loose-verbose $defaults mysqld server mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" if test ! -x $ledir/$MYSQLD diff --git a/sql-bench/compare-results.sh b/sql-bench/compare-results.sh index 9e3a8f2add8..e95bd23e6a3 100644 --- a/sql-bench/compare-results.sh +++ b/sql-bench/compare-results.sh @@ -93,7 +93,7 @@ foreach (@ARGV) } elsif (/Comments:\s+(.+)/i) { $tot{$prog}{'comments'} = $1; - } elsif (/^(\S+):\s*(estimated\s|)total\stime:\s+([\d.]+)\s+(wallclock\s|)secs/i) + } elsif (/^(\S+):.*(estimated\s|)total\stime:\s+([\d.]+)\s+(wallclock\s|)secs/i) { $tmp = $1; $tmp =~ s/://; $tot{$prog}{$tmp} = [ $3, (length($2) ? "+" : "")]; diff --git a/sql-bench/limits/mysql.cfg b/sql-bench/limits/mysql.cfg index cebb85d8dfd..feaa79e43e9 100644 --- a/sql-bench/limits/mysql.cfg +++ b/sql-bench/limits/mysql.cfg @@ -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=99 # Simultaneous connections (installation default) +connections=101 # Simultaneous connections (installation default) constraint_check=syntax only # Column constraints ###< create table crash_q (a int check (a>0)) ###> OK @@ -345,7 +345,7 @@ date_format_inresult=iso # Date format in result ###> OK ### ###< select a from crash_me_d - ###> 2003-03-26 + ###> 2003-08-27 ###< 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-03-26 13:44:57 + ###>2003-08-27 19:55:21 func_extra_tail=no # Function TAIL ### ###4.0.12-debug + ###>4.0.15-debug-log func_extra_weekday=yes # Function WEEKDAY ### ###13:44:57 + ###>19:55:21 func_odbc_database=yes # Function DATABASE ### ###2003-03-26 + ###>2003-08-27 func_sql_current_time=yes # Function CURRENT_TIME ### ###2003-03-26 13:44:57 + ###>2003-08-27 19:55:21 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-03-26 13:44:57 + ###>2003-08-27 19:55:21 func_sql_lower=yes # Function LOWER ### ###