diff options
234 files changed, 4508 insertions, 11074 deletions
diff --git a/.bzrignore b/.bzrignore index 8e3bf81af73..d1364b0219d 100644 --- a/.bzrignore +++ b/.bzrignore @@ -786,3 +786,9 @@ vio/test-sslserver vio/viotest-ssl extra/tztime.cc extra/mysql_tzinfo_to_sql +sql/mysql_tzinfo_to_sql_tztime.cc +sql/my_time.c +libmysql/my_time.c +libmysqld/my_time.c +sql/mysql_tzinfo_to_sql +sql/mysql_tzinfo_to_sql.cc diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index bcc5b0130a7..b64b4638f6c 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -90,6 +90,7 @@ marko@hundin.mysql.fi miguel@hegel.(none) miguel@hegel.br miguel@hegel.local +miguel@hegel.txg miguel@light. miguel@light.local miguel@sartre.local @@ -116,6 +117,7 @@ mskold@mysql.com msvensson@build.mysql.com mwagner@cash.mwagner.org mwagner@evoq.mwagner.org +mwagner@here.mwagner.org mwagner@work.mysql.com mydev@mysql.com mysql@home.(none) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 0a89c6a8dd2..cf466ef5848 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -148,6 +148,7 @@ $ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread*2; $ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build"; $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl"; $slave_port=$mysql_tcp_port+16; +$ndbcluster_port= 9350 + $opt_build_thread*2; $manager_port=$mysql_tcp_port+1; $mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20"; @@ -255,7 +256,7 @@ if ($opt_stage <= 1) } else { - $opt_config_options.= " --without-readline --with-libedit"; + $opt_config_options.= " --with-libedit"; } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); @@ -357,7 +358,7 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) log_timestamp(); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); - check_system("./mysql-test-run $flags --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + check_system("./mysql-test-run $flags --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); } # @@ -475,6 +476,11 @@ $0 takes the following options: --bdb Compile with support for Berkeley DB tables +--build-thread=<1,2,3...> +When running several Do-compile runs in parallel, each build +should have its own thread ID, so running the test suites +does not cause conflicts with duplicate TCP port numbers. + --config-env=<environment for configure> To set up the environment, like 'CC=cc CXX=gcc CXXFLAGS=-O3' diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm index 7da8b022031..da06e1f58e4 100755 --- a/Build-tools/Do-rpm +++ b/Build-tools/Do-rpm @@ -22,6 +22,7 @@ use Getopt::Long; Getopt::Long::Configure ("bundling"); use Sys::Hostname; +$opt_nobuild = undef; $opt_cc= undef; $opt_cflags= undef; $opt_clean= undef; @@ -48,6 +49,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", + "nobuild", "verbose|v", ) || &print_help; @@ -79,7 +81,10 @@ foreach (@spec) if (m/^%define\s*mysql_version\s*(.*)/) { $VERSION= $1; + $VERSION_SRPM=$VERSION; ($MAJOR, $MINOR, $RELEASE)= split(/\./,$VERSION); + $VERSION_SRPM= $MAJOR . '.' . $MINOR . '.' . $RELEASE; + $VERSION_SRPM =~ s/\-\w+$//; ($RELEASE, $SUFFIX)= split(/\-/,$RELEASE); $SUFFIX= "-" . $SUFFIX if ($SUFFIX); } @@ -143,60 +148,64 @@ chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); $SOURCEFILE= glob "mysql*-$VERSION.tar.gz"; -&logger("Starting RPM build of MySQL-$VERSION on $HOST"); +unless($opt_nobuild) { -foreach $file ($SOURCEFILE, $SPECFILE) -{ - &abort("Unable to find $file!") unless (-f "$file"); -} + &logger("Starting RPM build of MySQL-$VERSION on $HOST"); + + foreach $file ($SOURCEFILE, $SPECFILE) + { + &abort("Unable to find $file!") unless (-f "$file"); + } # # Install source and spec file # -&logger("Copying SOURCE and SPEC file to build directories."); -unless ($opt_dry_run) -{ - copy($SOURCEFILE, $SOURCEDIR) - or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); - copy($SPECFILE, $SPECDIR) - or &abort("Unable to copy $SPECFILE to $SPECDIR!"); -} + &logger("Copying SOURCE and SPEC file to build directories."); + unless ($opt_dry_run) + { + copy($SOURCEFILE, $SOURCEDIR) + or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); + copy($SPECFILE, $SPECDIR) + or &abort("Unable to copy $SPECFILE to $SPECDIR!"); + } # # 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); + &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); # # Build the RPMs # -$command= "$RPM"; -$command.= " -v" if ($opt_verbose); -$command.= " -ba"; -$command.= " --clean $RMSOURCE" if $opt_clean; -$command.= " $SPECDIR/"; -$command.= basename($SPECFILE); -&logger("Building RPM."); -&run_command($command, "Error while building the RPMs!"); + $command= "$RPM"; + $command.= " -v" if ($opt_verbose); + $command.= " -ba"; + $command.= " --clean $RMSOURCE" if $opt_clean; + $command.= " $SPECDIR/"; + $command.= basename($SPECFILE); + &logger("Building RPM."); + &run_command($command, "Error while building the RPMs!"); +} # # Move the resulting RPMs into the pwd # $command= "mv"; $command.= " -v " if ($opt_verbose); -$command.= " $SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD"; +$command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD"; &logger("Moving source RPM to current dir."); &run_command($command, "Error moving source RPM!"); $command= "mv"; $command.= " -v " if ($opt_verbose); -$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; +# $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; +$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD"; &logger("Moving binary RPMs to current dir."); &run_command($command, "Error moving binary RPMs!"); diff --git a/Build-tools/my_md5sum b/Build-tools/my_md5sum new file mode 100755 index 00000000000..20742ee2ed0 --- /dev/null +++ b/Build-tools/my_md5sum @@ -0,0 +1,124 @@ +#!/usr/bin/perl +# +# my_md5sum +# +# Script to clone the 'md5sum' command found on modern systems, since that +# command is not always found on all systems. +# +# Use the "--help" option for more info! +# +# Written by Matt Wagner <matt@mysql.com> +# +use strict; +use Digest::MD5; +use Getopt::Long; + +my $VER= "1.1"; + +# +# Strip the leading path info off the program name ($0). We want 'my_md5sum' +# not './my_md5sum'. +# +$0=~ s/^.*\/(.+)$/$1/; + +my ($opt_check, $opt_help)= undef; + +GetOptions( + "check|c" => \$opt_check, + "help|h" => \$opt_help, + ) || usage(); + +# +# Put all the [file1 file2 file3 ...]'s into an array +# +my @files = @ARGV; + +# +# Give the "--help" text if: +# - "--help|-h" was specified +# - The number of files given as arguments is nil +# - The "--check|-c" option is used with more than one [file] argument +# +usage() if $opt_help || $#files == -1 || ($opt_check && $#files > 0); + +# If "--check|-c", then go into checking +if ($opt_check) +{ + open (CHECKFILE, $files[0]) or die "$files[0]: $!"; + + while (<CHECKFILE>) + { + # + # Goto the next line in the file if it does not match a typical + # digest line like: + # + # f1007efa2c72daa693981ec764cdeaca Bootstrap + # + next if $_!~ m/^([a-z0-9]{32})\s+(.+)$/; + + # Collect the trappings from the above regex + my $checksum= $1; + my $checkfile= $2; + + # Generate a fresh MD5 for the file in question + my $digest= &mkmd5($checkfile); + + # Check the fresh MD5 against what is recorded in the file + # Print an error message if they don't match, else print OK + print "$checkfile: FAILED\n" if $digest ne $checksum; + print "$checkfile: OK\n" if $digest eq $checksum; + } +} +# Else generate the MD5 digest to STDOUT +else +{ + foreach my $file (@files) + { + my $digest= &mkmd5($file); + + print "$digest $file\n"; + } +} + + +# +# This routine generates the MD5 digest of a file +# +sub mkmd5 +{ + my $file= shift; + + open (FILE, $file) or die "$file: $!"; + binmode(FILE); + + my $digest= Digest::MD5->new->addfile(*FILE)->hexdigest; + + close FILE; + + return $digest; +} + +# +# Print the help text +# +sub usage +{ + print <<EOF; + +$0 version $VER by Matt Wagner <matt\@mysql.com> + +Usage: +$0 [-c [file]] | [file1...] +Generates or checks MD5 message digests. + +Options: +-c, --check Check message digests (default is generate) +-h, --help Display this text and exit + +The input for -c should be the list of message digests and file names that is +printed on STDOUT by this program when it generates digests. + +EOF + + exit(0); +} diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright index adc4ae34a50..f2da3cdf447 100755 --- a/Build-tools/mysql-copyright +++ b/Build-tools/mysql-copyright @@ -102,27 +102,13 @@ sub main # exist in the new mysql distributions, but let's be sure.. unlink("$destdir/PUBLIC", "$destdir/README"); copy("$WD/Docs/MySQLEULA.txt", "$destdir"); - - # remove readline subdir and update configure accordingly - system("rm -rf $destdir/cmd-line-utils/readline"); - if ($win_flag) { - chdir("$destdir") or (print "$! Unable to change directory to $desdir!\n" && exit(0)); - } else { - chdir("$destdir"); - unlink ("configure") or die "Can't delete $destdir/configure: $!\n"; - open(CONFIGURE,"<configure.in") or die "$! Unable to open configure.in to read from!\n"; - undef $/; - my $configure = <CONFIGURE>; - close(CONFIGURE); - $configure =~ s|cmd\-line\-utils/readline/Makefile dnl\n?||g; - open(CONFIGURE,">configure.in") or die "$! Unable to open configure.in to write to!\n"; - print CONFIGURE $configure; - close(CONFIGURE); - `autoconf`; - if (! -f "configure") { - print "\"./configure\" was not produced, exiting!\n"; - exit(0); - } + + # remove readline, bdb subdirs and update 'configure' + my @extra_fat= ('bdb', 'cmd-line-utils/readline'); + + foreach my $fat (@extra_fat) + { + &trim_the_fat($fat); } # fix file copyrights @@ -155,6 +141,39 @@ sub main } #### +#### This function will remove unwanted parts of a src tree for the mysqlcom +#### distributions. +#### +sub trim_the_fat +{ + my $the_fat= shift; + my $cwd= getcwd(); + + system("rm -rf $destdir/${the_fat}"); + if ($win_flag) + { + chdir("$destdir") or die "Unable to change directory to $destdir!: $!\n"; + } + else + { + chdir("$destdir"); + unlink ("configure") or die "Can't delete $destdir/configure: $!\n"; + open(CONFIGURE,"<configure.in") or die "Unable to open configure.in for read: $!\n"; + undef $/; + my $configure= <CONFIGURE>; + close(CONFIGURE); + $configure=~ s|${the_fat}/Makefile dnl\n?||g; + open(CONFIGURE,">configure.in") or die "Unable to open configure.in for write: $!\n"; + print CONFIGURE $configure; + close(CONFIGURE); + `autoconf`; + die "'./configure' was not produced!" unless (-f "configure"); + chdir("$cwd"); + } +} + + +#### #### mysqld and MySQL client programs have a usage printed with --help. #### This usage includes a copyright, which needs to be modified #### diff --git a/Makefile.am b/Makefile.am index 6d69ea85eb2..f8efb247c95 100644 --- a/Makefile.am +++ b/Makefile.am @@ -71,7 +71,8 @@ linked_server_sources: cd sql; rm -f mini_client_errors.c;\ @LN_CP_F@ ../libmysql/errmsg.c mini_client_errors.c;\ rm -f pack.c;@LN_CP_F@ ../sql-common/pack.c pack.c;\ - rm -f client.c;@LN_CP_F@ ../sql-common/client.c client.c + rm -f client.c;@LN_CP_F@ ../sql-common/client.c client.c;\ + rm -f my_time.c;@LN_CP_F@ ../sql-common/my_time.c my_time.c echo timestamp > linked_server_sources # Create permission databases diff --git a/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr b/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr deleted file mode 100755 index ef8404545fb..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/4.0.XX-classic.ipr +++ /dev/null @@ -1,51 +0,0 @@ -[Language] -LanguageSupport0=0009 - -[OperatingSystem] -OSSupport=0000000000010010 - -[Data] -CurrentMedia= -CurrentComponentDef=Default.cdf -ProductName=MySQL Servers and Clients -set_mifserial= -DevEnvironment=Microsoft Visual C++ 6 -AppExe= -set_dlldebug=No -EmailAddresss= -Instructions=Instructions.txt -set_testmode=No -set_mif=No -SummaryText= -Department= -HomeURL= -Author= -Type=Database Application -InstallRoot=D:\MySQL-Install\4.0.xcom-clas -Version=1.00.000 -InstallationGUID=40744a4d-efed-4cff-84a9-9e6389550f5c -set_level=Level 3 -CurrentFileGroupDef=Default.fdf -Notes=Notes.txt -set_maxerr=50 -set_args= -set_miffile=Status.mif -set_dllcmdline= -Copyright= -set_warnaserr=No -CurrentPlatform= -Category= -set_preproc= -CurrentLanguage=English -CompanyName=MySQL -Description=Description.txt -set_maxwarn=50 -set_crc=Yes -set_compileb4build=No - -[MediaInfo] - -[General] -Type=INSTALLMAIN -Version=1.10.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf deleted file mode 100755 index 48d37800cd1..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.cdf +++ /dev/null @@ -1,192 +0,0 @@ -[Development] -required0=Servers -SELECTED=Yes -FILENEED=STANDARD -required1=Grant Tables -HTTPLOCATION= -STATUS=Examples, Libraries, Includes and Script files -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=Examples, Libraries, Includes and Script files -DISPLAYTEXT=Examples, Libraries, Includes and Script files -IMAGE= -DEFSELECTION=Yes -filegroup0=Development -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=ALWAYSOVERWRITE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Grant Tables] -required0=Servers -SELECTED=Yes -FILENEED=CRITICAL -HTTPLOCATION= -STATUS=The Grant Tables and Core Files -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The Grant Tables and Core Files -DISPLAYTEXT=The Grant Tables and Core Files -IMAGE= -DEFSELECTION=Yes -filegroup0=Grant Tables -requiredby0=Development -COMMENT= -INCLUDEINBUILD=Yes -requiredby1=Clients and Tools -INSTALLATION=NEVEROVERWRITE -requiredby2=Documentation -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Components] -component0=Development -component1=Grant Tables -component2=Servers -component3=Clients and Tools -component4=Documentation - -[TopComponents] -component0=Servers -component1=Clients and Tools -component2=Documentation -component3=Development -component4=Grant Tables - -[SetupType] -setuptype0=Compact -setuptype1=Typical -setuptype2=Custom - -[Clients and Tools] -required0=Servers -SELECTED=Yes -FILENEED=HIGHLYRECOMMENDED -required1=Grant Tables -HTTPLOCATION= -STATUS=The MySQL clients and Maintenance Tools -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL clients and Maintenance Tools -DISPLAYTEXT=The MySQL clients and Maintenance Tools -IMAGE= -DEFSELECTION=Yes -filegroup0=Clients and Tools -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=NEWERDATE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Servers] -SELECTED=Yes -FILENEED=CRITICAL -HTTPLOCATION= -STATUS=The MySQL Servers -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL Servers -DISPLAYTEXT=The MySQL Servers -IMAGE= -DEFSELECTION=Yes -filegroup0=Servers -requiredby0=Development -COMMENT= -INCLUDEINBUILD=Yes -requiredby1=Grant Tables -INSTALLATION=ALWAYSOVERWRITE -requiredby2=Clients and Tools -requiredby3=Documentation -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[SetupTypeItem-Compact] -Comment= -item0=Grant Tables -item1=Servers -item2=Clients and Tools -item3=Documentation -Descrip= -DisplayText= - -[SetupTypeItem-Custom] -Comment= -item0=Development -item1=Grant Tables -item2=Servers -item3=Clients and Tools -Descrip= -item4=Documentation -DisplayText= - -[Info] -Type=CompDef -Version=1.00.000 -Name= - -[SetupTypeItem-Typical] -Comment= -item0=Development -item1=Grant Tables -item2=Servers -item3=Clients and Tools -Descrip= -item4=Documentation -DisplayText= - -[Documentation] -required0=Servers -SELECTED=Yes -FILENEED=HIGHLYRECOMMENDED -required1=Grant Tables -HTTPLOCATION= -STATUS=The MySQL Documentation with different formats -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL Documentation with different formats -DISPLAYTEXT=The MySQL Documentation with different formats -IMAGE= -DEFSELECTION=Yes -filegroup0=Documentation -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=ALWAYSOVERWRITE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.fgl b/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.fgl deleted file mode 100755 index 4e20dcea4ab..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Component Definitions/Default.fgl +++ /dev/null @@ -1,42 +0,0 @@ -[<PROGRAMFILES>\<COMMONFILES>] -DISPLAYTEXT=Common Files Folder -TYPE=TEXTSUBFIXED -fulldirectory= - -[<WINDIR>\<WINSYSDIR>] -DISPLAYTEXT=Windows System Folder -TYPE=TEXTSUBFIXED -fulldirectory= - -[USERDEFINED] -DISPLAYTEXT=Script-defined Folders -TYPE=USERSTART -fulldirectory= - -[<PROGRAMFILES>] -DISPLAYTEXT=Program Files Folder -SubDir0=<PROGRAMFILES>\<COMMONFILES> -TYPE=TEXTSUBFIXED -fulldirectory= - -[<TARGETDIR>] -DISPLAYTEXT=General Application Destination -TYPE=TEXTSUBFIXED -fulldirectory= - -[<WINDIR>] -DISPLAYTEXT=Windows Operating System -SubDir0=<WINDIR>\<WINSYSDIR> -TYPE=TEXTSUBFIXED -fulldirectory= - -[TopDir] -SubDir0=<WINDIR> -SubDir1=<PROGRAMFILES> -SubDir2=<TARGETDIR> -SubDir3=USERDEFINED - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl deleted file mode 100755 index ed1e42e65b6..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl +++ /dev/null @@ -1,32 +0,0 @@ -[bin] -file15=C:\mysql\bin\replace.exe -file16=C:\mysql\bin\winmysqladmin.cnt -file0=C:\mysql\bin\isamchk.exe -file17=C:\mysql\bin\WINMYSQLADMIN.HLP -file1=C:\mysql\bin\myisamchk.exe -file18=C:\mysql\bin\comp-err.exe -file2=C:\mysql\bin\myisamlog.exe -file19=C:\mysql\bin\my_print_defaults.exe -file3=C:\mysql\bin\myisampack.exe -file4=C:\mysql\bin\mysql.exe -file5=C:\mysql\bin\mysqladmin.exe -file6=C:\mysql\bin\mysqlbinlog.exe -file7=C:\mysql\bin\mysqlc.exe -file8=C:\mysql\bin\mysqlcheck.exe -file9=C:\mysql\bin\mysqldump.exe -file20=C:\mysql\bin\winmysqladmin.exe -file21=C:\mysql\bin\myisam_ftdump.exe -file10=C:\mysql\bin\mysqlimport.exe -fulldirectory= -file11=C:\mysql\bin\mysqlshow.exe -file12=C:\mysql\bin\mysqlwatch.exe -file13=C:\mysql\bin\pack_isam.exe -file14=C:\mysql\bin\perror.exe - -[TopDir] -SubDir0=bin - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Default.fdf b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Default.fdf deleted file mode 100755 index 8096a4b74bf..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Default.fdf +++ /dev/null @@ -1,82 +0,0 @@ -[FileGroups] -group0=Development -group1=Grant Tables -group2=Servers -group3=Clients and Tools -group4=Documentation - -[Development] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Grant Tables] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Clients and Tools] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM=0000000000000000 -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Servers] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Info] -Type=FileGrp -Version=1.00.000 -Name= - -[Documentation] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl deleted file mode 100755 index f56c51fce05..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl +++ /dev/null @@ -1,240 +0,0 @@ -[bench\Data\Wisconsin] -file0=C:\mysql\bench\Data\Wisconsin\onek.data -file1=C:\mysql\bench\Data\Wisconsin\tenk.data -fulldirectory= - -[lib\debug] -file0=C:\mysql\lib\debug\libmySQL.dll -file1=C:\mysql\lib\debug\libmySQL.lib -file2=C:\mysql\lib\debug\mysqlclient.lib -file3=C:\mysql\lib\debug\zlib.lib -file4=C:\mysql\lib\debug\mysys.lib -file5=C:\mysql\lib\debug\regex.lib -file6=C:\mysql\lib\debug\strings.lib -fulldirectory= - -[bench\output] -fulldirectory= - -[examples\libmysqltest] -file0=C:\mysql\examples\libmysqltest\myTest.c -file1=C:\mysql\examples\libmysqltest\myTest.dsp -file2=C:\mysql\examples\libmysqltest\myTest.dsw -file3=C:\mysql\examples\libmysqltest\myTest.exe -file4=C:\mysql\examples\libmysqltest\myTest.mak -file5=C:\mysql\examples\libmysqltest\myTest.ncb -file6=C:\mysql\examples\libmysqltest\myTest.opt -file7=C:\mysql\examples\libmysqltest\readme -fulldirectory= - -[include] -file15=C:\mysql\include\libmysqld.def -file16=C:\mysql\include\my_alloc.h -file0=C:\mysql\include\raid.h -file17=C:\mysql\include\my_getopt.h -file1=C:\mysql\include\errmsg.h -file2=C:\mysql\include\Libmysql.def -file3=C:\mysql\include\m_ctype.h -file4=C:\mysql\include\m_string.h -file5=C:\mysql\include\my_list.h -file6=C:\mysql\include\my_pthread.h -file7=C:\mysql\include\my_sys.h -file8=C:\mysql\include\mysql.h -file9=C:\mysql\include\mysql_com.h -file10=C:\mysql\include\mysql_version.h -fulldirectory= -file11=C:\mysql\include\mysqld_error.h -file12=C:\mysql\include\dbug.h -file13=C:\mysql\include\config-win.h -file14=C:\mysql\include\my_global.h - -[examples] -SubDir0=examples\libmysqltest -SubDir1=examples\tests -fulldirectory= - -[lib\opt] -file0=C:\mysql\lib\opt\libmySQL.dll -file1=C:\mysql\lib\opt\libmySQL.lib -file2=C:\mysql\lib\opt\mysqlclient.lib -file3=C:\mysql\lib\opt\zlib.lib -file4=C:\mysql\lib\opt\mysys.lib -file5=C:\mysql\lib\opt\regex.lib -file6=C:\mysql\lib\opt\strings.lib -fulldirectory= - -[bench\Data] -SubDir0=bench\Data\ATIS -SubDir1=bench\Data\Wisconsin -fulldirectory= - -[bench\limits] -file15=C:\mysql\bench\limits\pg.comment -file16=C:\mysql\bench\limits\solid.cfg -file0=C:\mysql\bench\limits\access.cfg -file17=C:\mysql\bench\limits\solid-nt4.cfg -file1=C:\mysql\bench\limits\access.comment -file18=C:\mysql\bench\limits\sybase.cfg -file2=C:\mysql\bench\limits\Adabas.cfg -file3=C:\mysql\bench\limits\Adabas.comment -file4=C:\mysql\bench\limits\Db2.cfg -file5=C:\mysql\bench\limits\empress.cfg -file6=C:\mysql\bench\limits\empress.comment -file7=C:\mysql\bench\limits\Informix.cfg -file8=C:\mysql\bench\limits\Informix.comment -file9=C:\mysql\bench\limits\msql.cfg -file10=C:\mysql\bench\limits\ms-sql.cfg -fulldirectory= -file11=C:\mysql\bench\limits\Ms-sql65.cfg -file12=C:\mysql\bench\limits\mysql.cfg -file13=C:\mysql\bench\limits\oracle.cfg -file14=C:\mysql\bench\limits\pg.cfg - -[TopDir] -SubDir0=bench -SubDir1=examples -SubDir2=include -SubDir3=lib -SubDir4=scripts - -[bench] -file15=C:\mysql\bench\test-create -file16=C:\mysql\bench\test-insert -file0=C:\mysql\bench\uname.bat -file17=C:\mysql\bench\test-select -file1=C:\mysql\bench\compare-results -file18=C:\mysql\bench\test-wisconsin -file2=C:\mysql\bench\copy-db -file19=C:\mysql\bench\bench-init.pl -file3=C:\mysql\bench\crash-me -file4=C:\mysql\bench\example.bat -file5=C:\mysql\bench\print-limit-table -file6=C:\mysql\bench\pwd.bat -file7=C:\mysql\bench\Readme -SubDir0=bench\Data -file8=C:\mysql\bench\run.bat -SubDir1=bench\limits -file9=C:\mysql\bench\run-all-tests -SubDir2=bench\output -file10=C:\mysql\bench\server-cfg -fulldirectory= -file11=C:\mysql\bench\test-alter-table -file12=C:\mysql\bench\test-ATIS -file13=C:\mysql\bench\test-big-tables -file14=C:\mysql\bench\test-connect - -[examples\tests] -file15=C:\mysql\examples\tests\lock_test.res -file16=C:\mysql\examples\tests\mail_to_db.pl -file0=C:\mysql\examples\tests\unique_users.tst -file17=C:\mysql\examples\tests\table_types.pl -file1=C:\mysql\examples\tests\auto_increment.tst -file18=C:\mysql\examples\tests\test_delayed_insert.pl -file2=C:\mysql\examples\tests\big_record.pl -file19=C:\mysql\examples\tests\udf_test -file3=C:\mysql\examples\tests\big_record.res -file4=C:\mysql\examples\tests\czech-sorting -file5=C:\mysql\examples\tests\deadlock-script.pl -file6=C:\mysql\examples\tests\export.pl -file7=C:\mysql\examples\tests\fork_test.pl -file8=C:\mysql\examples\tests\fork2_test.pl -file9=C:\mysql\examples\tests\fork3_test.pl -file20=C:\mysql\examples\tests\udf_test.res -file21=C:\mysql\examples\tests\auto_increment.res -file10=C:\mysql\examples\tests\function.res -fulldirectory= -file11=C:\mysql\examples\tests\function.tst -file12=C:\mysql\examples\tests\grant.pl -file13=C:\mysql\examples\tests\grant.res -file14=C:\mysql\examples\tests\lock_test.pl - -[bench\Data\ATIS] -file26=C:\mysql\bench\Data\ATIS\stop1.txt -file15=C:\mysql\bench\Data\ATIS\flight_class.txt -file27=C:\mysql\bench\Data\ATIS\time_interval.txt -file16=C:\mysql\bench\Data\ATIS\flight_day.txt -file0=C:\mysql\bench\Data\ATIS\transport.txt -file28=C:\mysql\bench\Data\ATIS\time_zone.txt -file17=C:\mysql\bench\Data\ATIS\flight_fare.txt -file1=C:\mysql\bench\Data\ATIS\airline.txt -file29=C:\mysql\bench\Data\ATIS\aircraft.txt -file18=C:\mysql\bench\Data\ATIS\food_service.txt -file2=C:\mysql\bench\Data\ATIS\airport.txt -file19=C:\mysql\bench\Data\ATIS\ground_service.txt -file3=C:\mysql\bench\Data\ATIS\airport_service.txt -file4=C:\mysql\bench\Data\ATIS\city.txt -file5=C:\mysql\bench\Data\ATIS\class_of_service.txt -file6=C:\mysql\bench\Data\ATIS\code_description.txt -file7=C:\mysql\bench\Data\ATIS\compound_class.txt -file8=C:\mysql\bench\Data\ATIS\connect_leg.txt -file9=C:\mysql\bench\Data\ATIS\date_day.txt -file20=C:\mysql\bench\Data\ATIS\month_name.txt -file21=C:\mysql\bench\Data\ATIS\restrict_carrier.txt -file10=C:\mysql\bench\Data\ATIS\day_name.txt -fulldirectory= -file22=C:\mysql\bench\Data\ATIS\restrict_class.txt -file11=C:\mysql\bench\Data\ATIS\dual_carrier.txt -file23=C:\mysql\bench\Data\ATIS\restriction.txt -file12=C:\mysql\bench\Data\ATIS\fare.txt -file24=C:\mysql\bench\Data\ATIS\state.txt -file13=C:\mysql\bench\Data\ATIS\fconnection.txt -file25=C:\mysql\bench\Data\ATIS\stop.txt -file14=C:\mysql\bench\Data\ATIS\flight.txt - -[General] -Type=FILELIST -Version=1.00.000 - -[scripts] -file37=C:\mysql\scripts\mysqld_safe-watch.sh -file26=C:\mysql\scripts\mysql_zap -file15=C:\mysql\scripts\mysql_fix_privilege_tables -file38=C:\mysql\scripts\mysqldumpslow -file27=C:\mysql\scripts\mysql_zap.sh -file16=C:\mysql\scripts\mysql_fix_privilege_tables.sh -file0=C:\mysql\scripts\Readme -file39=C:\mysql\scripts\mysqldumpslow.sh -file28=C:\mysql\scripts\mysqlaccess -file17=C:\mysql\scripts\mysql_install_db -file1=C:\mysql\scripts\make_binary_distribution.sh -file29=C:\mysql\scripts\mysqlaccess.conf -file18=C:\mysql\scripts\mysql_install_db.sh -file2=C:\mysql\scripts\msql2mysql -file19=C:\mysql\scripts\mysql_secure_installation -file3=C:\mysql\scripts\msql2mysql.sh -file4=C:\mysql\scripts\mysql_config -file5=C:\mysql\scripts\mysql_config.sh -file6=C:\mysql\scripts\mysql_convert_table_format -file7=C:\mysql\scripts\mysql_convert_table_format.sh -file40=C:\mysql\scripts\mysqlhotcopy -file8=C:\mysql\scripts\mysql_explain_log -file41=C:\mysql\scripts\mysqlhotcopy.pl -file30=C:\mysql\scripts\mysqlaccess.sh -file9=C:\mysql\scripts\mysql_explain_log.sh -file42=C:\mysql\scripts\mysqlhotcopy.sh -file31=C:\mysql\scripts\mysqlbug -file20=C:\mysql\scripts\mysql_secure_installation.sh -file43=C:\mysql\scripts\make_binary_distribution -file32=C:\mysql\scripts\mysqlbug.sh -file21=C:\mysql\scripts\mysql_setpermission -file10=C:\mysql\scripts\mysql_find_rows -fulldirectory= -file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql -file33=C:\mysql\scripts\mysqld_multi -file22=C:\mysql\scripts\mysql_setpermission.pl -file11=C:\mysql\scripts\mysql_find_rows.pl -file34=C:\mysql\scripts\mysqld_multi.sh -file23=C:\mysql\scripts\mysql_setpermission.sh -file12=C:\mysql\scripts\mysql_find_rows.sh -file35=C:\mysql\scripts\mysqld_safe -file24=C:\mysql\scripts\mysql_tableinfo -file13=C:\mysql\scripts\mysql_fix_extensions -file36=C:\mysql\scripts\mysqld_safe.sh -file25=C:\mysql\scripts\mysql_tableinfo.sh -file14=C:\mysql\scripts\mysql_fix_extensions.sh - -[lib] -SubDir0=lib\debug -SubDir1=lib\opt -fulldirectory= - diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Documentation.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Documentation.fgl deleted file mode 100755 index 80fe777cf0f..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Documentation.fgl +++ /dev/null @@ -1,99 +0,0 @@ -[Docs\Flags] -file59=C:\mysql\Docs\Flags\romania.gif -file48=C:\mysql\Docs\Flags\kroatia.eps -file37=C:\mysql\Docs\Flags\iceland.gif -file26=C:\mysql\Docs\Flags\france.eps -file15=C:\mysql\Docs\Flags\china.gif -file49=C:\mysql\Docs\Flags\kroatia.gif -file38=C:\mysql\Docs\Flags\ireland.eps -file27=C:\mysql\Docs\Flags\france.gif -file16=C:\mysql\Docs\Flags\croatia.eps -file0=C:\mysql\Docs\Flags\usa.gif -file39=C:\mysql\Docs\Flags\ireland.gif -file28=C:\mysql\Docs\Flags\germany.eps -file17=C:\mysql\Docs\Flags\croatia.gif -file1=C:\mysql\Docs\Flags\argentina.gif -file29=C:\mysql\Docs\Flags\germany.gif -file18=C:\mysql\Docs\Flags\czech-republic.eps -file2=C:\mysql\Docs\Flags\australia.eps -file19=C:\mysql\Docs\Flags\czech-republic.gif -file3=C:\mysql\Docs\Flags\australia.gif -file80=C:\mysql\Docs\Flags\usa.eps -file4=C:\mysql\Docs\Flags\austria.eps -file81=C:\mysql\Docs\Flags\argentina.eps -file70=C:\mysql\Docs\Flags\spain.eps -file5=C:\mysql\Docs\Flags\austria.gif -file71=C:\mysql\Docs\Flags\spain.gif -file60=C:\mysql\Docs\Flags\russia.eps -file6=C:\mysql\Docs\Flags\brazil.eps -file72=C:\mysql\Docs\Flags\sweden.eps -file61=C:\mysql\Docs\Flags\russia.gif -file50=C:\mysql\Docs\Flags\latvia.eps -file7=C:\mysql\Docs\Flags\brazil.gif -file73=C:\mysql\Docs\Flags\sweden.gif -file62=C:\mysql\Docs\Flags\singapore.eps -file51=C:\mysql\Docs\Flags\latvia.gif -file40=C:\mysql\Docs\Flags\island.eps -file8=C:\mysql\Docs\Flags\bulgaria.eps -file74=C:\mysql\Docs\Flags\switzerland.eps -file63=C:\mysql\Docs\Flags\singapore.gif -file52=C:\mysql\Docs\Flags\netherlands.eps -file41=C:\mysql\Docs\Flags\island.gif -file30=C:\mysql\Docs\Flags\great-britain.eps -file9=C:\mysql\Docs\Flags\bulgaria.gif -file75=C:\mysql\Docs\Flags\switzerland.gif -file64=C:\mysql\Docs\Flags\south-africa.eps -file53=C:\mysql\Docs\Flags\netherlands.gif -file42=C:\mysql\Docs\Flags\israel.eps -file31=C:\mysql\Docs\Flags\great-britain.gif -file20=C:\mysql\Docs\Flags\denmark.eps -file76=C:\mysql\Docs\Flags\taiwan.eps -file65=C:\mysql\Docs\Flags\south-africa.gif -file54=C:\mysql\Docs\Flags\poland.eps -file43=C:\mysql\Docs\Flags\israel.gif -file32=C:\mysql\Docs\Flags\greece.eps -file21=C:\mysql\Docs\Flags\denmark.gif -file10=C:\mysql\Docs\Flags\canada.eps -fulldirectory= -file77=C:\mysql\Docs\Flags\taiwan.gif -file66=C:\mysql\Docs\Flags\south-africa1.eps -file55=C:\mysql\Docs\Flags\poland.gif -file44=C:\mysql\Docs\Flags\italy.eps -file33=C:\mysql\Docs\Flags\greece.gif -file22=C:\mysql\Docs\Flags\estonia.eps -file11=C:\mysql\Docs\Flags\canada.gif -file78=C:\mysql\Docs\Flags\ukraine.eps -file67=C:\mysql\Docs\Flags\south-africa1.gif -file56=C:\mysql\Docs\Flags\portugal.eps -file45=C:\mysql\Docs\Flags\italy.gif -file34=C:\mysql\Docs\Flags\hungary.eps -file23=C:\mysql\Docs\Flags\estonia.gif -file12=C:\mysql\Docs\Flags\chile.eps -file79=C:\mysql\Docs\Flags\ukraine.gif -file68=C:\mysql\Docs\Flags\south-korea.eps -file57=C:\mysql\Docs\Flags\portugal.gif -file46=C:\mysql\Docs\Flags\japan.eps -file35=C:\mysql\Docs\Flags\hungary.gif -file24=C:\mysql\Docs\Flags\finland.eps -file13=C:\mysql\Docs\Flags\chile.gif -file69=C:\mysql\Docs\Flags\south-korea.gif -file58=C:\mysql\Docs\Flags\romania.eps -file47=C:\mysql\Docs\Flags\japan.gif -file36=C:\mysql\Docs\Flags\iceland.eps -file25=C:\mysql\Docs\Flags\finland.gif -file14=C:\mysql\Docs\Flags\china.eps - -[Docs] -file0=C:\mysql\Docs\manual_toc.html -file1=C:\mysql\Docs\manual.html -file2=C:\mysql\Docs\manual.txt -SubDir0=Docs\Flags -fulldirectory= - -[TopDir] -SubDir0=Docs - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Grant Tables.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Grant Tables.fgl deleted file mode 100755 index 178065a7003..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Grant Tables.fgl +++ /dev/null @@ -1,36 +0,0 @@ -[data\test] -fulldirectory= - -[data\mysql] -file15=C:\mysql\data\mysql\func.frm -file16=C:\mysql\data\mysql\func.MYD -file0=C:\mysql\data\mysql\columns_priv.frm -file17=C:\mysql\data\mysql\func.MYI -file1=C:\mysql\data\mysql\columns_priv.MYD -file2=C:\mysql\data\mysql\columns_priv.MYI -file3=C:\mysql\data\mysql\db.frm -file4=C:\mysql\data\mysql\db.MYD -file5=C:\mysql\data\mysql\db.MYI -file6=C:\mysql\data\mysql\host.frm -file7=C:\mysql\data\mysql\host.MYD -file8=C:\mysql\data\mysql\host.MYI -file9=C:\mysql\data\mysql\tables_priv.frm -file10=C:\mysql\data\mysql\tables_priv.MYD -fulldirectory= -file11=C:\mysql\data\mysql\tables_priv.MYI -file12=C:\mysql\data\mysql\user.frm -file13=C:\mysql\data\mysql\user.MYD -file14=C:\mysql\data\mysql\user.MYI - -[TopDir] -SubDir0=data - -[data] -SubDir0=data\mysql -SubDir1=data\test -fulldirectory= - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl deleted file mode 100755 index b51c37f8db2..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl +++ /dev/null @@ -1,251 +0,0 @@ -[Embedded\Static\release] -file0=C:\mysql\embedded\Static\release\test_stc.dsp -file1=C:\mysql\embedded\Static\release\ReadMe.txt -file2=C:\mysql\embedded\Static\release\StdAfx.cpp -file3=C:\mysql\embedded\Static\release\StdAfx.h -file4=C:\mysql\embedded\Static\release\test_stc.cpp -file5=C:\mysql\embedded\Static\release\mysqlserver.lib -fulldirectory= - -[share\polish] -file0=C:\mysql\share\polish\errmsg.sys -file1=C:\mysql\share\polish\errmsg.txt -fulldirectory= - -[share\dutch] -file0=C:\mysql\share\dutch\errmsg.sys -file1=C:\mysql\share\dutch\errmsg.txt -fulldirectory= - -[share\spanish] -file0=C:\mysql\share\spanish\errmsg.sys -file1=C:\mysql\share\spanish\errmsg.txt -fulldirectory= - -[share\english] -file0=C:\mysql\share\english\errmsg.sys -file1=C:\mysql\share\english\errmsg.txt -fulldirectory= - -[bin] -file0=C:\mysql\bin\mysqld-opt.exe -file1=C:\mysql\bin\mysqld-nt.exe -file2=C:\mysql\bin\mysqld.exe -file3=C:\mysql\bin\cygwinb19.dll -file4=C:\mysql\bin\libmySQL.dll -fulldirectory= - -[share\korean] -file0=C:\mysql\share\korean\errmsg.sys -file1=C:\mysql\share\korean\errmsg.txt -fulldirectory= - -[share\charsets] -file0=C:\mysql\share\charsets\cp1250.xml -file1=C:\mysql\share\charsets\cp1251.conf -file2=C:\mysql\share\charsets\cp1251.xml -file3=C:\mysql\share\charsets\cp1256.xml -file1=C:\mysql\share\charsets\cp1257.conf -file4=C:\mysql\share\charsets\cp1257.xml -file5=C:\mysql\share\charsets\cp850.xml -file6=C:\mysql\share\charsets\cp852.xml -file7=C:\mysql\share\charsets\cp866.xml -file8=C:\mysql\share\charsets\croat.conf -file9=C:\mysql\share\charsets\danish.conf -file10=C:\mysql\share\charsets\dec8.conf -file10=C:\mysql\share\charsets\dec8.xml -file11=C:\mysql\share\charsets\dos.conf -file12=C:\mysql\share\charsets\estonia.conf -file13=C:\mysql\share\charsets\geostd8.xml -file14=C:\mysql\share\charsets\german1.conf -file15=C:\mysql\share\charsets\greek.xml -file16=C:\mysql\share\charsets\greek.conf -file17=C:\mysql\share\charsets\hebrew.xml -file18=C:\mysql\share\charsets\hebrew.conf -file19=C:\mysql\share\charsets\hp8.xml -file20=C:\mysql\share\charsets\hp8.conf -file21=C:\mysql\share\charsets\hungarian.conf -file22=C:\mysql\share\charsets\keybcs2.xml -file23=C:\mysql\share\charsets\koi8_ru.conf -file24=C:\mysql\share\charsets\koi8_ukr.conf -file25=C:\mysql\share\charsets\koi8r.xml -file26=C:\mysql\share\charsets\koi8u.xml -file27=C:\mysql\share\charsets\latin1.conf -file28=C:\mysql\share\charsets\latin1.xml -file29=C:\mysql\share\charsets\latin2.conf -file30=C:\mysql\share\charsets\latin2.xml -file31=C:\mysql\share\charsets\latin5.conf -file32=C:\mysql\share\charsets\latin5.xml -file33=C:\mysql\share\charsets\latin7.xml -file34=C:\mysql\share\charsets\macce.xml -file35=C:\mysql\share\charsets\macroman.xml -file36=C:\mysql\share\charsets\swe7.conf -file37=C:\mysql\share\charsets\swe7.xml -file38=C:\mysql\share\charsets\usa7.conf -file39=C:\mysql\share\charsets\win1250.conf -file40=C:\mysql\share\charsets\win1251ukr.conf -file41=C:\mysql\share\charsets\win1251.conf -file42=C:\mysql\share\charsets\Index -file43=C:\mysql\share\charsets\Index.xml -file44=C:\mysql\share\charsets\Readme -file45=C:\mysql\share\charsets\languages.html -fulldirectory= - -[Embedded\DLL\debug] -file0=C:\mysql\embedded\DLL\debug\libmysqld.dll -file1=C:\mysql\embedded\DLL\debug\libmysqld.exp -file2=C:\mysql\embedded\DLL\debug\libmysqld.lib -fulldirectory= - -[Embedded] -file0=C:\mysql\embedded\embedded.dsw -SubDir0=Embedded\DLL -SubDir1=Embedded\Static -fulldirectory= - -[share\ukrainian] -file0=C:\mysql\share\ukrainian\errmsg.sys -file1=C:\mysql\share\ukrainian\errmsg.txt -fulldirectory= - -[share\hungarian] -file0=C:\mysql\share\hungarian\errmsg.sys -file1=C:\mysql\share\hungarian\errmsg.txt -fulldirectory= - -[share\german] -file0=C:\mysql\share\german\errmsg.sys -file1=C:\mysql\share\german\errmsg.txt -fulldirectory= - -[share\portuguese] -file0=C:\mysql\share\portuguese\errmsg.sys -file1=C:\mysql\share\portuguese\errmsg.txt -fulldirectory= - -[share\estonian] -file0=C:\mysql\share\estonian\errmsg.sys -file1=C:\mysql\share\estonian\errmsg.txt -fulldirectory= - -[share\romanian] -file0=C:\mysql\share\romanian\errmsg.sys -file1=C:\mysql\share\romanian\errmsg.txt -fulldirectory= - -[share\french] -file0=C:\mysql\share\french\errmsg.sys -file1=C:\mysql\share\french\errmsg.txt -fulldirectory= - -[share\swedish] -file0=C:\mysql\share\swedish\errmsg.sys -file1=C:\mysql\share\swedish\errmsg.txt -fulldirectory= - -[share\slovak] -file0=C:\mysql\share\slovak\errmsg.sys -file1=C:\mysql\share\slovak\errmsg.txt -fulldirectory= - -[share\greek] -file0=C:\mysql\share\greek\errmsg.sys -file1=C:\mysql\share\greek\errmsg.txt -fulldirectory= - -[TopDir] -file0=C:\mysql\my-huge.cnf -file1=C:\mysql\my-large.cnf -file2=C:\mysql\my-medium.cnf -file3=C:\mysql\my-small.cnf -file4=C:\mysql\MySQLEULA.txt -file5=C:\mysql\README.txt -SubDir0=bin -SubDir1=share -SubDir2=Embedded - -[share] -SubDir8=share\hungarian -SubDir9=share\charsets -SubDir20=share\spanish -SubDir21=share\swedish -SubDir10=share\italian -SubDir22=share\ukrainian -SubDir11=share\japanese -SubDir12=share\korean -SubDir13=share\norwegian -SubDir14=share\norwegian-ny -SubDir15=share\polish -SubDir16=share\portuguese -SubDir0=share\czech -SubDir17=share\romanian -SubDir1=share\danish -SubDir18=share\russian -SubDir2=share\dutch -SubDir19=share\slovak -SubDir3=share\english -fulldirectory= -SubDir4=share\estonian -SubDir5=share\french -SubDir6=share\german -SubDir7=share\greek - -[share\norwegian-ny] -file0=C:\mysql\share\norwegian-ny\errmsg.sys -file1=C:\mysql\share\norwegian-ny\errmsg.txt -fulldirectory= - -[Embedded\DLL] -file0=C:\mysql\embedded\DLL\test_dll.dsp -file1=C:\mysql\embedded\DLL\StdAfx.h -file2=C:\mysql\embedded\DLL\test_dll.cpp -file3=C:\mysql\embedded\DLL\StdAfx.cpp -SubDir0=Embedded\DLL\debug -SubDir1=Embedded\DLL\release -fulldirectory= - -[Embedded\Static] -SubDir0=Embedded\Static\release -fulldirectory= - -[Embedded\DLL\release] -file0=C:\mysql\embedded\DLL\release\libmysqld.dll -file1=C:\mysql\embedded\DLL\release\libmysqld.exp -file2=C:\mysql\embedded\DLL\release\libmysqld.lib -file3=C:\mysql\embedded\DLL\release\mysql-server.exe -fulldirectory= - -[share\danish] -file0=C:\mysql\share\danish\errmsg.sys -file1=C:\mysql\share\danish\errmsg.txt -fulldirectory= - -[share\czech] -file0=C:\mysql\share\czech\errmsg.sys -file1=C:\mysql\share\czech\errmsg.txt -fulldirectory= - -[General] -Type=FILELIST -Version=1.00.000 - -[share\russian] -file0=C:\mysql\share\russian\errmsg.sys -file1=C:\mysql\share\russian\errmsg.txt -fulldirectory= - -[share\norwegian] -file0=C:\mysql\share\norwegian\errmsg.sys -file1=C:\mysql\share\norwegian\errmsg.txt -fulldirectory= - -[share\japanese] -file0=C:\mysql\share\japanese\errmsg.sys -file1=C:\mysql\share\japanese\errmsg.txt -fulldirectory= - -[share\italian] -file0=C:\mysql\share\italian\errmsg.sys -file1=C:\mysql\share\italian\errmsg.txt -fulldirectory= - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Registry Entries/Default.rge b/VC++Files/InstallShield/4.0.XX-classic/Registry Entries/Default.rge deleted file mode 100755 index 537dfd82e48..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Registry Entries/Default.rge +++ /dev/null @@ -1,4 +0,0 @@ -[General] -Type=REGISTRYDATA -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.dbg b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.dbg Binary files differdeleted file mode 100755 index 0c6d4e6b708..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.dbg +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ino b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ino Binary files differdeleted file mode 100755 index 204d8ea0f36..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ino +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ins b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ins Binary files differdeleted file mode 100755 index 759009b5c84..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.ins +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.obs b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.obs Binary files differdeleted file mode 100755 index 5fcfcb62c4e..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.obs +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old deleted file mode 100755 index df143b493c4..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old +++ /dev/null @@ -1,640 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-1997, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup on a -// Windows 95 or Windows NT 4.0 platform. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - - // Include header file -#include "sdlang.h" -#include "sddialog.h" - -////////////////////// string defines //////////////////////////// - -#define UNINST_LOGFILE_NAME "Uninst.isu" - -//////////////////// installation declarations /////////////////// - - // ----- DLL prototypes ----- - - - // your DLL prototypes - - - // ---- script prototypes ----- - - // generated - prototype ShowDialogs(); - prototype MoveFileData(); - prototype HandleMoveDataError( NUMBER ); - prototype ProcessBeforeDataMove(); - prototype ProcessAfterDataMove(); - prototype SetupRegistry(); - prototype SetupFolders(); - prototype CleanUpInstall(); - prototype SetupInstall(); - prototype SetupScreen(); - prototype CheckRequirements(); - prototype DialogShowSdWelcome(); - prototype DialogShowSdShowInfoList(); - prototype DialogShowSdAskDestPath(); - prototype DialogShowSdSetupType(); - prototype DialogShowSdComponentDialog2(); - prototype DialogShowSdFinishReboot(); - - // your prototypes - - - // ----- global variables ------ - - // generated - BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; - STRING svDir; - STRING svName, svCompany, svSerial; - STRING szAppPath; - STRING svSetupType; - - - // your global variables - - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN PROGRAM -// -// The setup begins here by hiding the visible setup -// window. This is done to allow all the titles, images, etc. to -// be established before showing the main window. The following -// logic then performs the setup in a series of steps. -// -/////////////////////////////////////////////////////////////////////////////// -program - Disable( BACKGROUND ); - - CheckRequirements(); - - SetupInstall(); - - SetupScreen(); - - if (ShowDialogs()<0) goto end_install; - - if (ProcessBeforeDataMove()<0) goto end_install; - - if (MoveFileData()<0) goto end_install; - - if (ProcessAfterDataMove()<0) goto end_install; - - if (SetupRegistry()<0) goto end_install; - - if (SetupFolders()<0) goto end_install; - - - end_install: - - CleanUpInstall(); - - // If an unrecoverable error occurred, clean up the partial installation. - // Otherwise, exit normally. - - if (bInstallAborted) then - abort; - endif; - -endprogram - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ShowDialogs // -// // -// Purpose: This function manages the display and navigation // -// the standard dialogs that exist in a setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ShowDialogs() - NUMBER nResult; - begin - - Dlg_Start: - // beginning of dialogs label - - Dlg_SdWelcome: - nResult = DialogShowSdWelcome(); - if (nResult = BACK) goto Dlg_Start; - - Dlg_SdShowInfoList: - nResult = DialogShowSdShowInfoList(); - if (nResult = BACK) goto Dlg_SdWelcome; - - Dlg_SdAskDestPath: - nResult = DialogShowSdAskDestPath(); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - Dlg_SdSetupType: - nResult = DialogShowSdSetupType(); - if (nResult = BACK) goto Dlg_SdAskDestPath; - - Dlg_SdComponentDialog2: - if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then - goto Dlg_SdSetupType; - endif; - nResult = DialogShowSdComponentDialog2(); - if (nResult = BACK) goto Dlg_SdSetupType; - - return 0; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessBeforeDataMove // -// // -// Purpose: This function performs any necessary operations prior to the // -// actual data move operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessBeforeDataMove() - STRING svLogFile; - NUMBER nResult; - begin - - InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); - - svLogFile = UNINST_LOGFILE_NAME; - - nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); - if (nResult < 0) then - MessageBox( @ERROR_UNINSTSETUP, WARNING ); - endif; - - szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir - - if ((bIs32BitSetup) && (bIsShellExplorer)) then - RegDBSetItem( REGDB_APPPATH, szAppPath ); - RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); - RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); - endif; - - // TODO : update any items you want to process before moving the data - // - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: MoveFileData // -// // -// Purpose: This function handles the data movement for // -// the setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function MoveFileData() - NUMBER nResult, nDisk; - begin - - nDisk = 1; - SetStatusWindow( 0, "" ); - Disable( DIALOGCACHE ); - Enable( STATUS ); - StatusUpdate( ON, 100 ); - nResult = ComponentMoveData( MEDIA, nDisk, 0 ); - - HandleMoveDataError( nResult ); - - Disable( STATUS ); - - return nResult; - - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: HandleMoveDataError // -// // -// Purpose: This function handles the error (if any) during the move data // -// operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function HandleMoveDataError( nResult ) - STRING szErrMsg, svComponent , svFileGroup , svFile; - begin - - svComponent = ""; - svFileGroup = ""; - svFile = ""; - - switch (nResult) - case 0: - return 0; - default: - ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); - szErrMsg = @ERROR_MOVEDATA + "\n\n" + - @ERROR_COMPONENT + " " + svComponent + "\n" + - @ERROR_FILEGROUP + " " + svFileGroup + "\n" + - @ERROR_FILE + " " + svFile; - SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); - bInstallAborted = TRUE; - return nResult; - endswitch; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessAfterDataMove // -// // -// Purpose: This function performs any necessary operations needed after // -// all data has been moved. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessAfterDataMove() - begin - - // TODO : update self-registered files and other processes that - // should be performed after the data has been moved. - - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupRegistry // -// // -// Purpose: This function makes the registry entries for this setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupRegistry() - NUMBER nResult; - - begin - - // TODO : Add all your registry entry keys here - // - // - // RegDBCreateKeyEx, RegDBSetKeyValueEx.... - // - - nResult = CreateRegistrySet( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function: SetupFolders -// -// Purpose: This function creates all the folders and shortcuts for the -// setup. This includes program groups and items for Windows 3.1. -// -/////////////////////////////////////////////////////////////////////////////// -function SetupFolders() - NUMBER nResult; - - begin - - - // TODO : Add all your folder (program group) along with shortcuts (program items) - // - // - // CreateProgramFolder, AddFolderIcon.... - // - - nResult = CreateShellObjects( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CleanUpInstall // -// // -// Purpose: This cleans up the setup. Anything that should // -// be released or deleted at the end of the setup should // -// be done here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CleanUpInstall() - begin - - - if (bInstallAborted) then - return 0; - endif; - - DialogShowSdFinishReboot(); - - if (BATCH_INSTALL) then // ensure locked files are properly written - CommitSharedFiles(0); - endif; - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupInstall // -// // -// Purpose: This will setup the installation. Any general initialization // -// needed for the installation should be performed here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupInstall() - begin - - Enable( CORECOMPONENTHANDLING ); - - bInstallAborted = FALSE; - - if (bIs32BitSetup) then - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; - else - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names - endif; - - TARGETDIR = svDir; - - SdProductName( @PRODUCT_NAME ); - - Enable( DIALOGCACHE ); - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupScreen // -// // -// Purpose: This function establishes the screen look. This includes // -// colors, fonts, and text to be displayed. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupScreen() - begin - - Enable( FULLWINDOWMODE ); - Enable( INDVFILESTATUS ); - SetTitle( @TITLE_MAIN, 24, WHITE ); - - SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. - - Enable( BACKGROUND ); - - Delay( 1 ); - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CheckRequirements // -// // -// Purpose: This function checks all minimum requirements for the // -// application being installed. If any fail, then the user // -// is informed and the setup is terminated. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CheckRequirements() - NUMBER nvDx, nvDy, nvResult; - STRING svResult; - - begin - - bWinNT = FALSE; - bIsShellExplorer = FALSE; - - // Check screen resolution. - GetExtents( nvDx, nvDy ); - - if (nvDy < 480) then - MessageBox( @ERROR_VGARESOLUTION, WARNING ); - abort; - endif; - - // set 'setup' operation mode - bIs32BitSetup = TRUE; - GetSystemInfo( ISTYPE, nvResult, svResult ); - if (nvResult = 16) then - bIs32BitSetup = FALSE; // running 16-bit setup - return 0; // no additional information required - endif; - - // --- 32-bit testing after this point --- - - // Determine the target system's operating system. - GetSystemInfo( OS, nvResult, svResult ); - - if (nvResult = IS_WINDOWSNT) then - // Running Windows NT. - bWinNT = TRUE; - - // Check to see if the shell being used is EXPLORER shell. - if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then - if (nvResult >= 4) then - bIsShellExplorer = TRUE; - endif; - endif; - - elseif (nvResult = IS_WINDOWS95 ) then - bIsShellExplorer = TRUE; - - endif; - -end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdWelcome // -// // -// Purpose: This function handles the standard welcome dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdWelcome() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdShowInfoList // -// // -// Purpose: This function displays the general information list dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdShowInfoList() - NUMBER nResult; - LIST list; - STRING szTitle, szMsg, szFile; - begin - - szFile = SUPPORTDIR ^ "infolist.txt"; - - list = ListCreate( STRINGLIST ); - ListReadFromFile( list, szFile ); - szTitle = ""; - szMsg = " "; - nResult = SdShowInfoList( szTitle, szMsg, list ); - - ListDestroy( list ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdAskDestPath // -// // -// Purpose: This function asks the user for the destination directory. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdAskDestPath() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); - - TARGETDIR = svDir; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdSetupType // -// // -// Purpose: This function displays the standard setup type dialog. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdSetupType() - NUMBER nResult, nType; - STRING szTitle, szMsg; - begin - - switch (svSetupType) - case "Typical": - nType = TYPICAL; - case "Custom": - nType = CUSTOM; - case "Compact": - nType = COMPACT; - case "": - svSetupType = "Typical"; - nType = TYPICAL; - endswitch; - - szTitle = ""; - szMsg = ""; - nResult = SetupType( szTitle, szMsg, "", nType, 0 ); - - switch (nResult) - case COMPACT: - svSetupType = "Compact"; - case TYPICAL: - svSetupType = "Typical"; - case CUSTOM: - svSetupType = "Custom"; - endswitch; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdComponentDialog2 // -// // -// Purpose: This function displays the custom component dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdComponentDialog2() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - if ((svSetupType != "Custom") && (svSetupType != "")) then - return 0; - endif; - - szTitle = ""; - szMsg = ""; - nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdFinishReboot // -// // -// Purpose: This function will show the last dialog of the product. // -// It will allow the user to reboot and/or show some readme text. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdFinishReboot() - NUMBER nResult, nDefOptions; - STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; - NUMBER bOpt1, bOpt2; - begin - - if (!BATCH_INSTALL) then - bOpt1 = FALSE; - bOpt2 = FALSE; - szMsg1 = ""; - szMsg2 = ""; - szOption1 = ""; - szOption2 = ""; - nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); - return 0; - endif; - - nDefOptions = SYS_BOOTMACHINE; - szTitle = ""; - szMsg1 = ""; - szMsg2 = ""; - nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); - - return nResult; - end; - - // --- include script file section --- - -#include "sddialog.rul" - - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/setup.rul b/VC++Files/InstallShield/4.0.XX-classic/Script Files/setup.rul deleted file mode 100755 index 73d61114075..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/setup.rul +++ /dev/null @@ -1,641 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-1997, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup on a -// Windows 95 or Windows NT 4.0 platform. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - - // Include header file -#include "sdlang.h" -#include "sddialog.h" - -////////////////////// string defines //////////////////////////// - -#define UNINST_LOGFILE_NAME "Uninst.isu" - -//////////////////// installation declarations /////////////////// - - // ----- DLL prototypes ----- - - - // your DLL prototypes - - - // ---- script prototypes ----- - - // generated - prototype ShowDialogs(); - prototype MoveFileData(); - prototype HandleMoveDataError( NUMBER ); - prototype ProcessBeforeDataMove(); - prototype ProcessAfterDataMove(); - prototype SetupRegistry(); - prototype SetupFolders(); - prototype CleanUpInstall(); - prototype SetupInstall(); - prototype SetupScreen(); - prototype CheckRequirements(); - prototype DialogShowSdWelcome(); - prototype DialogShowSdShowInfoList(); - prototype DialogShowSdAskDestPath(); - prototype DialogShowSdSetupType(); - prototype DialogShowSdComponentDialog2(); - prototype DialogShowSdFinishReboot(); - - // your prototypes - - - // ----- global variables ------ - - // generated - BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; - STRING svDir; - STRING svName, svCompany, svSerial; - STRING szAppPath; - STRING svSetupType; - - - // your global variables - - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN PROGRAM -// -// The setup begins here by hiding the visible setup -// window. This is done to allow all the titles, images, etc. to -// be established before showing the main window. The following -// logic then performs the setup in a series of steps. -// -/////////////////////////////////////////////////////////////////////////////// -program - Disable( BACKGROUND ); - - CheckRequirements(); - - SetupInstall(); - - SetupScreen(); - - if (ShowDialogs()<0) goto end_install; - - if (ProcessBeforeDataMove()<0) goto end_install; - - if (MoveFileData()<0) goto end_install; - - if (ProcessAfterDataMove()<0) goto end_install; - - if (SetupRegistry()<0) goto end_install; - - if (SetupFolders()<0) goto end_install; - - - end_install: - - CleanUpInstall(); - - // If an unrecoverable error occurred, clean up the partial installation. - // Otherwise, exit normally. - - if (bInstallAborted) then - abort; - endif; - -endprogram - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ShowDialogs // -// // -// Purpose: This function manages the display and navigation // -// the standard dialogs that exist in a setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ShowDialogs() - NUMBER nResult; - begin - - Dlg_Start: - // beginning of dialogs label - - Dlg_SdWelcome: - nResult = DialogShowSdWelcome(); - if (nResult = BACK) goto Dlg_Start; - - Dlg_SdShowInfoList: - nResult = DialogShowSdShowInfoList(); - if (nResult = BACK) goto Dlg_SdWelcome; - - Dlg_SdAskDestPath: - nResult = DialogShowSdAskDestPath(); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - Dlg_SdSetupType: - nResult = DialogShowSdSetupType(); - if (nResult = BACK) goto Dlg_SdAskDestPath; - - Dlg_SdComponentDialog2: - if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then - goto Dlg_SdSetupType; - endif; - nResult = DialogShowSdComponentDialog2(); - if (nResult = BACK) goto Dlg_SdSetupType; - - return 0; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessBeforeDataMove // -// // -// Purpose: This function performs any necessary operations prior to the // -// actual data move operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessBeforeDataMove() - STRING svLogFile; - NUMBER nResult; - begin - - InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); - - svLogFile = UNINST_LOGFILE_NAME; - - nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); - if (nResult < 0) then - MessageBox( @ERROR_UNINSTSETUP, WARNING ); - endif; - - szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir - - if ((bIs32BitSetup) && (bIsShellExplorer)) then -// RegDBSetItem( REGDB_APPPATH, szAppPath ); -// RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); - RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); - endif; - - // TODO : update any items you want to process before moving the data - // - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: MoveFileData // -// // -// Purpose: This function handles the data movement for // -// the setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function MoveFileData() - NUMBER nResult, nDisk; - begin - - nDisk = 1; - SetStatusWindow( 0, "" ); - Disable( DIALOGCACHE ); - Enable( STATUS ); - StatusUpdate( ON, 100 ); - nResult = ComponentMoveData( MEDIA, nDisk, 0 ); - - HandleMoveDataError( nResult ); - - Disable( STATUS ); - - return nResult; - - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: HandleMoveDataError // -// // -// Purpose: This function handles the error (if any) during the move data // -// operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function HandleMoveDataError( nResult ) - STRING szErrMsg, svComponent , svFileGroup , svFile; - begin - - svComponent = ""; - svFileGroup = ""; - svFile = ""; - - switch (nResult) - case 0: - return 0; - default: - ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); - szErrMsg = @ERROR_MOVEDATA + "\n\n" + - @ERROR_COMPONENT + " " + svComponent + "\n" + - @ERROR_FILEGROUP + " " + svFileGroup + "\n" + - @ERROR_FILE + " " + svFile; - SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); - bInstallAborted = TRUE; - return nResult; - endswitch; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessAfterDataMove // -// // -// Purpose: This function performs any necessary operations needed after // -// all data has been moved. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessAfterDataMove() - begin - - // TODO : update self-registered files and other processes that - // should be performed after the data has been moved. - - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupRegistry // -// // -// Purpose: This function makes the registry entries for this setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupRegistry() - NUMBER nResult; - - begin - - // TODO : Add all your registry entry keys here - // - // - // RegDBCreateKeyEx, RegDBSetKeyValueEx.... - // - - nResult = CreateRegistrySet( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function: SetupFolders -// -// Purpose: This function creates all the folders and shortcuts for the -// setup. This includes program groups and items for Windows 3.1. -// -/////////////////////////////////////////////////////////////////////////////// -function SetupFolders() - NUMBER nResult; - - begin - - - // TODO : Add all your folder (program group) along with shortcuts (program items) - // - // - // CreateProgramFolder, AddFolderIcon.... - // - - nResult = CreateShellObjects( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CleanUpInstall // -// // -// Purpose: This cleans up the setup. Anything that should // -// be released or deleted at the end of the setup should // -// be done here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CleanUpInstall() - begin - - - if (bInstallAborted) then - return 0; - endif; - - DialogShowSdFinishReboot(); - - if (BATCH_INSTALL) then // ensure locked files are properly written - CommitSharedFiles(0); - endif; - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupInstall // -// // -// Purpose: This will setup the installation. Any general initialization // -// needed for the installation should be performed here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupInstall() - begin - - Enable( CORECOMPONENTHANDLING ); - - bInstallAborted = FALSE; - - if (bIs32BitSetup) then - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; - else - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names - endif; - - TARGETDIR = svDir; - - SdProductName( @PRODUCT_NAME ); - - Enable( DIALOGCACHE ); - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupScreen // -// // -// Purpose: This function establishes the screen look. This includes // -// colors, fonts, and text to be displayed. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupScreen() - begin - - Enable( FULLWINDOWMODE ); - Enable( INDVFILESTATUS ); - SetTitle( @TITLE_MAIN, 24, WHITE ); - - SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. - - Enable( BACKGROUND ); - - Delay( 1 ); - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CheckRequirements // -// // -// Purpose: This function checks all minimum requirements for the // -// application being installed. If any fail, then the user // -// is informed and the setup is terminated. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CheckRequirements() - NUMBER nvDx, nvDy, nvResult; - STRING svResult; - - begin - - bWinNT = FALSE; - bIsShellExplorer = FALSE; - - // Check screen resolution. - GetExtents( nvDx, nvDy ); - - if (nvDy < 480) then - MessageBox( @ERROR_VGARESOLUTION, WARNING ); - abort; - endif; - - // set 'setup' operation mode - bIs32BitSetup = TRUE; - GetSystemInfo( ISTYPE, nvResult, svResult ); - if (nvResult = 16) then - bIs32BitSetup = FALSE; // running 16-bit setup - return 0; // no additional information required - endif; - - // --- 32-bit testing after this point --- - - // Determine the target system's operating system. - GetSystemInfo( OS, nvResult, svResult ); - - if (nvResult = IS_WINDOWSNT) then - // Running Windows NT. - bWinNT = TRUE; - - // Check to see if the shell being used is EXPLORER shell. - if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then - if (nvResult >= 4) then - bIsShellExplorer = TRUE; - endif; - endif; - - elseif (nvResult = IS_WINDOWS95 ) then - bIsShellExplorer = TRUE; - - endif; - -end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdWelcome // -// // -// Purpose: This function handles the standard welcome dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdWelcome() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdShowInfoList // -// // -// Purpose: This function displays the general information list dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdShowInfoList() - NUMBER nResult; - LIST list; - STRING szTitle, szMsg, szFile; - begin - - szFile = SUPPORTDIR ^ "infolist.txt"; - - list = ListCreate( STRINGLIST ); - ListReadFromFile( list, szFile ); - szTitle = ""; - szMsg = " "; - nResult = SdShowInfoList( szTitle, szMsg, list ); - - ListDestroy( list ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdAskDestPath // -// // -// Purpose: This function asks the user for the destination directory. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdAskDestPath() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); - - TARGETDIR = svDir; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdSetupType // -// // -// Purpose: This function displays the standard setup type dialog. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdSetupType() - NUMBER nResult, nType; - STRING szTitle, szMsg; - begin - - switch (svSetupType) - case "Typical": - nType = TYPICAL; - case "Custom": - nType = CUSTOM; - case "Compact": - nType = COMPACT; - case "": - svSetupType = "Typical"; - nType = TYPICAL; - endswitch; - - szTitle = ""; - szMsg = ""; - nResult = SetupType( szTitle, szMsg, "", nType, 0 ); - - switch (nResult) - case COMPACT: - svSetupType = "Compact"; - case TYPICAL: - svSetupType = "Typical"; - case CUSTOM: - svSetupType = "Custom"; - endswitch; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdComponentDialog2 // -// // -// Purpose: This function displays the custom component dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdComponentDialog2() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - if ((svSetupType != "Custom") && (svSetupType != "")) then - return 0; - endif; - - szTitle = ""; - szMsg = ""; - nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdFinishReboot // -// // -// Purpose: This function will show the last dialog of the product. // -// It will allow the user to reboot and/or show some readme text. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdFinishReboot() - NUMBER nResult, nDefOptions; - STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; - NUMBER bOpt1, bOpt2; - begin - - if (!BATCH_INSTALL) then - bOpt1 = FALSE; - bOpt2 = FALSE; - szMsg1 = ""; - szMsg2 = ""; - szOption1 = ""; - szOption2 = ""; - nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); - return 0; - endif; - - nDefOptions = SYS_BOOTMACHINE; - szTitle = ""; - szMsg1 = ""; - szMsg2 = ""; - nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); - - return nResult; - end; - - // --- include script file section --- - -#include "sddialog.rul" - - - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt b/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt deleted file mode 100755 index e5a6f6ac433..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt +++ /dev/null @@ -1,25 +0,0 @@ -This is a release of MySQL Classic @VERSION@ for Win32. - -NOTE: If you install MySQL in a folder other than -C:\MYSQL or you intend to start MySQL on NT/Win2000 -as a service, you must create a file named C:\MY.CNF -or \Windows\my.ini or \winnt\my.ini with the following -information:: - -[mysqld] -basedir=E:/installation-path/ -datadir=E:/data-path/ - -After your have installed MySQL, the installation -directory will contain 4 files named 'my-small.cnf, -my-medium.cnf, my-large.cnf, my-huge.cnf'. -You can use this as a starting point for your own -C:\my.cnf file. - -If you have any problems, you can mail them to -win32@lists.mysql.com after you have consulted the -MySQL manual and the MySQL mailing list archive -(http://www.mysql.com/documentation/index.html) - -On behalf of the MySQL AB gang, -Michael Widenius diff --git a/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp b/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp Binary files differdeleted file mode 100755 index 3229d50c9bf..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-classic/Shell Objects/Default.shl b/VC++Files/InstallShield/4.0.XX-classic/Shell Objects/Default.shl deleted file mode 100755 index 187cb651307..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Shell Objects/Default.shl +++ /dev/null @@ -1,12 +0,0 @@ -[Data] -Folder3=<FOLDER_STARTUP> -Group0=Main -Group1=Startup -Folder0=<FOLDER_DESKTOP> -Folder1=<FOLDER_STARTMENU> -Folder2=<FOLDER_PROGRAMS> - -[Info] -Type=ShellObject -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/String Tables/0009-English/value.shl b/VC++Files/InstallShield/4.0.XX-classic/String Tables/0009-English/value.shl deleted file mode 100755 index 868c801c68c..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/String Tables/0009-English/value.shl +++ /dev/null @@ -1,23 +0,0 @@ -[Data] -TITLE_MAIN=MySQL Classic Servers and Clients @VERSION@ -COMPANY_NAME=MySQL AB -ERROR_COMPONENT=Component: -COMPANY_NAME16=Company -PRODUCT_VERSION=MySQL Classic Servers and Clients @VERSION@ -ERROR_MOVEDATA=An error occurred during the move data process: %d -ERROR_FILEGROUP=File Group: -UNINST_KEY=MySQL Classic Servers and Clients @VERSION@ -TITLE_CAPTIONBAR=MySQL Classic Servers and Clients @VERSION@ -PRODUCT_NAME16=Product -ERROR_VGARESOLUTION=This program requires VGA or better resolution. -ERROR_FILE=File: -UNINST_DISPLAY_NAME=MySQL Classic Servers and Clients @VERSION@ -PRODUCT_KEY=yourapp.Exe -PRODUCT_NAME=MySQL Classic Servers and Clients @VERSION@ -ERROR_UNINSTSETUP=unInstaller setup failed to initialize. You may not be able to uninstall this product. - -[General] -Language=0009 -Type=STRINGTABLESPECIFIC -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/String Tables/Default.shl b/VC++Files/InstallShield/4.0.XX-classic/String Tables/Default.shl deleted file mode 100755 index d4dc4925ab1..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/String Tables/Default.shl +++ /dev/null @@ -1,74 +0,0 @@ -[TITLE_MAIN] -Comment= - -[COMPANY_NAME] -Comment= - -[ERROR_COMPONENT] -Comment= - -[COMPANY_NAME16] -Comment= - -[PRODUCT_VERSION] -Comment= - -[ERROR_MOVEDATA] -Comment= - -[ERROR_FILEGROUP] -Comment= - -[Language] -Lang0=0009 -CurrentLang=0 - -[UNINST_KEY] -Comment= - -[TITLE_CAPTIONBAR] -Comment= - -[Data] -Entry0=ERROR_VGARESOLUTION -Entry1=TITLE_MAIN -Entry2=TITLE_CAPTIONBAR -Entry3=UNINST_KEY -Entry4=UNINST_DISPLAY_NAME -Entry5=COMPANY_NAME -Entry6=PRODUCT_NAME -Entry7=PRODUCT_VERSION -Entry8=PRODUCT_KEY -Entry9=ERROR_MOVEDATA -Entry10=ERROR_UNINSTSETUP -Entry11=COMPANY_NAME16 -Entry12=PRODUCT_NAME16 -Entry13=ERROR_COMPONENT -Entry14=ERROR_FILEGROUP -Entry15=ERROR_FILE - -[PRODUCT_NAME16] -Comment= - -[ERROR_VGARESOLUTION] -Comment= - -[ERROR_FILE] -Comment= - -[General] -Type=STRINGTABLE -Version=1.00.000 - -[UNINST_DISPLAY_NAME] -Comment= - -[PRODUCT_KEY] -Comment= - -[PRODUCT_NAME] -Comment= - -[ERROR_UNINSTSETUP] -Comment= - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Build.tsb b/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Build.tsb deleted file mode 100755 index 3949bd4c066..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Build.tsb +++ /dev/null @@ -1,56 +0,0 @@ -[<HKUS>] -Value= -KeyType=4 - -[<HKCR>] -Value= -KeyType=4 - -[<PROGRAMFILES>] -Value= -KeyType=4 - -[<WINSYSDIR>] -Value= -KeyType=4 - -[<COMMONFILES>] -Value= -KeyType=4 - -[<WINDIR>] -Value= -KeyType=4 - -[Data] -Key0=<PROGRAMFILES> -Key1=<COMMONFILES> -Key2=<WINDIR> -Key3=<WINSYSDIR> -Key4=<HKLM> -Key5=<HKCU> -Key6=<HKCC> -Key7=<HKDD> -Key8=<HKUS> -Key9=<HKCR> - -[General] -Type=TEXTSUB -Version=1.00.000 - -[<HKLM>] -Value= -KeyType=4 - -[<HKCU>] -Value= -KeyType=4 - -[<HKCC>] -Value= -KeyType=4 - -[<HKDD>] -Value= -KeyType=4 - diff --git a/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Setup.tsb b/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Setup.tsb deleted file mode 100755 index b0c5a509f0b..00000000000 --- a/VC++Files/InstallShield/4.0.XX-classic/Text Substitutions/Setup.tsb +++ /dev/null @@ -1,76 +0,0 @@ -[<SRCDIR>] -Value= -KeyType=4 - -[<HKUS>] -Value= -KeyType=4 - -[<HKCR>] -Value= -KeyType=4 - -[<PROGRAMFILES>] -Value= -KeyType=4 - -[<TARGETDIR>] -Value= -KeyType=4 - -[<WINSYSDIR>] -Value= -KeyType=4 - -[<COMMONFILES>] -Value= -KeyType=4 - -[<WINDIR>] -Value= -KeyType=4 - -[Data] -Key0=<PROGRAMFILES> -Key1=<COMMONFILES> -Key2=<WINDIR> -Key3=<WINSYSDIR> -Key4=<TARGETDIR> -Key5=<SUPPORTDIR> -Key10=<HKDD> -Key6=<SRCDIR> -Key11=<HKUS> -Key7=<HKLM> -Key12=<HKCR> -Key8=<HKCU> -Key13=<SHELL_OBJECT_FOLDER> -Key9=<HKCC> - -[<SUPPORTDIR>] -Value= -KeyType=4 - -[<SHELL_OBJECT_FOLDER>] -Value= -KeyType=4 - -[General] -Type=TEXTSUB -Version=1.00.000 - -[<HKLM>] -Value= -KeyType=4 - -[<HKCU>] -Value= -KeyType=4 - -[<HKCC>] -Value= -KeyType=4 - -[<HKDD>] -Value= -KeyType=4 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/4.0.XX-gpl.ipr b/VC++Files/InstallShield/4.0.XX-gpl/4.0.XX-gpl.ipr deleted file mode 100755 index c415a03a315..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/4.0.XX-gpl.ipr +++ /dev/null @@ -1,51 +0,0 @@ -[Language] -LanguageSupport0=0009 - -[OperatingSystem] -OSSupport=0000000000010010 - -[Data] -CurrentMedia= -CurrentComponentDef=Default.cdf -ProductName=MySQL Servers and Clients -set_mifserial= -DevEnvironment=Microsoft Visual C++ 6 -AppExe= -set_dlldebug=No -EmailAddresss= -Instructions=Instructions.txt -set_testmode=No -set_mif=No -SummaryText= -Department= -HomeURL= -Author= -Type=Database Application -InstallRoot=D:\MySQL-Install\mysql-4\MySQL Servers and Clients -Version=1.00.000 -InstallationGUID=40744a4d-efed-4cff-84a9-9e6389550f5c -set_level=Level 3 -CurrentFileGroupDef=Default.fdf -Notes=Notes.txt -set_maxerr=50 -set_args= -set_miffile=Status.mif -set_dllcmdline= -Copyright= -set_warnaserr=No -CurrentPlatform= -Category= -set_preproc= -CurrentLanguage=English -CompanyName=MySQL -Description=Description.txt -set_maxwarn=50 -set_crc=Yes -set_compileb4build=No - -[MediaInfo] - -[General] -Type=INSTALLMAIN -Version=1.10.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.cdf b/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.cdf deleted file mode 100755 index 48d37800cd1..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.cdf +++ /dev/null @@ -1,192 +0,0 @@ -[Development] -required0=Servers -SELECTED=Yes -FILENEED=STANDARD -required1=Grant Tables -HTTPLOCATION= -STATUS=Examples, Libraries, Includes and Script files -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=Examples, Libraries, Includes and Script files -DISPLAYTEXT=Examples, Libraries, Includes and Script files -IMAGE= -DEFSELECTION=Yes -filegroup0=Development -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=ALWAYSOVERWRITE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Grant Tables] -required0=Servers -SELECTED=Yes -FILENEED=CRITICAL -HTTPLOCATION= -STATUS=The Grant Tables and Core Files -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The Grant Tables and Core Files -DISPLAYTEXT=The Grant Tables and Core Files -IMAGE= -DEFSELECTION=Yes -filegroup0=Grant Tables -requiredby0=Development -COMMENT= -INCLUDEINBUILD=Yes -requiredby1=Clients and Tools -INSTALLATION=NEVEROVERWRITE -requiredby2=Documentation -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Components] -component0=Development -component1=Grant Tables -component2=Servers -component3=Clients and Tools -component4=Documentation - -[TopComponents] -component0=Servers -component1=Clients and Tools -component2=Documentation -component3=Development -component4=Grant Tables - -[SetupType] -setuptype0=Compact -setuptype1=Typical -setuptype2=Custom - -[Clients and Tools] -required0=Servers -SELECTED=Yes -FILENEED=HIGHLYRECOMMENDED -required1=Grant Tables -HTTPLOCATION= -STATUS=The MySQL clients and Maintenance Tools -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL clients and Maintenance Tools -DISPLAYTEXT=The MySQL clients and Maintenance Tools -IMAGE= -DEFSELECTION=Yes -filegroup0=Clients and Tools -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=NEWERDATE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Servers] -SELECTED=Yes -FILENEED=CRITICAL -HTTPLOCATION= -STATUS=The MySQL Servers -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL Servers -DISPLAYTEXT=The MySQL Servers -IMAGE= -DEFSELECTION=Yes -filegroup0=Servers -requiredby0=Development -COMMENT= -INCLUDEINBUILD=Yes -requiredby1=Grant Tables -INSTALLATION=ALWAYSOVERWRITE -requiredby2=Clients and Tools -requiredby3=Documentation -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[SetupTypeItem-Compact] -Comment= -item0=Grant Tables -item1=Servers -item2=Clients and Tools -item3=Documentation -Descrip= -DisplayText= - -[SetupTypeItem-Custom] -Comment= -item0=Development -item1=Grant Tables -item2=Servers -item3=Clients and Tools -Descrip= -item4=Documentation -DisplayText= - -[Info] -Type=CompDef -Version=1.00.000 -Name= - -[SetupTypeItem-Typical] -Comment= -item0=Development -item1=Grant Tables -item2=Servers -item3=Clients and Tools -Descrip= -item4=Documentation -DisplayText= - -[Documentation] -required0=Servers -SELECTED=Yes -FILENEED=HIGHLYRECOMMENDED -required1=Grant Tables -HTTPLOCATION= -STATUS=The MySQL Documentation with different formats -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL Documentation with different formats -DISPLAYTEXT=The MySQL Documentation with different formats -IMAGE= -DEFSELECTION=Yes -filegroup0=Documentation -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=ALWAYSOVERWRITE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.fgl b/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.fgl deleted file mode 100755 index 4e20dcea4ab..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Component Definitions/Default.fgl +++ /dev/null @@ -1,42 +0,0 @@ -[<PROGRAMFILES>\<COMMONFILES>] -DISPLAYTEXT=Common Files Folder -TYPE=TEXTSUBFIXED -fulldirectory= - -[<WINDIR>\<WINSYSDIR>] -DISPLAYTEXT=Windows System Folder -TYPE=TEXTSUBFIXED -fulldirectory= - -[USERDEFINED] -DISPLAYTEXT=Script-defined Folders -TYPE=USERSTART -fulldirectory= - -[<PROGRAMFILES>] -DISPLAYTEXT=Program Files Folder -SubDir0=<PROGRAMFILES>\<COMMONFILES> -TYPE=TEXTSUBFIXED -fulldirectory= - -[<TARGETDIR>] -DISPLAYTEXT=General Application Destination -TYPE=TEXTSUBFIXED -fulldirectory= - -[<WINDIR>] -DISPLAYTEXT=Windows Operating System -SubDir0=<WINDIR>\<WINSYSDIR> -TYPE=TEXTSUBFIXED -fulldirectory= - -[TopDir] -SubDir0=<WINDIR> -SubDir1=<PROGRAMFILES> -SubDir2=<TARGETDIR> -SubDir3=USERDEFINED - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl deleted file mode 100755 index ed1e42e65b6..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl +++ /dev/null @@ -1,32 +0,0 @@ -[bin] -file15=C:\mysql\bin\replace.exe -file16=C:\mysql\bin\winmysqladmin.cnt -file0=C:\mysql\bin\isamchk.exe -file17=C:\mysql\bin\WINMYSQLADMIN.HLP -file1=C:\mysql\bin\myisamchk.exe -file18=C:\mysql\bin\comp-err.exe -file2=C:\mysql\bin\myisamlog.exe -file19=C:\mysql\bin\my_print_defaults.exe -file3=C:\mysql\bin\myisampack.exe -file4=C:\mysql\bin\mysql.exe -file5=C:\mysql\bin\mysqladmin.exe -file6=C:\mysql\bin\mysqlbinlog.exe -file7=C:\mysql\bin\mysqlc.exe -file8=C:\mysql\bin\mysqlcheck.exe -file9=C:\mysql\bin\mysqldump.exe -file20=C:\mysql\bin\winmysqladmin.exe -file21=C:\mysql\bin\myisam_ftdump.exe -file10=C:\mysql\bin\mysqlimport.exe -fulldirectory= -file11=C:\mysql\bin\mysqlshow.exe -file12=C:\mysql\bin\mysqlwatch.exe -file13=C:\mysql\bin\pack_isam.exe -file14=C:\mysql\bin\perror.exe - -[TopDir] -SubDir0=bin - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Default.fdf b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Default.fdf deleted file mode 100755 index 8096a4b74bf..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Default.fdf +++ /dev/null @@ -1,82 +0,0 @@ -[FileGroups] -group0=Development -group1=Grant Tables -group2=Servers -group3=Clients and Tools -group4=Documentation - -[Development] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Grant Tables] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Clients and Tools] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM=0000000000000000 -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Servers] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Info] -Type=FileGrp -Version=1.00.000 -Name= - -[Documentation] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl deleted file mode 100755 index 02e01d564aa..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl +++ /dev/null @@ -1,242 +0,0 @@ -[bench\Data\Wisconsin] -file0=C:\mysql\bench\Data\Wisconsin\onek.data -file1=C:\mysql\bench\Data\Wisconsin\tenk.data -fulldirectory= - -[lib\debug] -file0=C:\mysql\lib\debug\libmySQL.dll -file1=C:\mysql\lib\debug\libmySQL.lib -file2=C:\mysql\lib\debug\mysqlclient.lib -file3=C:\mysql\lib\debug\zlib.lib -file4=C:\mysql\lib\debug\regex.lib -file5=C:\mysql\lib\debug\mysys.lib -file6=C:\mysql\lib\debug\strings.lib -fulldirectory= - -[bench\output] -fulldirectory= - -[examples\libmysqltest] -file0=C:\mysql\examples\libmysqltest\myTest.c -file1=C:\mysql\examples\libmysqltest\myTest.dsp -file2=C:\mysql\examples\libmysqltest\myTest.dsw -file3=C:\mysql\examples\libmysqltest\myTest.exe -file4=C:\mysql\examples\libmysqltest\myTest.mak -file5=C:\mysql\examples\libmysqltest\myTest.ncb -file6=C:\mysql\examples\libmysqltest\myTest.opt -file7=C:\mysql\examples\libmysqltest\readme -fulldirectory= - -[include] -file15=C:\mysql\include\libmysqld.def -file16=C:\mysql\include\my_alloc.h -file0=C:\mysql\include\raid.h -file17=C:\mysql\include\my_getopt.h -file1=C:\mysql\include\errmsg.h -file2=C:\mysql\include\Libmysql.def -file3=C:\mysql\include\m_ctype.h -file4=C:\mysql\include\m_string.h -file5=C:\mysql\include\my_list.h -file6=C:\mysql\include\my_pthread.h -file7=C:\mysql\include\my_sys.h -file8=C:\mysql\include\mysql.h -file9=C:\mysql\include\mysql_com.h -file10=C:\mysql\include\mysql_version.h -fulldirectory= -file11=C:\mysql\include\mysqld_error.h -file12=C:\mysql\include\dbug.h -file13=C:\mysql\include\config-win.h -file14=C:\mysql\include\my_global.h - -[examples] -SubDir0=examples\libmysqltest -SubDir1=examples\tests -fulldirectory= - -[lib\opt] -file0=C:\mysql\lib\opt\libmySQL.dll -file1=C:\mysql\lib\opt\libmySQL.lib -file2=C:\mysql\lib\opt\mysqlclient.lib -file3=C:\mysql\lib\opt\zlib.lib -file4=C:\mysql\lib\opt\strings.lib -file5=C:\mysql\lib\opt\mysys-max.lib -file6=C:\mysql\lib\opt\regex.lib -file7=C:\mysql\lib\opt\mysys.lib -fulldirectory= - -[bench\Data] -SubDir0=bench\Data\ATIS -SubDir1=bench\Data\Wisconsin -fulldirectory= - -[bench\limits] -file15=C:\mysql\bench\limits\pg.comment -file16=C:\mysql\bench\limits\solid.cfg -file0=C:\mysql\bench\limits\access.cfg -file17=C:\mysql\bench\limits\solid-nt4.cfg -file1=C:\mysql\bench\limits\access.comment -file18=C:\mysql\bench\limits\sybase.cfg -file2=C:\mysql\bench\limits\Adabas.cfg -file3=C:\mysql\bench\limits\Adabas.comment -file4=C:\mysql\bench\limits\Db2.cfg -file5=C:\mysql\bench\limits\empress.cfg -file6=C:\mysql\bench\limits\empress.comment -file7=C:\mysql\bench\limits\Informix.cfg -file8=C:\mysql\bench\limits\Informix.comment -file9=C:\mysql\bench\limits\msql.cfg -file10=C:\mysql\bench\limits\ms-sql.cfg -fulldirectory= -file11=C:\mysql\bench\limits\Ms-sql65.cfg -file12=C:\mysql\bench\limits\mysql.cfg -file13=C:\mysql\bench\limits\oracle.cfg -file14=C:\mysql\bench\limits\pg.cfg - -[TopDir] -SubDir0=bench -SubDir1=examples -SubDir2=include -SubDir3=lib -SubDir4=scripts - -[bench] -file15=C:\mysql\bench\test-create -file16=C:\mysql\bench\test-insert -file0=C:\mysql\bench\uname.bat -file17=C:\mysql\bench\test-select -file1=C:\mysql\bench\compare-results -file18=C:\mysql\bench\test-wisconsin -file2=C:\mysql\bench\copy-db -file19=C:\mysql\bench\bench-init.pl -file3=C:\mysql\bench\crash-me -file4=C:\mysql\bench\example.bat -file5=C:\mysql\bench\print-limit-table -file6=C:\mysql\bench\pwd.bat -file7=C:\mysql\bench\Readme -SubDir0=bench\Data -file8=C:\mysql\bench\run.bat -SubDir1=bench\limits -file9=C:\mysql\bench\run-all-tests -SubDir2=bench\output -file10=C:\mysql\bench\server-cfg -fulldirectory= -file11=C:\mysql\bench\test-alter-table -file12=C:\mysql\bench\test-ATIS -file13=C:\mysql\bench\test-big-tables -file14=C:\mysql\bench\test-connect - -[examples\tests] -file15=C:\mysql\examples\tests\lock_test.res -file16=C:\mysql\examples\tests\mail_to_db.pl -file0=C:\mysql\examples\tests\unique_users.tst -file17=C:\mysql\examples\tests\table_types.pl -file1=C:\mysql\examples\tests\auto_increment.tst -file18=C:\mysql\examples\tests\test_delayed_insert.pl -file2=C:\mysql\examples\tests\big_record.pl -file19=C:\mysql\examples\tests\udf_test -file3=C:\mysql\examples\tests\big_record.res -file4=C:\mysql\examples\tests\czech-sorting -file5=C:\mysql\examples\tests\deadlock-script.pl -file6=C:\mysql\examples\tests\export.pl -file7=C:\mysql\examples\tests\fork_test.pl -file8=C:\mysql\examples\tests\fork2_test.pl -file9=C:\mysql\examples\tests\fork3_test.pl -file20=C:\mysql\examples\tests\udf_test.res -file21=C:\mysql\examples\tests\auto_increment.res -file10=C:\mysql\examples\tests\function.res -fulldirectory= -file11=C:\mysql\examples\tests\function.tst -file12=C:\mysql\examples\tests\grant.pl -file13=C:\mysql\examples\tests\grant.res -file14=C:\mysql\examples\tests\lock_test.pl - -[bench\Data\ATIS] -file26=C:\mysql\bench\Data\ATIS\stop1.txt -file15=C:\mysql\bench\Data\ATIS\flight_class.txt -file27=C:\mysql\bench\Data\ATIS\time_interval.txt -file16=C:\mysql\bench\Data\ATIS\flight_day.txt -file0=C:\mysql\bench\Data\ATIS\transport.txt -file28=C:\mysql\bench\Data\ATIS\time_zone.txt -file17=C:\mysql\bench\Data\ATIS\flight_fare.txt -file1=C:\mysql\bench\Data\ATIS\airline.txt -file29=C:\mysql\bench\Data\ATIS\aircraft.txt -file18=C:\mysql\bench\Data\ATIS\food_service.txt -file2=C:\mysql\bench\Data\ATIS\airport.txt -file19=C:\mysql\bench\Data\ATIS\ground_service.txt -file3=C:\mysql\bench\Data\ATIS\airport_service.txt -file4=C:\mysql\bench\Data\ATIS\city.txt -file5=C:\mysql\bench\Data\ATIS\class_of_service.txt -file6=C:\mysql\bench\Data\ATIS\code_description.txt -file7=C:\mysql\bench\Data\ATIS\compound_class.txt -file8=C:\mysql\bench\Data\ATIS\connect_leg.txt -file9=C:\mysql\bench\Data\ATIS\date_day.txt -file20=C:\mysql\bench\Data\ATIS\month_name.txt -file21=C:\mysql\bench\Data\ATIS\restrict_carrier.txt -file10=C:\mysql\bench\Data\ATIS\day_name.txt -fulldirectory= -file22=C:\mysql\bench\Data\ATIS\restrict_class.txt -file11=C:\mysql\bench\Data\ATIS\dual_carrier.txt -file23=C:\mysql\bench\Data\ATIS\restriction.txt -file12=C:\mysql\bench\Data\ATIS\fare.txt -file24=C:\mysql\bench\Data\ATIS\state.txt -file13=C:\mysql\bench\Data\ATIS\fconnection.txt -file25=C:\mysql\bench\Data\ATIS\stop.txt -file14=C:\mysql\bench\Data\ATIS\flight.txt - -[General] -Type=FILELIST -Version=1.00.000 - -[scripts] -file37=C:\mysql\scripts\mysqld_safe-watch.sh -file26=C:\mysql\scripts\mysql_zap -file15=C:\mysql\scripts\mysql_fix_privilege_tables -file38=C:\mysql\scripts\mysqldumpslow -file27=C:\mysql\scripts\mysql_zap.sh -file16=C:\mysql\scripts\mysql_fix_privilege_tables.sh -file0=C:\mysql\scripts\Readme -file39=C:\mysql\scripts\mysqldumpslow.sh -file28=C:\mysql\scripts\mysqlaccess -file17=C:\mysql\scripts\mysql_install_db -file1=C:\mysql\scripts\make_binary_distribution.sh -file29=C:\mysql\scripts\mysqlaccess.conf -file18=C:\mysql\scripts\mysql_install_db.sh -file2=C:\mysql\scripts\msql2mysql -file19=C:\mysql\scripts\mysql_secure_installation -file3=C:\mysql\scripts\msql2mysql.sh -file4=C:\mysql\scripts\mysql_config -file5=C:\mysql\scripts\mysql_config.sh -file6=C:\mysql\scripts\mysql_convert_table_format -file7=C:\mysql\scripts\mysql_convert_table_format.sh -file40=C:\mysql\scripts\mysqlhotcopy -file8=C:\mysql\scripts\mysql_explain_log -file41=C:\mysql\scripts\mysqlhotcopy.pl -file30=C:\mysql\scripts\mysqlaccess.sh -file9=C:\mysql\scripts\mysql_explain_log.sh -file42=C:\mysql\scripts\mysqlhotcopy.sh -file31=C:\mysql\scripts\mysqlbug -file20=C:\mysql\scripts\mysql_secure_installation.sh -file43=C:\mysql\scripts\make_binary_distribution -file32=C:\mysql\scripts\mysqlbug.sh -file21=C:\mysql\scripts\mysql_setpermission -file10=C:\mysql\scripts\mysql_find_rows -fulldirectory= -file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql -file33=C:\mysql\scripts\mysqld_multi -file22=C:\mysql\scripts\mysql_setpermission.pl -file11=C:\mysql\scripts\mysql_find_rows.pl -file34=C:\mysql\scripts\mysqld_multi.sh -file23=C:\mysql\scripts\mysql_setpermission.sh -file12=C:\mysql\scripts\mysql_find_rows.sh -file35=C:\mysql\scripts\mysqld_safe -file24=C:\mysql\scripts\mysql_tableinfo -file13=C:\mysql\scripts\mysql_fix_extensions -file36=C:\mysql\scripts\mysqld_safe.sh -file25=C:\mysql\scripts\mysql_tableinfo.sh -file14=C:\mysql\scripts\mysql_fix_extensions.sh - -[lib] -file0=C:\mysql\lib\Readme -SubDir0=lib\debug -SubDir1=lib\opt -fulldirectory= - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Documentation.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Documentation.fgl deleted file mode 100755 index 107ebd1afb7..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Documentation.fgl +++ /dev/null @@ -1,101 +0,0 @@ -[Docs\Flags] -file59=C:\mysql\Docs\Flags\romania.gif -file48=C:\mysql\Docs\Flags\kroatia.eps -file37=C:\mysql\Docs\Flags\iceland.gif -file26=C:\mysql\Docs\Flags\france.eps -file15=C:\mysql\Docs\Flags\china.gif -file49=C:\mysql\Docs\Flags\kroatia.gif -file38=C:\mysql\Docs\Flags\ireland.eps -file27=C:\mysql\Docs\Flags\france.gif -file16=C:\mysql\Docs\Flags\croatia.eps -file0=C:\mysql\Docs\Flags\usa.gif -file39=C:\mysql\Docs\Flags\ireland.gif -file28=C:\mysql\Docs\Flags\germany.eps -file17=C:\mysql\Docs\Flags\croatia.gif -file1=C:\mysql\Docs\Flags\argentina.gif -file29=C:\mysql\Docs\Flags\germany.gif -file18=C:\mysql\Docs\Flags\czech-republic.eps -file2=C:\mysql\Docs\Flags\australia.eps -file19=C:\mysql\Docs\Flags\czech-republic.gif -file3=C:\mysql\Docs\Flags\australia.gif -file80=C:\mysql\Docs\Flags\usa.eps -file4=C:\mysql\Docs\Flags\austria.eps -file81=C:\mysql\Docs\Flags\argentina.eps -file70=C:\mysql\Docs\Flags\spain.eps -file5=C:\mysql\Docs\Flags\austria.gif -file71=C:\mysql\Docs\Flags\spain.gif -file60=C:\mysql\Docs\Flags\russia.eps -file6=C:\mysql\Docs\Flags\brazil.eps -file72=C:\mysql\Docs\Flags\sweden.eps -file61=C:\mysql\Docs\Flags\russia.gif -file50=C:\mysql\Docs\Flags\latvia.eps -file7=C:\mysql\Docs\Flags\brazil.gif -file73=C:\mysql\Docs\Flags\sweden.gif -file62=C:\mysql\Docs\Flags\singapore.eps -file51=C:\mysql\Docs\Flags\latvia.gif -file40=C:\mysql\Docs\Flags\island.eps -file8=C:\mysql\Docs\Flags\bulgaria.eps -file74=C:\mysql\Docs\Flags\switzerland.eps -file63=C:\mysql\Docs\Flags\singapore.gif -file52=C:\mysql\Docs\Flags\netherlands.eps -file41=C:\mysql\Docs\Flags\island.gif -file30=C:\mysql\Docs\Flags\great-britain.eps -file9=C:\mysql\Docs\Flags\bulgaria.gif -file75=C:\mysql\Docs\Flags\switzerland.gif -file64=C:\mysql\Docs\Flags\south-africa.eps -file53=C:\mysql\Docs\Flags\netherlands.gif -file42=C:\mysql\Docs\Flags\israel.eps -file31=C:\mysql\Docs\Flags\great-britain.gif -file20=C:\mysql\Docs\Flags\denmark.eps -file76=C:\mysql\Docs\Flags\taiwan.eps -file65=C:\mysql\Docs\Flags\south-africa.gif -file54=C:\mysql\Docs\Flags\poland.eps -file43=C:\mysql\Docs\Flags\israel.gif -file32=C:\mysql\Docs\Flags\greece.eps -file21=C:\mysql\Docs\Flags\denmark.gif -file10=C:\mysql\Docs\Flags\canada.eps -fulldirectory= -file77=C:\mysql\Docs\Flags\taiwan.gif -file66=C:\mysql\Docs\Flags\south-africa1.eps -file55=C:\mysql\Docs\Flags\poland.gif -file44=C:\mysql\Docs\Flags\italy.eps -file33=C:\mysql\Docs\Flags\greece.gif -file22=C:\mysql\Docs\Flags\estonia.eps -file11=C:\mysql\Docs\Flags\canada.gif -file78=C:\mysql\Docs\Flags\ukraine.eps -file67=C:\mysql\Docs\Flags\south-africa1.gif -file56=C:\mysql\Docs\Flags\portugal.eps -file45=C:\mysql\Docs\Flags\italy.gif -file34=C:\mysql\Docs\Flags\hungary.eps -file23=C:\mysql\Docs\Flags\estonia.gif -file12=C:\mysql\Docs\Flags\chile.eps -file79=C:\mysql\Docs\Flags\ukraine.gif -file68=C:\mysql\Docs\Flags\south-korea.eps -file57=C:\mysql\Docs\Flags\portugal.gif -file46=C:\mysql\Docs\Flags\japan.eps -file35=C:\mysql\Docs\Flags\hungary.gif -file24=C:\mysql\Docs\Flags\finland.eps -file13=C:\mysql\Docs\Flags\chile.gif -file69=C:\mysql\Docs\Flags\south-korea.gif -file58=C:\mysql\Docs\Flags\romania.eps -file47=C:\mysql\Docs\Flags\japan.gif -file36=C:\mysql\Docs\Flags\iceland.eps -file25=C:\mysql\Docs\Flags\finland.gif -file14=C:\mysql\Docs\Flags\china.eps - -[Docs] -file0=C:\mysql\Docs\manual_toc.html -file1=C:\mysql\Docs\Copying -file2=C:\mysql\Docs\Copying.lib -file3=C:\mysql\Docs\manual.html -file4=C:\mysql\Docs\manual.txt -SubDir0=Docs\Flags -fulldirectory= - -[TopDir] -SubDir0=Docs - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Grant Tables.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Grant Tables.fgl deleted file mode 100755 index 178065a7003..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Grant Tables.fgl +++ /dev/null @@ -1,36 +0,0 @@ -[data\test] -fulldirectory= - -[data\mysql] -file15=C:\mysql\data\mysql\func.frm -file16=C:\mysql\data\mysql\func.MYD -file0=C:\mysql\data\mysql\columns_priv.frm -file17=C:\mysql\data\mysql\func.MYI -file1=C:\mysql\data\mysql\columns_priv.MYD -file2=C:\mysql\data\mysql\columns_priv.MYI -file3=C:\mysql\data\mysql\db.frm -file4=C:\mysql\data\mysql\db.MYD -file5=C:\mysql\data\mysql\db.MYI -file6=C:\mysql\data\mysql\host.frm -file7=C:\mysql\data\mysql\host.MYD -file8=C:\mysql\data\mysql\host.MYI -file9=C:\mysql\data\mysql\tables_priv.frm -file10=C:\mysql\data\mysql\tables_priv.MYD -fulldirectory= -file11=C:\mysql\data\mysql\tables_priv.MYI -file12=C:\mysql\data\mysql\user.frm -file13=C:\mysql\data\mysql\user.MYD -file14=C:\mysql\data\mysql\user.MYI - -[TopDir] -SubDir0=data - -[data] -SubDir0=data\mysql -SubDir1=data\test -fulldirectory= - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl deleted file mode 100755 index 6564512de2c..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl +++ /dev/null @@ -1,253 +0,0 @@ -[Embedded\Static\release] -file0=C:\mysql\embedded\Static\release\test_stc.dsp -file1=C:\mysql\embedded\Static\release\ReadMe.txt -file2=C:\mysql\embedded\Static\release\StdAfx.cpp -file3=C:\mysql\embedded\Static\release\StdAfx.h -file4=C:\mysql\embedded\Static\release\test_stc.cpp -file5=C:\mysql\embedded\Static\release\mysqlserver.lib -fulldirectory= - -[share\polish] -file0=C:\mysql\share\polish\errmsg.sys -file1=C:\mysql\share\polish\errmsg.txt -fulldirectory= - -[share\dutch] -file0=C:\mysql\share\dutch\errmsg.sys -file1=C:\mysql\share\dutch\errmsg.txt -fulldirectory= - -[share\spanish] -file0=C:\mysql\share\spanish\errmsg.sys -file1=C:\mysql\share\spanish\errmsg.txt -fulldirectory= - -[share\english] -file0=C:\mysql\share\english\errmsg.sys -file1=C:\mysql\share\english\errmsg.txt -fulldirectory= - -[bin] -file0=C:\mysql\bin\mysqld-opt.exe -file1=C:\mysql\bin\mysqld-max.exe -file2=C:\mysql\bin\mysqld-max-nt.exe -file3=C:\mysql\bin\mysqld-nt.exe -file4=C:\mysql\bin\mysqld.exe -file5=C:\mysql\bin\cygwinb19.dll -file6=C:\mysql\bin\libmySQL.dll -fulldirectory= - -[share\korean] -file0=C:\mysql\share\korean\errmsg.sys -file1=C:\mysql\share\korean\errmsg.txt -fulldirectory= - -[share\charsets] -file0=C:\mysql\share\charsets\cp1250.xml -file1=C:\mysql\share\charsets\cp1251.conf -file2=C:\mysql\share\charsets\cp1251.xml -file3=C:\mysql\share\charsets\cp1256.xml -file1=C:\mysql\share\charsets\cp1257.conf -file4=C:\mysql\share\charsets\cp1257.xml -file5=C:\mysql\share\charsets\cp850.xml -file6=C:\mysql\share\charsets\cp852.xml -file7=C:\mysql\share\charsets\cp866.xml -file8=C:\mysql\share\charsets\croat.conf -file9=C:\mysql\share\charsets\danish.conf -file10=C:\mysql\share\charsets\dec8.conf -file10=C:\mysql\share\charsets\dec8.xml -file11=C:\mysql\share\charsets\dos.conf -file12=C:\mysql\share\charsets\estonia.conf -file13=C:\mysql\share\charsets\geostd8.xml -file14=C:\mysql\share\charsets\german1.conf -file15=C:\mysql\share\charsets\greek.xml -file16=C:\mysql\share\charsets\greek.conf -file17=C:\mysql\share\charsets\hebrew.xml -file18=C:\mysql\share\charsets\hebrew.conf -file19=C:\mysql\share\charsets\hp8.xml -file20=C:\mysql\share\charsets\hp8.conf -file21=C:\mysql\share\charsets\hungarian.conf -file22=C:\mysql\share\charsets\keybcs2.xml -file23=C:\mysql\share\charsets\koi8_ru.conf -file24=C:\mysql\share\charsets\koi8_ukr.conf -file25=C:\mysql\share\charsets\koi8r.xml -file26=C:\mysql\share\charsets\koi8u.xml -file27=C:\mysql\share\charsets\latin1.conf -file28=C:\mysql\share\charsets\latin1.xml -file29=C:\mysql\share\charsets\latin2.conf -file30=C:\mysql\share\charsets\latin2.xml -file31=C:\mysql\share\charsets\latin5.conf -file32=C:\mysql\share\charsets\latin5.xml -file33=C:\mysql\share\charsets\latin7.xml -file34=C:\mysql\share\charsets\macce.xml -file35=C:\mysql\share\charsets\macroman.xml -file36=C:\mysql\share\charsets\swe7.conf -file37=C:\mysql\share\charsets\swe7.xml -file38=C:\mysql\share\charsets\usa7.conf -file39=C:\mysql\share\charsets\win1250.conf -file40=C:\mysql\share\charsets\win1251ukr.conf -file41=C:\mysql\share\charsets\win1251.conf -file42=C:\mysql\share\charsets\Index -file43=C:\mysql\share\charsets\Index.xml -file44=C:\mysql\share\charsets\Readme -file45=C:\mysql\share\charsets\languages.html -fulldirectory= - -[Embedded\DLL\debug] -file0=C:\mysql\embedded\DLL\debug\libmysqld.dll -file1=C:\mysql\embedded\DLL\debug\libmysqld.exp -file2=C:\mysql\embedded\DLL\debug\libmysqld.lib -fulldirectory= - -[Embedded] -file0=C:\mysql\embedded\embedded.dsw -SubDir0=Embedded\DLL -SubDir1=Embedded\Static -fulldirectory= - -[share\ukrainian] -file0=C:\mysql\share\ukrainian\errmsg.sys -file1=C:\mysql\share\ukrainian\errmsg.txt -fulldirectory= - -[share\hungarian] -file0=C:\mysql\share\hungarian\errmsg.sys -file1=C:\mysql\share\hungarian\errmsg.txt -fulldirectory= - -[share\german] -file0=C:\mysql\share\german\errmsg.sys -file1=C:\mysql\share\german\errmsg.txt -fulldirectory= - -[share\portuguese] -file0=C:\mysql\share\portuguese\errmsg.sys -file1=C:\mysql\share\portuguese\errmsg.txt -fulldirectory= - -[share\estonian] -file0=C:\mysql\share\estonian\errmsg.sys -file1=C:\mysql\share\estonian\errmsg.txt -fulldirectory= - -[share\romanian] -file0=C:\mysql\share\romanian\errmsg.sys -file1=C:\mysql\share\romanian\errmsg.txt -fulldirectory= - -[share\french] -file0=C:\mysql\share\french\errmsg.sys -file1=C:\mysql\share\french\errmsg.txt -fulldirectory= - -[share\swedish] -file0=C:\mysql\share\swedish\errmsg.sys -file1=C:\mysql\share\swedish\errmsg.txt -fulldirectory= - -[share\slovak] -file0=C:\mysql\share\slovak\errmsg.sys -file1=C:\mysql\share\slovak\errmsg.txt -fulldirectory= - -[share\greek] -file0=C:\mysql\share\greek\errmsg.sys -file1=C:\mysql\share\greek\errmsg.txt -fulldirectory= - -[TopDir] -file0=C:\mysql\mysqlbug.txt -file1=C:\mysql\my-huge.cnf -file2=C:\mysql\my-large.cnf -file3=C:\mysql\my-medium.cnf -file4=C:\mysql\my-small.cnf -file5=C:\mysql\README.txt -SubDir0=bin -SubDir1=share -SubDir2=Embedded - -[share] -SubDir8=share\hungarian -SubDir9=share\charsets -SubDir20=share\spanish -SubDir21=share\swedish -SubDir10=share\italian -SubDir22=share\ukrainian -SubDir11=share\japanese -SubDir12=share\korean -SubDir13=share\norwegian -SubDir14=share\norwegian-ny -SubDir15=share\polish -SubDir16=share\portuguese -SubDir0=share\czech -SubDir17=share\romanian -SubDir1=share\danish -SubDir18=share\russian -SubDir2=share\dutch -SubDir19=share\slovak -SubDir3=share\english -fulldirectory= -SubDir4=share\estonian -SubDir5=share\french -SubDir6=share\german -SubDir7=share\greek - -[share\norwegian-ny] -file0=C:\mysql\share\norwegian-ny\errmsg.sys -file1=C:\mysql\share\norwegian-ny\errmsg.txt -fulldirectory= - -[Embedded\DLL] -file0=C:\mysql\embedded\DLL\test_dll.dsp -file1=C:\mysql\embedded\DLL\StdAfx.h -file2=C:\mysql\embedded\DLL\test_dll.cpp -file3=C:\mysql\embedded\DLL\StdAfx.cpp -SubDir0=Embedded\DLL\debug -SubDir1=Embedded\DLL\release -fulldirectory= - -[Embedded\Static] -SubDir0=Embedded\Static\release -fulldirectory= - -[Embedded\DLL\release] -file0=C:\mysql\embedded\DLL\release\libmysqld.dll -file1=C:\mysql\embedded\DLL\release\libmysqld.exp -file2=C:\mysql\embedded\DLL\release\libmysqld.lib -file3=C:\mysql\embedded\DLL\release\mysql-server.exe -fulldirectory= - -[share\danish] -file0=C:\mysql\share\danish\errmsg.sys -file1=C:\mysql\share\danish\errmsg.txt -fulldirectory= - -[share\czech] -file0=C:\mysql\share\czech\errmsg.sys -file1=C:\mysql\share\czech\errmsg.txt -fulldirectory= - -[General] -Type=FILELIST -Version=1.00.000 - -[share\russian] -file0=C:\mysql\share\russian\errmsg.sys -file1=C:\mysql\share\russian\errmsg.txt -fulldirectory= - -[share\norwegian] -file0=C:\mysql\share\norwegian\errmsg.sys -file1=C:\mysql\share\norwegian\errmsg.txt -fulldirectory= - -[share\japanese] -file0=C:\mysql\share\japanese\errmsg.sys -file1=C:\mysql\share\japanese\errmsg.txt -fulldirectory= - -[share\italian] -file0=C:\mysql\share\italian\errmsg.sys -file1=C:\mysql\share\italian\errmsg.txt -fulldirectory= - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Registry Entries/Default.rge b/VC++Files/InstallShield/4.0.XX-gpl/Registry Entries/Default.rge deleted file mode 100755 index 537dfd82e48..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Registry Entries/Default.rge +++ /dev/null @@ -1,4 +0,0 @@ -[General] -Type=REGISTRYDATA -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.dbg b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.dbg Binary files differdeleted file mode 100755 index 0c6d4e6b708..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.dbg +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ino b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ino Binary files differdeleted file mode 100755 index 204d8ea0f36..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ino +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ins b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ins Binary files differdeleted file mode 100755 index 759009b5c84..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.ins +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.obs b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.obs Binary files differdeleted file mode 100755 index 5fcfcb62c4e..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.obs +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old deleted file mode 100755 index df143b493c4..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old +++ /dev/null @@ -1,640 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-1997, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup on a -// Windows 95 or Windows NT 4.0 platform. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - - // Include header file -#include "sdlang.h" -#include "sddialog.h" - -////////////////////// string defines //////////////////////////// - -#define UNINST_LOGFILE_NAME "Uninst.isu" - -//////////////////// installation declarations /////////////////// - - // ----- DLL prototypes ----- - - - // your DLL prototypes - - - // ---- script prototypes ----- - - // generated - prototype ShowDialogs(); - prototype MoveFileData(); - prototype HandleMoveDataError( NUMBER ); - prototype ProcessBeforeDataMove(); - prototype ProcessAfterDataMove(); - prototype SetupRegistry(); - prototype SetupFolders(); - prototype CleanUpInstall(); - prototype SetupInstall(); - prototype SetupScreen(); - prototype CheckRequirements(); - prototype DialogShowSdWelcome(); - prototype DialogShowSdShowInfoList(); - prototype DialogShowSdAskDestPath(); - prototype DialogShowSdSetupType(); - prototype DialogShowSdComponentDialog2(); - prototype DialogShowSdFinishReboot(); - - // your prototypes - - - // ----- global variables ------ - - // generated - BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; - STRING svDir; - STRING svName, svCompany, svSerial; - STRING szAppPath; - STRING svSetupType; - - - // your global variables - - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN PROGRAM -// -// The setup begins here by hiding the visible setup -// window. This is done to allow all the titles, images, etc. to -// be established before showing the main window. The following -// logic then performs the setup in a series of steps. -// -/////////////////////////////////////////////////////////////////////////////// -program - Disable( BACKGROUND ); - - CheckRequirements(); - - SetupInstall(); - - SetupScreen(); - - if (ShowDialogs()<0) goto end_install; - - if (ProcessBeforeDataMove()<0) goto end_install; - - if (MoveFileData()<0) goto end_install; - - if (ProcessAfterDataMove()<0) goto end_install; - - if (SetupRegistry()<0) goto end_install; - - if (SetupFolders()<0) goto end_install; - - - end_install: - - CleanUpInstall(); - - // If an unrecoverable error occurred, clean up the partial installation. - // Otherwise, exit normally. - - if (bInstallAborted) then - abort; - endif; - -endprogram - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ShowDialogs // -// // -// Purpose: This function manages the display and navigation // -// the standard dialogs that exist in a setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ShowDialogs() - NUMBER nResult; - begin - - Dlg_Start: - // beginning of dialogs label - - Dlg_SdWelcome: - nResult = DialogShowSdWelcome(); - if (nResult = BACK) goto Dlg_Start; - - Dlg_SdShowInfoList: - nResult = DialogShowSdShowInfoList(); - if (nResult = BACK) goto Dlg_SdWelcome; - - Dlg_SdAskDestPath: - nResult = DialogShowSdAskDestPath(); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - Dlg_SdSetupType: - nResult = DialogShowSdSetupType(); - if (nResult = BACK) goto Dlg_SdAskDestPath; - - Dlg_SdComponentDialog2: - if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then - goto Dlg_SdSetupType; - endif; - nResult = DialogShowSdComponentDialog2(); - if (nResult = BACK) goto Dlg_SdSetupType; - - return 0; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessBeforeDataMove // -// // -// Purpose: This function performs any necessary operations prior to the // -// actual data move operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessBeforeDataMove() - STRING svLogFile; - NUMBER nResult; - begin - - InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); - - svLogFile = UNINST_LOGFILE_NAME; - - nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); - if (nResult < 0) then - MessageBox( @ERROR_UNINSTSETUP, WARNING ); - endif; - - szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir - - if ((bIs32BitSetup) && (bIsShellExplorer)) then - RegDBSetItem( REGDB_APPPATH, szAppPath ); - RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); - RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); - endif; - - // TODO : update any items you want to process before moving the data - // - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: MoveFileData // -// // -// Purpose: This function handles the data movement for // -// the setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function MoveFileData() - NUMBER nResult, nDisk; - begin - - nDisk = 1; - SetStatusWindow( 0, "" ); - Disable( DIALOGCACHE ); - Enable( STATUS ); - StatusUpdate( ON, 100 ); - nResult = ComponentMoveData( MEDIA, nDisk, 0 ); - - HandleMoveDataError( nResult ); - - Disable( STATUS ); - - return nResult; - - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: HandleMoveDataError // -// // -// Purpose: This function handles the error (if any) during the move data // -// operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function HandleMoveDataError( nResult ) - STRING szErrMsg, svComponent , svFileGroup , svFile; - begin - - svComponent = ""; - svFileGroup = ""; - svFile = ""; - - switch (nResult) - case 0: - return 0; - default: - ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); - szErrMsg = @ERROR_MOVEDATA + "\n\n" + - @ERROR_COMPONENT + " " + svComponent + "\n" + - @ERROR_FILEGROUP + " " + svFileGroup + "\n" + - @ERROR_FILE + " " + svFile; - SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); - bInstallAborted = TRUE; - return nResult; - endswitch; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessAfterDataMove // -// // -// Purpose: This function performs any necessary operations needed after // -// all data has been moved. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessAfterDataMove() - begin - - // TODO : update self-registered files and other processes that - // should be performed after the data has been moved. - - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupRegistry // -// // -// Purpose: This function makes the registry entries for this setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupRegistry() - NUMBER nResult; - - begin - - // TODO : Add all your registry entry keys here - // - // - // RegDBCreateKeyEx, RegDBSetKeyValueEx.... - // - - nResult = CreateRegistrySet( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function: SetupFolders -// -// Purpose: This function creates all the folders and shortcuts for the -// setup. This includes program groups and items for Windows 3.1. -// -/////////////////////////////////////////////////////////////////////////////// -function SetupFolders() - NUMBER nResult; - - begin - - - // TODO : Add all your folder (program group) along with shortcuts (program items) - // - // - // CreateProgramFolder, AddFolderIcon.... - // - - nResult = CreateShellObjects( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CleanUpInstall // -// // -// Purpose: This cleans up the setup. Anything that should // -// be released or deleted at the end of the setup should // -// be done here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CleanUpInstall() - begin - - - if (bInstallAborted) then - return 0; - endif; - - DialogShowSdFinishReboot(); - - if (BATCH_INSTALL) then // ensure locked files are properly written - CommitSharedFiles(0); - endif; - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupInstall // -// // -// Purpose: This will setup the installation. Any general initialization // -// needed for the installation should be performed here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupInstall() - begin - - Enable( CORECOMPONENTHANDLING ); - - bInstallAborted = FALSE; - - if (bIs32BitSetup) then - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; - else - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names - endif; - - TARGETDIR = svDir; - - SdProductName( @PRODUCT_NAME ); - - Enable( DIALOGCACHE ); - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupScreen // -// // -// Purpose: This function establishes the screen look. This includes // -// colors, fonts, and text to be displayed. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupScreen() - begin - - Enable( FULLWINDOWMODE ); - Enable( INDVFILESTATUS ); - SetTitle( @TITLE_MAIN, 24, WHITE ); - - SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. - - Enable( BACKGROUND ); - - Delay( 1 ); - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CheckRequirements // -// // -// Purpose: This function checks all minimum requirements for the // -// application being installed. If any fail, then the user // -// is informed and the setup is terminated. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CheckRequirements() - NUMBER nvDx, nvDy, nvResult; - STRING svResult; - - begin - - bWinNT = FALSE; - bIsShellExplorer = FALSE; - - // Check screen resolution. - GetExtents( nvDx, nvDy ); - - if (nvDy < 480) then - MessageBox( @ERROR_VGARESOLUTION, WARNING ); - abort; - endif; - - // set 'setup' operation mode - bIs32BitSetup = TRUE; - GetSystemInfo( ISTYPE, nvResult, svResult ); - if (nvResult = 16) then - bIs32BitSetup = FALSE; // running 16-bit setup - return 0; // no additional information required - endif; - - // --- 32-bit testing after this point --- - - // Determine the target system's operating system. - GetSystemInfo( OS, nvResult, svResult ); - - if (nvResult = IS_WINDOWSNT) then - // Running Windows NT. - bWinNT = TRUE; - - // Check to see if the shell being used is EXPLORER shell. - if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then - if (nvResult >= 4) then - bIsShellExplorer = TRUE; - endif; - endif; - - elseif (nvResult = IS_WINDOWS95 ) then - bIsShellExplorer = TRUE; - - endif; - -end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdWelcome // -// // -// Purpose: This function handles the standard welcome dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdWelcome() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdShowInfoList // -// // -// Purpose: This function displays the general information list dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdShowInfoList() - NUMBER nResult; - LIST list; - STRING szTitle, szMsg, szFile; - begin - - szFile = SUPPORTDIR ^ "infolist.txt"; - - list = ListCreate( STRINGLIST ); - ListReadFromFile( list, szFile ); - szTitle = ""; - szMsg = " "; - nResult = SdShowInfoList( szTitle, szMsg, list ); - - ListDestroy( list ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdAskDestPath // -// // -// Purpose: This function asks the user for the destination directory. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdAskDestPath() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); - - TARGETDIR = svDir; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdSetupType // -// // -// Purpose: This function displays the standard setup type dialog. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdSetupType() - NUMBER nResult, nType; - STRING szTitle, szMsg; - begin - - switch (svSetupType) - case "Typical": - nType = TYPICAL; - case "Custom": - nType = CUSTOM; - case "Compact": - nType = COMPACT; - case "": - svSetupType = "Typical"; - nType = TYPICAL; - endswitch; - - szTitle = ""; - szMsg = ""; - nResult = SetupType( szTitle, szMsg, "", nType, 0 ); - - switch (nResult) - case COMPACT: - svSetupType = "Compact"; - case TYPICAL: - svSetupType = "Typical"; - case CUSTOM: - svSetupType = "Custom"; - endswitch; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdComponentDialog2 // -// // -// Purpose: This function displays the custom component dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdComponentDialog2() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - if ((svSetupType != "Custom") && (svSetupType != "")) then - return 0; - endif; - - szTitle = ""; - szMsg = ""; - nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdFinishReboot // -// // -// Purpose: This function will show the last dialog of the product. // -// It will allow the user to reboot and/or show some readme text. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdFinishReboot() - NUMBER nResult, nDefOptions; - STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; - NUMBER bOpt1, bOpt2; - begin - - if (!BATCH_INSTALL) then - bOpt1 = FALSE; - bOpt2 = FALSE; - szMsg1 = ""; - szMsg2 = ""; - szOption1 = ""; - szOption2 = ""; - nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); - return 0; - endif; - - nDefOptions = SYS_BOOTMACHINE; - szTitle = ""; - szMsg1 = ""; - szMsg2 = ""; - nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); - - return nResult; - end; - - // --- include script file section --- - -#include "sddialog.rul" - - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/setup.rul b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/setup.rul deleted file mode 100755 index 73d61114075..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/setup.rul +++ /dev/null @@ -1,641 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-1997, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup on a -// Windows 95 or Windows NT 4.0 platform. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - - // Include header file -#include "sdlang.h" -#include "sddialog.h" - -////////////////////// string defines //////////////////////////// - -#define UNINST_LOGFILE_NAME "Uninst.isu" - -//////////////////// installation declarations /////////////////// - - // ----- DLL prototypes ----- - - - // your DLL prototypes - - - // ---- script prototypes ----- - - // generated - prototype ShowDialogs(); - prototype MoveFileData(); - prototype HandleMoveDataError( NUMBER ); - prototype ProcessBeforeDataMove(); - prototype ProcessAfterDataMove(); - prototype SetupRegistry(); - prototype SetupFolders(); - prototype CleanUpInstall(); - prototype SetupInstall(); - prototype SetupScreen(); - prototype CheckRequirements(); - prototype DialogShowSdWelcome(); - prototype DialogShowSdShowInfoList(); - prototype DialogShowSdAskDestPath(); - prototype DialogShowSdSetupType(); - prototype DialogShowSdComponentDialog2(); - prototype DialogShowSdFinishReboot(); - - // your prototypes - - - // ----- global variables ------ - - // generated - BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; - STRING svDir; - STRING svName, svCompany, svSerial; - STRING szAppPath; - STRING svSetupType; - - - // your global variables - - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN PROGRAM -// -// The setup begins here by hiding the visible setup -// window. This is done to allow all the titles, images, etc. to -// be established before showing the main window. The following -// logic then performs the setup in a series of steps. -// -/////////////////////////////////////////////////////////////////////////////// -program - Disable( BACKGROUND ); - - CheckRequirements(); - - SetupInstall(); - - SetupScreen(); - - if (ShowDialogs()<0) goto end_install; - - if (ProcessBeforeDataMove()<0) goto end_install; - - if (MoveFileData()<0) goto end_install; - - if (ProcessAfterDataMove()<0) goto end_install; - - if (SetupRegistry()<0) goto end_install; - - if (SetupFolders()<0) goto end_install; - - - end_install: - - CleanUpInstall(); - - // If an unrecoverable error occurred, clean up the partial installation. - // Otherwise, exit normally. - - if (bInstallAborted) then - abort; - endif; - -endprogram - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ShowDialogs // -// // -// Purpose: This function manages the display and navigation // -// the standard dialogs that exist in a setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ShowDialogs() - NUMBER nResult; - begin - - Dlg_Start: - // beginning of dialogs label - - Dlg_SdWelcome: - nResult = DialogShowSdWelcome(); - if (nResult = BACK) goto Dlg_Start; - - Dlg_SdShowInfoList: - nResult = DialogShowSdShowInfoList(); - if (nResult = BACK) goto Dlg_SdWelcome; - - Dlg_SdAskDestPath: - nResult = DialogShowSdAskDestPath(); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - Dlg_SdSetupType: - nResult = DialogShowSdSetupType(); - if (nResult = BACK) goto Dlg_SdAskDestPath; - - Dlg_SdComponentDialog2: - if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then - goto Dlg_SdSetupType; - endif; - nResult = DialogShowSdComponentDialog2(); - if (nResult = BACK) goto Dlg_SdSetupType; - - return 0; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessBeforeDataMove // -// // -// Purpose: This function performs any necessary operations prior to the // -// actual data move operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessBeforeDataMove() - STRING svLogFile; - NUMBER nResult; - begin - - InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); - - svLogFile = UNINST_LOGFILE_NAME; - - nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); - if (nResult < 0) then - MessageBox( @ERROR_UNINSTSETUP, WARNING ); - endif; - - szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir - - if ((bIs32BitSetup) && (bIsShellExplorer)) then -// RegDBSetItem( REGDB_APPPATH, szAppPath ); -// RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); - RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); - endif; - - // TODO : update any items you want to process before moving the data - // - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: MoveFileData // -// // -// Purpose: This function handles the data movement for // -// the setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function MoveFileData() - NUMBER nResult, nDisk; - begin - - nDisk = 1; - SetStatusWindow( 0, "" ); - Disable( DIALOGCACHE ); - Enable( STATUS ); - StatusUpdate( ON, 100 ); - nResult = ComponentMoveData( MEDIA, nDisk, 0 ); - - HandleMoveDataError( nResult ); - - Disable( STATUS ); - - return nResult; - - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: HandleMoveDataError // -// // -// Purpose: This function handles the error (if any) during the move data // -// operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function HandleMoveDataError( nResult ) - STRING szErrMsg, svComponent , svFileGroup , svFile; - begin - - svComponent = ""; - svFileGroup = ""; - svFile = ""; - - switch (nResult) - case 0: - return 0; - default: - ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); - szErrMsg = @ERROR_MOVEDATA + "\n\n" + - @ERROR_COMPONENT + " " + svComponent + "\n" + - @ERROR_FILEGROUP + " " + svFileGroup + "\n" + - @ERROR_FILE + " " + svFile; - SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); - bInstallAborted = TRUE; - return nResult; - endswitch; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessAfterDataMove // -// // -// Purpose: This function performs any necessary operations needed after // -// all data has been moved. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessAfterDataMove() - begin - - // TODO : update self-registered files and other processes that - // should be performed after the data has been moved. - - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupRegistry // -// // -// Purpose: This function makes the registry entries for this setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupRegistry() - NUMBER nResult; - - begin - - // TODO : Add all your registry entry keys here - // - // - // RegDBCreateKeyEx, RegDBSetKeyValueEx.... - // - - nResult = CreateRegistrySet( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function: SetupFolders -// -// Purpose: This function creates all the folders and shortcuts for the -// setup. This includes program groups and items for Windows 3.1. -// -/////////////////////////////////////////////////////////////////////////////// -function SetupFolders() - NUMBER nResult; - - begin - - - // TODO : Add all your folder (program group) along with shortcuts (program items) - // - // - // CreateProgramFolder, AddFolderIcon.... - // - - nResult = CreateShellObjects( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CleanUpInstall // -// // -// Purpose: This cleans up the setup. Anything that should // -// be released or deleted at the end of the setup should // -// be done here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CleanUpInstall() - begin - - - if (bInstallAborted) then - return 0; - endif; - - DialogShowSdFinishReboot(); - - if (BATCH_INSTALL) then // ensure locked files are properly written - CommitSharedFiles(0); - endif; - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupInstall // -// // -// Purpose: This will setup the installation. Any general initialization // -// needed for the installation should be performed here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupInstall() - begin - - Enable( CORECOMPONENTHANDLING ); - - bInstallAborted = FALSE; - - if (bIs32BitSetup) then - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; - else - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names - endif; - - TARGETDIR = svDir; - - SdProductName( @PRODUCT_NAME ); - - Enable( DIALOGCACHE ); - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupScreen // -// // -// Purpose: This function establishes the screen look. This includes // -// colors, fonts, and text to be displayed. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupScreen() - begin - - Enable( FULLWINDOWMODE ); - Enable( INDVFILESTATUS ); - SetTitle( @TITLE_MAIN, 24, WHITE ); - - SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. - - Enable( BACKGROUND ); - - Delay( 1 ); - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CheckRequirements // -// // -// Purpose: This function checks all minimum requirements for the // -// application being installed. If any fail, then the user // -// is informed and the setup is terminated. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CheckRequirements() - NUMBER nvDx, nvDy, nvResult; - STRING svResult; - - begin - - bWinNT = FALSE; - bIsShellExplorer = FALSE; - - // Check screen resolution. - GetExtents( nvDx, nvDy ); - - if (nvDy < 480) then - MessageBox( @ERROR_VGARESOLUTION, WARNING ); - abort; - endif; - - // set 'setup' operation mode - bIs32BitSetup = TRUE; - GetSystemInfo( ISTYPE, nvResult, svResult ); - if (nvResult = 16) then - bIs32BitSetup = FALSE; // running 16-bit setup - return 0; // no additional information required - endif; - - // --- 32-bit testing after this point --- - - // Determine the target system's operating system. - GetSystemInfo( OS, nvResult, svResult ); - - if (nvResult = IS_WINDOWSNT) then - // Running Windows NT. - bWinNT = TRUE; - - // Check to see if the shell being used is EXPLORER shell. - if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then - if (nvResult >= 4) then - bIsShellExplorer = TRUE; - endif; - endif; - - elseif (nvResult = IS_WINDOWS95 ) then - bIsShellExplorer = TRUE; - - endif; - -end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdWelcome // -// // -// Purpose: This function handles the standard welcome dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdWelcome() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdShowInfoList // -// // -// Purpose: This function displays the general information list dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdShowInfoList() - NUMBER nResult; - LIST list; - STRING szTitle, szMsg, szFile; - begin - - szFile = SUPPORTDIR ^ "infolist.txt"; - - list = ListCreate( STRINGLIST ); - ListReadFromFile( list, szFile ); - szTitle = ""; - szMsg = " "; - nResult = SdShowInfoList( szTitle, szMsg, list ); - - ListDestroy( list ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdAskDestPath // -// // -// Purpose: This function asks the user for the destination directory. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdAskDestPath() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); - - TARGETDIR = svDir; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdSetupType // -// // -// Purpose: This function displays the standard setup type dialog. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdSetupType() - NUMBER nResult, nType; - STRING szTitle, szMsg; - begin - - switch (svSetupType) - case "Typical": - nType = TYPICAL; - case "Custom": - nType = CUSTOM; - case "Compact": - nType = COMPACT; - case "": - svSetupType = "Typical"; - nType = TYPICAL; - endswitch; - - szTitle = ""; - szMsg = ""; - nResult = SetupType( szTitle, szMsg, "", nType, 0 ); - - switch (nResult) - case COMPACT: - svSetupType = "Compact"; - case TYPICAL: - svSetupType = "Typical"; - case CUSTOM: - svSetupType = "Custom"; - endswitch; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdComponentDialog2 // -// // -// Purpose: This function displays the custom component dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdComponentDialog2() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - if ((svSetupType != "Custom") && (svSetupType != "")) then - return 0; - endif; - - szTitle = ""; - szMsg = ""; - nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdFinishReboot // -// // -// Purpose: This function will show the last dialog of the product. // -// It will allow the user to reboot and/or show some readme text. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdFinishReboot() - NUMBER nResult, nDefOptions; - STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; - NUMBER bOpt1, bOpt2; - begin - - if (!BATCH_INSTALL) then - bOpt1 = FALSE; - bOpt2 = FALSE; - szMsg1 = ""; - szMsg2 = ""; - szOption1 = ""; - szOption2 = ""; - nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); - return 0; - endif; - - nDefOptions = SYS_BOOTMACHINE; - szTitle = ""; - szMsg1 = ""; - szMsg2 = ""; - nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); - - return nResult; - end; - - // --- include script file section --- - -#include "sddialog.rul" - - - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt b/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt deleted file mode 100755 index acdf4f48618..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt +++ /dev/null @@ -1,25 +0,0 @@ -This is a release of MySQL @VERSION@ for Win32. - -NOTE: If you install MySQL in a folder other than -C:\MYSQL or you intend to start MySQL on NT/Win2000 -as a service, you must create a file named C:\MY.CNF -or \Windows\my.ini or \winnt\my.ini with the following -information:: - -[mysqld] -basedir=E:/installation-path/ -datadir=E:/data-path/ - -After your have installed MySQL, the installation -directory will contain 4 files named 'my-small.cnf, -my-medium.cnf, my-large.cnf, my-huge.cnf'. -You can use this as a starting point for your own -C:\my.cnf file. - -If you have any problems, you can mail them to -win32@lists.mysql.com after you have consulted the -MySQL manual and the MySQL mailing list archive -(http://www.mysql.com/documentation/index.html) - -On behalf of the MySQL AB gang, -Michael Widenius diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp b/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp Binary files differdeleted file mode 100755 index 3229d50c9bf..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Shell Objects/Default.shl b/VC++Files/InstallShield/4.0.XX-gpl/Shell Objects/Default.shl deleted file mode 100755 index 187cb651307..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Shell Objects/Default.shl +++ /dev/null @@ -1,12 +0,0 @@ -[Data] -Folder3=<FOLDER_STARTUP> -Group0=Main -Group1=Startup -Folder0=<FOLDER_DESKTOP> -Folder1=<FOLDER_STARTMENU> -Folder2=<FOLDER_PROGRAMS> - -[Info] -Type=ShellObject -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/String Tables/0009-English/value.shl b/VC++Files/InstallShield/4.0.XX-gpl/String Tables/0009-English/value.shl deleted file mode 100755 index 35e7c278cc9..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/String Tables/0009-English/value.shl +++ /dev/null @@ -1,23 +0,0 @@ -[Data] -TITLE_MAIN=MySQL Servers and Clients @VERSION@ -COMPANY_NAME=MySQL AB -ERROR_COMPONENT=Component: -COMPANY_NAME16=Company -PRODUCT_VERSION=MySQL Servers and Clients @VERSION@ -ERROR_MOVEDATA=An error occurred during the move data process: %d -ERROR_FILEGROUP=File Group: -UNINST_KEY=MySQL Servers and Clients @VERSION@ -TITLE_CAPTIONBAR=MySQL Servers and Clients @VERSION@ -PRODUCT_NAME16=Product -ERROR_VGARESOLUTION=This program requires VGA or better resolution. -ERROR_FILE=File: -UNINST_DISPLAY_NAME=MySQL Servers and Clients @VERSION@ -PRODUCT_KEY=yourapp.Exe -PRODUCT_NAME=MySQL Servers and Clients @VERSION@ -ERROR_UNINSTSETUP=unInstaller setup failed to initialize. You may not be able to uninstall this product. - -[General] -Language=0009 -Type=STRINGTABLESPECIFIC -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/String Tables/Default.shl b/VC++Files/InstallShield/4.0.XX-gpl/String Tables/Default.shl deleted file mode 100755 index d4dc4925ab1..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/String Tables/Default.shl +++ /dev/null @@ -1,74 +0,0 @@ -[TITLE_MAIN] -Comment= - -[COMPANY_NAME] -Comment= - -[ERROR_COMPONENT] -Comment= - -[COMPANY_NAME16] -Comment= - -[PRODUCT_VERSION] -Comment= - -[ERROR_MOVEDATA] -Comment= - -[ERROR_FILEGROUP] -Comment= - -[Language] -Lang0=0009 -CurrentLang=0 - -[UNINST_KEY] -Comment= - -[TITLE_CAPTIONBAR] -Comment= - -[Data] -Entry0=ERROR_VGARESOLUTION -Entry1=TITLE_MAIN -Entry2=TITLE_CAPTIONBAR -Entry3=UNINST_KEY -Entry4=UNINST_DISPLAY_NAME -Entry5=COMPANY_NAME -Entry6=PRODUCT_NAME -Entry7=PRODUCT_VERSION -Entry8=PRODUCT_KEY -Entry9=ERROR_MOVEDATA -Entry10=ERROR_UNINSTSETUP -Entry11=COMPANY_NAME16 -Entry12=PRODUCT_NAME16 -Entry13=ERROR_COMPONENT -Entry14=ERROR_FILEGROUP -Entry15=ERROR_FILE - -[PRODUCT_NAME16] -Comment= - -[ERROR_VGARESOLUTION] -Comment= - -[ERROR_FILE] -Comment= - -[General] -Type=STRINGTABLE -Version=1.00.000 - -[UNINST_DISPLAY_NAME] -Comment= - -[PRODUCT_KEY] -Comment= - -[PRODUCT_NAME] -Comment= - -[ERROR_UNINSTSETUP] -Comment= - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Build.tsb b/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Build.tsb deleted file mode 100755 index 3949bd4c066..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Build.tsb +++ /dev/null @@ -1,56 +0,0 @@ -[<HKUS>] -Value= -KeyType=4 - -[<HKCR>] -Value= -KeyType=4 - -[<PROGRAMFILES>] -Value= -KeyType=4 - -[<WINSYSDIR>] -Value= -KeyType=4 - -[<COMMONFILES>] -Value= -KeyType=4 - -[<WINDIR>] -Value= -KeyType=4 - -[Data] -Key0=<PROGRAMFILES> -Key1=<COMMONFILES> -Key2=<WINDIR> -Key3=<WINSYSDIR> -Key4=<HKLM> -Key5=<HKCU> -Key6=<HKCC> -Key7=<HKDD> -Key8=<HKUS> -Key9=<HKCR> - -[General] -Type=TEXTSUB -Version=1.00.000 - -[<HKLM>] -Value= -KeyType=4 - -[<HKCU>] -Value= -KeyType=4 - -[<HKCC>] -Value= -KeyType=4 - -[<HKDD>] -Value= -KeyType=4 - diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Setup.tsb b/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Setup.tsb deleted file mode 100755 index b0c5a509f0b..00000000000 --- a/VC++Files/InstallShield/4.0.XX-gpl/Text Substitutions/Setup.tsb +++ /dev/null @@ -1,76 +0,0 @@ -[<SRCDIR>] -Value= -KeyType=4 - -[<HKUS>] -Value= -KeyType=4 - -[<HKCR>] -Value= -KeyType=4 - -[<PROGRAMFILES>] -Value= -KeyType=4 - -[<TARGETDIR>] -Value= -KeyType=4 - -[<WINSYSDIR>] -Value= -KeyType=4 - -[<COMMONFILES>] -Value= -KeyType=4 - -[<WINDIR>] -Value= -KeyType=4 - -[Data] -Key0=<PROGRAMFILES> -Key1=<COMMONFILES> -Key2=<WINDIR> -Key3=<WINSYSDIR> -Key4=<TARGETDIR> -Key5=<SUPPORTDIR> -Key10=<HKDD> -Key6=<SRCDIR> -Key11=<HKUS> -Key7=<HKLM> -Key12=<HKCR> -Key8=<HKCU> -Key13=<SHELL_OBJECT_FOLDER> -Key9=<HKCC> - -[<SUPPORTDIR>] -Value= -KeyType=4 - -[<SHELL_OBJECT_FOLDER>] -Value= -KeyType=4 - -[General] -Type=TEXTSUB -Version=1.00.000 - -[<HKLM>] -Value= -KeyType=4 - -[<HKCU>] -Value= -KeyType=4 - -[<HKCC>] -Value= -KeyType=4 - -[<HKDD>] -Value= -KeyType=4 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/4.0.XX-pro.ipr b/VC++Files/InstallShield/4.0.XX-pro/4.0.XX-pro.ipr deleted file mode 100755 index bfa7a082873..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/4.0.XX-pro.ipr +++ /dev/null @@ -1,52 +0,0 @@ -[Language] -LanguageSupport0=0009 - -[OperatingSystem] -OSSupport=0000000000010010 - -[Data] -CurrentMedia=New Media -CurrentComponentDef=Default.cdf -ProductName=MySQL Servers and Clients -set_mifserial= -DevEnvironment=Microsoft Visual C++ 6 -AppExe= -set_dlldebug=No -EmailAddresss= -Instructions=Instructions.txt -set_testmode=No -set_mif=No -SummaryText= -Department= -HomeURL= -Author= -Type=Database Application -InstallRoot=D:\MySQL-Install\4.0.xpro -Version=1.00.000 -InstallationGUID=40744a4d-efed-4cff-84a9-9e6389550f5c -set_level=Level 3 -CurrentFileGroupDef=Default.fdf -Notes=Notes.txt -set_maxerr=50 -set_args= -set_miffile=Status.mif -set_dllcmdline= -Copyright= -set_warnaserr=No -CurrentPlatform= -Category= -set_preproc= -CurrentLanguage=English -CompanyName=MySQL -Description=Description.txt -set_maxwarn=50 -set_crc=Yes -set_compileb4build=No - -[MediaInfo] -mediadata0=New Media/ - -[General] -Type=INSTALLMAIN -Version=1.10.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.cdf b/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.cdf deleted file mode 100755 index 48d37800cd1..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.cdf +++ /dev/null @@ -1,192 +0,0 @@ -[Development] -required0=Servers -SELECTED=Yes -FILENEED=STANDARD -required1=Grant Tables -HTTPLOCATION= -STATUS=Examples, Libraries, Includes and Script files -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=Examples, Libraries, Includes and Script files -DISPLAYTEXT=Examples, Libraries, Includes and Script files -IMAGE= -DEFSELECTION=Yes -filegroup0=Development -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=ALWAYSOVERWRITE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Grant Tables] -required0=Servers -SELECTED=Yes -FILENEED=CRITICAL -HTTPLOCATION= -STATUS=The Grant Tables and Core Files -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The Grant Tables and Core Files -DISPLAYTEXT=The Grant Tables and Core Files -IMAGE= -DEFSELECTION=Yes -filegroup0=Grant Tables -requiredby0=Development -COMMENT= -INCLUDEINBUILD=Yes -requiredby1=Clients and Tools -INSTALLATION=NEVEROVERWRITE -requiredby2=Documentation -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Components] -component0=Development -component1=Grant Tables -component2=Servers -component3=Clients and Tools -component4=Documentation - -[TopComponents] -component0=Servers -component1=Clients and Tools -component2=Documentation -component3=Development -component4=Grant Tables - -[SetupType] -setuptype0=Compact -setuptype1=Typical -setuptype2=Custom - -[Clients and Tools] -required0=Servers -SELECTED=Yes -FILENEED=HIGHLYRECOMMENDED -required1=Grant Tables -HTTPLOCATION= -STATUS=The MySQL clients and Maintenance Tools -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL clients and Maintenance Tools -DISPLAYTEXT=The MySQL clients and Maintenance Tools -IMAGE= -DEFSELECTION=Yes -filegroup0=Clients and Tools -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=NEWERDATE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[Servers] -SELECTED=Yes -FILENEED=CRITICAL -HTTPLOCATION= -STATUS=The MySQL Servers -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL Servers -DISPLAYTEXT=The MySQL Servers -IMAGE= -DEFSELECTION=Yes -filegroup0=Servers -requiredby0=Development -COMMENT= -INCLUDEINBUILD=Yes -requiredby1=Grant Tables -INSTALLATION=ALWAYSOVERWRITE -requiredby2=Clients and Tools -requiredby3=Documentation -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - -[SetupTypeItem-Compact] -Comment= -item0=Grant Tables -item1=Servers -item2=Clients and Tools -item3=Documentation -Descrip= -DisplayText= - -[SetupTypeItem-Custom] -Comment= -item0=Development -item1=Grant Tables -item2=Servers -item3=Clients and Tools -Descrip= -item4=Documentation -DisplayText= - -[Info] -Type=CompDef -Version=1.00.000 -Name= - -[SetupTypeItem-Typical] -Comment= -item0=Development -item1=Grant Tables -item2=Servers -item3=Clients and Tools -Descrip= -item4=Documentation -DisplayText= - -[Documentation] -required0=Servers -SELECTED=Yes -FILENEED=HIGHLYRECOMMENDED -required1=Grant Tables -HTTPLOCATION= -STATUS=The MySQL Documentation with different formats -UNINSTALLABLE=Yes -TARGET=<TARGETDIR> -FTPLOCATION= -VISIBLE=Yes -DESCRIPTION=The MySQL Documentation with different formats -DISPLAYTEXT=The MySQL Documentation with different formats -IMAGE= -DEFSELECTION=Yes -filegroup0=Documentation -COMMENT= -INCLUDEINBUILD=Yes -INSTALLATION=ALWAYSOVERWRITE -COMPRESSIFSEPARATE=No -MISC= -ENCRYPT=No -DISK=ANYDISK -TARGETDIRCDROM= -PASSWORD= -TARGETHIDDEN=General Application Destination - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.fgl b/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.fgl deleted file mode 100755 index 4e20dcea4ab..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Component Definitions/Default.fgl +++ /dev/null @@ -1,42 +0,0 @@ -[<PROGRAMFILES>\<COMMONFILES>] -DISPLAYTEXT=Common Files Folder -TYPE=TEXTSUBFIXED -fulldirectory= - -[<WINDIR>\<WINSYSDIR>] -DISPLAYTEXT=Windows System Folder -TYPE=TEXTSUBFIXED -fulldirectory= - -[USERDEFINED] -DISPLAYTEXT=Script-defined Folders -TYPE=USERSTART -fulldirectory= - -[<PROGRAMFILES>] -DISPLAYTEXT=Program Files Folder -SubDir0=<PROGRAMFILES>\<COMMONFILES> -TYPE=TEXTSUBFIXED -fulldirectory= - -[<TARGETDIR>] -DISPLAYTEXT=General Application Destination -TYPE=TEXTSUBFIXED -fulldirectory= - -[<WINDIR>] -DISPLAYTEXT=Windows Operating System -SubDir0=<WINDIR>\<WINSYSDIR> -TYPE=TEXTSUBFIXED -fulldirectory= - -[TopDir] -SubDir0=<WINDIR> -SubDir1=<PROGRAMFILES> -SubDir2=<TARGETDIR> -SubDir3=USERDEFINED - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl deleted file mode 100755 index ed1e42e65b6..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl +++ /dev/null @@ -1,32 +0,0 @@ -[bin] -file15=C:\mysql\bin\replace.exe -file16=C:\mysql\bin\winmysqladmin.cnt -file0=C:\mysql\bin\isamchk.exe -file17=C:\mysql\bin\WINMYSQLADMIN.HLP -file1=C:\mysql\bin\myisamchk.exe -file18=C:\mysql\bin\comp-err.exe -file2=C:\mysql\bin\myisamlog.exe -file19=C:\mysql\bin\my_print_defaults.exe -file3=C:\mysql\bin\myisampack.exe -file4=C:\mysql\bin\mysql.exe -file5=C:\mysql\bin\mysqladmin.exe -file6=C:\mysql\bin\mysqlbinlog.exe -file7=C:\mysql\bin\mysqlc.exe -file8=C:\mysql\bin\mysqlcheck.exe -file9=C:\mysql\bin\mysqldump.exe -file20=C:\mysql\bin\winmysqladmin.exe -file21=C:\mysql\bin\myisam_ftdump.exe -file10=C:\mysql\bin\mysqlimport.exe -fulldirectory= -file11=C:\mysql\bin\mysqlshow.exe -file12=C:\mysql\bin\mysqlwatch.exe -file13=C:\mysql\bin\pack_isam.exe -file14=C:\mysql\bin\perror.exe - -[TopDir] -SubDir0=bin - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Default.fdf b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Default.fdf deleted file mode 100755 index 8096a4b74bf..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Default.fdf +++ /dev/null @@ -1,82 +0,0 @@ -[FileGroups] -group0=Development -group1=Grant Tables -group2=Servers -group3=Clients and Tools -group4=Documentation - -[Development] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Grant Tables] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Clients and Tools] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM=0000000000000000 -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Servers] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - -[Info] -Type=FileGrp -Version=1.00.000 -Name= - -[Documentation] -SELFREGISTERING=No -HTTPLOCATION= -LANGUAGE= -OPERATINGSYSTEM= -FTPLOCATION= -FILETYPE=No -INFOTYPE=Standard -COMMENT= -COMPRESS=Yes -COMPRESSDLL= -POTENTIALLY=No -MISC= - diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl deleted file mode 100755 index 292cc867909..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl +++ /dev/null @@ -1,240 +0,0 @@ -[bench\Data\Wisconsin] -file0=C:\mysql\bench\Data\Wisconsin\onek.data -file1=C:\mysql\bench\Data\Wisconsin\tenk.data -fulldirectory= - -[lib\debug] -file0=C:\mysql\lib\debug\libmySQL.dll -file1=C:\mysql\lib\debug\libmySQL.lib -file2=C:\mysql\lib\debug\mysqlclient.lib -file3=C:\mysql\lib\debug\zlib.lib -file4=C:\mysql\lib\debug\mysys.lib -file5=C:\mysql\lib\debug\regex.lib -file6=C:\mysql\lib\debug\strings.lib -fulldirectory= - -[bench\output] -fulldirectory= - -[examples\libmysqltest] -file0=C:\mysql\examples\libmysqltest\myTest.c -file1=C:\mysql\examples\libmysqltest\myTest.dsp -file2=C:\mysql\examples\libmysqltest\myTest.dsw -file3=C:\mysql\examples\libmysqltest\myTest.exe -file4=C:\mysql\examples\libmysqltest\myTest.mak -file5=C:\mysql\examples\libmysqltest\myTest.ncb -file6=C:\mysql\examples\libmysqltest\myTest.opt -file7=C:\mysql\examples\libmysqltest\readme -fulldirectory= - -[include] -file15=C:\mysql\include\libmysqld.def -file16=C:\mysql\include\my_alloc.h -file0=C:\mysql\include\raid.h -file17=C:\mysql\include\my_getopt.h -file1=C:\mysql\include\errmsg.h -file2=C:\mysql\include\Libmysql.def -file3=C:\mysql\include\m_ctype.h -file4=C:\mysql\include\m_string.h -file5=C:\mysql\include\my_list.h -file6=C:\mysql\include\my_pthread.h -file7=C:\mysql\include\my_sys.h -file8=C:\mysql\include\mysql.h -file9=C:\mysql\include\mysql_com.h -file10=C:\mysql\include\mysql_version.h -fulldirectory= -file11=C:\mysql\include\mysqld_error.h -file12=C:\mysql\include\dbug.h -file13=C:\mysql\include\config-win.h -file14=C:\mysql\include\my_global.h - -[examples] -SubDir0=examples\libmysqltest -SubDir1=examples\tests -fulldirectory= - -[lib\opt] -file0=C:\mysql\lib\opt\libmySQL.dll -file1=C:\mysql\lib\opt\libmySQL.lib -file2=C:\mysql\lib\opt\mysqlclient.lib -file3=C:\mysql\lib\opt\zlib.lib -file4=C:\mysql\lib\opt\strings.lib -file5=C:\mysql\lib\opt\regex.lib -file6=C:\mysql\lib\opt\mysys.lib -fulldirectory= - -[bench\Data] -SubDir0=bench\Data\ATIS -SubDir1=bench\Data\Wisconsin -fulldirectory= - -[bench\limits] -file15=C:\mysql\bench\limits\pg.comment -file16=C:\mysql\bench\limits\solid.cfg -file0=C:\mysql\bench\limits\access.cfg -file17=C:\mysql\bench\limits\solid-nt4.cfg -file1=C:\mysql\bench\limits\access.comment -file18=C:\mysql\bench\limits\sybase.cfg -file2=C:\mysql\bench\limits\Adabas.cfg -file3=C:\mysql\bench\limits\Adabas.comment -file4=C:\mysql\bench\limits\Db2.cfg -file5=C:\mysql\bench\limits\empress.cfg -file6=C:\mysql\bench\limits\empress.comment -file7=C:\mysql\bench\limits\Informix.cfg -file8=C:\mysql\bench\limits\Informix.comment -file9=C:\mysql\bench\limits\msql.cfg -file10=C:\mysql\bench\limits\ms-sql.cfg -fulldirectory= -file11=C:\mysql\bench\limits\Ms-sql65.cfg -file12=C:\mysql\bench\limits\mysql.cfg -file13=C:\mysql\bench\limits\oracle.cfg -file14=C:\mysql\bench\limits\pg.cfg - -[TopDir] -SubDir0=bench -SubDir1=examples -SubDir2=include -SubDir3=lib -SubDir4=scripts - -[bench] -file15=C:\mysql\bench\test-create -file16=C:\mysql\bench\test-insert -file0=C:\mysql\bench\uname.bat -file17=C:\mysql\bench\test-select -file1=C:\mysql\bench\compare-results -file18=C:\mysql\bench\test-wisconsin -file2=C:\mysql\bench\copy-db -file19=C:\mysql\bench\bench-init.pl -file3=C:\mysql\bench\crash-me -file4=C:\mysql\bench\example.bat -file5=C:\mysql\bench\print-limit-table -file6=C:\mysql\bench\pwd.bat -file7=C:\mysql\bench\Readme -SubDir0=bench\Data -file8=C:\mysql\bench\run.bat -SubDir1=bench\limits -file9=C:\mysql\bench\run-all-tests -SubDir2=bench\output -file10=C:\mysql\bench\server-cfg -fulldirectory= -file11=C:\mysql\bench\test-alter-table -file12=C:\mysql\bench\test-ATIS -file13=C:\mysql\bench\test-big-tables -file14=C:\mysql\bench\test-connect - -[examples\tests] -file15=C:\mysql\examples\tests\lock_test.res -file16=C:\mysql\examples\tests\mail_to_db.pl -file0=C:\mysql\examples\tests\unique_users.tst -file17=C:\mysql\examples\tests\table_types.pl -file1=C:\mysql\examples\tests\auto_increment.tst -file18=C:\mysql\examples\tests\test_delayed_insert.pl -file2=C:\mysql\examples\tests\big_record.pl -file19=C:\mysql\examples\tests\udf_test -file3=C:\mysql\examples\tests\big_record.res -file4=C:\mysql\examples\tests\czech-sorting -file5=C:\mysql\examples\tests\deadlock-script.pl -file6=C:\mysql\examples\tests\export.pl -file7=C:\mysql\examples\tests\fork_test.pl -file8=C:\mysql\examples\tests\fork2_test.pl -file9=C:\mysql\examples\tests\fork3_test.pl -file20=C:\mysql\examples\tests\udf_test.res -file21=C:\mysql\examples\tests\auto_increment.res -file10=C:\mysql\examples\tests\function.res -fulldirectory= -file11=C:\mysql\examples\tests\function.tst -file12=C:\mysql\examples\tests\grant.pl -file13=C:\mysql\examples\tests\grant.res -file14=C:\mysql\examples\tests\lock_test.pl - -[bench\Data\ATIS] -file26=C:\mysql\bench\Data\ATIS\stop1.txt -file15=C:\mysql\bench\Data\ATIS\flight_class.txt -file27=C:\mysql\bench\Data\ATIS\time_interval.txt -file16=C:\mysql\bench\Data\ATIS\flight_day.txt -file0=C:\mysql\bench\Data\ATIS\transport.txt -file28=C:\mysql\bench\Data\ATIS\time_zone.txt -file17=C:\mysql\bench\Data\ATIS\flight_fare.txt -file1=C:\mysql\bench\Data\ATIS\airline.txt -file29=C:\mysql\bench\Data\ATIS\aircraft.txt -file18=C:\mysql\bench\Data\ATIS\food_service.txt -file2=C:\mysql\bench\Data\ATIS\airport.txt -file19=C:\mysql\bench\Data\ATIS\ground_service.txt -file3=C:\mysql\bench\Data\ATIS\airport_service.txt -file4=C:\mysql\bench\Data\ATIS\city.txt -file5=C:\mysql\bench\Data\ATIS\class_of_service.txt -file6=C:\mysql\bench\Data\ATIS\code_description.txt -file7=C:\mysql\bench\Data\ATIS\compound_class.txt -file8=C:\mysql\bench\Data\ATIS\connect_leg.txt -file9=C:\mysql\bench\Data\ATIS\date_day.txt -file20=C:\mysql\bench\Data\ATIS\month_name.txt -file21=C:\mysql\bench\Data\ATIS\restrict_carrier.txt -file10=C:\mysql\bench\Data\ATIS\day_name.txt -fulldirectory= -file22=C:\mysql\bench\Data\ATIS\restrict_class.txt -file11=C:\mysql\bench\Data\ATIS\dual_carrier.txt -file23=C:\mysql\bench\Data\ATIS\restriction.txt -file12=C:\mysql\bench\Data\ATIS\fare.txt -file24=C:\mysql\bench\Data\ATIS\state.txt -file13=C:\mysql\bench\Data\ATIS\fconnection.txt -file25=C:\mysql\bench\Data\ATIS\stop.txt -file14=C:\mysql\bench\Data\ATIS\flight.txt - -[General] -Type=FILELIST -Version=1.00.000 - -[scripts] -file37=C:\mysql\scripts\mysqld_safe-watch.sh -file26=C:\mysql\scripts\mysql_zap -file15=C:\mysql\scripts\mysql_fix_privilege_tables -file38=C:\mysql\scripts\mysqldumpslow -file27=C:\mysql\scripts\mysql_zap.sh -file16=C:\mysql\scripts\mysql_fix_privilege_tables.sh -file0=C:\mysql\scripts\Readme -file39=C:\mysql\scripts\mysqldumpslow.sh -file28=C:\mysql\scripts\mysqlaccess -file17=C:\mysql\scripts\mysql_install_db -file1=C:\mysql\scripts\make_binary_distribution.sh -file29=C:\mysql\scripts\mysqlaccess.conf -file18=C:\mysql\scripts\mysql_install_db.sh -file2=C:\mysql\scripts\msql2mysql -file19=C:\mysql\scripts\mysql_secure_installation -file3=C:\mysql\scripts\msql2mysql.sh -file4=C:\mysql\scripts\mysql_config -file5=C:\mysql\scripts\mysql_config.sh -file6=C:\mysql\scripts\mysql_convert_table_format -file7=C:\mysql\scripts\mysql_convert_table_format.sh -file40=C:\mysql\scripts\mysqlhotcopy -file8=C:\mysql\scripts\mysql_explain_log -file41=C:\mysql\scripts\mysqlhotcopy.pl -file30=C:\mysql\scripts\mysqlaccess.sh -file9=C:\mysql\scripts\mysql_explain_log.sh -file42=C:\mysql\scripts\mysqlhotcopy.sh -file31=C:\mysql\scripts\mysqlbug -file20=C:\mysql\scripts\mysql_secure_installation.sh -file43=C:\mysql\scripts\make_binary_distribution -file32=C:\mysql\scripts\mysqlbug.sh -file21=C:\mysql\scripts\mysql_setpermission -file10=C:\mysql\scripts\mysql_find_rows -fulldirectory= -file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql -file33=C:\mysql\scripts\mysqld_multi -file22=C:\mysql\scripts\mysql_setpermission.pl -file11=C:\mysql\scripts\mysql_find_rows.pl -file34=C:\mysql\scripts\mysqld_multi.sh -file23=C:\mysql\scripts\mysql_setpermission.sh -file12=C:\mysql\scripts\mysql_find_rows.sh -file35=C:\mysql\scripts\mysqld_safe -file24=C:\mysql\scripts\mysql_tableinfo -file13=C:\mysql\scripts\mysql_fix_extensions -file36=C:\mysql\scripts\mysqld_safe.sh -file25=C:\mysql\scripts\mysql_tableinfo.sh -file14=C:\mysql\scripts\mysql_fix_extensions.sh - -[lib] -SubDir0=lib\debug -SubDir1=lib\opt -fulldirectory= - diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Documentation.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Documentation.fgl deleted file mode 100755 index 80fe777cf0f..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Documentation.fgl +++ /dev/null @@ -1,99 +0,0 @@ -[Docs\Flags] -file59=C:\mysql\Docs\Flags\romania.gif -file48=C:\mysql\Docs\Flags\kroatia.eps -file37=C:\mysql\Docs\Flags\iceland.gif -file26=C:\mysql\Docs\Flags\france.eps -file15=C:\mysql\Docs\Flags\china.gif -file49=C:\mysql\Docs\Flags\kroatia.gif -file38=C:\mysql\Docs\Flags\ireland.eps -file27=C:\mysql\Docs\Flags\france.gif -file16=C:\mysql\Docs\Flags\croatia.eps -file0=C:\mysql\Docs\Flags\usa.gif -file39=C:\mysql\Docs\Flags\ireland.gif -file28=C:\mysql\Docs\Flags\germany.eps -file17=C:\mysql\Docs\Flags\croatia.gif -file1=C:\mysql\Docs\Flags\argentina.gif -file29=C:\mysql\Docs\Flags\germany.gif -file18=C:\mysql\Docs\Flags\czech-republic.eps -file2=C:\mysql\Docs\Flags\australia.eps -file19=C:\mysql\Docs\Flags\czech-republic.gif -file3=C:\mysql\Docs\Flags\australia.gif -file80=C:\mysql\Docs\Flags\usa.eps -file4=C:\mysql\Docs\Flags\austria.eps -file81=C:\mysql\Docs\Flags\argentina.eps -file70=C:\mysql\Docs\Flags\spain.eps -file5=C:\mysql\Docs\Flags\austria.gif -file71=C:\mysql\Docs\Flags\spain.gif -file60=C:\mysql\Docs\Flags\russia.eps -file6=C:\mysql\Docs\Flags\brazil.eps -file72=C:\mysql\Docs\Flags\sweden.eps -file61=C:\mysql\Docs\Flags\russia.gif -file50=C:\mysql\Docs\Flags\latvia.eps -file7=C:\mysql\Docs\Flags\brazil.gif -file73=C:\mysql\Docs\Flags\sweden.gif -file62=C:\mysql\Docs\Flags\singapore.eps -file51=C:\mysql\Docs\Flags\latvia.gif -file40=C:\mysql\Docs\Flags\island.eps -file8=C:\mysql\Docs\Flags\bulgaria.eps -file74=C:\mysql\Docs\Flags\switzerland.eps -file63=C:\mysql\Docs\Flags\singapore.gif -file52=C:\mysql\Docs\Flags\netherlands.eps -file41=C:\mysql\Docs\Flags\island.gif -file30=C:\mysql\Docs\Flags\great-britain.eps -file9=C:\mysql\Docs\Flags\bulgaria.gif -file75=C:\mysql\Docs\Flags\switzerland.gif -file64=C:\mysql\Docs\Flags\south-africa.eps -file53=C:\mysql\Docs\Flags\netherlands.gif -file42=C:\mysql\Docs\Flags\israel.eps -file31=C:\mysql\Docs\Flags\great-britain.gif -file20=C:\mysql\Docs\Flags\denmark.eps -file76=C:\mysql\Docs\Flags\taiwan.eps -file65=C:\mysql\Docs\Flags\south-africa.gif -file54=C:\mysql\Docs\Flags\poland.eps -file43=C:\mysql\Docs\Flags\israel.gif -file32=C:\mysql\Docs\Flags\greece.eps -file21=C:\mysql\Docs\Flags\denmark.gif -file10=C:\mysql\Docs\Flags\canada.eps -fulldirectory= -file77=C:\mysql\Docs\Flags\taiwan.gif -file66=C:\mysql\Docs\Flags\south-africa1.eps -file55=C:\mysql\Docs\Flags\poland.gif -file44=C:\mysql\Docs\Flags\italy.eps -file33=C:\mysql\Docs\Flags\greece.gif -file22=C:\mysql\Docs\Flags\estonia.eps -file11=C:\mysql\Docs\Flags\canada.gif -file78=C:\mysql\Docs\Flags\ukraine.eps -file67=C:\mysql\Docs\Flags\south-africa1.gif -file56=C:\mysql\Docs\Flags\portugal.eps -file45=C:\mysql\Docs\Flags\italy.gif -file34=C:\mysql\Docs\Flags\hungary.eps -file23=C:\mysql\Docs\Flags\estonia.gif -file12=C:\mysql\Docs\Flags\chile.eps -file79=C:\mysql\Docs\Flags\ukraine.gif -file68=C:\mysql\Docs\Flags\south-korea.eps -file57=C:\mysql\Docs\Flags\portugal.gif -file46=C:\mysql\Docs\Flags\japan.eps -file35=C:\mysql\Docs\Flags\hungary.gif -file24=C:\mysql\Docs\Flags\finland.eps -file13=C:\mysql\Docs\Flags\chile.gif -file69=C:\mysql\Docs\Flags\south-korea.gif -file58=C:\mysql\Docs\Flags\romania.eps -file47=C:\mysql\Docs\Flags\japan.gif -file36=C:\mysql\Docs\Flags\iceland.eps -file25=C:\mysql\Docs\Flags\finland.gif -file14=C:\mysql\Docs\Flags\china.eps - -[Docs] -file0=C:\mysql\Docs\manual_toc.html -file1=C:\mysql\Docs\manual.html -file2=C:\mysql\Docs\manual.txt -SubDir0=Docs\Flags -fulldirectory= - -[TopDir] -SubDir0=Docs - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Grant Tables.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Grant Tables.fgl deleted file mode 100755 index 178065a7003..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Grant Tables.fgl +++ /dev/null @@ -1,36 +0,0 @@ -[data\test] -fulldirectory= - -[data\mysql] -file15=C:\mysql\data\mysql\func.frm -file16=C:\mysql\data\mysql\func.MYD -file0=C:\mysql\data\mysql\columns_priv.frm -file17=C:\mysql\data\mysql\func.MYI -file1=C:\mysql\data\mysql\columns_priv.MYD -file2=C:\mysql\data\mysql\columns_priv.MYI -file3=C:\mysql\data\mysql\db.frm -file4=C:\mysql\data\mysql\db.MYD -file5=C:\mysql\data\mysql\db.MYI -file6=C:\mysql\data\mysql\host.frm -file7=C:\mysql\data\mysql\host.MYD -file8=C:\mysql\data\mysql\host.MYI -file9=C:\mysql\data\mysql\tables_priv.frm -file10=C:\mysql\data\mysql\tables_priv.MYD -fulldirectory= -file11=C:\mysql\data\mysql\tables_priv.MYI -file12=C:\mysql\data\mysql\user.frm -file13=C:\mysql\data\mysql\user.MYD -file14=C:\mysql\data\mysql\user.MYI - -[TopDir] -SubDir0=data - -[data] -SubDir0=data\mysql -SubDir1=data\test -fulldirectory= - -[General] -Type=FILELIST -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl deleted file mode 100755 index b51c37f8db2..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl +++ /dev/null @@ -1,251 +0,0 @@ -[Embedded\Static\release] -file0=C:\mysql\embedded\Static\release\test_stc.dsp -file1=C:\mysql\embedded\Static\release\ReadMe.txt -file2=C:\mysql\embedded\Static\release\StdAfx.cpp -file3=C:\mysql\embedded\Static\release\StdAfx.h -file4=C:\mysql\embedded\Static\release\test_stc.cpp -file5=C:\mysql\embedded\Static\release\mysqlserver.lib -fulldirectory= - -[share\polish] -file0=C:\mysql\share\polish\errmsg.sys -file1=C:\mysql\share\polish\errmsg.txt -fulldirectory= - -[share\dutch] -file0=C:\mysql\share\dutch\errmsg.sys -file1=C:\mysql\share\dutch\errmsg.txt -fulldirectory= - -[share\spanish] -file0=C:\mysql\share\spanish\errmsg.sys -file1=C:\mysql\share\spanish\errmsg.txt -fulldirectory= - -[share\english] -file0=C:\mysql\share\english\errmsg.sys -file1=C:\mysql\share\english\errmsg.txt -fulldirectory= - -[bin] -file0=C:\mysql\bin\mysqld-opt.exe -file1=C:\mysql\bin\mysqld-nt.exe -file2=C:\mysql\bin\mysqld.exe -file3=C:\mysql\bin\cygwinb19.dll -file4=C:\mysql\bin\libmySQL.dll -fulldirectory= - -[share\korean] -file0=C:\mysql\share\korean\errmsg.sys -file1=C:\mysql\share\korean\errmsg.txt -fulldirectory= - -[share\charsets] -file0=C:\mysql\share\charsets\cp1250.xml -file1=C:\mysql\share\charsets\cp1251.conf -file2=C:\mysql\share\charsets\cp1251.xml -file3=C:\mysql\share\charsets\cp1256.xml -file1=C:\mysql\share\charsets\cp1257.conf -file4=C:\mysql\share\charsets\cp1257.xml -file5=C:\mysql\share\charsets\cp850.xml -file6=C:\mysql\share\charsets\cp852.xml -file7=C:\mysql\share\charsets\cp866.xml -file8=C:\mysql\share\charsets\croat.conf -file9=C:\mysql\share\charsets\danish.conf -file10=C:\mysql\share\charsets\dec8.conf -file10=C:\mysql\share\charsets\dec8.xml -file11=C:\mysql\share\charsets\dos.conf -file12=C:\mysql\share\charsets\estonia.conf -file13=C:\mysql\share\charsets\geostd8.xml -file14=C:\mysql\share\charsets\german1.conf -file15=C:\mysql\share\charsets\greek.xml -file16=C:\mysql\share\charsets\greek.conf -file17=C:\mysql\share\charsets\hebrew.xml -file18=C:\mysql\share\charsets\hebrew.conf -file19=C:\mysql\share\charsets\hp8.xml -file20=C:\mysql\share\charsets\hp8.conf -file21=C:\mysql\share\charsets\hungarian.conf -file22=C:\mysql\share\charsets\keybcs2.xml -file23=C:\mysql\share\charsets\koi8_ru.conf -file24=C:\mysql\share\charsets\koi8_ukr.conf -file25=C:\mysql\share\charsets\koi8r.xml -file26=C:\mysql\share\charsets\koi8u.xml -file27=C:\mysql\share\charsets\latin1.conf -file28=C:\mysql\share\charsets\latin1.xml -file29=C:\mysql\share\charsets\latin2.conf -file30=C:\mysql\share\charsets\latin2.xml -file31=C:\mysql\share\charsets\latin5.conf -file32=C:\mysql\share\charsets\latin5.xml -file33=C:\mysql\share\charsets\latin7.xml -file34=C:\mysql\share\charsets\macce.xml -file35=C:\mysql\share\charsets\macroman.xml -file36=C:\mysql\share\charsets\swe7.conf -file37=C:\mysql\share\charsets\swe7.xml -file38=C:\mysql\share\charsets\usa7.conf -file39=C:\mysql\share\charsets\win1250.conf -file40=C:\mysql\share\charsets\win1251ukr.conf -file41=C:\mysql\share\charsets\win1251.conf -file42=C:\mysql\share\charsets\Index -file43=C:\mysql\share\charsets\Index.xml -file44=C:\mysql\share\charsets\Readme -file45=C:\mysql\share\charsets\languages.html -fulldirectory= - -[Embedded\DLL\debug] -file0=C:\mysql\embedded\DLL\debug\libmysqld.dll -file1=C:\mysql\embedded\DLL\debug\libmysqld.exp -file2=C:\mysql\embedded\DLL\debug\libmysqld.lib -fulldirectory= - -[Embedded] -file0=C:\mysql\embedded\embedded.dsw -SubDir0=Embedded\DLL -SubDir1=Embedded\Static -fulldirectory= - -[share\ukrainian] -file0=C:\mysql\share\ukrainian\errmsg.sys -file1=C:\mysql\share\ukrainian\errmsg.txt -fulldirectory= - -[share\hungarian] -file0=C:\mysql\share\hungarian\errmsg.sys -file1=C:\mysql\share\hungarian\errmsg.txt -fulldirectory= - -[share\german] -file0=C:\mysql\share\german\errmsg.sys -file1=C:\mysql\share\german\errmsg.txt -fulldirectory= - -[share\portuguese] -file0=C:\mysql\share\portuguese\errmsg.sys -file1=C:\mysql\share\portuguese\errmsg.txt -fulldirectory= - -[share\estonian] -file0=C:\mysql\share\estonian\errmsg.sys -file1=C:\mysql\share\estonian\errmsg.txt -fulldirectory= - -[share\romanian] -file0=C:\mysql\share\romanian\errmsg.sys -file1=C:\mysql\share\romanian\errmsg.txt -fulldirectory= - -[share\french] -file0=C:\mysql\share\french\errmsg.sys -file1=C:\mysql\share\french\errmsg.txt -fulldirectory= - -[share\swedish] -file0=C:\mysql\share\swedish\errmsg.sys -file1=C:\mysql\share\swedish\errmsg.txt -fulldirectory= - -[share\slovak] -file0=C:\mysql\share\slovak\errmsg.sys -file1=C:\mysql\share\slovak\errmsg.txt -fulldirectory= - -[share\greek] -file0=C:\mysql\share\greek\errmsg.sys -file1=C:\mysql\share\greek\errmsg.txt -fulldirectory= - -[TopDir] -file0=C:\mysql\my-huge.cnf -file1=C:\mysql\my-large.cnf -file2=C:\mysql\my-medium.cnf -file3=C:\mysql\my-small.cnf -file4=C:\mysql\MySQLEULA.txt -file5=C:\mysql\README.txt -SubDir0=bin -SubDir1=share -SubDir2=Embedded - -[share] -SubDir8=share\hungarian -SubDir9=share\charsets -SubDir20=share\spanish -SubDir21=share\swedish -SubDir10=share\italian -SubDir22=share\ukrainian -SubDir11=share\japanese -SubDir12=share\korean -SubDir13=share\norwegian -SubDir14=share\norwegian-ny -SubDir15=share\polish -SubDir16=share\portuguese -SubDir0=share\czech -SubDir17=share\romanian -SubDir1=share\danish -SubDir18=share\russian -SubDir2=share\dutch -SubDir19=share\slovak -SubDir3=share\english -fulldirectory= -SubDir4=share\estonian -SubDir5=share\french -SubDir6=share\german -SubDir7=share\greek - -[share\norwegian-ny] -file0=C:\mysql\share\norwegian-ny\errmsg.sys -file1=C:\mysql\share\norwegian-ny\errmsg.txt -fulldirectory= - -[Embedded\DLL] -file0=C:\mysql\embedded\DLL\test_dll.dsp -file1=C:\mysql\embedded\DLL\StdAfx.h -file2=C:\mysql\embedded\DLL\test_dll.cpp -file3=C:\mysql\embedded\DLL\StdAfx.cpp -SubDir0=Embedded\DLL\debug -SubDir1=Embedded\DLL\release -fulldirectory= - -[Embedded\Static] -SubDir0=Embedded\Static\release -fulldirectory= - -[Embedded\DLL\release] -file0=C:\mysql\embedded\DLL\release\libmysqld.dll -file1=C:\mysql\embedded\DLL\release\libmysqld.exp -file2=C:\mysql\embedded\DLL\release\libmysqld.lib -file3=C:\mysql\embedded\DLL\release\mysql-server.exe -fulldirectory= - -[share\danish] -file0=C:\mysql\share\danish\errmsg.sys -file1=C:\mysql\share\danish\errmsg.txt -fulldirectory= - -[share\czech] -file0=C:\mysql\share\czech\errmsg.sys -file1=C:\mysql\share\czech\errmsg.txt -fulldirectory= - -[General] -Type=FILELIST -Version=1.00.000 - -[share\russian] -file0=C:\mysql\share\russian\errmsg.sys -file1=C:\mysql\share\russian\errmsg.txt -fulldirectory= - -[share\norwegian] -file0=C:\mysql\share\norwegian\errmsg.sys -file1=C:\mysql\share\norwegian\errmsg.txt -fulldirectory= - -[share\japanese] -file0=C:\mysql\share\japanese\errmsg.sys -file1=C:\mysql\share\japanese\errmsg.txt -fulldirectory= - -[share\italian] -file0=C:\mysql\share\italian\errmsg.sys -file1=C:\mysql\share\italian\errmsg.txt -fulldirectory= - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Registry Entries/Default.rge b/VC++Files/InstallShield/4.0.XX-pro/Registry Entries/Default.rge deleted file mode 100755 index 537dfd82e48..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Registry Entries/Default.rge +++ /dev/null @@ -1,4 +0,0 @@ -[General] -Type=REGISTRYDATA -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.dbg b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.dbg Binary files differdeleted file mode 100755 index 0c6d4e6b708..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.dbg +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ino b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ino Binary files differdeleted file mode 100755 index 204d8ea0f36..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ino +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ins b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ins Binary files differdeleted file mode 100755 index 759009b5c84..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.ins +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.obs b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.obs Binary files differdeleted file mode 100755 index 5fcfcb62c4e..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.obs +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old deleted file mode 100755 index df143b493c4..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old +++ /dev/null @@ -1,640 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-1997, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup on a -// Windows 95 or Windows NT 4.0 platform. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - - // Include header file -#include "sdlang.h" -#include "sddialog.h" - -////////////////////// string defines //////////////////////////// - -#define UNINST_LOGFILE_NAME "Uninst.isu" - -//////////////////// installation declarations /////////////////// - - // ----- DLL prototypes ----- - - - // your DLL prototypes - - - // ---- script prototypes ----- - - // generated - prototype ShowDialogs(); - prototype MoveFileData(); - prototype HandleMoveDataError( NUMBER ); - prototype ProcessBeforeDataMove(); - prototype ProcessAfterDataMove(); - prototype SetupRegistry(); - prototype SetupFolders(); - prototype CleanUpInstall(); - prototype SetupInstall(); - prototype SetupScreen(); - prototype CheckRequirements(); - prototype DialogShowSdWelcome(); - prototype DialogShowSdShowInfoList(); - prototype DialogShowSdAskDestPath(); - prototype DialogShowSdSetupType(); - prototype DialogShowSdComponentDialog2(); - prototype DialogShowSdFinishReboot(); - - // your prototypes - - - // ----- global variables ------ - - // generated - BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; - STRING svDir; - STRING svName, svCompany, svSerial; - STRING szAppPath; - STRING svSetupType; - - - // your global variables - - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN PROGRAM -// -// The setup begins here by hiding the visible setup -// window. This is done to allow all the titles, images, etc. to -// be established before showing the main window. The following -// logic then performs the setup in a series of steps. -// -/////////////////////////////////////////////////////////////////////////////// -program - Disable( BACKGROUND ); - - CheckRequirements(); - - SetupInstall(); - - SetupScreen(); - - if (ShowDialogs()<0) goto end_install; - - if (ProcessBeforeDataMove()<0) goto end_install; - - if (MoveFileData()<0) goto end_install; - - if (ProcessAfterDataMove()<0) goto end_install; - - if (SetupRegistry()<0) goto end_install; - - if (SetupFolders()<0) goto end_install; - - - end_install: - - CleanUpInstall(); - - // If an unrecoverable error occurred, clean up the partial installation. - // Otherwise, exit normally. - - if (bInstallAborted) then - abort; - endif; - -endprogram - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ShowDialogs // -// // -// Purpose: This function manages the display and navigation // -// the standard dialogs that exist in a setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ShowDialogs() - NUMBER nResult; - begin - - Dlg_Start: - // beginning of dialogs label - - Dlg_SdWelcome: - nResult = DialogShowSdWelcome(); - if (nResult = BACK) goto Dlg_Start; - - Dlg_SdShowInfoList: - nResult = DialogShowSdShowInfoList(); - if (nResult = BACK) goto Dlg_SdWelcome; - - Dlg_SdAskDestPath: - nResult = DialogShowSdAskDestPath(); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - Dlg_SdSetupType: - nResult = DialogShowSdSetupType(); - if (nResult = BACK) goto Dlg_SdAskDestPath; - - Dlg_SdComponentDialog2: - if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then - goto Dlg_SdSetupType; - endif; - nResult = DialogShowSdComponentDialog2(); - if (nResult = BACK) goto Dlg_SdSetupType; - - return 0; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessBeforeDataMove // -// // -// Purpose: This function performs any necessary operations prior to the // -// actual data move operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessBeforeDataMove() - STRING svLogFile; - NUMBER nResult; - begin - - InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); - - svLogFile = UNINST_LOGFILE_NAME; - - nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); - if (nResult < 0) then - MessageBox( @ERROR_UNINSTSETUP, WARNING ); - endif; - - szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir - - if ((bIs32BitSetup) && (bIsShellExplorer)) then - RegDBSetItem( REGDB_APPPATH, szAppPath ); - RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); - RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); - endif; - - // TODO : update any items you want to process before moving the data - // - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: MoveFileData // -// // -// Purpose: This function handles the data movement for // -// the setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function MoveFileData() - NUMBER nResult, nDisk; - begin - - nDisk = 1; - SetStatusWindow( 0, "" ); - Disable( DIALOGCACHE ); - Enable( STATUS ); - StatusUpdate( ON, 100 ); - nResult = ComponentMoveData( MEDIA, nDisk, 0 ); - - HandleMoveDataError( nResult ); - - Disable( STATUS ); - - return nResult; - - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: HandleMoveDataError // -// // -// Purpose: This function handles the error (if any) during the move data // -// operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function HandleMoveDataError( nResult ) - STRING szErrMsg, svComponent , svFileGroup , svFile; - begin - - svComponent = ""; - svFileGroup = ""; - svFile = ""; - - switch (nResult) - case 0: - return 0; - default: - ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); - szErrMsg = @ERROR_MOVEDATA + "\n\n" + - @ERROR_COMPONENT + " " + svComponent + "\n" + - @ERROR_FILEGROUP + " " + svFileGroup + "\n" + - @ERROR_FILE + " " + svFile; - SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); - bInstallAborted = TRUE; - return nResult; - endswitch; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessAfterDataMove // -// // -// Purpose: This function performs any necessary operations needed after // -// all data has been moved. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessAfterDataMove() - begin - - // TODO : update self-registered files and other processes that - // should be performed after the data has been moved. - - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupRegistry // -// // -// Purpose: This function makes the registry entries for this setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupRegistry() - NUMBER nResult; - - begin - - // TODO : Add all your registry entry keys here - // - // - // RegDBCreateKeyEx, RegDBSetKeyValueEx.... - // - - nResult = CreateRegistrySet( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function: SetupFolders -// -// Purpose: This function creates all the folders and shortcuts for the -// setup. This includes program groups and items for Windows 3.1. -// -/////////////////////////////////////////////////////////////////////////////// -function SetupFolders() - NUMBER nResult; - - begin - - - // TODO : Add all your folder (program group) along with shortcuts (program items) - // - // - // CreateProgramFolder, AddFolderIcon.... - // - - nResult = CreateShellObjects( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CleanUpInstall // -// // -// Purpose: This cleans up the setup. Anything that should // -// be released or deleted at the end of the setup should // -// be done here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CleanUpInstall() - begin - - - if (bInstallAborted) then - return 0; - endif; - - DialogShowSdFinishReboot(); - - if (BATCH_INSTALL) then // ensure locked files are properly written - CommitSharedFiles(0); - endif; - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupInstall // -// // -// Purpose: This will setup the installation. Any general initialization // -// needed for the installation should be performed here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupInstall() - begin - - Enable( CORECOMPONENTHANDLING ); - - bInstallAborted = FALSE; - - if (bIs32BitSetup) then - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; - else - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names - endif; - - TARGETDIR = svDir; - - SdProductName( @PRODUCT_NAME ); - - Enable( DIALOGCACHE ); - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupScreen // -// // -// Purpose: This function establishes the screen look. This includes // -// colors, fonts, and text to be displayed. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupScreen() - begin - - Enable( FULLWINDOWMODE ); - Enable( INDVFILESTATUS ); - SetTitle( @TITLE_MAIN, 24, WHITE ); - - SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. - - Enable( BACKGROUND ); - - Delay( 1 ); - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CheckRequirements // -// // -// Purpose: This function checks all minimum requirements for the // -// application being installed. If any fail, then the user // -// is informed and the setup is terminated. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CheckRequirements() - NUMBER nvDx, nvDy, nvResult; - STRING svResult; - - begin - - bWinNT = FALSE; - bIsShellExplorer = FALSE; - - // Check screen resolution. - GetExtents( nvDx, nvDy ); - - if (nvDy < 480) then - MessageBox( @ERROR_VGARESOLUTION, WARNING ); - abort; - endif; - - // set 'setup' operation mode - bIs32BitSetup = TRUE; - GetSystemInfo( ISTYPE, nvResult, svResult ); - if (nvResult = 16) then - bIs32BitSetup = FALSE; // running 16-bit setup - return 0; // no additional information required - endif; - - // --- 32-bit testing after this point --- - - // Determine the target system's operating system. - GetSystemInfo( OS, nvResult, svResult ); - - if (nvResult = IS_WINDOWSNT) then - // Running Windows NT. - bWinNT = TRUE; - - // Check to see if the shell being used is EXPLORER shell. - if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then - if (nvResult >= 4) then - bIsShellExplorer = TRUE; - endif; - endif; - - elseif (nvResult = IS_WINDOWS95 ) then - bIsShellExplorer = TRUE; - - endif; - -end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdWelcome // -// // -// Purpose: This function handles the standard welcome dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdWelcome() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdShowInfoList // -// // -// Purpose: This function displays the general information list dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdShowInfoList() - NUMBER nResult; - LIST list; - STRING szTitle, szMsg, szFile; - begin - - szFile = SUPPORTDIR ^ "infolist.txt"; - - list = ListCreate( STRINGLIST ); - ListReadFromFile( list, szFile ); - szTitle = ""; - szMsg = " "; - nResult = SdShowInfoList( szTitle, szMsg, list ); - - ListDestroy( list ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdAskDestPath // -// // -// Purpose: This function asks the user for the destination directory. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdAskDestPath() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); - - TARGETDIR = svDir; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdSetupType // -// // -// Purpose: This function displays the standard setup type dialog. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdSetupType() - NUMBER nResult, nType; - STRING szTitle, szMsg; - begin - - switch (svSetupType) - case "Typical": - nType = TYPICAL; - case "Custom": - nType = CUSTOM; - case "Compact": - nType = COMPACT; - case "": - svSetupType = "Typical"; - nType = TYPICAL; - endswitch; - - szTitle = ""; - szMsg = ""; - nResult = SetupType( szTitle, szMsg, "", nType, 0 ); - - switch (nResult) - case COMPACT: - svSetupType = "Compact"; - case TYPICAL: - svSetupType = "Typical"; - case CUSTOM: - svSetupType = "Custom"; - endswitch; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdComponentDialog2 // -// // -// Purpose: This function displays the custom component dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdComponentDialog2() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - if ((svSetupType != "Custom") && (svSetupType != "")) then - return 0; - endif; - - szTitle = ""; - szMsg = ""; - nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdFinishReboot // -// // -// Purpose: This function will show the last dialog of the product. // -// It will allow the user to reboot and/or show some readme text. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdFinishReboot() - NUMBER nResult, nDefOptions; - STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; - NUMBER bOpt1, bOpt2; - begin - - if (!BATCH_INSTALL) then - bOpt1 = FALSE; - bOpt2 = FALSE; - szMsg1 = ""; - szMsg2 = ""; - szOption1 = ""; - szOption2 = ""; - nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); - return 0; - endif; - - nDefOptions = SYS_BOOTMACHINE; - szTitle = ""; - szMsg1 = ""; - szMsg2 = ""; - nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); - - return nResult; - end; - - // --- include script file section --- - -#include "sddialog.rul" - - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/setup.rul b/VC++Files/InstallShield/4.0.XX-pro/Script Files/setup.rul deleted file mode 100755 index 73d61114075..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/setup.rul +++ /dev/null @@ -1,641 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-1997, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup on a -// Windows 95 or Windows NT 4.0 platform. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - - // Include header file -#include "sdlang.h" -#include "sddialog.h" - -////////////////////// string defines //////////////////////////// - -#define UNINST_LOGFILE_NAME "Uninst.isu" - -//////////////////// installation declarations /////////////////// - - // ----- DLL prototypes ----- - - - // your DLL prototypes - - - // ---- script prototypes ----- - - // generated - prototype ShowDialogs(); - prototype MoveFileData(); - prototype HandleMoveDataError( NUMBER ); - prototype ProcessBeforeDataMove(); - prototype ProcessAfterDataMove(); - prototype SetupRegistry(); - prototype SetupFolders(); - prototype CleanUpInstall(); - prototype SetupInstall(); - prototype SetupScreen(); - prototype CheckRequirements(); - prototype DialogShowSdWelcome(); - prototype DialogShowSdShowInfoList(); - prototype DialogShowSdAskDestPath(); - prototype DialogShowSdSetupType(); - prototype DialogShowSdComponentDialog2(); - prototype DialogShowSdFinishReboot(); - - // your prototypes - - - // ----- global variables ------ - - // generated - BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; - STRING svDir; - STRING svName, svCompany, svSerial; - STRING szAppPath; - STRING svSetupType; - - - // your global variables - - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN PROGRAM -// -// The setup begins here by hiding the visible setup -// window. This is done to allow all the titles, images, etc. to -// be established before showing the main window. The following -// logic then performs the setup in a series of steps. -// -/////////////////////////////////////////////////////////////////////////////// -program - Disable( BACKGROUND ); - - CheckRequirements(); - - SetupInstall(); - - SetupScreen(); - - if (ShowDialogs()<0) goto end_install; - - if (ProcessBeforeDataMove()<0) goto end_install; - - if (MoveFileData()<0) goto end_install; - - if (ProcessAfterDataMove()<0) goto end_install; - - if (SetupRegistry()<0) goto end_install; - - if (SetupFolders()<0) goto end_install; - - - end_install: - - CleanUpInstall(); - - // If an unrecoverable error occurred, clean up the partial installation. - // Otherwise, exit normally. - - if (bInstallAborted) then - abort; - endif; - -endprogram - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ShowDialogs // -// // -// Purpose: This function manages the display and navigation // -// the standard dialogs that exist in a setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ShowDialogs() - NUMBER nResult; - begin - - Dlg_Start: - // beginning of dialogs label - - Dlg_SdWelcome: - nResult = DialogShowSdWelcome(); - if (nResult = BACK) goto Dlg_Start; - - Dlg_SdShowInfoList: - nResult = DialogShowSdShowInfoList(); - if (nResult = BACK) goto Dlg_SdWelcome; - - Dlg_SdAskDestPath: - nResult = DialogShowSdAskDestPath(); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - Dlg_SdSetupType: - nResult = DialogShowSdSetupType(); - if (nResult = BACK) goto Dlg_SdAskDestPath; - - Dlg_SdComponentDialog2: - if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then - goto Dlg_SdSetupType; - endif; - nResult = DialogShowSdComponentDialog2(); - if (nResult = BACK) goto Dlg_SdSetupType; - - return 0; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessBeforeDataMove // -// // -// Purpose: This function performs any necessary operations prior to the // -// actual data move operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessBeforeDataMove() - STRING svLogFile; - NUMBER nResult; - begin - - InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); - - svLogFile = UNINST_LOGFILE_NAME; - - nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); - if (nResult < 0) then - MessageBox( @ERROR_UNINSTSETUP, WARNING ); - endif; - - szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir - - if ((bIs32BitSetup) && (bIsShellExplorer)) then -// RegDBSetItem( REGDB_APPPATH, szAppPath ); -// RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); - RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); - endif; - - // TODO : update any items you want to process before moving the data - // - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: MoveFileData // -// // -// Purpose: This function handles the data movement for // -// the setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function MoveFileData() - NUMBER nResult, nDisk; - begin - - nDisk = 1; - SetStatusWindow( 0, "" ); - Disable( DIALOGCACHE ); - Enable( STATUS ); - StatusUpdate( ON, 100 ); - nResult = ComponentMoveData( MEDIA, nDisk, 0 ); - - HandleMoveDataError( nResult ); - - Disable( STATUS ); - - return nResult; - - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: HandleMoveDataError // -// // -// Purpose: This function handles the error (if any) during the move data // -// operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function HandleMoveDataError( nResult ) - STRING szErrMsg, svComponent , svFileGroup , svFile; - begin - - svComponent = ""; - svFileGroup = ""; - svFile = ""; - - switch (nResult) - case 0: - return 0; - default: - ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); - szErrMsg = @ERROR_MOVEDATA + "\n\n" + - @ERROR_COMPONENT + " " + svComponent + "\n" + - @ERROR_FILEGROUP + " " + svFileGroup + "\n" + - @ERROR_FILE + " " + svFile; - SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); - bInstallAborted = TRUE; - return nResult; - endswitch; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessAfterDataMove // -// // -// Purpose: This function performs any necessary operations needed after // -// all data has been moved. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessAfterDataMove() - begin - - // TODO : update self-registered files and other processes that - // should be performed after the data has been moved. - - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupRegistry // -// // -// Purpose: This function makes the registry entries for this setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupRegistry() - NUMBER nResult; - - begin - - // TODO : Add all your registry entry keys here - // - // - // RegDBCreateKeyEx, RegDBSetKeyValueEx.... - // - - nResult = CreateRegistrySet( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function: SetupFolders -// -// Purpose: This function creates all the folders and shortcuts for the -// setup. This includes program groups and items for Windows 3.1. -// -/////////////////////////////////////////////////////////////////////////////// -function SetupFolders() - NUMBER nResult; - - begin - - - // TODO : Add all your folder (program group) along with shortcuts (program items) - // - // - // CreateProgramFolder, AddFolderIcon.... - // - - nResult = CreateShellObjects( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CleanUpInstall // -// // -// Purpose: This cleans up the setup. Anything that should // -// be released or deleted at the end of the setup should // -// be done here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CleanUpInstall() - begin - - - if (bInstallAborted) then - return 0; - endif; - - DialogShowSdFinishReboot(); - - if (BATCH_INSTALL) then // ensure locked files are properly written - CommitSharedFiles(0); - endif; - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupInstall // -// // -// Purpose: This will setup the installation. Any general initialization // -// needed for the installation should be performed here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupInstall() - begin - - Enable( CORECOMPONENTHANDLING ); - - bInstallAborted = FALSE; - - if (bIs32BitSetup) then - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; - else - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names - endif; - - TARGETDIR = svDir; - - SdProductName( @PRODUCT_NAME ); - - Enable( DIALOGCACHE ); - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupScreen // -// // -// Purpose: This function establishes the screen look. This includes // -// colors, fonts, and text to be displayed. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupScreen() - begin - - Enable( FULLWINDOWMODE ); - Enable( INDVFILESTATUS ); - SetTitle( @TITLE_MAIN, 24, WHITE ); - - SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. - - Enable( BACKGROUND ); - - Delay( 1 ); - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CheckRequirements // -// // -// Purpose: This function checks all minimum requirements for the // -// application being installed. If any fail, then the user // -// is informed and the setup is terminated. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CheckRequirements() - NUMBER nvDx, nvDy, nvResult; - STRING svResult; - - begin - - bWinNT = FALSE; - bIsShellExplorer = FALSE; - - // Check screen resolution. - GetExtents( nvDx, nvDy ); - - if (nvDy < 480) then - MessageBox( @ERROR_VGARESOLUTION, WARNING ); - abort; - endif; - - // set 'setup' operation mode - bIs32BitSetup = TRUE; - GetSystemInfo( ISTYPE, nvResult, svResult ); - if (nvResult = 16) then - bIs32BitSetup = FALSE; // running 16-bit setup - return 0; // no additional information required - endif; - - // --- 32-bit testing after this point --- - - // Determine the target system's operating system. - GetSystemInfo( OS, nvResult, svResult ); - - if (nvResult = IS_WINDOWSNT) then - // Running Windows NT. - bWinNT = TRUE; - - // Check to see if the shell being used is EXPLORER shell. - if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then - if (nvResult >= 4) then - bIsShellExplorer = TRUE; - endif; - endif; - - elseif (nvResult = IS_WINDOWS95 ) then - bIsShellExplorer = TRUE; - - endif; - -end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdWelcome // -// // -// Purpose: This function handles the standard welcome dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdWelcome() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdShowInfoList // -// // -// Purpose: This function displays the general information list dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdShowInfoList() - NUMBER nResult; - LIST list; - STRING szTitle, szMsg, szFile; - begin - - szFile = SUPPORTDIR ^ "infolist.txt"; - - list = ListCreate( STRINGLIST ); - ListReadFromFile( list, szFile ); - szTitle = ""; - szMsg = " "; - nResult = SdShowInfoList( szTitle, szMsg, list ); - - ListDestroy( list ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdAskDestPath // -// // -// Purpose: This function asks the user for the destination directory. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdAskDestPath() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); - - TARGETDIR = svDir; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdSetupType // -// // -// Purpose: This function displays the standard setup type dialog. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdSetupType() - NUMBER nResult, nType; - STRING szTitle, szMsg; - begin - - switch (svSetupType) - case "Typical": - nType = TYPICAL; - case "Custom": - nType = CUSTOM; - case "Compact": - nType = COMPACT; - case "": - svSetupType = "Typical"; - nType = TYPICAL; - endswitch; - - szTitle = ""; - szMsg = ""; - nResult = SetupType( szTitle, szMsg, "", nType, 0 ); - - switch (nResult) - case COMPACT: - svSetupType = "Compact"; - case TYPICAL: - svSetupType = "Typical"; - case CUSTOM: - svSetupType = "Custom"; - endswitch; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdComponentDialog2 // -// // -// Purpose: This function displays the custom component dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdComponentDialog2() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - if ((svSetupType != "Custom") && (svSetupType != "")) then - return 0; - endif; - - szTitle = ""; - szMsg = ""; - nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdFinishReboot // -// // -// Purpose: This function will show the last dialog of the product. // -// It will allow the user to reboot and/or show some readme text. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdFinishReboot() - NUMBER nResult, nDefOptions; - STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; - NUMBER bOpt1, bOpt2; - begin - - if (!BATCH_INSTALL) then - bOpt1 = FALSE; - bOpt2 = FALSE; - szMsg1 = ""; - szMsg2 = ""; - szOption1 = ""; - szOption2 = ""; - nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); - return 0; - endif; - - nDefOptions = SYS_BOOTMACHINE; - szTitle = ""; - szMsg1 = ""; - szMsg2 = ""; - nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); - - return nResult; - end; - - // --- include script file section --- - -#include "sddialog.rul" - - - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt b/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt deleted file mode 100755 index 52ccf8e11a9..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Compressed Files/Language Independent/OS Independent/infolist.txt +++ /dev/null @@ -1,25 +0,0 @@ -This is a release of MySQL Pro @VERSION@ for Win32. - -NOTE: If you install MySQL in a folder other than -C:\MYSQL or you intend to start MySQL on NT/Win2000 -as a service, you must create a file named C:\MY.CNF -or \Windows\my.ini or \winnt\my.ini with the following -information:: - -[mysqld] -basedir=E:/installation-path/ -datadir=E:/data-path/ - -After your have installed MySQL, the installation -directory will contain 4 files named 'my-small.cnf, -my-medium.cnf, my-large.cnf, my-huge.cnf'. -You can use this as a starting point for your own -C:\my.cnf file. - -If you have any problems, you can mail them to -win32@lists.mysql.com after you have consulted the -MySQL manual and the MySQL mailing list archive -(http://www.mysql.com/documentation/index.html) - -On behalf of the MySQL AB gang, -Michael Widenius diff --git a/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp b/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp Binary files differdeleted file mode 100755 index 3229d50c9bf..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Setup Files/Uncompressed Files/Language Independent/OS Independent/setup.bmp +++ /dev/null diff --git a/VC++Files/InstallShield/4.0.XX-pro/Shell Objects/Default.shl b/VC++Files/InstallShield/4.0.XX-pro/Shell Objects/Default.shl deleted file mode 100755 index 187cb651307..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Shell Objects/Default.shl +++ /dev/null @@ -1,12 +0,0 @@ -[Data] -Folder3=<FOLDER_STARTUP> -Group0=Main -Group1=Startup -Folder0=<FOLDER_DESKTOP> -Folder1=<FOLDER_STARTMENU> -Folder2=<FOLDER_PROGRAMS> - -[Info] -Type=ShellObject -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/String Tables/0009-English/value.shl b/VC++Files/InstallShield/4.0.XX-pro/String Tables/0009-English/value.shl deleted file mode 100755 index 525f3be0b3e..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/String Tables/0009-English/value.shl +++ /dev/null @@ -1,23 +0,0 @@ -[Data] -TITLE_MAIN=MySQL Pro Servers and Clients @VERSION@ -COMPANY_NAME=MySQL AB -ERROR_COMPONENT=Component: -COMPANY_NAME16=Company -PRODUCT_VERSION=MySQL Pro Servers and Clients @VERSION@ -ERROR_MOVEDATA=An error occurred during the move data process: %d -ERROR_FILEGROUP=File Group: -UNINST_KEY=MySQL Pro Servers and Clients @VERSION@ -TITLE_CAPTIONBAR=MySQL Pro Servers and Clients @VERSION@ -PRODUCT_NAME16=Product -ERROR_VGARESOLUTION=This program requires VGA or better resolution. -ERROR_FILE=File: -UNINST_DISPLAY_NAME=MySQL Pro Servers and Clients @VERSION@ -PRODUCT_KEY=yourapp.Exe -PRODUCT_NAME=MySQL Pro Servers and Clients @VERSION@ -ERROR_UNINSTSETUP=unInstaller setup failed to initialize. You may not be able to uninstall this product. - -[General] -Language=0009 -Type=STRINGTABLESPECIFIC -Version=1.00.000 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/String Tables/Default.shl b/VC++Files/InstallShield/4.0.XX-pro/String Tables/Default.shl deleted file mode 100755 index d4dc4925ab1..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/String Tables/Default.shl +++ /dev/null @@ -1,74 +0,0 @@ -[TITLE_MAIN] -Comment= - -[COMPANY_NAME] -Comment= - -[ERROR_COMPONENT] -Comment= - -[COMPANY_NAME16] -Comment= - -[PRODUCT_VERSION] -Comment= - -[ERROR_MOVEDATA] -Comment= - -[ERROR_FILEGROUP] -Comment= - -[Language] -Lang0=0009 -CurrentLang=0 - -[UNINST_KEY] -Comment= - -[TITLE_CAPTIONBAR] -Comment= - -[Data] -Entry0=ERROR_VGARESOLUTION -Entry1=TITLE_MAIN -Entry2=TITLE_CAPTIONBAR -Entry3=UNINST_KEY -Entry4=UNINST_DISPLAY_NAME -Entry5=COMPANY_NAME -Entry6=PRODUCT_NAME -Entry7=PRODUCT_VERSION -Entry8=PRODUCT_KEY -Entry9=ERROR_MOVEDATA -Entry10=ERROR_UNINSTSETUP -Entry11=COMPANY_NAME16 -Entry12=PRODUCT_NAME16 -Entry13=ERROR_COMPONENT -Entry14=ERROR_FILEGROUP -Entry15=ERROR_FILE - -[PRODUCT_NAME16] -Comment= - -[ERROR_VGARESOLUTION] -Comment= - -[ERROR_FILE] -Comment= - -[General] -Type=STRINGTABLE -Version=1.00.000 - -[UNINST_DISPLAY_NAME] -Comment= - -[PRODUCT_KEY] -Comment= - -[PRODUCT_NAME] -Comment= - -[ERROR_UNINSTSETUP] -Comment= - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Build.tsb b/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Build.tsb deleted file mode 100755 index 3949bd4c066..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Build.tsb +++ /dev/null @@ -1,56 +0,0 @@ -[<HKUS>] -Value= -KeyType=4 - -[<HKCR>] -Value= -KeyType=4 - -[<PROGRAMFILES>] -Value= -KeyType=4 - -[<WINSYSDIR>] -Value= -KeyType=4 - -[<COMMONFILES>] -Value= -KeyType=4 - -[<WINDIR>] -Value= -KeyType=4 - -[Data] -Key0=<PROGRAMFILES> -Key1=<COMMONFILES> -Key2=<WINDIR> -Key3=<WINSYSDIR> -Key4=<HKLM> -Key5=<HKCU> -Key6=<HKCC> -Key7=<HKDD> -Key8=<HKUS> -Key9=<HKCR> - -[General] -Type=TEXTSUB -Version=1.00.000 - -[<HKLM>] -Value= -KeyType=4 - -[<HKCU>] -Value= -KeyType=4 - -[<HKCC>] -Value= -KeyType=4 - -[<HKDD>] -Value= -KeyType=4 - diff --git a/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Setup.tsb b/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Setup.tsb deleted file mode 100755 index b0c5a509f0b..00000000000 --- a/VC++Files/InstallShield/4.0.XX-pro/Text Substitutions/Setup.tsb +++ /dev/null @@ -1,76 +0,0 @@ -[<SRCDIR>] -Value= -KeyType=4 - -[<HKUS>] -Value= -KeyType=4 - -[<HKCR>] -Value= -KeyType=4 - -[<PROGRAMFILES>] -Value= -KeyType=4 - -[<TARGETDIR>] -Value= -KeyType=4 - -[<WINSYSDIR>] -Value= -KeyType=4 - -[<COMMONFILES>] -Value= -KeyType=4 - -[<WINDIR>] -Value= -KeyType=4 - -[Data] -Key0=<PROGRAMFILES> -Key1=<COMMONFILES> -Key2=<WINDIR> -Key3=<WINSYSDIR> -Key4=<TARGETDIR> -Key5=<SUPPORTDIR> -Key10=<HKDD> -Key6=<SRCDIR> -Key11=<HKUS> -Key7=<HKLM> -Key12=<HKCR> -Key8=<HKCU> -Key13=<SHELL_OBJECT_FOLDER> -Key9=<HKCC> - -[<SUPPORTDIR>] -Value= -KeyType=4 - -[<SHELL_OBJECT_FOLDER>] -Value= -KeyType=4 - -[General] -Type=TEXTSUB -Version=1.00.000 - -[<HKLM>] -Value= -KeyType=4 - -[<HKCU>] -Value= -KeyType=4 - -[<HKCC>] -Value= -KeyType=4 - -[<HKDD>] -Value= -KeyType=4 - diff --git a/VC++Files/InstallShield/Script Files/Setup.dbg b/VC++Files/InstallShield/Script Files/Setup.dbg Binary files differdeleted file mode 100644 index 0c6d4e6b708..00000000000 --- a/VC++Files/InstallShield/Script Files/Setup.dbg +++ /dev/null diff --git a/VC++Files/InstallShield/Script Files/Setup.ino b/VC++Files/InstallShield/Script Files/Setup.ino Binary files differdeleted file mode 100644 index 204d8ea0f36..00000000000 --- a/VC++Files/InstallShield/Script Files/Setup.ino +++ /dev/null diff --git a/VC++Files/InstallShield/Script Files/Setup.ins b/VC++Files/InstallShield/Script Files/Setup.ins Binary files differdeleted file mode 100644 index 759009b5c84..00000000000 --- a/VC++Files/InstallShield/Script Files/Setup.ins +++ /dev/null diff --git a/VC++Files/InstallShield/Script Files/Setup.obs b/VC++Files/InstallShield/Script Files/Setup.obs Binary files differdeleted file mode 100644 index 5fcfcb62c4e..00000000000 --- a/VC++Files/InstallShield/Script Files/Setup.obs +++ /dev/null diff --git a/VC++Files/InstallShield/Script Files/Setup.rul b/VC++Files/InstallShield/Script Files/Setup.rul deleted file mode 100644 index df143b493c4..00000000000 --- a/VC++Files/InstallShield/Script Files/Setup.rul +++ /dev/null @@ -1,640 +0,0 @@ - -//////////////////////////////////////////////////////////////////////////////// -// -// IIIIIII SSSSSS -// II SS InstallShield (R) -// II SSSSSS (c) 1996-1997, InstallShield Software Corporation -// II SS (c) 1990-1996, InstallShield Corporation -// IIIIIII SSSSSS All Rights Reserved. -// -// -// This code is generated as a starting setup template. You should -// modify it to provide all necessary steps for your setup. -// -// -// File Name: Setup.rul -// -// Description: InstallShield script -// -// Comments: This template script performs a basic setup on a -// Windows 95 or Windows NT 4.0 platform. With minor -// modifications, this template can be adapted to create -// new, customized setups. -// -//////////////////////////////////////////////////////////////////////////////// - - - // Include header file -#include "sdlang.h" -#include "sddialog.h" - -////////////////////// string defines //////////////////////////// - -#define UNINST_LOGFILE_NAME "Uninst.isu" - -//////////////////// installation declarations /////////////////// - - // ----- DLL prototypes ----- - - - // your DLL prototypes - - - // ---- script prototypes ----- - - // generated - prototype ShowDialogs(); - prototype MoveFileData(); - prototype HandleMoveDataError( NUMBER ); - prototype ProcessBeforeDataMove(); - prototype ProcessAfterDataMove(); - prototype SetupRegistry(); - prototype SetupFolders(); - prototype CleanUpInstall(); - prototype SetupInstall(); - prototype SetupScreen(); - prototype CheckRequirements(); - prototype DialogShowSdWelcome(); - prototype DialogShowSdShowInfoList(); - prototype DialogShowSdAskDestPath(); - prototype DialogShowSdSetupType(); - prototype DialogShowSdComponentDialog2(); - prototype DialogShowSdFinishReboot(); - - // your prototypes - - - // ----- global variables ------ - - // generated - BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup; - STRING svDir; - STRING svName, svCompany, svSerial; - STRING szAppPath; - STRING svSetupType; - - - // your global variables - - -/////////////////////////////////////////////////////////////////////////////// -// -// MAIN PROGRAM -// -// The setup begins here by hiding the visible setup -// window. This is done to allow all the titles, images, etc. to -// be established before showing the main window. The following -// logic then performs the setup in a series of steps. -// -/////////////////////////////////////////////////////////////////////////////// -program - Disable( BACKGROUND ); - - CheckRequirements(); - - SetupInstall(); - - SetupScreen(); - - if (ShowDialogs()<0) goto end_install; - - if (ProcessBeforeDataMove()<0) goto end_install; - - if (MoveFileData()<0) goto end_install; - - if (ProcessAfterDataMove()<0) goto end_install; - - if (SetupRegistry()<0) goto end_install; - - if (SetupFolders()<0) goto end_install; - - - end_install: - - CleanUpInstall(); - - // If an unrecoverable error occurred, clean up the partial installation. - // Otherwise, exit normally. - - if (bInstallAborted) then - abort; - endif; - -endprogram - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ShowDialogs // -// // -// Purpose: This function manages the display and navigation // -// the standard dialogs that exist in a setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ShowDialogs() - NUMBER nResult; - begin - - Dlg_Start: - // beginning of dialogs label - - Dlg_SdWelcome: - nResult = DialogShowSdWelcome(); - if (nResult = BACK) goto Dlg_Start; - - Dlg_SdShowInfoList: - nResult = DialogShowSdShowInfoList(); - if (nResult = BACK) goto Dlg_SdWelcome; - - Dlg_SdAskDestPath: - nResult = DialogShowSdAskDestPath(); - if (nResult = BACK) goto Dlg_SdShowInfoList; - - Dlg_SdSetupType: - nResult = DialogShowSdSetupType(); - if (nResult = BACK) goto Dlg_SdAskDestPath; - - Dlg_SdComponentDialog2: - if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then - goto Dlg_SdSetupType; - endif; - nResult = DialogShowSdComponentDialog2(); - if (nResult = BACK) goto Dlg_SdSetupType; - - return 0; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessBeforeDataMove // -// // -// Purpose: This function performs any necessary operations prior to the // -// actual data move operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessBeforeDataMove() - STRING svLogFile; - NUMBER nResult; - begin - - InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY ); - - svLogFile = UNINST_LOGFILE_NAME; - - nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 ); - if (nResult < 0) then - MessageBox( @ERROR_UNINSTSETUP, WARNING ); - endif; - - szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir - - if ((bIs32BitSetup) && (bIsShellExplorer)) then - RegDBSetItem( REGDB_APPPATH, szAppPath ); - RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY ); - RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME ); - endif; - - // TODO : update any items you want to process before moving the data - // - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: MoveFileData // -// // -// Purpose: This function handles the data movement for // -// the setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function MoveFileData() - NUMBER nResult, nDisk; - begin - - nDisk = 1; - SetStatusWindow( 0, "" ); - Disable( DIALOGCACHE ); - Enable( STATUS ); - StatusUpdate( ON, 100 ); - nResult = ComponentMoveData( MEDIA, nDisk, 0 ); - - HandleMoveDataError( nResult ); - - Disable( STATUS ); - - return nResult; - - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: HandleMoveDataError // -// // -// Purpose: This function handles the error (if any) during the move data // -// operation. // -// // -/////////////////////////////////////////////////////////////////////////////// -function HandleMoveDataError( nResult ) - STRING szErrMsg, svComponent , svFileGroup , svFile; - begin - - svComponent = ""; - svFileGroup = ""; - svFile = ""; - - switch (nResult) - case 0: - return 0; - default: - ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult ); - szErrMsg = @ERROR_MOVEDATA + "\n\n" + - @ERROR_COMPONENT + " " + svComponent + "\n" + - @ERROR_FILEGROUP + " " + svFileGroup + "\n" + - @ERROR_FILE + " " + svFile; - SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult ); - bInstallAborted = TRUE; - return nResult; - endswitch; - - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: ProcessAfterDataMove // -// // -// Purpose: This function performs any necessary operations needed after // -// all data has been moved. // -// // -/////////////////////////////////////////////////////////////////////////////// -function ProcessAfterDataMove() - begin - - // TODO : update self-registered files and other processes that - // should be performed after the data has been moved. - - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupRegistry // -// // -// Purpose: This function makes the registry entries for this setup. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupRegistry() - NUMBER nResult; - - begin - - // TODO : Add all your registry entry keys here - // - // - // RegDBCreateKeyEx, RegDBSetKeyValueEx.... - // - - nResult = CreateRegistrySet( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function: SetupFolders -// -// Purpose: This function creates all the folders and shortcuts for the -// setup. This includes program groups and items for Windows 3.1. -// -/////////////////////////////////////////////////////////////////////////////// -function SetupFolders() - NUMBER nResult; - - begin - - - // TODO : Add all your folder (program group) along with shortcuts (program items) - // - // - // CreateProgramFolder, AddFolderIcon.... - // - - nResult = CreateShellObjects( "" ); - - return nResult; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CleanUpInstall // -// // -// Purpose: This cleans up the setup. Anything that should // -// be released or deleted at the end of the setup should // -// be done here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CleanUpInstall() - begin - - - if (bInstallAborted) then - return 0; - endif; - - DialogShowSdFinishReboot(); - - if (BATCH_INSTALL) then // ensure locked files are properly written - CommitSharedFiles(0); - endif; - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupInstall // -// // -// Purpose: This will setup the installation. Any general initialization // -// needed for the installation should be performed here. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupInstall() - begin - - Enable( CORECOMPONENTHANDLING ); - - bInstallAborted = FALSE; - - if (bIs32BitSetup) then - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME; - else - svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names - endif; - - TARGETDIR = svDir; - - SdProductName( @PRODUCT_NAME ); - - Enable( DIALOGCACHE ); - - return 0; - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: SetupScreen // -// // -// Purpose: This function establishes the screen look. This includes // -// colors, fonts, and text to be displayed. // -// // -/////////////////////////////////////////////////////////////////////////////// -function SetupScreen() - begin - - Enable( FULLWINDOWMODE ); - Enable( INDVFILESTATUS ); - SetTitle( @TITLE_MAIN, 24, WHITE ); - - SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text. - - Enable( BACKGROUND ); - - Delay( 1 ); - end; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: CheckRequirements // -// // -// Purpose: This function checks all minimum requirements for the // -// application being installed. If any fail, then the user // -// is informed and the setup is terminated. // -// // -/////////////////////////////////////////////////////////////////////////////// -function CheckRequirements() - NUMBER nvDx, nvDy, nvResult; - STRING svResult; - - begin - - bWinNT = FALSE; - bIsShellExplorer = FALSE; - - // Check screen resolution. - GetExtents( nvDx, nvDy ); - - if (nvDy < 480) then - MessageBox( @ERROR_VGARESOLUTION, WARNING ); - abort; - endif; - - // set 'setup' operation mode - bIs32BitSetup = TRUE; - GetSystemInfo( ISTYPE, nvResult, svResult ); - if (nvResult = 16) then - bIs32BitSetup = FALSE; // running 16-bit setup - return 0; // no additional information required - endif; - - // --- 32-bit testing after this point --- - - // Determine the target system's operating system. - GetSystemInfo( OS, nvResult, svResult ); - - if (nvResult = IS_WINDOWSNT) then - // Running Windows NT. - bWinNT = TRUE; - - // Check to see if the shell being used is EXPLORER shell. - if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then - if (nvResult >= 4) then - bIsShellExplorer = TRUE; - endif; - endif; - - elseif (nvResult = IS_WINDOWS95 ) then - bIsShellExplorer = TRUE; - - endif; - -end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdWelcome // -// // -// Purpose: This function handles the standard welcome dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdWelcome() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdWelcome( szTitle, szMsg ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdShowInfoList // -// // -// Purpose: This function displays the general information list dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdShowInfoList() - NUMBER nResult; - LIST list; - STRING szTitle, szMsg, szFile; - begin - - szFile = SUPPORTDIR ^ "infolist.txt"; - - list = ListCreate( STRINGLIST ); - ListReadFromFile( list, szFile ); - szTitle = ""; - szMsg = " "; - nResult = SdShowInfoList( szTitle, szMsg, list ); - - ListDestroy( list ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdAskDestPath // -// // -// Purpose: This function asks the user for the destination directory. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdAskDestPath() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - szTitle = ""; - szMsg = ""; - nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 ); - - TARGETDIR = svDir; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdSetupType // -// // -// Purpose: This function displays the standard setup type dialog. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdSetupType() - NUMBER nResult, nType; - STRING szTitle, szMsg; - begin - - switch (svSetupType) - case "Typical": - nType = TYPICAL; - case "Custom": - nType = CUSTOM; - case "Compact": - nType = COMPACT; - case "": - svSetupType = "Typical"; - nType = TYPICAL; - endswitch; - - szTitle = ""; - szMsg = ""; - nResult = SetupType( szTitle, szMsg, "", nType, 0 ); - - switch (nResult) - case COMPACT: - svSetupType = "Compact"; - case TYPICAL: - svSetupType = "Typical"; - case CUSTOM: - svSetupType = "Custom"; - endswitch; - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdComponentDialog2 // -// // -// Purpose: This function displays the custom component dialog. // -// // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdComponentDialog2() - NUMBER nResult; - STRING szTitle, szMsg; - begin - - if ((svSetupType != "Custom") && (svSetupType != "")) then - return 0; - endif; - - szTitle = ""; - szMsg = ""; - nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" ); - - return nResult; - end; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Function: DialogShowSdFinishReboot // -// // -// Purpose: This function will show the last dialog of the product. // -// It will allow the user to reboot and/or show some readme text. // -// // -/////////////////////////////////////////////////////////////////////////////// -function DialogShowSdFinishReboot() - NUMBER nResult, nDefOptions; - STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; - NUMBER bOpt1, bOpt2; - begin - - if (!BATCH_INSTALL) then - bOpt1 = FALSE; - bOpt2 = FALSE; - szMsg1 = ""; - szMsg2 = ""; - szOption1 = ""; - szOption2 = ""; - nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 ); - return 0; - endif; - - nDefOptions = SYS_BOOTMACHINE; - szTitle = ""; - szMsg1 = ""; - szMsg2 = ""; - nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 ); - - return nResult; - end; - - // --- include script file section --- - -#include "sddialog.rul" - - diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp index a147fb3438c..0768b3095ea 100644 --- a/VC++Files/innobase/innobase.dsp +++ b/VC++Files/innobase/innobase.dsp @@ -368,6 +368,10 @@ SOURCE=.\row\row0vers.c # End Source File # Begin Source File +SOURCE=.\srv\srv0que.c +# End Source File +# Begin Source File + SOURCE=.\srv\srv0srv.c # End Source File # Begin Source File diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp index c315775443b..f382f36cb85 100644 --- a/VC++Files/libmysql/libmysql.dsp +++ b/VC++Files/libmysql/libmysql.dsp @@ -427,6 +427,10 @@ SOURCE=.\pack.c # End Source File # Begin Source File +SOURCE=.\my_time.c +# End Source File +# Begin Source File + SOURCE=.\password.c # End Source File # Begin Source File diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 8d4dac20b6c..820ca30509c 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -368,6 +368,10 @@ SOURCE="..\sql-common\pack.c" # End Source File # Begin Source File +SOURCE=..\sql-common\my_time.c +# End Source File +# Begin Source File + SOURCE=..\libmysql\password.c
# End Source File
# Begin Source File
@@ -564,6 +568,10 @@ SOURCE=..\sql\time.cpp # End Source File
# Begin Source File
+SOURCE=..\sql\tztime.cpp +# End Source File +# Begin Source File + SOURCE=..\sql\uniques.cpp
# End Source File
# Begin Source File
diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 3f6b591cbdb..7c599113b6e 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -1053,6 +1053,10 @@ SOURCE=.\pack.c # End Source File # Begin Source File +SOURCE=.\my_time.c +# End Source File +# Begin Source File + SOURCE=.\password.c !IF "$(CFG)" == "mysqld - Win32 Release" @@ -1816,6 +1820,10 @@ SOURCE=.\time.cpp # End Source File # Begin Source File +SOURCE=.\tztime.cpp +# End Source File +# Begin Source File + SOURCE=.\uniques.cpp # End Source File # Begin Source File diff --git a/acinclude.m4 b/acinclude.m4 index 30bb1549715..5e642c547c3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -777,14 +777,15 @@ AC_DEFUN(MYSQL_FIND_OPENSSL, [ ---) for d in /usr/ssl/include /usr/local/ssl/include /usr/include \ /usr/include/ssl /opt/ssl/include /opt/openssl/include \ -/usr/local/ssl/include /usr/local/include ; do +/usr/local/ssl/include /usr/local/include /usr/freeware/include ; do if test -f $d/openssl/ssl.h ; then OPENSSL_INCLUDE=-I$d fi done for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \ -/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib /usr/local/lib/ ; do +/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib \ +/usr/freeware/lib32 /usr/local/lib/ ; do if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl.dylib ; then OPENSSL_LIB=$d fi diff --git a/client/mysqldump.c b/client/mysqldump.c index 218a97c252e..dfac9ea0e7c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -55,6 +55,7 @@ #define EX_MYSQLERR 2 #define EX_CONSCHECK 3 #define EX_EOM 4 +#define EX_EOF 5 /* ferror for output file was got */ /* index into 'show fields from table' */ @@ -127,6 +128,9 @@ TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1, static struct my_option my_long_options[] = { + {"all", 'a', "Deprecated. Use --create-options instead.", + (gptr*) &create_options, (gptr*) &create_options, 0, GET_BOOL, NO_ARG, 1, + 0, 0, 0, 0, 0}, {"all-databases", 'A', "Dump all the databases. This will be same as --databases with all databases selected.", (gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, @@ -239,10 +243,10 @@ static struct my_option my_long_options[] = {"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-set-names", 'N', - "Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead", + "Deprecated. Use --skip-set-charset instead.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"set-charset", OPT_SET_CHARSET, - "'SET CHARACTER_SET_CLIENT=default_character_set' will be put in the output", + "Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.", (gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"set-variable", 'O', @@ -332,6 +336,23 @@ static const char *check_if_ignore_table(const char *table_name); #include <help_start.h> +/* + exit with message if ferror(file) + + SYNOPSIS + check_io() + file - checked file +*/ + +void check_io(FILE *file) +{ + if (ferror(file)) + { + fprintf(stderr, "%s: Got errno %d on write\n", my_progname, errno); + safe_exit(EX_EOF); + } +} + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, @@ -378,6 +399,7 @@ static void write_header(FILE *sql_file, char *db_name) { fputs("<?xml version=\"1.0\"?>\n", sql_file); fputs("<mysqldump>\n", sql_file); + check_io(sql_file); } else if (!opt_compact) { @@ -409,6 +431,7 @@ static void write_header(FILE *sql_file, char *db_name) "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s%s%s\" */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); + check_io(sql_file); } } /* write_header */ @@ -416,7 +439,10 @@ static void write_header(FILE *sql_file, char *db_name) static void write_footer(FILE *sql_file) { if (opt_xml) + { fputs("</mysqldump>\n", sql_file); + check_io(sql_file); + } else if (!opt_compact) { fprintf(sql_file,"\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n"); @@ -432,6 +458,7 @@ static void write_footer(FILE *sql_file) "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); fputs("\n", sql_file); + check_io(sql_file); } } /* write_footer */ @@ -725,6 +752,7 @@ static void unescape(FILE *file,char *pos,uint length) fputc('\'', file); fputs(tmp, file); fputc('\'', file); + check_io(file); my_free(tmp, MYF(MY_WME)); DBUG_VOID_RETURN; } /* unescape */ @@ -816,6 +844,7 @@ static void print_quoted_xml(FILE *xml_file, const char *str, ulong len) break; } } + check_io(xml_file); } @@ -849,6 +878,7 @@ static void print_xml_tag1(FILE * xml_file, const char* sbeg, print_quoted_xml(xml_file, sval, strlen(sval)); fputs("\">", xml_file); fputs(send, xml_file); + check_io(xml_file); } @@ -877,6 +907,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name, ulong *lengths= mysql_fetch_lengths(tableRes); fprintf(xml_file, "\t\t<%s", row_name); + check_io(xml_file); mysql_field_seek(tableRes, 0); for (i= 0; (field= mysql_fetch_field(tableRes)); i++) { @@ -887,9 +918,11 @@ static void print_xml_row(FILE *xml_file, const char *row_name, fputs("=\"", xml_file); print_quoted_xml(xml_file, (*row)[i], lengths[i]); fputc('"', xml_file); + check_io(xml_file); } } fputs(" />\n", xml_file); + check_io(xml_file); } /* @@ -956,14 +989,21 @@ static uint getTableStructure(char *table, char* db) write_header(sql_file, db); } if (!opt_xml && opt_comments) + { fprintf(sql_file, "\n--\n-- Table structure for table %s\n--\n\n", result_table); + check_io(sql_file); + } if (opt_drop) + { fprintf(sql_file, "DROP TABLE IF EXISTS %s;\n", opt_quoted_table); + check_io(sql_file); + } tableRes=mysql_store_result(sock); row=mysql_fetch_row(tableRes); fprintf(sql_file, "%s;\n", row[1]); + check_io(sql_file); mysql_free_result(tableRes); } sprintf(insert_pat,"show fields from %s", result_table); @@ -1043,6 +1083,7 @@ static uint getTableStructure(char *table, char* db) fprintf(sql_file, "CREATE TABLE %s (\n", result_table); else print_xml_tag1(sql_file, "\t", "table_structure name=", table, "\n"); + check_io(sql_file); } if (cFlag) sprintf(insert_pat, "INSERT %sINTO %s (", delayed, result_table); @@ -1060,7 +1101,10 @@ static uint getTableStructure(char *table, char* db) if (init) { if (!opt_xml && !tFlag) + { fputs(",\n",sql_file); + check_io(sql_file); + } if (cFlag) strpos=strmov(strpos,", "); } @@ -1092,6 +1136,7 @@ static uint getTableStructure(char *table, char* db) fputs(" NOT NULL", sql_file); if (row[SHOW_EXTRA][0]) fprintf(sql_file, " %s",row[SHOW_EXTRA]); + check_io(sql_file); } } numFields = (uint) mysql_num_rows(tableRes); @@ -1160,12 +1205,14 @@ static uint getTableStructure(char *table, char* db) fputs(quote_name(row[4], name_buff, 0), sql_file); if (row[7]) fprintf(sql_file, " (%s)",row[7]); /* Sub key */ + check_io(sql_file); } if (!opt_xml) { if (keynr) putc(')', sql_file); fputs("\n)",sql_file); + check_io(sql_file); } /* Get MySQL specific create options */ @@ -1204,6 +1251,7 @@ static uint getTableStructure(char *table, char* db) print_value(sql_file,tableRes,row,"","Create_options",0); print_value(sql_file,tableRes,row,"comment=","Comment",1); fputs(" */",sql_file); + check_io(sql_file); } } mysql_free_result(tableRes); /* Is always safe to free */ @@ -1212,6 +1260,7 @@ static uint getTableStructure(char *table, char* db) fputs(";\n", sql_file); else fputs("\t</table_structure>\n", sql_file); + check_io(sql_file); } } if (cFlag) @@ -1365,19 +1414,28 @@ static void dumpTable(uint numFields, char *table) else { if (!opt_xml && opt_comments) + { fprintf(md_result_file,"\n--\n-- Dumping data for table %s\n--\n", result_table); + check_io(md_result_file); + } sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s", result_table); if (where) { if (!opt_xml && opt_comments) + { fprintf(md_result_file,"-- WHERE: %s\n",where); + check_io(md_result_file); + } query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10)); strxmov(query, query_buf, " WHERE ", where, NullS); } if (!opt_xml && !opt_compact) + { fputs("\n", md_result_file); + check_io(md_result_file); + } if (mysql_query(sock, query)) { DBerror(sock, "when retrieving data from server"); @@ -1405,10 +1463,16 @@ static void dumpTable(uint numFields, char *table) } if (opt_disable_keys) + { fprintf(md_result_file, "\n/*!40000 ALTER TABLE %s DISABLE KEYS */;\n", opt_quoted_table); + check_io(md_result_file); + } if (opt_lock) + { fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table); + check_io(md_result_file); + } total_length= opt_net_buffer_length; /* Force row break */ row_break=0; @@ -1418,7 +1482,10 @@ static void dumpTable(uint numFields, char *table) print_xml_tag1(md_result_file, "\t", "table_data name=", table, "\n"); if (opt_autocommit) + { fprintf(md_result_file, "set autocommit=0;\n"); + check_io(md_result_file); + } while ((row=mysql_fetch_row(res))) { @@ -1426,11 +1493,17 @@ static void dumpTable(uint numFields, char *table) ulong *lengths=mysql_fetch_lengths(res); rownr++; if (!extended_insert && !opt_xml) + { fputs(insert_pat,md_result_file); + check_io(md_result_file); + } mysql_field_seek(res,0); if (opt_xml) + { fputs("\t<row>\n", md_result_file); + check_io(md_result_file); + } for (i = 0; i < mysql_num_fields(res); i++) { @@ -1503,7 +1576,10 @@ static void dumpTable(uint numFields, char *table) else { if (i && !opt_xml) + { fputc(',', md_result_file); + check_io(md_result_file); + } if (row[i]) { if (!IS_NUM_FIELD(field)) @@ -1544,11 +1620,17 @@ static void dumpTable(uint numFields, char *table) fputs(ptr, md_result_file); } } + else + fputs("NULL", md_result_file); + check_io(md_result_file); } } if (opt_xml) + { fputs("\t</row>\n", md_result_file); + check_io(md_result_file); + } if (extended_insert) { @@ -1571,9 +1653,13 @@ static void dumpTable(uint numFields, char *table) fputs(extended_row.str,md_result_file); total_length = row_length+init_length; } + check_io(md_result_file); } else if (!opt_xml) + { fputs(");\n", md_result_file); + check_io(md_result_file); + } } /* XML - close table tag and supress regular output */ @@ -1582,6 +1668,7 @@ static void dumpTable(uint numFields, char *table) else if (extended_insert && row_break) fputs(";\n", md_result_file); /* If not empty table */ fflush(md_result_file); + check_io(md_result_file); if (mysql_errno(sock)) { sprintf(query,"%s: Error %d: %s when dumping table %s at row: %ld\n", @@ -1595,12 +1682,21 @@ static void dumpTable(uint numFields, char *table) goto err; } if (opt_lock) + { fputs("UNLOCK TABLES;\n", md_result_file); + check_io(md_result_file); + } if (opt_disable_keys) + { fprintf(md_result_file,"/*!40000 ALTER TABLE %s ENABLE KEYS */;\n", opt_quoted_table); + check_io(md_result_file); + } if (opt_autocommit) + { fprintf(md_result_file, "commit;\n"); + check_io(md_result_file); + } mysql_free_result(res); if (query != query_buf) my_free(query, MYF(MY_ALLOW_ZERO_PTR)); @@ -1691,7 +1787,10 @@ static int init_dumping(char *database) char quoted_database_buf[64*2+3]; char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted); if (opt_comments) + { fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", qdatabase); + check_io(md_result_file); + } if (!opt_create_db) { char qbuf[256]; @@ -1718,6 +1817,7 @@ static int init_dumping(char *database) } } fprintf(md_result_file,"\nUSE %s;\n", qdatabase); + check_io(md_result_file); } } if (extended_insert && init_dynamic_string(&extended_row, "", 1024, 1024)) @@ -1764,7 +1864,10 @@ static int dump_all_tables_in_db(char *database) dumpTable(numrows,table); } if (opt_xml) + { fputs("</database>\n", md_result_file); + check_io(md_result_file); + } if (lock_tables) mysql_query(sock,"UNLOCK TABLES"); return 0; @@ -1810,7 +1913,10 @@ static int dump_selected_tables(char *db, char **table_names, int tables) dumpTable(numrows, *table_names); } if (opt_xml) + { fputs("</database>\n", md_result_file); + check_io(md_result_file); + } if (lock_tables) mysql_query(sock,"UNLOCK TABLES"); return 0; @@ -1879,6 +1985,7 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row, unescape(file,row[0],(uint) strlen(row[0])); else fputs(row[0], file); + check_io(file); return; } } @@ -2018,6 +2125,7 @@ int main(int argc, char **argv) fprintf(md_result_file, "CHANGE MASTER TO MASTER_LOG_FILE='%s', \ MASTER_LOG_POS=%s ;\n",row[0],row[1]); + check_io(md_result_file); } mysql_free_result(master); } diff --git a/client/mysqltest.c b/client/mysqltest.c index 88b7917612e..5ba4ad7336c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -224,7 +224,7 @@ Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG, Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG, Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER, Q_WAIT_FOR_SLAVE_TO_STOP, -Q_REQUIRE_VERSION, +Q_REQUIRE_VERSION, Q_REQUIRE_OS, Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS, Q_ENABLE_INFO, Q_DISABLE_INFO, Q_ENABLE_METADATA, Q_DISABLE_METADATA, @@ -298,6 +298,7 @@ const char *command_names[]= "require_manager", "wait_for_slave_to_stop", "require_version", + "require_os", "enable_warnings", "disable_warnings", "enable_info", @@ -853,6 +854,27 @@ int do_require_version(struct st_query* q) return 0; } +int do_require_os(struct st_query* q) +{ + char *p=q->first_argument, *os_arg; + DBUG_ENTER("do_require_os"); + + if (!*p) + die("Missing version argument in require_os\n"); + os_arg= p; + while (*p && !my_isspace(charset_info,*p)) + p++; + *p = 0; + + if (strcmp(os_arg, "unix")) + die("For now only testing of os=unix is implemented\n"); + +#if defined(__NETWARE__) || defined(__WIN__) || defined(__OS2__) + abort_not_supported_test(); +#endif + DBUG_RETURN(0); +} + int do_source(struct st_query* q) { char* p=q->first_argument, *name; @@ -2715,6 +2737,7 @@ int main(int argc, char **argv) case Q_SLEEP: do_sleep(q, 0); break; case Q_REAL_SLEEP: do_sleep(q, 1); break; case Q_REQUIRE_VERSION: do_require_version(q); break; + case Q_REQUIRE_OS: do_require_os(q); break; case Q_WAIT_FOR_SLAVE_TO_STOP: do_wait_for_slave_to_stop(q); break; case Q_REQUIRE_MANAGER: do_require_manager(q); break; #ifndef EMBEDDED_LIBRARY diff --git a/configure.in b/configure.in index 7810bf58fa7..62ef9751edd 100644 --- a/configure.in +++ b/configure.in @@ -2407,6 +2407,8 @@ do AC_DEFINE(USE_MB) AC_DEFINE(USE_MB_IDENT) ;; + binary) + ;; cp1250) AC_DEFINE(HAVE_CHARSET_cp1250) ;; @@ -2533,6 +2535,10 @@ case $default_charset in default_charset_default_collation="big5_chinese_ci" default_charset_collations="big5_chinese_ci big5_bin" ;; + binary) + default_charset_default_collation="binary" + default_charset_collations="binary" + ;; cp1250) default_charset_default_collation="cp1250_general_ci" default_charset_collations="cp1250_general_ci cp1250_czech_ci cp1250_bin" @@ -2770,12 +2776,14 @@ then if test X"$have_isam" != Xno then sql_server_dirs="$sql_server_dirs isam merge" + AC_CONFIG_FILES(isam/Makefile merge/Makefile) fi if test X"$have_berkeley_db" != Xno; then if test X"$have_berkeley_db" != Xyes; then # we must build berkeley db from source sql_server_dirs="$sql_server_dirs $have_berkeley_db" + AC_CONFIG_FILES(bdb/Makefile) echo "CONFIGURING FOR BERKELEY DB" bdb_conf_flags= @@ -3015,9 +3023,8 @@ fi AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS) # Output results -AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl +AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl strings/Makefile regex/Makefile heap/Makefile dnl - bdb/Makefile dnl myisam/Makefile myisammrg/Makefile dnl os2/Makefile os2/include/Makefile os2/include/sys/Makefile dnl man/Makefile BUILD/Makefile vio/Makefile dnl @@ -3025,7 +3032,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl libmysql/Makefile client/Makefile dnl pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl sql-common/Makefile SSL/Makefile dnl - merge/Makefile dbug/Makefile scripts/Makefile dnl + dbug/Makefile scripts/Makefile dnl include/Makefile sql-bench/Makefile tools/Makefile dnl tests/Makefile Docs/Makefile support-files/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl diff --git a/include/Makefile.am b/include/Makefile.am index 10e1b12a770..0c845900a4f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -22,7 +22,7 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \ errmsg.h my_global.h my_net.h my_alloc.h \ my_getopt.h sslopt-longopts.h my_dir.h typelib.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - sql_state.h $(BUILT_SOURCES) + sql_state.h mysql_time.h $(BUILT_SOURCES) noinst_HEADERS = config-win.h config-os2.h config-netware.h \ nisam.h heap.h merge.h my_bitmap.h\ myisam.h myisampack.h myisammrg.h ft_global.h\ @@ -30,7 +30,7 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_aes.h my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h \ - mysql_version.h.in my_handler.h + mysql_version.h.in my_handler.h my_time.h # mysql_version.h are generated SUPERCLEANFILES = mysql_version.h my_config.h diff --git a/include/my_base.h b/include/my_base.h index f912cb4278c..0ef66ef8123 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -377,7 +377,4 @@ typedef ulong ha_rows; #define MAX_FILE_SIZE LONGLONG_MAX #endif -/* Currently used for saying which interfaces a Storage Engine implements */ -#define HA_ERR_NOT_IMPLEMENTED -1 - #endif /* _my_base_h */ diff --git a/include/my_global.h b/include/my_global.h index 70b5b1af819..e8a00ddaa3a 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1076,13 +1076,14 @@ do { doubleget_union _tmp; \ #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) #define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\ - *((T)+1)=(char) ((byte *) &V)[5];\ - *((T)+2)=(char) ((byte *) &V)[6];\ - *((T)+3)=(char) ((byte *) &V)[7];\ - *((T)+4)=(char) ((byte *) &V)[0];\ - *((T)+5)=(char) ((byte *) &V)[1];\ - *((T)+6)=(char) ((byte *) &V)[2];\ - *((T)+7)=(char) ((byte *) &V)[3]; } while(0) + *(((char*)T)+1)=(char) ((byte *) &V)[5];\ + *(((char*)T)+2)=(char) ((byte *) &V)[6];\ + *(((char*)T)+3)=(char) ((byte *) &V)[7];\ + *(((char*)T)+4)=(char) ((byte *) &V)[0];\ + *(((char*)T)+5)=(char) ((byte *) &V)[1];\ + *(((char*)T)+6)=(char) ((byte *) &V)[2];\ + *(((char*)T)+7)=(char) ((byte *) &V)[3]; }\ + while(0) #define doubleget(V,M) do { double def_temp;\ ((byte*) &def_temp)[0]=(M)[4];\ ((byte*) &def_temp)[1]=(M)[5];\ @@ -1134,12 +1135,12 @@ do { doubleget_union _tmp; \ ((byte*) &def_temp)[3]=(M)[3];\ (V)=def_temp; } while(0) #define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ - *(T+1)=(char)(def_temp); \ - *(T+0)=(char)(def_temp >> 8); } while(0) -#define longstore(T,A) do { *((T)+3)=((A));\ - *((T)+2)=(((A) >> 8));\ - *((T)+1)=(((A) >> 16));\ - *((T)+0)=(((A) >> 24)); } while(0) + *(((char*)T)+1)=(char)(def_temp); \ + *(((char*)T)+0)=(char)(def_temp >> 8); } while(0) +#define longstore(T,A) do { *(((char*)T)+3)=((A));\ + *(((char*)T)+2)=(((A) >> 8));\ + *(((char*)T)+1)=(((A) >> 16));\ + *(((char*)T)+0)=(((A) >> 24)); } while(0) #define floatstore(T,V) memcpy_fixed((byte*)(T), (byte*)(&V), sizeof(float)) #define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) diff --git a/include/my_time.h b/include/my_time.h new file mode 100644 index 00000000000..e42f7e9e402 --- /dev/null +++ b/include/my_time.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + This is a private header of sql-common library, containing + declarations for my_time.c +*/ + +#ifndef _my_time_h_ +#define _my_time_h_ +#include "my_global.h" +#include "mysql_time.h" + +C_MODE_START + +extern ulonglong log_10_int[20]; + +#define YY_PART_YEAR 70 + +/* Flags to str_to_datetime */ +#define TIME_FUZZY_DATE 1 +#define TIME_DATETIME_ONLY 2 + +enum enum_mysql_timestamp_type +str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, + uint flags, int *was_cut); + +bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, + int *was_cut); + +C_MODE_END + +#endif /* _my_time_h_ */ diff --git a/include/myisam.h b/include/myisam.h index c99e9a30b08..02c56115dfd 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -47,7 +47,7 @@ extern "C" { #define MI_NAME_IEXT ".MYI" #define MI_NAME_DEXT ".MYD" /* Max extra space to use when sorting keys */ -#define MI_MAX_TEMP_LENGTH 256*1024L*1024L +#define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L /* Possible values for myisam_block_size (must be power of 2) */ #define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */ diff --git a/include/mysql.h b/include/mysql.h index 931995fb1ac..0f3fdc90548 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -55,6 +55,7 @@ typedef int my_socket; #endif /* _global_h */ #include "mysql_com.h" +#include "mysql_time.h" #include "mysql_version.h" #include "typelib.h" @@ -301,7 +302,6 @@ typedef struct st_mysql_res { #endif - typedef struct st_mysql_manager { NET net; @@ -322,7 +322,7 @@ typedef struct st_mysql_parameters unsigned long *p_net_buffer_length; } MYSQL_PARAMETERS; -#if !defined(MYSQL_CLIENT) && !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) +#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) #define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) #define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) #endif @@ -533,30 +533,13 @@ enum enum_mysql_stmt_state MYSQL_STMT_FETCH_DONE }; -/* - client TIME structure to handle TIME, DATE and TIMESTAMP directly in - binary protocol -*/ -enum mysql_st_timestamp_type { MYSQL_TIMESTAMP_NONE, MYSQL_TIMESTAMP_DATE, - MYSQL_TIMESTAMP_FULL, MYSQL_TIMESTAMP_TIME }; - -typedef struct mysql_st_time -{ - unsigned int year,month,day,hour,minute,second; - unsigned long second_part; - my_bool neg; - - enum mysql_st_timestamp_type time_type; - -} MYSQL_TIME; - /* bind structure */ typedef struct st_mysql_bind { unsigned long *length; /* output length pointer */ my_bool *is_null; /* Pointer to null indicators */ - char *buffer; /* buffer to get/put data */ + void *buffer; /* buffer to get/put data */ enum enum_field_types buffer_type; /* buffer type */ unsigned long buffer_length; /* buffer length, must be set for str/binary */ diff --git a/include/mysql_time.h b/include/mysql_time.h new file mode 100644 index 00000000000..943d018fc14 --- /dev/null +++ b/include/mysql_time.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 */ + +#ifndef _mysql_time_h_ +#define _mysql_time_h_ + +/* Time declarations shared between server and client library */ + +enum enum_mysql_timestamp_type +{ + MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, + MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 +}; + + +typedef struct st_mysql_time +{ + unsigned int year, month, day, hour, minute, second; + unsigned long second_part; + my_bool neg; + enum enum_mysql_timestamp_type time_type; +} MYSQL_TIME; + +#endif /* _mysql_time_h_ */ diff --git a/innobase/include/mach0data.h b/innobase/include/mach0data.h index f28c9422670..7ad760cd60f 100644 --- a/innobase/include/mach0data.h +++ b/innobase/include/mach0data.h @@ -89,7 +89,7 @@ mach_read_from_4( /* out: ulint integer */ byte* b); /* in: pointer to four bytes */ /************************************************************* -Writes a ulint in a compressed form. */ +Writes a ulint in a compressed form (1..5 bytes). */ UNIV_INLINE ulint mach_write_compressed( @@ -168,7 +168,7 @@ mach_read_from_8( /* out: dulint integer */ byte* b); /* in: pointer to 8 bytes */ /************************************************************* -Writes a dulint in a compressed form. */ +Writes a dulint in a compressed form (5..9 bytes). */ UNIV_INLINE ulint mach_dulint_write_compressed( @@ -193,7 +193,7 @@ mach_dulint_read_compressed( /* out: read dulint */ byte* b); /* in: pointer to memory from where to read */ /************************************************************* -Writes a dulint in a compressed form. */ +Writes a dulint in a compressed form (1..11 bytes). */ UNIV_INLINE ulint mach_dulint_write_much_compressed( diff --git a/innobase/include/mach0data.ic b/innobase/include/mach0data.ic index 3ccdcf1dc0a..3ffb9baa344 100644 --- a/innobase/include/mach0data.ic +++ b/innobase/include/mach0data.ic @@ -366,7 +366,7 @@ mach_read_from_6( } /************************************************************* -Writes a dulint in a compressed form. */ +Writes a dulint in a compressed form (5..9 bytes). */ UNIV_INLINE ulint mach_dulint_write_compressed( @@ -422,7 +422,7 @@ mach_dulint_read_compressed( } /************************************************************* -Writes a dulint in a compressed form. */ +Writes a dulint in a compressed form (1..11 bytes). */ UNIV_INLINE ulint mach_dulint_write_much_compressed( diff --git a/innobase/include/mtr0log.h b/innobase/include/mtr0log.h index f50c1dfcb6a..41be168a371 100644 --- a/innobase/include/mtr0log.h +++ b/innobase/include/mtr0log.h @@ -121,7 +121,9 @@ mlog_close( mtr_t* mtr, /* in: mtr */ byte* ptr); /* in: buffer space from ptr up was not used */ /************************************************************ -Writes the initial part of a log record. */ +Writes the initial part of a log record (3..11 bytes). +If the implementation of this function is changed, all +size parameters to mlog_open() should be adjusted accordingly! */ UNIV_INLINE byte* mlog_write_initial_log_record_fast( diff --git a/innobase/include/mtr0log.ic b/innobase/include/mtr0log.ic index c02e0a96a81..aa3f945c202 100644 --- a/innobase/include/mtr0log.ic +++ b/innobase/include/mtr0log.ic @@ -137,7 +137,9 @@ mlog_catenate_dulint_compressed( } /************************************************************ -Writes the initial part of a log record. */ +Writes the initial part of a log record (3..11 bytes). +If the implementation of this function is changed, all +size parameters to mlog_open() should be adjusted accordingly! */ UNIV_INLINE byte* mlog_write_initial_log_record_fast( diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h index 7d20455ffdf..8f402881224 100644 --- a/innobase/include/trx0sys.h +++ b/innobase/include/trx0sys.h @@ -32,6 +32,14 @@ or there was no master log position info inside InnoDB. */ extern char trx_sys_mysql_master_log_name[]; extern ib_longlong trx_sys_mysql_master_log_pos; +/* If this MySQL server uses binary logging, after InnoDB has been inited +and if it has done a crash recovery, we store the binlog file name and position +here. If .._pos is -1, it means there was no binlog position info inside +InnoDB. */ + +extern char trx_sys_mysql_bin_log_name[]; +extern ib_longlong trx_sys_mysql_bin_log_pos; + /* The transaction system */ extern trx_sys_t* trx_sys; diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c index f46984f6bb3..ea8c296f8cf 100644 --- a/innobase/mem/mem0dbg.c +++ b/innobase/mem/mem0dbg.c @@ -22,6 +22,7 @@ static ulint mem_n_allocations = 0; static ulint mem_total_allocated_memory = 0; ulint mem_current_allocated_memory = 0; static ulint mem_max_allocated_memory = 0; +static ulint mem_last_print_info = 0; /* Size of the hash table for memory management tracking */ #define MEM_HASH_SIZE 997 diff --git a/innobase/pars/lexyy.c b/innobase/pars/lexyy.c index d98d3c9b945..0112f618533 100644 --- a/innobase/pars/lexyy.c +++ b/innobase/pars/lexyy.c @@ -25,7 +25,6 @@ #ifdef __cplusplus #include <stdlib.h> -#include <unistd.h> /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -934,31 +933,54 @@ case 3: YY_RULE_SETUP #line 116 "pars0lex.l" { +/* Quoted character string literals are handled in an explicit +start state 'quoted'. This state is entered and the buffer for +the scanned string is emptied upon encountering a starting quote. + +In the state 'quoted', only two actions are possible (defined below). */ BEGIN(quoted); stringbuf_len = 0; } YY_BREAK case 4: YY_RULE_SETUP -#line 120 "pars0lex.l" -string_append(yytext, yyleng); +#line 125 "pars0lex.l" +{ + /* Got a sequence of characters other than "'": + append to string buffer */ + string_append(yytext, yyleng); +} YY_BREAK case 5: YY_RULE_SETUP -#line 121 "pars0lex.l" -{ string_append(yytext, yyleng / 2); +#line 130 "pars0lex.l" +{ + /* Got a sequence of "'" characters: + append half of them to string buffer, + as "''" represents a single "'". + We apply truncating division, + so that "'''" will result in "'". */ + + string_append(yytext, yyleng / 2); + + /* If we got an odd number of quotes, then the + last quote we got is the terminating quote. + At the end of the string, we return to the + initial start state and report the scanned + string literal. */ + if (yyleng % 2) { BEGIN(INITIAL); yylval = sym_tab_add_str_lit( pars_sym_tab_global, - stringbuf, stringbuf_len); + (byte*) stringbuf, stringbuf_len); return(PARS_STR_LIT); } } YY_BREAK case 6: YY_RULE_SETUP -#line 131 "pars0lex.l" +#line 154 "pars0lex.l" { yylval = sym_tab_add_null_lit(pars_sym_tab_global); @@ -967,521 +989,521 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 137 "pars0lex.l" +#line 160 "pars0lex.l" { /* Implicit cursor name */ yylval = sym_tab_add_str_lit(pars_sym_tab_global, - yytext, yyleng); + (byte*) yytext, yyleng); return(PARS_SQL_TOKEN); } YY_BREAK case 8: YY_RULE_SETUP -#line 144 "pars0lex.l" +#line 167 "pars0lex.l" { return(PARS_AND_TOKEN); } YY_BREAK case 9: YY_RULE_SETUP -#line 148 "pars0lex.l" +#line 171 "pars0lex.l" { return(PARS_OR_TOKEN); } YY_BREAK case 10: YY_RULE_SETUP -#line 152 "pars0lex.l" +#line 175 "pars0lex.l" { return(PARS_NOT_TOKEN); } YY_BREAK case 11: YY_RULE_SETUP -#line 156 "pars0lex.l" +#line 179 "pars0lex.l" { return(PARS_PROCEDURE_TOKEN); } YY_BREAK case 12: YY_RULE_SETUP -#line 160 "pars0lex.l" +#line 183 "pars0lex.l" { return(PARS_IN_TOKEN); } YY_BREAK case 13: YY_RULE_SETUP -#line 164 "pars0lex.l" +#line 187 "pars0lex.l" { return(PARS_OUT_TOKEN); } YY_BREAK case 14: YY_RULE_SETUP -#line 168 "pars0lex.l" +#line 191 "pars0lex.l" { return(PARS_INT_TOKEN); } YY_BREAK case 15: YY_RULE_SETUP -#line 172 "pars0lex.l" +#line 195 "pars0lex.l" { return(PARS_INT_TOKEN); } YY_BREAK case 16: YY_RULE_SETUP -#line 176 "pars0lex.l" +#line 199 "pars0lex.l" { return(PARS_FLOAT_TOKEN); } YY_BREAK case 17: YY_RULE_SETUP -#line 180 "pars0lex.l" +#line 203 "pars0lex.l" { return(PARS_CHAR_TOKEN); } YY_BREAK case 18: YY_RULE_SETUP -#line 184 "pars0lex.l" +#line 207 "pars0lex.l" { return(PARS_IS_TOKEN); } YY_BREAK case 19: YY_RULE_SETUP -#line 188 "pars0lex.l" +#line 211 "pars0lex.l" { return(PARS_BEGIN_TOKEN); } YY_BREAK case 20: YY_RULE_SETUP -#line 192 "pars0lex.l" +#line 215 "pars0lex.l" { return(PARS_END_TOKEN); } YY_BREAK case 21: YY_RULE_SETUP -#line 196 "pars0lex.l" +#line 219 "pars0lex.l" { return(PARS_IF_TOKEN); } YY_BREAK case 22: YY_RULE_SETUP -#line 200 "pars0lex.l" +#line 223 "pars0lex.l" { return(PARS_THEN_TOKEN); } YY_BREAK case 23: YY_RULE_SETUP -#line 204 "pars0lex.l" +#line 227 "pars0lex.l" { return(PARS_ELSE_TOKEN); } YY_BREAK case 24: YY_RULE_SETUP -#line 208 "pars0lex.l" +#line 231 "pars0lex.l" { return(PARS_ELSIF_TOKEN); } YY_BREAK case 25: YY_RULE_SETUP -#line 212 "pars0lex.l" +#line 235 "pars0lex.l" { return(PARS_LOOP_TOKEN); } YY_BREAK case 26: YY_RULE_SETUP -#line 216 "pars0lex.l" +#line 239 "pars0lex.l" { return(PARS_WHILE_TOKEN); } YY_BREAK case 27: YY_RULE_SETUP -#line 220 "pars0lex.l" +#line 243 "pars0lex.l" { return(PARS_RETURN_TOKEN); } YY_BREAK case 28: YY_RULE_SETUP -#line 224 "pars0lex.l" +#line 247 "pars0lex.l" { return(PARS_SELECT_TOKEN); } YY_BREAK case 29: YY_RULE_SETUP -#line 228 "pars0lex.l" +#line 251 "pars0lex.l" { return(PARS_SUM_TOKEN); } YY_BREAK case 30: YY_RULE_SETUP -#line 232 "pars0lex.l" +#line 255 "pars0lex.l" { return(PARS_COUNT_TOKEN); } YY_BREAK case 31: YY_RULE_SETUP -#line 236 "pars0lex.l" +#line 259 "pars0lex.l" { return(PARS_DISTINCT_TOKEN); } YY_BREAK case 32: YY_RULE_SETUP -#line 240 "pars0lex.l" +#line 263 "pars0lex.l" { return(PARS_FROM_TOKEN); } YY_BREAK case 33: YY_RULE_SETUP -#line 244 "pars0lex.l" +#line 267 "pars0lex.l" { return(PARS_WHERE_TOKEN); } YY_BREAK case 34: YY_RULE_SETUP -#line 248 "pars0lex.l" +#line 271 "pars0lex.l" { return(PARS_FOR_TOKEN); } YY_BREAK case 35: YY_RULE_SETUP -#line 252 "pars0lex.l" +#line 275 "pars0lex.l" { return(PARS_CONSISTENT_TOKEN); } YY_BREAK case 36: YY_RULE_SETUP -#line 256 "pars0lex.l" +#line 279 "pars0lex.l" { return(PARS_READ_TOKEN); } YY_BREAK case 37: YY_RULE_SETUP -#line 260 "pars0lex.l" +#line 283 "pars0lex.l" { return(PARS_ORDER_TOKEN); } YY_BREAK case 38: YY_RULE_SETUP -#line 264 "pars0lex.l" +#line 287 "pars0lex.l" { return(PARS_BY_TOKEN); } YY_BREAK case 39: YY_RULE_SETUP -#line 268 "pars0lex.l" +#line 291 "pars0lex.l" { return(PARS_ASC_TOKEN); } YY_BREAK case 40: YY_RULE_SETUP -#line 272 "pars0lex.l" +#line 295 "pars0lex.l" { return(PARS_DESC_TOKEN); } YY_BREAK case 41: YY_RULE_SETUP -#line 276 "pars0lex.l" +#line 299 "pars0lex.l" { return(PARS_INSERT_TOKEN); } YY_BREAK case 42: YY_RULE_SETUP -#line 280 "pars0lex.l" +#line 303 "pars0lex.l" { return(PARS_INTO_TOKEN); } YY_BREAK case 43: YY_RULE_SETUP -#line 284 "pars0lex.l" +#line 307 "pars0lex.l" { return(PARS_VALUES_TOKEN); } YY_BREAK case 44: YY_RULE_SETUP -#line 288 "pars0lex.l" +#line 311 "pars0lex.l" { return(PARS_UPDATE_TOKEN); } YY_BREAK case 45: YY_RULE_SETUP -#line 292 "pars0lex.l" +#line 315 "pars0lex.l" { return(PARS_SET_TOKEN); } YY_BREAK case 46: YY_RULE_SETUP -#line 296 "pars0lex.l" +#line 319 "pars0lex.l" { return(PARS_DELETE_TOKEN); } YY_BREAK case 47: YY_RULE_SETUP -#line 300 "pars0lex.l" +#line 323 "pars0lex.l" { return(PARS_CURRENT_TOKEN); } YY_BREAK case 48: YY_RULE_SETUP -#line 304 "pars0lex.l" +#line 327 "pars0lex.l" { return(PARS_OF_TOKEN); } YY_BREAK case 49: YY_RULE_SETUP -#line 308 "pars0lex.l" +#line 331 "pars0lex.l" { return(PARS_CREATE_TOKEN); } YY_BREAK case 50: YY_RULE_SETUP -#line 312 "pars0lex.l" +#line 335 "pars0lex.l" { return(PARS_TABLE_TOKEN); } YY_BREAK case 51: YY_RULE_SETUP -#line 316 "pars0lex.l" +#line 339 "pars0lex.l" { return(PARS_INDEX_TOKEN); } YY_BREAK case 52: YY_RULE_SETUP -#line 320 "pars0lex.l" +#line 343 "pars0lex.l" { return(PARS_UNIQUE_TOKEN); } YY_BREAK case 53: YY_RULE_SETUP -#line 324 "pars0lex.l" +#line 347 "pars0lex.l" { return(PARS_CLUSTERED_TOKEN); } YY_BREAK case 54: YY_RULE_SETUP -#line 328 "pars0lex.l" +#line 351 "pars0lex.l" { return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN); } YY_BREAK case 55: YY_RULE_SETUP -#line 332 "pars0lex.l" +#line 355 "pars0lex.l" { return(PARS_ON_TOKEN); } YY_BREAK case 56: YY_RULE_SETUP -#line 336 "pars0lex.l" +#line 359 "pars0lex.l" { return(PARS_DECLARE_TOKEN); } YY_BREAK case 57: YY_RULE_SETUP -#line 340 "pars0lex.l" +#line 363 "pars0lex.l" { return(PARS_CURSOR_TOKEN); } YY_BREAK case 58: YY_RULE_SETUP -#line 344 "pars0lex.l" +#line 367 "pars0lex.l" { return(PARS_OPEN_TOKEN); } YY_BREAK case 59: YY_RULE_SETUP -#line 348 "pars0lex.l" +#line 371 "pars0lex.l" { return(PARS_FETCH_TOKEN); } YY_BREAK case 60: YY_RULE_SETUP -#line 352 "pars0lex.l" +#line 375 "pars0lex.l" { return(PARS_CLOSE_TOKEN); } YY_BREAK case 61: YY_RULE_SETUP -#line 356 "pars0lex.l" +#line 379 "pars0lex.l" { return(PARS_NOTFOUND_TOKEN); } YY_BREAK case 62: YY_RULE_SETUP -#line 360 "pars0lex.l" +#line 383 "pars0lex.l" { return(PARS_TO_CHAR_TOKEN); } YY_BREAK case 63: YY_RULE_SETUP -#line 364 "pars0lex.l" +#line 387 "pars0lex.l" { return(PARS_TO_NUMBER_TOKEN); } YY_BREAK case 64: YY_RULE_SETUP -#line 368 "pars0lex.l" +#line 391 "pars0lex.l" { return(PARS_TO_BINARY_TOKEN); } YY_BREAK case 65: YY_RULE_SETUP -#line 372 "pars0lex.l" +#line 395 "pars0lex.l" { return(PARS_BINARY_TO_NUMBER_TOKEN); } YY_BREAK case 66: YY_RULE_SETUP -#line 376 "pars0lex.l" +#line 399 "pars0lex.l" { return(PARS_SUBSTR_TOKEN); } YY_BREAK case 67: YY_RULE_SETUP -#line 380 "pars0lex.l" +#line 403 "pars0lex.l" { return(PARS_REPLSTR_TOKEN); } YY_BREAK case 68: YY_RULE_SETUP -#line 384 "pars0lex.l" +#line 407 "pars0lex.l" { return(PARS_CONCAT_TOKEN); } YY_BREAK case 69: YY_RULE_SETUP -#line 388 "pars0lex.l" +#line 411 "pars0lex.l" { return(PARS_INSTR_TOKEN); } YY_BREAK case 70: YY_RULE_SETUP -#line 392 "pars0lex.l" +#line 415 "pars0lex.l" { return(PARS_LENGTH_TOKEN); } YY_BREAK case 71: YY_RULE_SETUP -#line 396 "pars0lex.l" +#line 419 "pars0lex.l" { return(PARS_SYSDATE_TOKEN); } YY_BREAK case 72: YY_RULE_SETUP -#line 400 "pars0lex.l" +#line 423 "pars0lex.l" { return(PARS_PRINTF_TOKEN); } YY_BREAK case 73: YY_RULE_SETUP -#line 404 "pars0lex.l" +#line 427 "pars0lex.l" { return(PARS_ASSERT_TOKEN); } YY_BREAK case 74: YY_RULE_SETUP -#line 408 "pars0lex.l" +#line 431 "pars0lex.l" { return(PARS_RND_TOKEN); } YY_BREAK case 75: YY_RULE_SETUP -#line 412 "pars0lex.l" +#line 435 "pars0lex.l" { return(PARS_RND_STR_TOKEN); } YY_BREAK case 76: YY_RULE_SETUP -#line 416 "pars0lex.l" +#line 439 "pars0lex.l" { return(PARS_ROW_PRINTF_TOKEN); } YY_BREAK case 77: YY_RULE_SETUP -#line 420 "pars0lex.l" +#line 443 "pars0lex.l" { return(PARS_COMMIT_TOKEN); } YY_BREAK case 78: YY_RULE_SETUP -#line 424 "pars0lex.l" +#line 447 "pars0lex.l" { return(PARS_ROLLBACK_TOKEN); } YY_BREAK case 79: YY_RULE_SETUP -#line 428 "pars0lex.l" +#line 451 "pars0lex.l" { return(PARS_WORK_TOKEN); } YY_BREAK case 80: YY_RULE_SETUP -#line 432 "pars0lex.l" +#line 455 "pars0lex.l" { yylval = sym_tab_add_id(pars_sym_tab_global, (byte*)yytext, @@ -1491,42 +1513,42 @@ YY_RULE_SETUP YY_BREAK case 81: YY_RULE_SETUP -#line 439 "pars0lex.l" +#line 462 "pars0lex.l" { return(PARS_DDOT_TOKEN); } YY_BREAK case 82: YY_RULE_SETUP -#line 443 "pars0lex.l" +#line 466 "pars0lex.l" { return(PARS_ASSIGN_TOKEN); } YY_BREAK case 83: YY_RULE_SETUP -#line 447 "pars0lex.l" +#line 470 "pars0lex.l" { return(PARS_LE_TOKEN); } YY_BREAK case 84: YY_RULE_SETUP -#line 451 "pars0lex.l" +#line 474 "pars0lex.l" { return(PARS_GE_TOKEN); } YY_BREAK case 85: YY_RULE_SETUP -#line 455 "pars0lex.l" +#line 478 "pars0lex.l" { return(PARS_NE_TOKEN); } YY_BREAK case 86: YY_RULE_SETUP -#line 459 "pars0lex.l" +#line 482 "pars0lex.l" { return((int)(*yytext)); @@ -1534,7 +1556,7 @@ YY_RULE_SETUP YY_BREAK case 87: YY_RULE_SETUP -#line 464 "pars0lex.l" +#line 487 "pars0lex.l" { return((int)(*yytext)); @@ -1542,7 +1564,7 @@ YY_RULE_SETUP YY_BREAK case 88: YY_RULE_SETUP -#line 469 "pars0lex.l" +#line 492 "pars0lex.l" { return((int)(*yytext)); @@ -1550,7 +1572,7 @@ YY_RULE_SETUP YY_BREAK case 89: YY_RULE_SETUP -#line 474 "pars0lex.l" +#line 497 "pars0lex.l" { return((int)(*yytext)); @@ -1558,7 +1580,7 @@ YY_RULE_SETUP YY_BREAK case 90: YY_RULE_SETUP -#line 479 "pars0lex.l" +#line 502 "pars0lex.l" { return((int)(*yytext)); @@ -1566,7 +1588,7 @@ YY_RULE_SETUP YY_BREAK case 91: YY_RULE_SETUP -#line 484 "pars0lex.l" +#line 507 "pars0lex.l" { return((int)(*yytext)); @@ -1574,7 +1596,7 @@ YY_RULE_SETUP YY_BREAK case 92: YY_RULE_SETUP -#line 489 "pars0lex.l" +#line 512 "pars0lex.l" { return((int)(*yytext)); @@ -1582,7 +1604,7 @@ YY_RULE_SETUP YY_BREAK case 93: YY_RULE_SETUP -#line 494 "pars0lex.l" +#line 517 "pars0lex.l" { return((int)(*yytext)); @@ -1590,7 +1612,7 @@ YY_RULE_SETUP YY_BREAK case 94: YY_RULE_SETUP -#line 499 "pars0lex.l" +#line 522 "pars0lex.l" { return((int)(*yytext)); @@ -1598,7 +1620,7 @@ YY_RULE_SETUP YY_BREAK case 95: YY_RULE_SETUP -#line 504 "pars0lex.l" +#line 527 "pars0lex.l" { return((int)(*yytext)); @@ -1606,7 +1628,7 @@ YY_RULE_SETUP YY_BREAK case 96: YY_RULE_SETUP -#line 509 "pars0lex.l" +#line 532 "pars0lex.l" { return((int)(*yytext)); @@ -1614,7 +1636,7 @@ YY_RULE_SETUP YY_BREAK case 97: YY_RULE_SETUP -#line 514 "pars0lex.l" +#line 537 "pars0lex.l" { return((int)(*yytext)); @@ -1622,7 +1644,7 @@ YY_RULE_SETUP YY_BREAK case 98: YY_RULE_SETUP -#line 519 "pars0lex.l" +#line 542 "pars0lex.l" { return((int)(*yytext)); @@ -1630,7 +1652,7 @@ YY_RULE_SETUP YY_BREAK case 99: YY_RULE_SETUP -#line 524 "pars0lex.l" +#line 547 "pars0lex.l" { return((int)(*yytext)); @@ -1638,7 +1660,7 @@ YY_RULE_SETUP YY_BREAK case 100: YY_RULE_SETUP -#line 529 "pars0lex.l" +#line 552 "pars0lex.l" { return((int)(*yytext)); @@ -1646,32 +1668,32 @@ YY_RULE_SETUP YY_BREAK case 101: YY_RULE_SETUP -#line 534 "pars0lex.l" +#line 557 "pars0lex.l" BEGIN(comment); /* eat up comment */ YY_BREAK case 102: YY_RULE_SETUP -#line 536 "pars0lex.l" +#line 559 "pars0lex.l" YY_BREAK case 103: YY_RULE_SETUP -#line 537 "pars0lex.l" +#line 560 "pars0lex.l" YY_BREAK case 104: YY_RULE_SETUP -#line 538 "pars0lex.l" +#line 561 "pars0lex.l" BEGIN(INITIAL); YY_BREAK case 105: YY_RULE_SETUP -#line 540 "pars0lex.l" +#line 563 "pars0lex.l" /* eat up whitespace */ YY_BREAK case 106: YY_RULE_SETUP -#line 543 "pars0lex.l" +#line 566 "pars0lex.l" { fprintf(stderr,"Unrecognized character: %02x\n", *yytext); @@ -1683,10 +1705,10 @@ YY_RULE_SETUP YY_BREAK case 107: YY_RULE_SETUP -#line 552 "pars0lex.l" +#line 575 "pars0lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1687 "lex.yy.c" +#line 1710 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): case YY_STATE_EOF(quoted): @@ -2574,5 +2596,5 @@ int main() return 0; } #endif -#line 552 "pars0lex.l" +#line 575 "pars0lex.l" diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l index 4e2399613cb..811057d48a1 100644 --- a/innobase/pars/pars0lex.l +++ b/innobase/pars/pars0lex.l @@ -114,11 +114,34 @@ ID [a-z_A-Z][a-z_A-Z0-9]* } "'" { +/* Quoted character string literals are handled in an explicit +start state 'quoted'. This state is entered and the buffer for +the scanned string is emptied upon encountering a starting quote. + +In the state 'quoted', only two actions are possible (defined below). */ BEGIN(quoted); stringbuf_len = 0; } -<quoted>[^\']+ string_append(yytext, yyleng); -<quoted>"'"+ { string_append(yytext, yyleng / 2); +<quoted>[^\']+ { + /* Got a sequence of characters other than "'": + append to string buffer */ + string_append(yytext, yyleng); +} +<quoted>"'"+ { + /* Got a sequence of "'" characters: + append half of them to string buffer, + as "''" represents a single "'". + We apply truncating division, + so that "'''" will result in "'". */ + + string_append(yytext, yyleng / 2); + + /* If we got an odd number of quotes, then the + last quote we got is the terminating quote. + At the end of the string, we return to the + initial start state and report the scanned + string literal. */ + if (yyleng % 2) { BEGIN(INITIAL); yylval = sym_tab_add_str_lit( diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index 5c8ae0952ef..54bd5be01a1 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -45,6 +45,15 @@ or there was no master log position info inside InnoDB. */ char trx_sys_mysql_master_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN]; ib_longlong trx_sys_mysql_master_log_pos = -1; +/* If this MySQL server uses binary logging, after InnoDB has been inited +and if it has done a crash recovery, we store the binlog file name and position +here. If .._pos is -1, it means there was no binlog position info inside +InnoDB. */ + +char trx_sys_mysql_bin_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN]; +ib_longlong trx_sys_mysql_bin_log_pos = -1; + + /******************************************************************** Determines if a page number is located inside the doublewrite buffer. */ @@ -648,8 +657,8 @@ trx_sys_print_mysql_binlog_offset_from_page( } /********************************************************************* -Prints to stderr the MySQL binlog offset info in the trx system header if -the magic number shows it valid. */ +Stores the MySQL binlog offset info in the trx system header if +the magic number shows it valid, and print the info to stderr */ void trx_sys_print_mysql_binlog_offset(void) @@ -657,7 +666,8 @@ trx_sys_print_mysql_binlog_offset(void) { trx_sysf_t* sys_header; mtr_t mtr; - + ulong trx_sys_mysql_bin_log_pos_high, trx_sys_mysql_bin_log_pos_low; + mtr_start(&mtr); sys_header = trx_sysf_get(&mtr); @@ -671,14 +681,22 @@ trx_sys_print_mysql_binlog_offset(void) return; } - fprintf(stderr, - "InnoDB: Last MySQL binlog file position %lu %lu, file name %s\n", - (ulong) mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_HIGH), - (ulong) mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_LOW), - sys_header + TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME); + trx_sys_mysql_bin_log_pos_high = mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_OFFSET_HIGH); + trx_sys_mysql_bin_log_pos_low = mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_OFFSET_LOW); + + trx_sys_mysql_bin_log_pos = (((ib_longlong)trx_sys_mysql_bin_log_pos_high) << 32) + + (ib_longlong)trx_sys_mysql_bin_log_pos_low; + + ut_memcpy(trx_sys_mysql_bin_log_name, sys_header + TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_NAME, TRX_SYS_MYSQL_LOG_NAME_LEN); + fprintf(stderr, + "InnoDB: Last MySQL binlog file position %lu %lu, file name %s\n", + trx_sys_mysql_bin_log_pos_high, trx_sys_mysql_bin_log_pos_low, + trx_sys_mysql_bin_log_name); + mtr_commit(&mtr); } diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index 883ea2b5932..b073155f02b 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -65,7 +65,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ my_pread.lo mf_cache.lo md5.lo sha1.lo\ my_getopt.lo my_gethostbyname.lo my_port.lo sqlobjects = net.lo -sql_cmn_objects = pack.lo client.lo +sql_cmn_objects = pack.lo client.lo my_time.lo # Not needed in the minimum library mysysobjects2 = my_lib.lo diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index d29a7deb69e..fd0c5024f8c 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -16,6 +16,7 @@ #include <my_global.h> #include <my_sys.h> +#include <my_time.h> #include <mysys_err.h> #include <m_string.h> #include <m_ctype.h> @@ -58,6 +59,9 @@ #include <sql_common.h> #include "client_settings.h" +#undef net_buffer_length +#undef max_allowed_packet + ulong net_buffer_length=8192; ulong max_allowed_packet= 1024L*1024L*1024L; ulong net_read_timeout= CLIENT_NET_READ_TIMEOUT; @@ -2199,7 +2203,7 @@ static void store_param_type(char **pos, MYSQL_BIND *param) static void store_param_tinyint(NET *net, MYSQL_BIND *param) { - *(net->write_pos++)= (uchar) *param->buffer; + *(net->write_pos++)= *(uchar *) param->buffer; } static void store_param_short(NET *net, MYSQL_BIND *param) @@ -3008,33 +3012,33 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, /******************************************************************** - Fetch-bind related implementations + Fetch and conversion of result set rows (binary protocol). *********************************************************************/ -/**************************************************************************** - Functions to fetch data to application buffers - - All functions have the following characteristics: - - SYNOPSIS - fetch_result_xxx() - param MySQL bind param - row Row value - - RETURN VALUES - 0 ok - 1 Error (Can't alloc net->buffer) -****************************************************************************/ - static void set_zero_time(MYSQL_TIME *tm) { - tm->year= tm->month= tm->day= 0; - tm->hour= tm->minute= tm->second= 0; - tm->second_part= 0; - tm->neg= (bool)0; + bzero((void *)tm, sizeof(*tm)); } -/* Read TIME from binary packet and return it to MYSQL_TIME */ + +/* + Read date, (time, datetime) value from network buffer and store it + in MYSQL_TIME structure. + + SYNOPSIS + read_binary_{date,time,datetime}() + tm MYSQL_TIME structure to fill + pos pointer to current position in network buffer. + These functions increase pos to point to the beginning of this + field (this is just due to implementation of net_field_length + which is used to get length of binary representation of + time value). + + Auxiliary functions to read time (date, datetime) values from network + buffer and store in MYSQL_TIME structure. Jointly used by conversion + and no-conversion fetching. +*/ + static uint read_binary_time(MYSQL_TIME *tm, uchar **pos) { uchar *to; @@ -3060,7 +3064,6 @@ static uint read_binary_time(MYSQL_TIME *tm, uchar **pos) return length; } -/* Read DATETIME from binary packet and return it to MYSQL_TIME */ static uint read_binary_datetime(MYSQL_TIME *tm, uchar **pos) { uchar *to; @@ -3091,7 +3094,6 @@ static uint read_binary_datetime(MYSQL_TIME *tm, uchar **pos) return length; } -/* Read DATE from binary packet and return it to MYSQL_TIME */ static uint read_binary_date(MYSQL_TIME *tm, uchar **pos) { uchar *to; @@ -3115,18 +3117,19 @@ static uint read_binary_date(MYSQL_TIME *tm, uchar **pos) } -/* Convert Numeric to buffer types */ +/* Convert integer value to client buffer type. */ + static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field, longlong value) { - char *buffer= param->buffer; + char *buffer= (char *)param->buffer; uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); switch (param->buffer_type) { case MYSQL_TYPE_NULL: /* do nothing */ break; case MYSQL_TYPE_TINY: - *param->buffer= (uchar) value; + *(uchar *)param->buffer= (uchar) value; break; case MYSQL_TYPE_SHORT: shortstore(buffer, value); @@ -3175,7 +3178,7 @@ static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field, static void send_data_double(MYSQL_BIND *param, double value) { - char *buffer= param->buffer; + char *buffer= (char *)param->buffer; switch(param->buffer_type) { case MYSQL_TYPE_NULL: /* do nothing */ @@ -3228,7 +3231,7 @@ static void send_data_double(MYSQL_BIND *param, double value) static void send_data_str(MYSQL_BIND *param, char *value, uint length) { - char *buffer= param->buffer; + char *buffer= (char *)param->buffer; int err=0; switch(param->buffer_type) { @@ -3273,6 +3276,21 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length) doublestore(buffer, data); break; } + case MYSQL_TYPE_TIME: + { + int dummy; + MYSQL_TIME *tm= (MYSQL_TIME *)buffer; + str_to_time(value, length, tm, &dummy); + break; + } + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_DATETIME: + { + int dummy; + MYSQL_TIME *tm= (MYSQL_TIME *)buffer; + str_to_datetime(value, length, tm, 0, &dummy); + break; + } case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_LONG_BLOB: @@ -3332,7 +3350,7 @@ static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime, length= my_sprintf(buff,(buff, "%04d-%02d-%02d", ltime.year, ltime.month,ltime.day)); break; - case MYSQL_TIMESTAMP_FULL: + case MYSQL_TIMESTAMP_DATETIME: length= my_sprintf(buff,(buff, "%04d-%02d-%02d %02d:%02d:%02d", ltime.year,ltime.month,ltime.day, ltime.hour,ltime.minute,ltime.second)); @@ -3351,7 +3369,7 @@ static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime, } -/* Fetch data to buffers */ +/* Fetch data to client buffers with conversion. */ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) { @@ -3437,7 +3455,7 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) MYSQL_TIME tm; length= read_binary_datetime(&tm, row); - tm.time_type= MYSQL_TIMESTAMP_FULL; + tm.time_type= MYSQL_TIMESTAMP_DATETIME; send_data_time(param, tm, length); break; } @@ -3450,9 +3468,28 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) } +/* + Functions to fetch data to application buffers without conversion. + + All functions have the following characteristics: + + SYNOPSIS + fetch_result_xxx() + param MySQL bind param + pos Row value + + DESCRIPTION + These are no-conversion functions, used in binary protocol to store + rows in application buffers. A function used only if type of binary data + is compatible with type of application buffer. + + RETURN + none +*/ + static void fetch_result_tinyint(MYSQL_BIND *param, uchar **row) { - *param->buffer= **row; + *(uchar *)param->buffer= **row; (*row)++; } @@ -3527,7 +3564,7 @@ static void fetch_result_str(MYSQL_BIND *param, uchar **row) memcpy(param->buffer, (char *)*row, copy_length); /* Add an end null if there is room in the buffer */ if (copy_length != param->buffer_length) - *(param->buffer+copy_length)= '\0'; + ((uchar *)param->buffer)[copy_length]= '\0'; *param->length= length; /* return total length */ *row+= length; } diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 58e11e4f297..a0825a6a4fd 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -33,7 +33,8 @@ noinst_LIBRARIES = libmysqld_int.a pkglib_LIBRARIES = libmysqld.a SUBDIRS = . examples libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc -libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c +libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ + my_time.c noinst_HEADERS = embedded_priv.h emb_qcache.h diff --git a/man/mysqlaccess.1.in b/man/mysqlaccess.1.in index 9a5e58541d2..cf2e0658a1c 100644 --- a/man/mysqlaccess.1.in +++ b/man/mysqlaccess.1.in @@ -1,7 +1,6 @@ .TH mysqlaccess 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" .SH NAME -.BR mysqlaccess - \- Create new users to mysql. +.BR mysqlaccess \- Create new users to mysql. .SH USAGE mysqlaccess [host [user [db]]] OPTIONS .SH SYNOPSIS diff --git a/man/mysqldump.1.in b/man/mysqldump.1.in index 34d83dbe0b3..6d1cc80c837 100644 --- a/man/mysqldump.1.in +++ b/man/mysqldump.1.in @@ -1,6 +1,6 @@ .TH mysqldump 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database" .SH NAME -mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data. +mysqldump \- text\-based client for dumping or backing up mysql databases, tables and or data. .SH USAGE .BR "mysqldump [\fP\fIOPTIONS\fP] database [\fP\fItables\fP]" diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c index c19f2582b9c..3e8ff9db009 100644 --- a/myisam/mi_delete.c +++ b/myisam/mi_delete.c @@ -265,6 +265,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, { keyinfo=&info->s->ft2_keyinfo; kpos-=keyinfo->keylength+nod_flag; /* we'll modify key entry 'in vivo' */ + get_key_full_length_rdonly(off, key); key+=off; ret_value=_mi_ck_real_delete(info, &info->s->ft2_keyinfo, key, HA_FT_WLEN, &root); diff --git a/myisam/mi_static.c b/myisam/mi_static.c index f7d008ffbb7..f41aeff8453 100644 --- a/myisam/mi_static.c +++ b/myisam/mi_static.c @@ -38,7 +38,7 @@ my_bool myisam_concurrent_insert=1; #else my_bool myisam_concurrent_insert=0; #endif -my_off_t myisam_max_extra_temp_length= MI_MAX_TEMP_LENGTH; +my_off_t myisam_max_extra_temp_length= (my_off_t)MI_MAX_TEMP_LENGTH; my_off_t myisam_max_temp_length= MAX_FILE_SIZE; ulong myisam_bulk_insert_tree_size=8192*1024; ulong myisam_data_pointer_size=4; diff --git a/myisammrg/myrg_write.c b/myisammrg/myrg_write.c index 0f191edc23c..532709e361d 100644 --- a/myisammrg/myrg_write.c +++ b/myisammrg/myrg_write.c @@ -22,9 +22,9 @@ int myrg_write(register MYRG_INFO *info, byte *rec) { /* [phi] MERGE_WRITE_DISABLED is handled by the else case */ if (info->merge_insert_method == MERGE_INSERT_TO_FIRST) - return mi_write(info->open_tables[0].table,rec); + return mi_write((info->current_table=info->open_tables)->table,rec); else if (info->merge_insert_method == MERGE_INSERT_TO_LAST) - return mi_write(info->end_table[-1].table,rec); + return mi_write((info->current_table=info->end_table-1)->table,rec); else /* unsupported insertion method */ return (my_errno= HA_ERR_WRONG_COMMAND); } diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 6ec8c293a9c..e10c0739cb4 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -19,6 +19,13 @@ if HAVE_NDBCLUSTER_DB SUBDIRS = ndb +DIST_SUBDIRS=ndb +else +# If one uses automake conditionals, automake will automatically +# include all possible branches to DIST_SUBDIRS goal. +# Reset DIST_SUBDIRS if we don't use NDB +SUBDIRS= +DIST_SUBDIRS= endif benchdir_root= $(prefix) @@ -79,6 +86,7 @@ SUFFIXES = .sh -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ + -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \ -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \ $< > $@-t diff --git a/mysql-test/include/have_debug.inc b/mysql-test/include/have_debug.inc new file mode 100644 index 00000000000..ff59037b6eb --- /dev/null +++ b/mysql-test/include/have_debug.inc @@ -0,0 +1,4 @@ +-- require r/have_debug.require +disable_query_log; +select (version() like "%debug%") as debug; +enable_query_log; diff --git a/mysql-test/misc/kill_master.sh b/mysql-test/misc/kill_master.sh new file mode 100644 index 00000000000..7938c9d3ac2 --- /dev/null +++ b/mysql-test/misc/kill_master.sh @@ -0,0 +1,4 @@ +kill -9 `cat var/run/master.pid` +# The kill may fail if process has already gone away, +# so don't use the exit code of the kill. Use 0. +exit 0 diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index d4c5bfb2209..52938c8a2ee 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -202,6 +202,7 @@ MASTER_MYPORT=9306 SLAVE_RUNNING=0 SLAVE_MYPORT=9307 MYSQL_MANAGER_PORT=9305 # needs to be out of the way of slaves +NDBCLUSTER_PORT=9350 MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log MYSQL_MANAGER_USER=root @@ -258,6 +259,7 @@ while test $# -gt 0; do --master_port=*) MASTER_MYPORT=`$ECHO "$1" | $SED -e "s;--master_port=;;"` ;; --slave_port=*) SLAVE_MYPORT=`$ECHO "$1" | $SED -e "s;--slave_port=;;"` ;; --manager-port=*) MYSQL_MANAGER_PORT=`$ECHO "$1" | $SED -e "s;--manager_port=;;"` ;; + --ndbcluster_port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster_port=;;"` ;; --with-openssl) EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \ --ssl-ca=$BASEDIR/SSL/cacert.pem \ @@ -689,7 +691,7 @@ report_stats () { # $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp # Remove some non fatal warnings from the log files - $SED -e 's!Warning: Table:.* on delete!!g' \ + $SED -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \ $MY_LOG_DIR/*.err \ | $SED -e 's!Warning: Table:.* on rename!!g' \ > $MY_LOG_DIR/warnings.tmp @@ -882,8 +884,12 @@ start_master() if [ x$MASTER_RUNNING = x1 ] || [ x$LOCAL_MASTER = x1 ] ; then return fi - # Remove stale binary logs - $RM -f $MYSQL_TEST_DIR/var/log/master-bin.* + # Remove stale binary logs except for 2 tests which need them + if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ] + then + $RM -f $MYSQL_TEST_DIR/var/log/master-bin.* + fi + # Remove old master.info and relay-log.info files $RM -f $MYSQL_TEST_DIR/var/master-data/master.info $MYSQL_TEST_DIR/var/master-data/relay-log.info @@ -1005,8 +1011,12 @@ start_slave() slave_sock="$SLAVE_MYSOCK" fi # Remove stale binary logs and old master.info files - $RM -f $MYSQL_TEST_DIR/var/log/$slave_ident-*bin.* - $RM -f $slave_datadir/master.info $slave_datadir/relay-log.info + # except for too tests which need them + if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ] + then + $RM -f $MYSQL_TEST_DIR/var/log/$slave_ident-*bin.* + $RM -f $slave_datadir/master.info $slave_datadir/relay-log.info + fi #run slave initialization shell script if one exists if [ -f "$slave_init_script" ] ; @@ -1418,7 +1428,7 @@ then if [ -z "$USE_RUNNING_NDBCLUSTER" ] then # Kill any running ndbcluster stuff - ./ndb/ndbcluster --stop + ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --stop fi fi @@ -1439,7 +1449,7 @@ then if [ -z "$USE_RUNNING_NDBCLUSTER" ] then echo "Starting ndbcluster" - ./ndb/ndbcluster --small --discless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 + ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --discless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 export NDB_CONNECTSTRING=`cat Ndb.cfg` else export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" @@ -1539,7 +1549,7 @@ then if [ -z "$USE_RUNNING_NDBCLUSTER" ] then # Kill any running ndbcluster stuff - ./ndb/ndbcluster --stop + ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --stop fi fi diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index 5acb757d253..82c65c98866 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -43,9 +43,7 @@ HostName: CHOOSE_HOSTNAME_7 [MGM] Id: 1 ExecuteOnComputer: 1 -PortNumber: CHOOSE_PORT_BASE00 -PortNumberStats: CHOOSE_PORT_BASE01 - +PortNumber: CHOOSE_PORT_MGM [DB] Id: 2 @@ -74,4 +72,4 @@ Id: 14 ExecuteOnComputer: 7 [TCP DEFAULT] -PortNumber: CHOOSE_PORT_BASE02 +PortNumber: CHOOSE_PORT_TRANSPORTER diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index d706f5dcffe..e51f6f6b076 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -5,7 +5,7 @@ # This scripts starts the table handler ndbcluster # configurable parameters, make sure to change in mysqlcluterd as well -port_base="22" # using ports port_base{"00","01", etc} +port_base="2200" fsdir=`pwd` # end configurable parameters @@ -85,8 +85,8 @@ fs_ndb=$fsdir/ndbcluster fs_mgm_1=$fs_ndb/1.ndb_mgm fs_ndb_2=$fs_ndb/2.ndb_db fs_ndb_3=$fs_ndb/3.ndb_db -fs_name_2=$fs_ndb/node-2-fs -fs_name_3=$fs_ndb/node-3-fs +fs_name_2=$fs_ndb/node-2-fs-$port_base +fs_name_3=$fs_ndb/node-3-fs-$port_base NDB_HOME= export NDB_CONNECTSTRING @@ -125,8 +125,9 @@ fi # set som help variables ndb_host="localhost" -ndb_port=$port_base"00" -NDB_CONNECTSTRING_BASE="host=$ndb_host:$ndb_port;nodeid=" +ndb_mgmd_port=$port_base +port_transporter=`expr $ndb_mgmd_port + 2` +NDB_CONNECTSTRING_BASE="host=$ndb_host:$ndb_mgmd_port;nodeid=" # Start management server as deamon @@ -145,7 +146,8 @@ sed \ -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \ -e s,"CHOOSE_FILESYSTEM_NODE_2","$fs_name_2",g \ -e s,"CHOOSE_FILESYSTEM_NODE_3","$fs_name_3",g \ - -e s,"CHOOSE_PORT_BASE",$port_base,g \ + -e s,"CHOOSE_PORT_MGM",$ndb_mgmd_port,g \ + -e s,"CHOOSE_PORT_TRANSPORTER",$port_transporter,g \ < ndb/ndb_config_2_node.ini \ > "$fs_mgm_1/config.ini" fi @@ -195,7 +197,7 @@ status_ndbcluster status_ndbcluster() { # Start management client -echo "show" | $exec_mgmtclient $ndb_host $ndb_port +echo "show" | $exec_mgmtclient $ndb_host $ndb_mgmd_port } stop_default_ndbcluster() { @@ -210,11 +212,11 @@ if [ ! -f $cfgfile ] ; then fi ndb_host=`cat $cfgfile | sed -e "s,.*host=\(.*\)\:.*,\1,1"` -ndb_port=`cat $cfgfile | sed -e "s,.*host=$ndb_host\:\([0-9]*\).*,\1,1"` +ndb_mgmd_port=`cat $cfgfile | sed -e "s,.*host=$ndb_host\:\([0-9]*\).*,\1,1"` # Start management client -exec_mgmtclient="$exec_mgmtclient --try-reconnect=1 $ndb_host $ndb_port" +exec_mgmtclient="$exec_mgmtclient --try-reconnect=1 $ndb_host $ndb_mgmd_port" echo "$exec_mgmtclient" echo "all stop" | $exec_mgmtclient diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index c2ed40f3f94..1441b3c3600 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -470,3 +470,9 @@ t1 CREATE TABLE `t1` ( ALTER TABLE t1 DROP PRIMARY KEY; ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists DROP TABLE t1; +create table t1 (a int, b int, key(a)); +insert into t1 values (1,1), (2,2); +alter table t1 drop key no_such_key; +ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists +alter table t1 drop key a; +drop table t1; diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index a544bbbf0b7..f2846e238e3 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1181,3 +1181,66 @@ a A a drop table t1; +create table t1( +pk1 text not null, pk2 text not null, pk3 char(4), +key1 int, key2 int, +primary key(pk1(4), pk2(4), pk3), key(key1), key(key2) +) engine=bdb; +insert into t1 values (concat('aaa-', repeat('A', 4000)), +concat('eee-', repeat('e', 4000)), 'a++a', 1, 1); +insert into t1 values (concat('bbb-', repeat('B', 4000)), +concat('ggg-', repeat('G', 4000)), 'b++b', 1, 1); +select substring(pk1, 1, 4), substring(pk1, 4001), +substring(pk2, 1, 4), substring(pk2, 4001), pk3, key1, key2 +from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +substring(pk1, 1, 4) substring(pk1, 4001) substring(pk2, 1, 4) substring(pk2, 4001) pk3 key1 key2 +aaa- AAAA eee- eeee a++a 1 1 +bbb- BBBB ggg- GGGG b++b 1 1 +drop table t1; +create table t1 ( +pk1 varchar(8) not null default '', +pk2 varchar(4) not null default '', +key1 int(11) default null, +key2 int(11) default null, +primary key (pk1,pk2), +key key1 (key1), +key key2 (key2)) engine=bdb; +insert into t1 values ('','empt',2,2), ('a','a--a',2,2), +('bb','b--b',2,2), ('ccc','c--c',2,2), ('dddd','d--d',2,2); +select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +pk1 pk2 key1 key2 + empt 2 2 +a a--a 2 2 +bb b--b 2 2 +ccc c--c 2 2 +dddd d--d 2 2 +drop table t1; +set autocommit=0; +create table t1(b varchar(30)) engine=bdb; +insert into t1 values ('one'); +commit; +select b FROM t1 outer_table where +exists (select 'two' from t1 where 'two' = outer_table.b); +b +drop table t1; +set autocommit=1; +create table t1(a int primary key, b varchar(30)) engine=bdb; +insert into t1 values (1,'one'), (2,'two'), (3,'three'), (4,'four'); +create table t2 like t1; +insert t2 select * from t1; +select a from t1 where a in (select a from t2); +a +1 +2 +3 +4 +delete from t2; +insert into t2 (a, b) +select a, b from t1 where (a, b) in (select a, b from t1); +select * from t2; +a b +1 one +2 two +3 three +4 four +drop table t1, t2; diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result new file mode 100644 index 00000000000..257f69fa6d9 --- /dev/null +++ b/mysql-test/r/flush_table.result @@ -0,0 +1,66 @@ +drop table if exists t1,t2; +create table t1 (a int not null auto_increment primary key); +insert into t1 values(0); +lock table t1 read; +flush table t1; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1(table_id char(20) primary key); +create table t2(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +insert into t2 values ('test.t2'); +insert into t2 values (''); +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +table_id +test.t1 + +handler a2 read first limit 9; +table_id +test.t1 + +handler t2 read first limit 9; +table_id +test.t2 + +flush tables; +handler a1 read first limit 9; +ERROR 42S02: Unknown table 'a1' in HANDLER +handler a2 read first limit 9; +ERROR 42S02: Unknown table 'a2' in HANDLER +handler t2 read first limit 9; +ERROR 42S02: Unknown table 't2' in HANDLER +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +table_id +test.t1 + +handler a2 read first limit 9; +table_id +test.t1 + +handler t2 read first limit 9; +table_id +test.t2 + +flush table t1; +handler a1 read first limit 9; +ERROR 42S02: Unknown table 'a1' in HANDLER +handler a2 read first limit 9; +ERROR 42S02: Unknown table 'a2' in HANDLER +handler t2 read first limit 9; +table_id +test.t2 + +flush table t2; +handler t2 close; +ERROR 42S02: Unknown table 't2' in HANDLER +drop table t1; +drop table t2; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index c86a379cccd..30c4c75f3d1 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -7,8 +7,8 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'), ('Full-text search in MySQL', 'implements vector space model'); SHOW INDEX FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 a 1 a A NULL NULL NULL YES FULLTEXT -t1 1 a 2 b A NULL NULL NULL YES FULLTEXT +t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT +t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT select * from t1 where MATCH(a,b) AGAINST ("collections"); a b Only MyISAM tables support collections @@ -223,7 +223,7 @@ id show keys from t2; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t2 1 tig 1 ticket A NULL NULL NULL YES BTREE -t2 1 tix 1 inhalt A NULL NULL NULL YES FULLTEXT +t2 1 tix 1 inhalt NULL NULL NULL NULL YES FULLTEXT show create table t2; Table Create Table t2 CREATE TABLE `t2` ( diff --git a/mysql-test/r/have_debug.require b/mysql-test/r/have_debug.require new file mode 100644 index 00000000000..714922cee63 --- /dev/null +++ b/mysql-test/r/have_debug.require @@ -0,0 +1,2 @@ +debug +1 diff --git a/mysql-test/r/innodb_cache.result b/mysql-test/r/innodb_cache.result index 5c5e0bb6dfe..ec43cbe10b2 100644 --- a/mysql-test/r/innodb_cache.result +++ b/mysql-test/r/innodb_cache.result @@ -98,7 +98,7 @@ commit; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 -drop table if exists t1; +drop table t3,t2,t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; select count(*) from t1; count(*) @@ -108,3 +108,22 @@ select count(*) from t1; count(*) 1 drop table t1; +set GLOBAL query_cache_size=1355776; +CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; +CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; +CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb; +INSERT INTO t1 VALUES (1,'me'); +INSERT INTO t2 VALUES (1,'you'); +INSERT INTO t3 VALUES (2,1,1,2); +delete from t3 where t1_id = 1 and t2_id = 1; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +id a +begin; +insert into t3 VALUES ( NULL, 1, 1, 2 ); +insert into t3 VALUES ( NULL, 1, 1, 2 ); +ERROR 23000: Duplicate entry '1-1' for key 2 +commit; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +id a +1 me +drop table t3,t2,t1; diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index d43a18c6a96..3be73f6cc6a 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -32,7 +32,7 @@ T1 ALTER TABLE T1 add b int; SHOW TABLES LIKE "T1"; Tables_in_test (T1) -t1 +T1 ALTER TABLE T1 RENAME T2; SHOW TABLES LIKE "T2"; Tables_in_test (T2) @@ -41,7 +41,7 @@ LOCK TABLE T2 WRITE; ALTER TABLE T2 drop b; SHOW TABLES LIKE "T2"; Tables_in_test (T2) -t2 +T2 UNLOCK TABLES; RENAME TABLE T2 TO T1; SHOW TABLES LIKE "T1"; @@ -121,3 +121,13 @@ LOCATION Mic-5 Mic-6 drop table T1; +create table T1 (A int); +alter table T1 add index (A); +show tables like 'T1%'; +Tables_in_test (T1%) +T1 +alter table t1 add index (A); +show tables like 't1%'; +Tables_in_test (t1%) +t1 +drop table t1; diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result index 362d17e0461..ecb785f243f 100644 --- a/mysql-test/r/lowercase_table3.result +++ b/mysql-test/r/lowercase_table3.result @@ -4,7 +4,7 @@ SELECT * from T1; a drop table t1; flush tables; -CREATE TABLE t1 (a int) type=INNODB; +CREATE TABLE t1 (a int) ENGINE=INNODB; SELECT * from T1; -Can't open file: 'T1.InnoDB'. (errno: 1) +ERROR HY000: Can't open file: 'T1.InnoDB'. (errno: 1) drop table t1; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 63e0a228aa5..83f8230f11c 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -544,6 +544,24 @@ insert into t1 values (99,NULL); select * from t4 where a+0 > 90; a b 99 1 +insert t5 values (1,1); +ERROR 23000: Duplicate entry '1-1' for key 1 +insert t6 values (2,1); +ERROR 23000: Duplicate entry '2-1' for key 1 +insert t5 values (1,1) on duplicate key update b=b+10; +insert t6 values (2,1) on duplicate key update b=b+20; +select * from t5 where a < 3; +a b +1 2 +1 3 +1 4 +1 5 +1 11 +2 2 +2 3 +2 4 +2 5 +2 21 drop table t6, t5, t4, t3, t2, t1; CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,1), (2,1); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index b9f4f62e882..7e69620394b 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -141,7 +141,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2"); </mysqldump> DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r; -INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'); +INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -159,6 +159,7 @@ CREATE TABLE `t1` ( /*!40000 ALTER TABLE `t1` DISABLE KEYS */; LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES ('абцде'); +INSERT INTO `t1` VALUES (NULL); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/r/ndb_autodiscover2.result index cafaf4dce6f..08803d997a5 100644 --- a/mysql-test/r/ndb_autodiscover2.result +++ b/mysql-test/r/ndb_autodiscover2.result @@ -1,9 +1,9 @@ -select * from t9; +select * from t9 order by a; a b +1 2 2 3 -4 5 3 4 -1 2 +4 5 show status like 'handler_discover%'; Variable_name Value Handler_discover 1 diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index e03952efe13..27f4ce7f815 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -119,3 +119,103 @@ EXECUTE stmt1 USING @var; _utf8 'A' collate utf8_bin = ? 1 DEALLOCATE PREPARE stmt1; +create table t1 (id int); +prepare stmt1 from "select FOUND_ROWS()"; +select SQL_CALC_FOUND_ROWS * from t1; +id +execute stmt1; +FOUND_ROWS() +0 +insert into t1 values (1); +select SQL_CALC_FOUND_ROWS * from t1; +id +1 +execute stmt1; +FOUND_ROWS() +1 +execute stmt1; +FOUND_ROWS() +0 +deallocate prepare stmt1; +drop table t1; +create table t1 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday') +) engine = MYISAM ; +create table t2 like t1; +set @stmt= ' explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +execute stmt1 ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +deallocate prepare stmt1; +drop tables t1,t2; +set @arg00=1; +prepare stmt1 from ' create table t1 (m int) as select 1 as m ' ; +execute stmt1 ; +select m from t1; +m +1 +drop table t1; +prepare stmt1 from ' create table t1 (m int) as select ? as m ' ; +execute stmt1 using @arg00; +select m from t1; +m +1 +deallocate prepare stmt1; +drop table t1; +create table t1 (id int(10) unsigned NOT NULL default '0', +name varchar(64) NOT NULL default '', +PRIMARY KEY (id), UNIQUE KEY `name` (`name`)); +insert into t1 values (1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'); +prepare stmt1 from 'select name from t1 where id=? or id=?'; +set @id1=1,@id2=6; +execute stmt1 using @id1, @id2; +name +1 +6 +select name from t1 where id=1 or id=6; +name +1 +6 +deallocate prepare stmt1; +drop table t1; +create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ; +prepare stmt1 from ' show table status from test like ''t1%'' '; +execute stmt1; +Name Engine Version 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 +t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL +show table status from test like 't1%' ; +Name Engine Version 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 +t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL +deallocate prepare stmt1 ; +drop table t1; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 06a479c964c..6df76da91d8 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -244,7 +244,7 @@ id select_type table type possible_keys key key_len ref rows Extra 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 +1 SIMPLE t1 ref x x 5 const 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 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 653a8e7302e..87691e864c5 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 Engine 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 +Name Engine Version 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 @@ -309,58 +309,58 @@ insert into t1 values (1),(2); insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); show table status; -Name Engine 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 -t1 HEAP Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +Name Engine Version 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 +t1 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); show table status; -Name Engine 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 -t1 HEAP Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +Name Engine Version 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 +t1 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); show table status; -Name Engine 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 -t1 HEAP Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +Name Engine Version 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 +t1 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; show table status; -Name Engine 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 -t1 HEAP Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +Name Engine Version 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 +t1 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1; delete from t2; delete from t3; show table status; -Name Engine 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 -t1 HEAP Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +Name Engine Version 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 +t1 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); show table status; -Name Engine 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 -t1 HEAP Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +Name Engine Version 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 +t1 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; show table status; -Name Engine 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 -t1 HEAP Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +Name Engine Version 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 +t1 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL drop table t1, t2, t3; create database test_$1; show create database test_$1; diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 9c1816e295c..bbbc607b6f8 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -96,3 +96,13 @@ id value (select t1.value from t1 where t1.id=t2.id) 1 z a 2 x b drop table t1,t2; +create table t1 (a int, b int) engine=innodb; +insert into t1 values (1,2), (1,3), (2,3), (2,4), (2,5), (3,4), (4,5), (4,100); +create table t2 (a int) engine=innodb; +insert into t2 values (1),(2),(3),(4); +select a, sum(b) as b from t1 group by a having b > (select max(a) from t2); +a b +1 5 +2 12 +4 105 +drop table t1, t2; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index bed4e890c18..afee837b1a5 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -960,3 +960,31 @@ a a 150 drop table t1; +CREATE TABLE t1 ( ID1 int(10) unsigned NOT NULL DEFAULT '0' , ID2 datetime NOT NULL DEFAULT '0000-00-00 00:00:00' , DATA1 varchar(10) , DATA2 double(5,4) , DATA3 datetime , PRIMARY KEY (ID1,ID2)); +CREATE TABLE t2 ( ID int(3) unsigned NOT NULL DEFAULT '0' , DATA1 timestamp DEFAULT '0000-00-00 00:00:00' , PRIMARY KEY (ID)); +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1); +ID1 ID2 DATA1 DATA2 DATA3 ID DATA1 +drop table t1,t2; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 32654bb0bc4..122dcaa6c49 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -304,3 +304,11 @@ SHOW CREATE TABLE t1; --error 1091 ALTER TABLE t1 DROP PRIMARY KEY; DROP TABLE t1; + +# BUG#3899 +create table t1 (a int, b int, key(a)); +insert into t1 values (1,1), (2,2); +--error 1091 +alter table t1 drop key no_such_key; +alter table t1 drop key a; +drop table t1; diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 6823dd23b73..32ea0662534 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -822,3 +822,67 @@ alter table t1 modify a char(10) binary; explain select a from t1; select a from t1; drop table t1; + +# +# bug#2686 - index_merge select on BerkeleyDB table with varchar PK causes mysqld to crash +# + +create table t1( + pk1 text not null, pk2 text not null, pk3 char(4), + key1 int, key2 int, + primary key(pk1(4), pk2(4), pk3), key(key1), key(key2) +) engine=bdb; +insert into t1 values (concat('aaa-', repeat('A', 4000)), + concat('eee-', repeat('e', 4000)), 'a++a', 1, 1); +insert into t1 values (concat('bbb-', repeat('B', 4000)), + concat('ggg-', repeat('G', 4000)), 'b++b', 1, 1); +select substring(pk1, 1, 4), substring(pk1, 4001), + substring(pk2, 1, 4), substring(pk2, 4001), pk3, key1, key2 + from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +drop table t1; + +# +# bug#2688 - Wrong index_merge query results for BDB table with variable length primary key +# + +create table t1 ( + pk1 varchar(8) not null default '', + pk2 varchar(4) not null default '', + key1 int(11) default null, + key2 int(11) default null, + primary key (pk1,pk2), + key key1 (key1), + key key2 (key2)) engine=bdb; +insert into t1 values ('','empt',2,2), ('a','a--a',2,2), + ('bb','b--b',2,2), ('ccc','c--c',2,2), ('dddd','d--d',2,2); +select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3; +drop table t1; + + +# +# Bug #4000: problem with active cursor. +# + +set autocommit=0; +create table t1(b varchar(30)) engine=bdb; +insert into t1 values ('one'); +commit; +select b FROM t1 outer_table where +exists (select 'two' from t1 where 'two' = outer_table.b); +drop table t1; +set autocommit=1; + +# +# Bug #4089: subselect and open cursor. +# + +create table t1(a int primary key, b varchar(30)) engine=bdb; +insert into t1 values (1,'one'), (2,'two'), (3,'three'), (4,'four'); +create table t2 like t1; +insert t2 select * from t1; +select a from t1 where a in (select a from t2); +delete from t2; +insert into t2 (a, b) + select a, b from t1 where (a, b) in (select a, b from t1); +select * from t2; +drop table t1, t2; diff --git a/mysql-test/t/flush_table.test b/mysql-test/t/flush_table.test index 4ddcd53d5c8..8bee94cf21f 100644 --- a/mysql-test/t/flush_table.test +++ b/mysql-test/t/flush_table.test @@ -4,10 +4,55 @@ # Test of flush table # -#drop table if exists t1; -#create table t1 (a int not null auto_increment primary key); -#insert into t1 values(0); -#lock table t1 read; -#flush table t1; -#check table t1; -#drop table t1; +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +create table t1 (a int not null auto_increment primary key); +insert into t1 values(0); +lock table t1 read; +flush table t1; +check table t1; +drop table t1; + +# +# In the following test FLUSH TABLES produces a deadlock +# (hang forever) if the fix for bug#3565 is missing. +# +create table t1(table_id char(20) primary key); +create table t2(table_id char(20) primary key); +insert into t1 values ('test.t1'); +insert into t1 values (''); +insert into t2 values ('test.t2'); +insert into t2 values (''); +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush tables; +--error 1109; +handler a1 read first limit 9; +--error 1109; +handler a2 read first limit 9; +--error 1109; +handler t2 read first limit 9; +# +handler t1 open as a1; +handler t1 open as a2; +handler t2 open; +handler a1 read first limit 9; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush table t1; +--error 1109; +handler a1 read first limit 9; +--error 1109; +handler a2 read first limit 9; +handler t2 read first limit 9; +flush table t2; +--error 1109; +handler t2 close; +drop table t1; +drop table t2; + diff --git a/mysql-test/t/innodb_cache.test b/mysql-test/t/innodb_cache.test index 8568fce7d97..101dde37f89 100644 --- a/mysql-test/t/innodb_cache.test +++ b/mysql-test/t/innodb_cache.test @@ -52,10 +52,31 @@ show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; commit; show status like "Qcache_queries_in_cache"; +drop table t3,t2,t1; -drop table if exists t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; select count(*) from t1; insert into t1 (id) values (0); select count(*) from t1; drop table t1; + +# +# one statement roll back inside transation +# +set GLOBAL query_cache_size=1355776; +CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; +CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; +CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb; +INSERT INTO t1 VALUES (1,'me'); +INSERT INTO t2 VALUES (1,'you'); +INSERT INTO t3 VALUES (2,1,1,2); +delete from t3 where t1_id = 1 and t2_id = 1; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +begin; +insert into t3 VALUES ( NULL, 1, 1, 2 ); +-- error 1062 +insert into t3 VALUES ( NULL, 1, 1, 2 ); +commit; +select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc; +drop table t3,t2,t1; + diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index 5c479391916..a4eaeac4ef4 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -89,3 +89,14 @@ SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHER SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3; drop table T1; + +# +# Test name conversion with ALTER TABLE / CREATE INDEX (Bug #3109) +# + +create table T1 (A int); +alter table T1 add index (A); +show tables like 'T1%'; +alter table t1 add index (A); +show tables like 't1%'; +drop table t1; diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index 1753772ecc3..a394cde7237 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -9,7 +9,7 @@ disable_query_log; show variables like "lower_case_%"; --require r/true.require -select @@version_compile_os NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE"; +select convert(@@version_compile_os using latin1) NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE"; enable_query_log; --disable_warnings @@ -31,7 +31,7 @@ flush tables; # storing things in lower case. # -CREATE TABLE t1 (a int) type=INNODB; +CREATE TABLE t1 (a int) ENGINE=INNODB; --error 1016 SELECT * from T1; drop table t1; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 1f61e200613..cf55c26fb69 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -190,6 +190,14 @@ select * from t5 order by a,b; select * from t6 order by a,b; insert into t1 values (99,NULL); select * from t4 where a+0 > 90; +# bug#4008 - cannot determine a unique key that caused "dupl. key error" +--error 1062 +insert t5 values (1,1); +--error 1062 +insert t6 values (2,1); +insert t5 values (1,1) on duplicate key update b=b+10; +insert t6 values (2,1) on duplicate key update b=b+20; +select * from t5 where a < 3; drop table t6, t5, t4, t3, t2, t1; CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) ENGINE=MyISAM; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index bcfe81dc95f..89b3739f955 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -73,11 +73,12 @@ DROP TABLE t1; # # Bug #1994 +# Bug #4261 # CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r; -INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'); ---exec $MYSQL_DUMP --skip-comments test t1 +INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); +--exec $MYSQL_DUMP --skip-comments --skip-extended-insert test t1 DROP TABLE t1; # diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test index 2aae2508a2b..297795d909e 100644 --- a/mysql-test/t/ndb_autodiscover2.test +++ b/mysql-test/t/ndb_autodiscover2.test @@ -5,7 +5,7 @@ # The previous step has simply removed the frm file # from disk, but left the table in NDB # -select * from t9; +select * from t9 order by a; # handler_discover should be zero show status like 'handler_discover%'; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index f379fb3eebe..35f9b193fe4 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -114,8 +114,8 @@ set @str1 = 'select ?'; set @str2 = convert(@str1 using ucs2); prepare stmt1 from @str2; execute stmt1 using @ivar; - drop table t1,t2; + # # Bug #4105: Server crash on attempt to prepare a statement with character # set introducer @@ -124,3 +124,85 @@ PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?"; set @var='A'; EXECUTE stmt1 USING @var; DEALLOCATE PREPARE stmt1; + +# +# BUG#3486: FOUND_ROWS() fails inside stored procedure [and prepared statement] +# +create table t1 (id int); +prepare stmt1 from "select FOUND_ROWS()"; +select SQL_CALC_FOUND_ROWS * from t1; +# Expect 0 +execute stmt1; +insert into t1 values (1); +select SQL_CALC_FOUND_ROWS * from t1; +# Expect 1 +execute stmt1; +# Expect 0 +execute stmt1; +deallocate prepare stmt1; +drop table t1; + +# +# prepared EXPLAIN +# +create table t1 +( + c1 tinyint, c2 smallint, c3 mediumint, c4 int, + c5 integer, c6 bigint, c7 float, c8 double, + c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), + c13 date, c14 datetime, c15 timestamp(14), c16 time, + c17 year, c18 bit, c19 bool, c20 char, + c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, + c25 blob, c26 text, c27 mediumblob, c28 mediumtext, + c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), + c32 set('monday', 'tuesday', 'wednesday') +) engine = MYISAM ; +create table t2 like t1; + +set @stmt= ' explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25; +deallocate prepare stmt1; +drop tables t1,t2; + +# +# parameters from variables (for field creation) +# +set @arg00=1; +prepare stmt1 from ' create table t1 (m int) as select 1 as m ' ; +execute stmt1 ; +select m from t1; +drop table t1; +prepare stmt1 from ' create table t1 (m int) as select ? as m ' ; +execute stmt1 using @arg00; +select m from t1; +deallocate prepare stmt1; +drop table t1; + +# +# eq() for parameters +# +create table t1 (id int(10) unsigned NOT NULL default '0', + name varchar(64) NOT NULL default '', + PRIMARY KEY (id), UNIQUE KEY `name` (`name`)); +insert into t1 values (1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'); +prepare stmt1 from 'select name from t1 where id=? or id=?'; +set @id1=1,@id2=6; +execute stmt1 using @id1, @id2; +select name from t1 where id=1 or id=6; +deallocate prepare stmt1; +drop table t1; + +# +# SHOW TABLE STATUS test +# +create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ; +prepare stmt1 from ' show table status from test like ''t1%'' '; +--replace_column 12 # 13 # 14 # +execute stmt1; +--replace_column 12 # 13 # 14 # +show table status from test like 't1%' ; +deallocate prepare stmt1 ; +drop table t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index deb95af9168..3ff2605cff4 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -222,37 +222,37 @@ CREATE TABLE t3 ( insert into t1 values (1),(2); insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); ---replace_column 6 # 7 # 8 # +--replace_column 7 # 8 # 9 # show table status; insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); ---replace_column 6 # 7 # 8 # +--replace_column 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 6 # 7 # 8 # +--replace_column 7 # 8 # 9 # show table status; delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; ---replace_column 6 # 7 # 8 # +--replace_column 7 # 8 # 9 # show table status; delete from t1; delete from t2; delete from t3; ---replace_column 6 # 7 # 8 # +--replace_column 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 6 # 7 # 8 # +--replace_column 7 # 8 # 9 # show table status; delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; ---replace_column 6 # 7 # 8 # +--replace_column 7 # 8 # 9 # show table status; drop table t1, t2, t3; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 47642832158..8c13171d221 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -101,3 +101,13 @@ insert into t2 values (1,'z'),(2,'x'); select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2; select t2.id,t2.value,(select t1.value from t1 where t1.id=t2.id) from t2; drop table t1,t2; + +# +# unlocking tables with subqueries in HAVING +# +create table t1 (a int, b int) engine=innodb; +insert into t1 values (1,2), (1,3), (2,3), (2,4), (2,5), (3,4), (4,5), (4,100); +create table t2 (a int) engine=innodb; +insert into t2 values (1),(2),(3),(4); +select a, sum(b) as b from t1 group by a having b > (select max(a) from t2); +drop table t1, t2; diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index 41fbdec84e7..a81772c74e4 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -80,3 +80,4 @@ DROP TABLE help_relation; DROP TABLE help_topic; -- enable_query_log
+ diff --git a/mysql-test/t/system_mysql_db_refs.test b/mysql-test/t/system_mysql_db_refs.test index 62d6f3de944..4c6557ba5c7 100644 --- a/mysql-test/t/system_mysql_db_refs.test +++ b/mysql-test/t/system_mysql_db_refs.test @@ -99,3 +99,4 @@ drop table test_func; drop table test_host;
drop table test_user;
drop table test_db;
+ diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index b21f635162f..206b40f8ce7 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -535,3 +535,35 @@ CREATE TABLE t1 (uid int(1)); INSERT INTO t1 SELECT 150; SELECT 'a' UNION SELECT uid FROM t1; drop table t1; + +# +# parser stack overflow +# +CREATE TABLE t1 ( ID1 int(10) unsigned NOT NULL DEFAULT '0' , ID2 datetime NOT NULL DEFAULT '0000-00-00 00:00:00' , DATA1 varchar(10) , DATA2 double(5,4) , DATA3 datetime , PRIMARY KEY (ID1,ID2)); + +CREATE TABLE t2 ( ID int(3) unsigned NOT NULL DEFAULT '0' , DATA1 timestamp DEFAULT '0000-00-00 00:00:00' , PRIMARY KEY (ID)); +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1) UNION +(SELECT * FROM t1 AS PARTITIONED, t2 AS +PARTITIONED_B WHERE PARTITIONED_B.ID=PARTITIONED.ID1); +drop table t1,t2; diff --git a/mysys/hash.c b/mysys/hash.c index b7be41a9058..11cbbd6b898 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -122,7 +122,8 @@ static uint hash_rec_mask(HASH *hash,HASH_LINK *pos,uint buffmax, -#if !defined(__SUNPRO_C) && !defined(__USLC__) /* broken compilers */ +/* for compilers which can not handle inline */ +#if !defined(__SUNPRO_C) && !defined(__USLC__) && !defined(__sgi) inline #endif unsigned int rec_hashnr(HASH *hash,const byte *record) diff --git a/ndb/src/kernel/SimBlockList.cpp b/ndb/src/kernel/SimBlockList.cpp index c41b17e1919..75a52ae0c4b 100644 --- a/ndb/src/kernel/SimBlockList.cpp +++ b/ndb/src/kernel/SimBlockList.cpp @@ -34,6 +34,9 @@ #include <Dbtux.hpp> #include <NdbEnv.h> +#ifndef VM_TRACE +#define NEW_BLOCK(B) new B +#else enum SIMBLOCKLIST_DUMMY { A_VALUE = 0 }; static @@ -60,13 +63,13 @@ void * operator new (size_t sz, SIMBLOCKLIST_DUMMY dummy){ return tmp; } +#define NEW_BLOCK(B) new(A_VALUE) B +#endif void SimBlockList::load(const Configuration & conf){ noOfBlocks = 16; theList = new SimulatedBlock * [noOfBlocks]; - for(int i = 0; i<noOfBlocks; i++) - theList[i] = 0; Dbdict* dbdict = 0; Dbdih* dbdih = 0; @@ -75,28 +78,28 @@ SimBlockList::load(const Configuration & conf){ Uint32 dl; const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator(); if(p && !ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) && dl){ - fs = new (A_VALUE) VoidFs(conf); + fs = NEW_BLOCK(VoidFs)(conf); } else { - fs = new (A_VALUE) Ndbfs(conf); + fs = NEW_BLOCK(Ndbfs)(conf); } } - theList[0] = new (A_VALUE) Dbacc(conf); - theList[1] = new (A_VALUE) Cmvmi(conf); + theList[0] = NEW_BLOCK(Dbacc)(conf); + theList[1] = NEW_BLOCK(Cmvmi)(conf); theList[2] = fs; - theList[3] = dbdict = new (A_VALUE) Dbdict(conf); - theList[4] = dbdih = new (A_VALUE) Dbdih(conf); - theList[5] = new (A_VALUE) Dblqh(conf); - theList[6] = new (A_VALUE) Dbtc(conf); - theList[7] = new (A_VALUE) Dbtup(conf); - theList[8] = new (A_VALUE) Ndbcntr(conf); - theList[9] = new (A_VALUE) Qmgr(conf); - theList[10] = new (A_VALUE) Trix(conf); - theList[11] = new (A_VALUE) Backup(conf); - theList[12] = new (A_VALUE) DbUtil(conf); - theList[13] = new (A_VALUE) Suma(conf); - theList[14] = new (A_VALUE) Grep(conf); - theList[15] = new (A_VALUE) Dbtux(conf); + theList[3] = dbdict = NEW_BLOCK(Dbdict)(conf); + theList[4] = dbdih = NEW_BLOCK(Dbdih)(conf); + theList[5] = NEW_BLOCK(Dblqh)(conf); + theList[6] = NEW_BLOCK(Dbtc)(conf); + theList[7] = NEW_BLOCK(Dbtup)(conf); + theList[8] = NEW_BLOCK(Ndbcntr)(conf); + theList[9] = NEW_BLOCK(Qmgr)(conf); + theList[10] = NEW_BLOCK(Trix)(conf); + theList[11] = NEW_BLOCK(Backup)(conf); + theList[12] = NEW_BLOCK(DbUtil)(conf); + theList[13] = NEW_BLOCK(Suma)(conf); + theList[14] = NEW_BLOCK(Grep)(conf); + theList[15] = NEW_BLOCK(Dbtux)(conf); // Metadata common part shared by block instances ptrMetaDataCommon = new MetaData::Common(*dbdict, *dbdih); diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 051c6d7de27..05dffadc058 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -3767,7 +3767,8 @@ void Dbtc::sendtckeyconf(Signal* signal, UintR TcommitFlag) return; // No queued TcKeyConf }//if }//if - + + regApiPtr->m_exec_flag = 0; TcKeyConf::setNoOfOperations(confInfo, (TopWords >> 1)); if ((TpacketLen > 25) || !is_api){ TcKeyConf * const tcKeyConf = (TcKeyConf *)signal->getDataPtrSend(); @@ -5202,6 +5203,7 @@ void Dbtc::execTCROLLBACKREQ(Signal* signal) return; }//if + apiConnectptr.p->m_exec_flag = 1; switch (apiConnectptr.p->apiConnectstate) { case CS_STARTED: case CS_RECEIVING: @@ -10999,7 +11001,8 @@ void Dbtc::sendTcIndxConf(Signal* signal, UintR TcommitFlag) TcIndxConf::setMarkerFlag(confInfo, Tmarker); const UintR TpacketLen = 6 + TopWords; regApiPtr->tcindxrec = 0; - + regApiPtr->m_exec_flag = 0; + if ((TpacketLen > 25) || !is_api){ TcIndxConf * const tcIndxConf = (TcIndxConf *)signal->getDataPtrSend(); diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index c02f2c2a928..5fff137b54f 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -38,10 +38,6 @@ Name: Ndb.cpp #include <NdbEnv.h> #include <BaseString.hpp> -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** void connect(); @@ -1013,18 +1009,14 @@ const char * Ndb::getCatalogName() const void Ndb::setCatalogName(const char * a_catalog_name) { if (a_catalog_name) { - strncpy(theDataBase, a_catalog_name, NDB_MAX_DATABASE_NAME_SIZE); - // Prepare prefix for faster operations - uint db_len = MIN(strlen(theDataBase), NDB_MAX_DATABASE_NAME_SIZE - 1); - uint schema_len = - MIN(strlen(theDataBaseSchema), NDB_MAX_SCHEMA_NAME_SIZE - 1); - strncpy(prefixName, theDataBase, NDB_MAX_DATABASE_NAME_SIZE - 1); - prefixName[db_len] = table_name_separator; - strncpy(prefixName+db_len+1, theDataBaseSchema, - NDB_MAX_SCHEMA_NAME_SIZE - 1); - prefixName[db_len+schema_len+1] = table_name_separator; - prefixName[db_len+schema_len+2] = '\0'; - prefixEnd = prefixName + db_len+schema_len + 2; + snprintf(theDataBase, sizeof(theDataBase), "%s", + a_catalog_name ? a_catalog_name : ""); + + int len = snprintf(prefixName, sizeof(prefixName), "%s%c%s%c", + theDataBase, table_name_separator, + theDataBaseSchema, table_name_separator); + prefixEnd = prefixName + (len < sizeof(prefixName) ? len : + sizeof(prefixName) - 1); } } @@ -1036,18 +1028,14 @@ const char * Ndb::getSchemaName() const void Ndb::setSchemaName(const char * a_schema_name) { if (a_schema_name) { - strncpy(theDataBaseSchema, a_schema_name, NDB_MAX_SCHEMA_NAME_SIZE); - // Prepare prefix for faster operations - uint db_len = MIN(strlen(theDataBase), NDB_MAX_DATABASE_NAME_SIZE - 1); - uint schema_len = - MIN(strlen(theDataBaseSchema), NDB_MAX_SCHEMA_NAME_SIZE - 1); - strncpy(prefixName, theDataBase, NDB_MAX_DATABASE_NAME_SIZE - 1); - prefixName[db_len] = table_name_separator; - strncpy(prefixName+db_len+1, theDataBaseSchema, - NDB_MAX_SCHEMA_NAME_SIZE - 1); - prefixName[db_len+schema_len+1] = table_name_separator; - prefixName[db_len+schema_len+2] = '\0'; - prefixEnd = prefixName + db_len+schema_len + 2; + snprintf(theDataBaseSchema, sizeof(theDataBase), "%s", + a_schema_name ? a_schema_name : ""); + + int len = snprintf(prefixName, sizeof(prefixName), "%s%c%s%c", + theDataBase, table_name_separator, + theDataBaseSchema, table_name_separator); + prefixEnd = prefixName + (len < sizeof(prefixName) ? len : + sizeof(prefixName) - 1); } } diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 03baff4aefd..f451ba885d4 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -56,7 +56,7 @@ Ndb(const char* aDataBase); Parameters: aDataBase : Name of the database. Remark: Connect to the database. ***************************************************************************/ -Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) : +Ndb::Ndb( const char* aDataBase , const char* aSchema) : theNdbObjectIdMap(0), thePreparedTransactionsArray(NULL), theSentTransactionsArray(NULL), @@ -121,22 +121,16 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) : theLastTupleId[i] = 0; }//for - if (aDataBase) - strncpy(theDataBase, aDataBase, NDB_MAX_DATABASE_NAME_SIZE); - else - memset(theDataBase, 0, sizeof(theDataBase)); - strncpy(theDataBaseSchema, aDataBaseSchema, NDB_MAX_SCHEMA_NAME_SIZE); - // Prepare prefix for faster operations - uint db_len = MIN(strlen(theDataBase), NDB_MAX_DATABASE_NAME_SIZE - 1); - uint schema_len = - MIN(strlen(theDataBaseSchema), NDB_MAX_SCHEMA_NAME_SIZE - 1); - strncpy(prefixName, theDataBase, NDB_MAX_DATABASE_NAME_SIZE - 1); - prefixName[db_len] = table_name_separator; - strncpy(prefixName+db_len+1, theDataBaseSchema, - NDB_MAX_SCHEMA_NAME_SIZE - 1); - prefixName[db_len+schema_len+1] = table_name_separator; - prefixName[db_len+schema_len+2] = '\0'; - prefixEnd = prefixName + db_len+schema_len + 2; + snprintf(theDataBase, sizeof(theDataBase), "%s", + aDataBase ? aDataBase : ""); + snprintf(theDataBaseSchema, sizeof(theDataBaseSchema), "%s", + aSchema ? aSchema : ""); + + int len = snprintf(prefixName, sizeof(prefixName), "%s%c%s%c", + theDataBase, table_name_separator, + theDataBaseSchema, table_name_separator); + prefixEnd = prefixName + (len < sizeof(prefixName) ? len : + sizeof(prefixName) - 1); NdbMutex_Lock(&createNdbMutex); diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp index 97eb1691552..0a4fa96dd2d 100644 --- a/ndb/test/ndbapi/testScan.cpp +++ b/ndb/test/ndbapi/testScan.cpp @@ -776,32 +776,7 @@ int runOnlyOpenScanOnce(NDBT_Context* ctx, NDBT_Step* step){ } int runOnlyOneOpInScanTrans(NDBT_Context* ctx, NDBT_Step* step){ - const NdbDictionary::Table* pTab = ctx->getTab(); - int records = ctx->getNumRecords(); - int numFailed = 0; - - ScanFunctions scanF(*pTab); - if (scanF.scanReadFunctions(GETNDB(step), - records, - 6, - ScanFunctions::OnlyOneOpInScanTrans, - false) == 0){ - numFailed++; - } - if (scanF.scanReadFunctions(GETNDB(step), - records, - 6, - ScanFunctions::OnlyOneOpInScanTrans, - true) == 0){ - numFailed++; - } - - - if(numFailed > 0) - return NDBT_FAILED; - else - return NDBT_OK; - + return NDBT_OK; } int runExecuteScanWithoutOpenScan(NDBT_Context* ctx, NDBT_Step* step){ diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index f64c1c3f8ba..e458eea8653 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -148,24 +148,33 @@ cmd: testBasic args: -n MassiveRollback2 T1 T6 T13 #-m 500 1: testBasic -n ReadConsistency T6 +max-time: 500 cmd: testTimeout args: -n DontTimeoutTransaction T1 +max-time: 500 cmd: testTimeout args: -n DontTimeoutTransaction5 T1 +max-time: 500 cmd: testTimeout args: -n TimeoutTransaction T1 +max-time: 500 cmd: testTimeout args: -n TimeoutTransaction5 T1 +max-time: 500 cmd: testTimeout args: -n BuddyTransNoTimeout T1 +max-time: 500 cmd: testTimeout args: -n BuddyTransNoTimeout5 T1 +max-time: 500 +cmd: testTimeout +args: -n TimeoutRandTransaction T1 # # SCAN TESTS # @@ -333,6 +342,18 @@ max-time: 500 cmd: testScan args: -n ScanReadError5030 T1 +max-time: 500 +cmd: testScan +args: -n InsertDelete T1 T6 + +max-time: 500 +cmd: testScan +args: -n CheckAfterTerror T1 + +max-time: 500 +cmd: testScan +args: -n ScanReadWhileNodeIsDown T1 + # OLD FLEX max-time: 500 cmd: flexBench diff --git a/scripts/fill_func_tables.sh b/scripts/fill_func_tables.sh index 459afee2fe1..459afee2fe1 100755..100644 --- a/scripts/fill_func_tables.sh +++ b/scripts/fill_func_tables.sh diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 189796377cc..7692869c607 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -103,7 +103,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ isam/isamchk$BS isam/pack_isam$BS \ myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ myisam/myisam_ftdump$BS \ - sql/mysqld$BS \ + sql/mysqld$BS sql/mysql_tzinfo_to_sql$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh index e5893c1eb1e..9b2cc2d7d22 100644 --- a/scripts/make_win_binary_distribution.sh +++ b/scripts/make_win_binary_distribution.sh @@ -110,6 +110,9 @@ print_debug "Copying sql-bench to $DIRNAME/bench" mkdir $DIRNAME/bench cp -fr sql-bench/* $DIRNAME/bench +print_debug "Copying support-files to $DIRNAME" +cp support-files/* $DIRNAME + # Files for bin for i in client_release/* client_debug/mysqld.exe lib_release/libmySQL.dll do @@ -124,7 +127,7 @@ do cp $i $DIRNAME/include done -# Windows users are used to having dbug.h +# Windows users are used to having dbug.h ? cp include/my_dbug.h $DIRNAME/include/dbug.h # Libraries found in lib_release and lib_debug diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index f6102085021..eaaf219afc4 100755..100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -161,13 +161,16 @@ vreplace() done } -for d in 4.0.XX-gpl 4.0.XX-pro 4.0.XX-classic -do - cd $BASE/InstallShield/$d/String\ Tables/0009-English - vreplace value.shl - cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent - vreplace infolist.txt -done +if test -d $BASE/InstallShield +then + for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic + do + cd $BASE/InstallShield/$d/String\ Tables/0009-English + vreplace value.shl + cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent + vreplace infolist.txt + done +fi # # Move all error message files to root directory @@ -288,6 +291,12 @@ do done # +# support files +# +mkdir $BASE/support-files +cp support-files/*.cnf $BASE/support-files + +# # Raw dirs from source tree # @@ -308,7 +317,6 @@ done ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp - unix_to_dos $BASE/README mv $BASE/README $BASE/README.txt @@ -318,7 +326,7 @@ mv $BASE/README $BASE/README.txt if [ -d $BASE/SSL/SCCS ] then - find $BASE -type d -name SCCS | xargs rm -r -f + find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f fi # diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 85835498bc1..e45c0ec5571 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -154,12 +154,15 @@ then i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" if test "$windows" = "0" then - i_u="$i_u + i_u="$i_u INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) values ('$hostname',''); INSERT INTO user (host,user) values ('localhost','');" else - i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" + i_u="$i_u + INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" fi fi fi diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 69bf2bebaa8..f841a21b788 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -118,13 +118,14 @@ then cmd="cat" fi -# Find where mysql_fix_privilege_tables.sql is located +# Find where first mysql_fix_privilege_tables.sql is located for i in $basedir/support-files $basedir/share $basedir/share/mysql \ $basedir/scripts @pkgdatadir@ . ./scripts do if test -f $i/$file then pkgdatadir=$i + break fi done diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 558b0e2da0c..aa5b99aebcc 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb $args" +--skip-bdb $args --max_allowed_packet=8M" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then diff --git a/sql-common/Makefile.am b/sql-common/Makefile.am index 1f397c0ea87..6bd42d70e4f 100644 --- a/sql-common/Makefile.am +++ b/sql-common/Makefile.am @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## Process this file with automake to create Makefile.in -EXTRA_DIST = client.c pack.c +EXTRA_DIST = client.c pack.c my_time.c # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/sql-common/client.c b/sql-common/client.c index 5c1a718c5bb..e6c36965f97 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -39,6 +39,10 @@ #include "mysql.h" +/* Remove client convenience wrappers */ +#undef max_allowed_packet +#undef net_buffer_length + #ifdef EMBEDDED_LIBRARY #undef MYSQL_SERVER diff --git a/sql-common/my_time.c b/sql-common/my_time.c new file mode 100644 index 00000000000..46c84ac9ba7 --- /dev/null +++ b/sql-common/my_time.c @@ -0,0 +1,561 @@ +/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 <my_time.h> +#include <m_string.h> +#include <m_ctype.h> + +ulonglong log_10_int[20]= +{ + 1, 10, 100, 1000, 10000UL, 100000UL, 1000000UL, 10000000UL, + ULL(100000000), ULL(1000000000), ULL(10000000000), ULL(100000000000), + ULL(1000000000000), ULL(10000000000000), ULL(100000000000000), + ULL(1000000000000000), ULL(10000000000000000), ULL(100000000000000000), + ULL(1000000000000000000), ULL(10000000000000000000) +}; + + +/* Position for YYYY-DD-MM HH-MM-DD.FFFFFF AM in default format */ + +static uchar internal_format_positions[]= +{0, 1, 2, 3, 4, 5, 6, (uchar) 255}; + +static char time_separator=':'; + +/* + Convert a timestamp string to a MYSQL_TIME value. + + SYNOPSIS + str_to_datetime() + str String to parse + length Length of string + l_time Date is stored here + flags Bitmap of following items + TIME_FUZZY_DATE Set if we should allow partial dates + TIME_DATETIME_ONLY Set if we only allow full datetimes. + was_cut Set to 1 if value was cut during conversion or to 0 + otherwise. + + DESCRIPTION + At least the following formats are recogniced (based on number of digits) + YYMMDD, YYYYMMDD, YYMMDDHHMMSS, YYYYMMDDHHMMSS + YY-MM-DD, YYYY-MM-DD, YY-MM-DD HH.MM.SS + YYYYMMDDTHHMMSS where T is a the character T (ISO8601) + Also dates where all parts are zero are allowed + + The second part may have an optional .###### fraction part. + + NOTES + This function should work with a format position vector as long as the + following things holds: + - All date are kept together and all time parts are kept together + - Date and time parts must be separated by blank + - Second fractions must come after second part and be separated + by a '.'. (The second fractions are optional) + - AM/PM must come after second fractions (or after seconds if no fractions) + - Year must always been specified. + - If time is before date, then we will use datetime format only if + the argument consist of two parts, separated by space. + Otherwise we will assume the argument is a date. + - The hour part must be specified in hour-minute-second order. + + RETURN VALUES + MYSQL_TIMESTAMP_NONE String wasn't a timestamp, like + [DD [HH:[MM:[SS]]]].fraction. + l_time is not changed. + MYSQL_TIMESTAMP_DATE DATE string (YY MM and DD parts ok) + MYSQL_TIMESTAMP_DATETIME Full timestamp + MYSQL_TIMESTAMP_ERROR Timestamp with wrong values. + All elements in l_time is set to 0 +*/ + +#define MAX_DATE_PARTS 8 + +enum enum_mysql_timestamp_type +str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, + uint flags, int *was_cut) +{ + uint field_length, year_length, digits, i, number_of_fields; + uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; + uint add_hours= 0, start_loop; + ulong not_zero_date, allow_space; + bool is_internal_format; + const char *pos, *last_field_pos; + const char *end=str+length; + const uchar *format_position; + bool found_delimitier= 0, found_space= 0; + uint frac_pos, frac_len; + DBUG_ENTER("str_to_datetime"); + DBUG_PRINT("ENTER",("str: %.*s",length,str)); + + LINT_INIT(field_length); + LINT_INIT(year_length); + LINT_INIT(last_field_pos); + + *was_cut= 0; + + /* Skip space at start */ + for (; str != end && my_isspace(&my_charset_latin1, *str) ; str++) + ; + if (str == end || ! my_isdigit(&my_charset_latin1, *str)) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + + is_internal_format= 0; + /* This has to be changed if want to activate different timestamp formats */ + format_position= internal_format_positions; + + /* + Calculate number of digits in first part. + If length= 8 or >= 14 then year is of format YYYY. + (YYYY-MM-DD, YYYYMMDD, YYYYYMMDDHHMMSS) + */ + for (pos=str; pos != end && my_isdigit(&my_charset_latin1,*pos) ; pos++) + ; + + digits= (uint) (pos-str); + start_loop= 0; /* Start of scan loop */ + date_len[format_position[0]]= 0; /* Length of year field */ + if (pos == end) + { + /* Found date in internal format (only numbers like YYYYMMDD) */ + year_length= (digits == 4 || digits == 8 || digits >= 14) ? 4 : 2; + field_length=year_length-1; + is_internal_format= 1; + format_position= internal_format_positions; + } + else + { + if (format_position[0] >= 3) /* If year is after HHMMDD */ + { + /* + If year is not in first part then we have to determinate if we got + a date field or a datetime field. + We do this by checking if there is two numbers separated by + space in the input. + */ + while (pos < end && !my_isspace(&my_charset_latin1, *pos)) + pos++; + while (pos < end && !my_isdigit(&my_charset_latin1, *pos)) + pos++; + if (pos == end) + { + if (flags & TIME_DATETIME_ONLY) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); /* Can't be a full datetime */ + } + /* Date field. Set hour, minutes and seconds to 0 */ + date[0]= date[1]= date[2]= date[3]= date[4]= 0; + start_loop= 5; /* Start with first date part */ + } + } + } + + /* + Only allow space in the first "part" of the datetime field and: + - after days, part seconds + - before and after AM/PM (handled by code later) + + 2003-03-03 20:00:20 AM + 20:00:20.000000 AM 03-03-2000 + */ + i= max((uint) format_position[0], (uint) format_position[1]); + set_if_bigger(i, (uint) format_position[2]); + allow_space= ((1 << i) | (1 << format_position[6])); + allow_space&= (1 | 2 | 4 | 8); + + not_zero_date= 0; + for (i = start_loop; + i < MAX_DATE_PARTS-1 && str != end && + my_isdigit(&my_charset_latin1,*str); + i++) + { + const char *start= str; + ulong tmp_value= (uint) (uchar) (*str++ - '0'); + while (str != end && my_isdigit(&my_charset_latin1,str[0]) && + (!is_internal_format || field_length--)) + { + tmp_value=tmp_value*10 + (ulong) (uchar) (*str - '0'); + str++; + } + date_len[i]= (uint) (str - start); + if (tmp_value > 999999) /* Impossible date part */ + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + date[i]=tmp_value; + not_zero_date|= tmp_value; + + /* Length-1 of next field */ + field_length= format_position[i+1] == 0 ? 3 : 1; + + if ((last_field_pos= str) == end) + { + i++; /* Register last found part */ + break; + } + /* Allow a 'T' after day to allow CCYYMMDDT type of fields */ + if (i == format_position[2] && *str == 'T') + { + str++; /* ISO8601: CCYYMMDDThhmmss */ + continue; + } + if (i == format_position[5]) /* Seconds */ + { + if (*str == '.') /* Followed by part seconds */ + { + str++; + field_length= 5; /* 5 digits after first (=6) */ + } + continue; + + /* No part seconds */ + date[++i]= 0; + } + while (str != end && + (my_ispunct(&my_charset_latin1,*str) || + my_isspace(&my_charset_latin1,*str))) + { + if (my_isspace(&my_charset_latin1,*str)) + { + if (!(allow_space & (1 << i))) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + found_space= 1; + } + str++; + found_delimitier= 1; /* Should be a 'normal' date */ + } + /* Check if next position is AM/PM */ + if (i == format_position[6]) /* Seconds, time for AM/PM */ + { + i++; /* Skip AM/PM part */ + if (format_position[7] != 255) /* If using AM/PM */ + { + if (str+2 <= end && (str[1] == 'M' || str[1] == 'm')) + { + if (str[0] == 'p' || str[0] == 'P') + add_hours= 12; + else if (str[0] != 'a' || str[0] != 'A') + continue; /* Not AM/PM */ + str+= 2; /* Skip AM/PM */ + /* Skip space after AM/PM */ + while (str != end && my_isspace(&my_charset_latin1,*str)) + str++; + } + } + } + last_field_pos= str; + } + if (found_delimitier && !found_space && (flags & TIME_DATETIME_ONLY)) + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); /* Can't be a datetime */ + } + + str= last_field_pos; + + number_of_fields= i - start_loop; + while (i < MAX_DATE_PARTS) + { + date_len[i]= 0; + date[i++]= 0; + } + + if (!is_internal_format) + { + year_length= date_len[(uint) format_position[0]]; + if (!year_length) /* Year must be specified */ + { + *was_cut= 1; + DBUG_RETURN(MYSQL_TIMESTAMP_NONE); + } + + l_time->year= date[(uint) format_position[0]]; + l_time->month= date[(uint) format_position[1]]; + l_time->day= date[(uint) format_position[2]]; + l_time->hour= date[(uint) format_position[3]]; + l_time->minute= date[(uint) format_position[4]]; + l_time->second= date[(uint) format_position[5]]; + + frac_pos= (uint) format_position[6]; + frac_len= date_len[frac_pos]; + if (frac_len < 6) + date[frac_pos]*= (uint) log_10_int[6 - frac_len]; + l_time->second_part= date[frac_pos]; + + if (format_position[7] != (uchar) 255) + { + if (l_time->hour > 12) + { + *was_cut= 1; + goto err; + } + l_time->hour= l_time->hour%12 + add_hours; + } + } + else + { + l_time->year= date[0]; + l_time->month= date[1]; + l_time->day= date[2]; + l_time->hour= date[3]; + l_time->minute= date[4]; + l_time->second= date[5]; + if (date_len[6] < 6) + date[6]*= (uint) log_10_int[6 - date_len[6]]; + l_time->second_part=date[6]; + } + l_time->neg= 0; + + if (year_length == 2 && i >= format_position[1] && i >=format_position[2] && + (l_time->month || l_time->day)) + l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900); + + if (number_of_fields < 3 || l_time->month > 12 || + l_time->day > 31 || l_time->hour > 23 || + l_time->minute > 59 || l_time->second > 59 || + (!(flags & TIME_FUZZY_DATE) && (l_time->month == 0 || l_time->day == 0))) + { + /* Only give warning for a zero date if there is some garbage after */ + if (!not_zero_date) /* If zero date */ + { + for (; str != end ; str++) + { + if (!my_isspace(&my_charset_latin1, *str)) + { + not_zero_date= 1; /* Give warning */ + break; + } + } + } + if (not_zero_date) + *was_cut= 1; + goto err; + } + + l_time->time_type= (number_of_fields <= 3 ? + MYSQL_TIMESTAMP_DATE : MYSQL_TIMESTAMP_DATETIME); + + for (; str != end ; str++) + { + if (!my_isspace(&my_charset_latin1,*str)) + { + *was_cut= 1; + break; + } + } + + DBUG_RETURN(l_time->time_type= + (number_of_fields <= 3 ? MYSQL_TIMESTAMP_DATE : + MYSQL_TIMESTAMP_DATETIME)); + +err: + bzero((char*) l_time, sizeof(*l_time)); + DBUG_RETURN(MYSQL_TIMESTAMP_ERROR); +} + + +/* + Convert a time string to a TIME struct. + + SYNOPSIS + str_to_time() + str A string in full TIMESTAMP format or + [-] DAYS [H]H:MM:SS, [H]H:MM:SS, [M]M:SS, [H]HMMSS, + [M]MSS or [S]S + There may be an optional [.second_part] after seconds + length Length of str + l_time Store result here + was_cut Set to 1 if value was cut during conversion or to 0 + otherwise. + + NOTES + Because of the extra days argument, this function can only + work with times where the time arguments are in the above order. + + RETURN + 0 ok + 1 error +*/ + +bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time, + int *was_cut) +{ + long date[5],value; + const char *end=str+length, *end_of_days; + bool found_days,found_hours; + uint state; + + l_time->neg=0; + *was_cut= 0; + for (; str != end && my_isspace(&my_charset_latin1,*str) ; str++) + length--; + if (str != end && *str == '-') + { + l_time->neg=1; + str++; + length--; + } + if (str == end) + return 1; + + /* Check first if this is a full TIMESTAMP */ + if (length >= 12) + { /* Probably full timestamp */ + enum enum_mysql_timestamp_type + res= str_to_datetime(str, length, l_time, + (TIME_FUZZY_DATE | TIME_DATETIME_ONLY), was_cut); + if ((int) res >= (int) MYSQL_TIMESTAMP_ERROR) + return res == MYSQL_TIMESTAMP_ERROR; + /* We need to restore was_cut flag since str_to_datetime can modify it */ + *was_cut= 0; + } + + /* Not a timestamp. Try to get this as a DAYS_TO_SECOND string */ + for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++) + value=value*10L + (long) (*str - '0'); + + /* Skip all space after 'days' */ + end_of_days= str; + for (; str != end && my_isspace(&my_charset_latin1, str[0]) ; str++) + ; + + LINT_INIT(state); + found_days=found_hours=0; + if ((uint) (end-str) > 1 && str != end_of_days && + my_isdigit(&my_charset_latin1, *str)) + { /* Found days part */ + date[0]= value; + state= 1; /* Assume next is hours */ + found_days= 1; + } + else if ((end-str) > 1 && *str == time_separator && + my_isdigit(&my_charset_latin1, str[1])) + { + date[0]=0; /* Assume we found hours */ + date[1]=value; + state=2; + found_hours=1; + str++; /* skip ':' */ + } + else + { + /* String given as one number; assume HHMMSS format */ + date[0]= 0; + date[1]= value/10000; + date[2]= value/100 % 100; + date[3]= value % 100; + state=4; + goto fractional; + } + + /* Read hours, minutes and seconds */ + for (;;) + { + for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++) + value=value*10L + (long) (*str - '0'); + date[state++]=value; + if (state == 4 || (end-str) < 2 || *str != time_separator || + !my_isdigit(&my_charset_latin1,str[1])) + break; + str++; /* Skip time_separator (':') */ + } + + if (state != 4) + { /* Not HH:MM:SS */ + /* Fix the date to assume that seconds was given */ + if (!found_hours && !found_days) + { + bmove_upp((char*) (date+4), (char*) (date+state), + sizeof(long)*(state-1)); + bzero((char*) date, sizeof(long)*(4-state)); + } + else + bzero((char*) (date+state), sizeof(long)*(4-state)); + } + +fractional: + /* Get fractional second part */ + if ((end-str) >= 2 && *str == '.' && my_isdigit(&my_charset_latin1,str[1])) + { + uint field_length=5; + str++; value=(uint) (uchar) (*str - '0'); + while (++str != end && + my_isdigit(&my_charset_latin1,str[0]) && + field_length--) + value=value*10 + (uint) (uchar) (*str - '0'); + if (field_length) + value*= (long) log_10_int[field_length]; + date[4]=value; + } + else + date[4]=0; + + if (internal_format_positions[7] != 255) + { + /* Read a possible AM/PM */ + while (str != end && my_isspace(&my_charset_latin1, *str)) + str++; + if (str+2 <= end && (str[1] == 'M' || str[1] == 'm')) + { + if (str[0] == 'p' || str[0] == 'P') + { + str+= 2; + date[1]= date[1]%12 + 12; + } + else if (str[0] == 'a' || str[0] == 'A') + str+=2; + } + } + + /* Some simple checks */ + if (date[2] >= 60 || date[3] >= 60) + { + *was_cut= 1; + return 1; + } + l_time->year= 0; /* For protocol::store_time */ + l_time->month= 0; + l_time->day= date[0]; + l_time->hour= date[1]; + l_time->minute= date[2]; + l_time->second= date[3]; + l_time->second_part= date[4]; + l_time->time_type= MYSQL_TIMESTAMP_TIME; + + /* Check if there is garbage at end of the TIME specification */ + if (str != end) + { + do + { + if (!my_isspace(&my_charset_latin1,*str)) + { + *was_cut= 1; + break; + } + } while (++str != end); + } + return 0; +} + + diff --git a/sql/Makefile.am b/sql/Makefile.am index b96f3a63aeb..9777e1b8533 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -27,6 +27,7 @@ WRAPLIBS= @WRAPLIBS@ SUBDIRS = share libexec_PROGRAMS = mysqld noinst_PROGRAMS = gen_lex_hash +bin_PROGRAMS = mysql_tzinfo_to_sql gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@ LDADD = @isam_libs@ \ ../myisam/libmyisam.a \ @@ -88,10 +89,15 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ client.c sql_client.cc mini_client_errors.c pack.c\ stacktrace.c repl_failsafe.h repl_failsafe.cc \ gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \ - tztime.cc examples/ha_example.cc examples/ha_archive.cc + tztime.cc my_time.c \ + examples/ha_example.cc examples/ha_archive.cc gen_lex_hash_SOURCES = gen_lex_hash.cc gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) +mysql_tzinfo_to_sql_SOURCES = mysql_tzinfo_to_sql_tztime.cc +mysql_tzinfo_to_sql_CXXFLAGS = -DTZINFO2SQL $(AM_CXXFLAGS) +mysql_tzinfo_to_sql_LDADD = $(LDADD) $(CXXLDFLAGS) + DEFS = -DMYSQL_SERVER \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ @@ -109,10 +115,16 @@ link_sources: @LN_CP_F@ ../sql-common/pack.c pack.c rm -f client.c @LN_CP_F@ ../sql-common/client.c client.c + rm -f my_time.c + @LN_CP_F@ ../sql-common/my_time.c my_time.c gen_lex_hash.o: gen_lex_hash.cc lex.h $(CXXCOMPILE) -c $(INCLUDES) $< +mysql_tzinfo_to_sql_tztime.cc: tztime.cc + rm -f $(srcdir)/mysql_tzinfo_to_sql_tztime.cc + @LN_CP_F@ $(srcdir)/tztime.cc $(srcdir)/mysql_tzinfo_to_sql_tztime.cc + # Try to get better dependencies for the grammar. Othervise really bad # things like different grammars for different pars of MySQL can # happen if you are unlucky. diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 001ab735497..e052a819ef8 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -481,13 +481,13 @@ int ha_archive::update_row(const byte * old_data, byte * new_data) { DBUG_ENTER("ha_archive::update_row"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } int ha_archive::delete_row(const byte * buf) { DBUG_ENTER("ha_archive::delete_row"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } int ha_archive::index_read(byte * buf, const byte * key, @@ -496,7 +496,7 @@ int ha_archive::index_read(byte * buf, const byte * key, __attribute__((unused))) { DBUG_ENTER("ha_archive::index_read"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } int ha_archive::index_read_idx(byte * buf, uint index, const byte * key, @@ -505,32 +505,32 @@ int ha_archive::index_read_idx(byte * buf, uint index, const byte * key, __attribute__((unused))) { DBUG_ENTER("ha_archive::index_read_idx"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } int ha_archive::index_next(byte * buf) { DBUG_ENTER("ha_archive::index_next"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } int ha_archive::index_prev(byte * buf) { DBUG_ENTER("ha_archive::index_prev"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } int ha_archive::index_first(byte * buf) { DBUG_ENTER("ha_archive::index_first"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } int ha_archive::index_last(byte * buf) { DBUG_ENTER("ha_archive::index_last"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -581,6 +581,6 @@ ha_rows ha_archive::records_in_range(int inx, enum ha_rkey_function end_search_flag) { DBUG_ENTER("ha_archive::records_in_range "); - DBUG_RETURN(records); // HA_ERR_NOT_IMPLEMENTED + DBUG_RETURN(records); // HA_ERR_WRONG_COMMAND } #endif /* HAVE_ARCHIVE_DB */ diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h index 90f64b4c01c..03e296d0eae 100644 --- a/sql/examples/ha_archive.h +++ b/sql/examples/ha_archive.h @@ -22,7 +22,7 @@ /* Please read ha_archive.cc first. If you are looking for more general - answers on how storage engines work, look at ha_example.cc and + answers on how storage engines work, look at ha_example.cc and ha_example.h. */ @@ -36,7 +36,7 @@ typedef struct st_archive_share { bool dirty; /* Flag for if a flush should occur */ } ARCHIVE_SHARE; -/* +/* Version for file format. 1 - Initial Version */ @@ -61,7 +61,7 @@ public: /* The size of the offset value we will use for position() */ ref_length = sizeof(z_off_t); } - ~ha_archive() + ~ha_archive() { } const char *table_type() const { return "ARCHIVE"; } @@ -69,21 +69,18 @@ public: const char **bas_ext() const; ulong table_flags() const { - return (HA_REC_NOT_IN_SEQ | HA_NOT_EXACT_COUNT | HA_NO_WRITE_DELAYED | - HA_NO_AUTO_INCREMENT); + return (HA_REC_NOT_IN_SEQ | HA_NOT_EXACT_COUNT | HA_NO_AUTO_INCREMENT | + HA_FILE_BASED); } - ulong index_flags(uint inx) const + ulong index_flags(uint idx, uint part) const { return 0; } - /* - This is just a default, there is no real limit as far as + /* + Have to put something here, there is no real limit as far as archive is concerned. */ - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return 0; } - uint max_key_parts() const { return 0; } - uint max_key_length() const { return 0; } + uint max_supported_record_length() const { return UINT_MAX; } /* Called in test_quick_select to determine if indexes should be used. */ diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index 4c192a94b4b..097abd48e05 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -14,24 +14,24 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - ha_example is a stubbed storage engine. It does nothing at this point. It - will let you create/open/delete tables but that is all. You can enable it +/* + ha_example is a stubbed storage engine. It does nothing at this point. It + will let you create/open/delete tables but that is all. You can enable it in your buld by doing the following during your build process: ./configure --with-example-storage-engine - + Once this is done mysql will let you create tables with: CREATE TABLE A (...) ENGINE=EXAMPLE; The example is setup to use table locks. It implements an example "SHARE" - that is inserted into a hash by table name. You can use this to store + that is inserted into a hash by table name. You can use this to store information of state that any example handler object will be able to see if it is using the same table. - Please read the object definition in ha_example.h before reading the rest + Please read the object definition in ha_example.h before reading the rest if this file. - To get an idea of what occurs here is an example select that would do a + To get an idea of what occurs here is an example select that would do a scan of an entire table: ha_example::store_lock ha_example::external_lock @@ -50,13 +50,13 @@ ha_example::rnd_next ha_example::extra ENUM HA_EXTRA_NO_CACHE End cacheing of records (def) - ha_example::external_lock + ha_example::external_lock ha_example::extra ENUM HA_EXTRA_RESET Reset database to after open - In the above example has 9 row called before rnd_next signalled that it was - at the end of its data. In the above example the table was already opened - (or you would have seen a call to ha_example::open(). Calls to + In the above example has 9 row called before rnd_next signalled that it was + at the end of its data. In the above example the table was already opened + (or you would have seen a call to ha_example::open(). Calls to ha_example::extra() are hints as to what will be occuring to the request. Happy coding! @@ -92,7 +92,7 @@ static byte* example_get_key(EXAMPLE_SHARE *share,uint *length, /* Example of simple lock controls. The "share" it creates is structure we will pass to each example handler. Do you have to have one of these? Well, you have - pieces that are used for locking, and they are needed to function. + pieces that are used for locking, and they are needed to function. */ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table) { @@ -130,7 +130,7 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table) my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), &share, sizeof(*share), &tmp_name, length+1, - NullS))) + NullS))) { pthread_mutex_unlock(&example_mutex); return NULL; @@ -161,7 +161,7 @@ error: } -/* +/* Free lock controls. We call this whenever we close a table. If the table had the last reference to the share then we free memory associated with it. */ @@ -182,7 +182,7 @@ static int free_share(EXAMPLE_SHARE *share) /* - If frm_error() is called then we will use this to to find out what file extentions + If frm_error() is called then we will use this to to find out what file extentions exist for the storage engine. This is also used by the default rename_table and delete_table method in handler.cc. */ @@ -190,10 +190,10 @@ const char **ha_example::bas_ext() const { static const char *ext[]= { NullS }; return ext; } -/* +/* Used for opening tables. The name will be the name of the file. A table is opened when it needs to be opened. For instance - when a request comes in for a select on the table (tables are not + when a request comes in for a select on the table (tables are not open and closed for each request, they are cached). Called from handler.cc by handler::ha_open(). The server opens all tables by @@ -212,12 +212,12 @@ int ha_example::open(const char *name, int mode, uint test_if_locked) /* - Closes a table. We call the free_share() function to free any resources + Closes a table. We call the free_share() function to free any resources that we have allocated in the "shared" structure. Called from sql_base.cc, sql_select.cc, and table.cc. In sql_select.cc it is only used to close up temporary tables or during - the process where a temporary table is converted over to being a + the process where a temporary table is converted over to being a myisam table. For sql_base.cc look at close_data_tables(). */ @@ -230,7 +230,7 @@ int ha_example::close(void) /* write_row() inserts a row. No extra() hint is given currently if a bulk load - is happeneding. buf() is a byte array of data. You can use the field + is happeneding. buf() is a byte array of data. You can use the field information to extract the data from the native byte array type. Example of this would be: for (Field **field=table->field ; *field ; field++) @@ -238,20 +238,20 @@ int ha_example::close(void) ... } - See ha_tina.cc for an example of extracting all of the data as strings. + See ha_tina.cc for an example of extracting all of the data as strings. ha_berekly.cc has an example of how to store it intact by "packing" it for ha_berkeley's own native storage type. See the note for update_row() on auto_increments and timestamps. This case also applied to write_row(). - Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc, + Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc, sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc. */ int ha_example::write_row(byte * buf) { DBUG_ENTER("ha_example::write_row"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -274,7 +274,7 @@ int ha_example::update_row(const byte * old_data, byte * new_data) { DBUG_ENTER("ha_example::update_row"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -282,8 +282,8 @@ int ha_example::update_row(const byte * old_data, byte * new_data) This will delete a row. buf will contain a copy of the row to be deleted. The server will call this right after the current row has been called (from either a previous rnd_nexT() or index call). - If you keep a pointer to the last row or can access a primary key it will - make doing the deletion quite a bit easier. + If you keep a pointer to the last row or can access a primary key it will + make doing the deletion quite a bit easier. Keep in mind that the server does no guarentee consecutive deletions. ORDER BY clauses can be used. @@ -294,7 +294,7 @@ int ha_example::update_row(const byte * old_data, byte * new_data) int ha_example::delete_row(const byte * buf) { DBUG_ENTER("ha_example::delete_row"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -309,7 +309,7 @@ int ha_example::index_read(byte * buf, const byte * key, __attribute__((unused))) { DBUG_ENTER("ha_example::index_read"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -323,7 +323,7 @@ int ha_example::index_read_idx(byte * buf, uint index, const byte * key, __attribute__((unused))) { DBUG_ENTER("ha_example::index_read_idx"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -333,7 +333,7 @@ int ha_example::index_read_idx(byte * buf, uint index, const byte * key, int ha_example::index_next(byte * buf) { DBUG_ENTER("ha_example::index_next"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -343,40 +343,40 @@ int ha_example::index_next(byte * buf) int ha_example::index_prev(byte * buf) { DBUG_ENTER("ha_example::index_prev"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } /* index_first() asks for the first key in the index. - Called from opt_range.cc, opt_sum.cc, sql_handler.cc, + Called from opt_range.cc, opt_sum.cc, sql_handler.cc, and sql_select.cc. */ int ha_example::index_first(byte * buf) { DBUG_ENTER("ha_example::index_first"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } /* index_last() asks for the last key in the index. - Called from opt_range.cc, opt_sum.cc, sql_handler.cc, + Called from opt_range.cc, opt_sum.cc, sql_handler.cc, and sql_select.cc. */ int ha_example::index_last(byte * buf) { DBUG_ENTER("ha_example::index_last"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } -/* +/* rnd_init() is called when the system wants the storage engine to do a table - scan. - See the example in the introduction at the top of this file to see when + scan. + See the example in the introduction at the top of this file to see when rnd_init() is called. Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc, @@ -385,11 +385,16 @@ int ha_example::index_last(byte * buf) int ha_example::rnd_init(bool scan) { DBUG_ENTER("ha_example::rnd_init"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } +int ha_example::rnd_end() +{ + DBUG_ENTER("ha_example::rnd_end"); + DBUG_RETURN(0); +} -/* +/* This is called for each row of the table scan. When you run out of records you should return HA_ERR_END_OF_FILE. Fill buff up with the row information. The Field structure for the table is the key to getting data into buf @@ -415,8 +420,8 @@ int ha_example::rnd_next(byte *buf) the size needed to store current_position. ref is just a byte array that the server will maintain. If you are using offsets to mark rows, then current_position should be the offset. If it is a primary key like in - BDB, then it needs to be a primary key. - + BDB, then it needs to be a primary key. + Called from filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc. */ void ha_example::position(const byte *record) @@ -436,7 +441,7 @@ void ha_example::position(const byte *record) int ha_example::rnd_pos(byte * buf, byte *pos) { DBUG_ENTER("ha_example::rnd_pos"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -449,9 +454,9 @@ int ha_example::rnd_pos(byte * buf, byte *pos) if (records < 2) records = 2; The reason is that the server will optimize for cases of only a single - record. If in a table scan you don't know the number of records + record. If in a table scan you don't know the number of records it will probably be better to set records to two so you can return - as many records as you need. + as many records as you need. Along with records a few more variables you may wish to set are: records deleted @@ -518,9 +523,9 @@ int ha_example::reset(void) /* Used to delete all rows in a table. Both for cases of truncate and for cases where the optimizer realizes that all rows will be - removed as a result of a SQL statement. + removed as a result of a SQL statement. - Called from item_sum.cc by Item_func_group_concat::clear(), + Called from item_sum.cc by Item_func_group_concat::clear(), Item_sum_count_distinct::clear(), and Item_func_group_concat::clear(). Called from sql_delete.cc by mysql_delete(). Called from sql_select.cc by JOIN::reinit(). @@ -529,12 +534,12 @@ int ha_example::reset(void) int ha_example::delete_all_rows() { DBUG_ENTER("ha_example::delete_all_rows"); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } -/* - First you should go read the section "locking functions for mysql" in +/* + First you should go read the section "locking functions for mysql" in lock.cc to understand this. This create a lock on the table. If you are implementing a storage engine that can handle transacations look at ha_berkely.cc to see how you will @@ -564,7 +569,7 @@ int ha_example::external_lock(THD *thd, int lock_type) lock (if we don't want to use MySQL table locks at all) or add locks for many tables (like we do when we are using a MERGE handler). - Berkeley DB for example changes all WRITE locks to TL_WRITE_ALLOW_WRITE + Berkeley DB for example changes all WRITE locks to TL_WRITE_ALLOW_WRITE (which signals that we are doing WRITES, but we are still allowing other reader's and writer's. @@ -591,9 +596,9 @@ THR_LOCK_DATA **ha_example::store_lock(THD *thd, } /* - Used to delete a table. By the time delete_table() has been called all + Used to delete a table. By the time delete_table() has been called all opened references to this table will have been closed (and your globally - shared references released. The variable name will just be the name of + shared references released. The variable name will just be the name of the table. You will need to remove any files you have created at this point. If you do not implement this, the default delete_table() is called from @@ -623,10 +628,10 @@ int ha_example::delete_table(const char *name) int ha_example::rename_table(const char * from, const char * to) { DBUG_ENTER("ha_example::rename_table "); - DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); } -/* +/* Given a starting key, and an ending key estimate the number of rows that will exist between the two. end_key may be empty which in case determine if start_key matches any rows. @@ -644,14 +649,14 @@ ha_rows ha_example::records_in_range(uint inx, key_range *min_key, /* create() is called to create a database. The variable name will have the name of the table. When create() is called you do not need to worry about opening - the table. Also, the FRM file will have already been created so adjusting + the table. Also, the FRM file will have already been created so adjusting create_info will not do you any good. You can overwrite the frm file at this - point if you wish to change the table definition, but there are no methods + point if you wish to change the table definition, but there are no methods currently provided for doing that. Called from handle.cc by ha_create_table(). */ -int ha_example::create(const char *name, TABLE *table_arg, +int ha_example::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info) { DBUG_ENTER("ha_example::create"); diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h index cd8baac2017..dc8f265c16e 100644 --- a/sql/examples/ha_example.h +++ b/sql/examples/ha_example.h @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* +/* Please read ha_exmple.cc before reading this file. Please keep in mind that the example storage engine implements all methods that are required to be implemented. handler.h has a full list of methods @@ -48,55 +48,68 @@ public: ha_example(TABLE *table): handler(table) { } - ~ha_example() + ~ha_example() { } /* The name that will be used for display purposes */ - const char *table_type() const { return "EXAMPLE"; } - /* The name of the index type that will be used for display */ - const char *index_type(uint inx) { return "NONE"; } + const char *table_type() const { return "EXAMPLE"; } + /* + The name of the index type that will be used for display + don't implement this method unless you really have indexes + */ + const char *index_type(uint inx) { return "HASH"; } const char **bas_ext() const; - /* - This is a list of flags that says what the storage engine + /* + This is a list of flags that says what the storage engine implements. The current table flags are documented in - table_flags. + handler.h */ ulong table_flags() const { return 0; } - /* - This is a list of flags that says how the storage engine + /* + This is a list of flags that says how the storage engine implements indexes. The current index flags are documented in - handler.h. If you do not implement indexes, just return zero + handler.h. If you do not implement indexes, just return zero here. */ - ulong index_flags(uint inx) const + ulong index_flags(uint inx, uint part) const { return 0; } - /* + /* unireg.cc will call the following to make sure that the storage engine can handle the data it is about to send. + + Return *real* limits of your storage engine here. MySQL will do + min(your_limits, MySQL_limits) automatically + + There is no need to implement ..._key_... methods if you don't suport + indexes. */ - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return 0; } - uint max_key_parts() const { return 0; } - uint max_key_length() const { return 0; } + uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } + uint max_supported_keys() const { return 0; } + uint max_supported_key_parts() const { return 0; } + uint max_supported_key_length() const { return 0; } /* Called in test_quick_select to determine if indexes should be used. */ virtual double scan_time() { return (double) (records+deleted) / 20.0+10; } - /* + /* The next method will never be called if you do not implement indexes. */ virtual double read_time(ha_rows rows) { return (double) rows / 20.0+1; } - /* + /* Everything below are methods that we implment in ha_example.cc. + + Most of these methods are not obligatory, skip them and + MySQL will treat them as not implemented */ - int open(const char *name, int mode, uint test_if_locked); - int close(void); + int open(const char *name, int mode, uint test_if_locked); // required + int close(void); // required + int write_row(byte * buf); int update_row(const byte * old_data, byte * new_data); int delete_row(const byte * buf); @@ -108,21 +121,32 @@ public: int index_prev(byte * buf); int index_first(byte * buf); int index_last(byte * buf); - int rnd_init(bool scan=1); - int rnd_next(byte *buf); - int rnd_pos(byte * buf, byte *pos); - void position(const byte *record); - void info(uint); + /* + unlike index_init(), rnd_init() can be called two times + without rnd_end() in between (it only makes sense if scan=1). + then the second call should prepare for the new table scan + (e.g if rnd_init allocates the cursor, second call should + position it to the start of the table, no need to deallocate + and allocate it again + */ + int rnd_init(bool scan); //required + int rnd_end(); + int rnd_next(byte *buf); //required + int rnd_pos(byte * buf, byte *pos); //required + void position(const byte *record); //required + void info(uint); //required + int extra(enum ha_extra_function operation); int reset(void); - int external_lock(THD *thd, int lock_type); + int external_lock(THD *thd, int lock_type); //required int delete_all_rows(void); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); int delete_table(const char *from); int rename_table(const char * from, const char * to); - int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); + int create(const char *name, TABLE *form, + HA_CREATE_INFO *create_info); //required THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, - enum thr_lock_type lock_type); + enum thr_lock_type lock_type); //required }; diff --git a/sql/field.cc b/sql/field.cc index f113b98cccd..2d3729817b7 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -398,8 +398,8 @@ bool Field::get_date(TIME *ltime,uint fuzzydate) char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; if (!(res=val_str(&tmp)) || - str_to_TIME_with_warn(res->ptr(), res->length(), ltime, fuzzydate) <= - TIMESTAMP_DATETIME_ERROR) + str_to_datetime_with_warn(res->ptr(), res->length(), + ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR) return 1; return 0; } @@ -433,7 +433,7 @@ void Field::store_time(TIME *ltime,timestamp_type type) bool Field::optimize_range(uint idx) { - return !test(table->file->index_flags(idx) & HA_WRONG_ASCII_ORDER); + return test(table->file->index_flags(idx) & HA_READ_RANGE); } /**************************************************************************** @@ -2918,12 +2918,12 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs) bool in_dst_time_gap; THD *thd= table->in_use; - have_smth_to_conv= (str_to_TIME(from, len, &l_time, 0, &error) > - TIMESTAMP_DATETIME_ERROR); + have_smth_to_conv= (str_to_datetime(from, len, &l_time, 0, &error) > + MYSQL_TIMESTAMP_ERROR); if (error) set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, - from, len, TIMESTAMP_DATETIME, 1); + from, len, MYSQL_TIMESTAMP_DATETIME, 1); if (have_smth_to_conv) { @@ -2931,7 +2931,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs) { set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - from, len, TIMESTAMP_DATETIME, !error); + from, len, MYSQL_TIMESTAMP_DATETIME, !error); error= 1; } @@ -2939,7 +2939,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs) { set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_INVALID_TIMESTAMP, - from, len, TIMESTAMP_DATETIME, !error); + from, len, MYSQL_TIMESTAMP_DATETIME, !error); error= 1; } } @@ -2962,7 +2962,7 @@ int Field_timestamp::store(double nr) { set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - nr, TIMESTAMP_DATETIME); + nr, MYSQL_TIMESTAMP_DATETIME); nr= 0; // Avoid overflow on buff error= 1; } @@ -2985,7 +2985,7 @@ int Field_timestamp::store(longlong nr) { set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - nr, TIMESTAMP_DATETIME, 1); + nr, MYSQL_TIMESTAMP_DATETIME, 1); error= 1; } @@ -2993,14 +2993,14 @@ int Field_timestamp::store(longlong nr) { set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_INVALID_TIMESTAMP, - nr, TIMESTAMP_DATETIME, !error); + nr, MYSQL_TIMESTAMP_DATETIME, !error); error= 1; } } else if (error) set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, - nr, TIMESTAMP_DATETIME, 1); + nr, MYSQL_TIMESTAMP_DATETIME, 1); #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) @@ -3232,14 +3232,14 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs) tmp=0L; error= 1; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, - from, len, TIMESTAMP_TIME, 1); + from, len, MYSQL_TIMESTAMP_TIME, 1); } else { if (error) set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, - from, len, TIMESTAMP_TIME, 1); + from, len, MYSQL_TIMESTAMP_TIME, 1); if (ltime.month) ltime.day=0; @@ -3249,7 +3249,7 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs) tmp=8385959; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - from, len, TIMESTAMP_TIME, !error); + from, len, MYSQL_TIMESTAMP_TIME, !error); error= 1; } } @@ -3269,14 +3269,14 @@ int Field_time::store(double nr) { tmp=8385959L; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME); + ER_WARN_DATA_OUT_OF_RANGE, nr, MYSQL_TIMESTAMP_TIME); error= 1; } else if (nr < -8385959.0) { tmp= -8385959L; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME); + ER_WARN_DATA_OUT_OF_RANGE, nr, MYSQL_TIMESTAMP_TIME); error= 1; } else @@ -3288,7 +3288,8 @@ int Field_time::store(double nr) { tmp=0; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME); + ER_WARN_DATA_OUT_OF_RANGE, nr, + MYSQL_TIMESTAMP_TIME); error= 1; } } @@ -3305,14 +3306,16 @@ int Field_time::store(longlong nr) { tmp=8385959L; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME, 1); + ER_WARN_DATA_OUT_OF_RANGE, nr, + MYSQL_TIMESTAMP_TIME, 1); error= 1; } else if (nr < (longlong) -8385959L) { tmp= -8385959L; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME, 1); + ER_WARN_DATA_OUT_OF_RANGE, nr, + MYSQL_TIMESTAMP_TIME, 1); error= 1; } else @@ -3322,7 +3325,8 @@ int Field_time::store(longlong nr) { tmp=0; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME, 1); + ER_WARN_DATA_OUT_OF_RANGE, nr, + MYSQL_TIMESTAMP_TIME, 1); error= 1; } } @@ -3417,7 +3421,7 @@ bool Field_time::get_time(TIME *ltime) ltime->minute= (int) tmp/100; ltime->second= (int) tmp % 100; ltime->second_part=0; - ltime->time_type= TIMESTAMP_TIME; + ltime->time_type= MYSQL_TIMESTAMP_TIME; return 0; } @@ -3566,8 +3570,7 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs) uint32 tmp; int error; - if (str_to_TIME(from, len, &l_time, 1, &error) <= - TIMESTAMP_DATETIME_ERROR) + if (str_to_datetime(from, len, &l_time, 1, &error) <= MYSQL_TIMESTAMP_ERROR) { tmp=0; error= 1; @@ -3577,7 +3580,7 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs) if (error) set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, - from, len, TIMESTAMP_DATE, 1); + from, len, MYSQL_TIMESTAMP_DATE, 1); #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) @@ -3602,7 +3605,7 @@ int Field_date::store(double nr) tmp=0L; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - nr, TIMESTAMP_DATE); + nr, MYSQL_TIMESTAMP_DATE); error= 1; } else @@ -3630,7 +3633,7 @@ int Field_date::store(longlong nr) tmp=0L; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - nr, TIMESTAMP_DATE, 0); + nr, MYSQL_TIMESTAMP_DATE, 0); error= 1; } else @@ -3758,8 +3761,7 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs) TIME l_time; long tmp; int error; - if (str_to_TIME(from, len, &l_time, 1, &error) <= - TIMESTAMP_DATETIME_ERROR) + if (str_to_datetime(from, len, &l_time, 1, &error) <= MYSQL_TIMESTAMP_ERROR) { tmp=0L; error= 1; @@ -3769,7 +3771,7 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs) if (error) set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, - from, len, TIMESTAMP_DATE, 1); + from, len, MYSQL_TIMESTAMP_DATE, 1); int3store(ptr,tmp); return error; @@ -3781,7 +3783,7 @@ int Field_newdate::store(double nr) { (void) Field_newdate::store((longlong) -1); set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_TRUNCATED, nr, TIMESTAMP_DATE); + ER_WARN_DATA_TRUNCATED, nr, MYSQL_TIMESTAMP_DATE); return 1; } else @@ -3799,7 +3801,8 @@ int Field_newdate::store(longlong nr) { tmp=0; set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_DATE, 1); + ER_WARN_DATA_OUT_OF_RANGE, nr, + MYSQL_TIMESTAMP_DATE, 1); error= 1; } else @@ -3818,7 +3821,8 @@ int Field_newdate::store(longlong nr) { tmp=0L; // Don't allow date to change set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_DATE, 1); + ER_WARN_DATA_OUT_OF_RANGE, nr, + MYSQL_TIMESTAMP_DATE, 1); error= 1; } else @@ -3831,7 +3835,7 @@ int Field_newdate::store(longlong nr) void Field_newdate::store_time(TIME *ltime,timestamp_type type) { long tmp; - if (type == TIMESTAMP_DATE || type == TIMESTAMP_DATETIME) + if (type == MYSQL_TIMESTAMP_DATE || type == MYSQL_TIMESTAMP_DATETIME) tmp=ltime->year*16*32+ltime->month*32+ltime->day; else { @@ -3895,7 +3899,7 @@ bool Field_newdate::get_date(TIME *ltime,uint fuzzydate) ltime->day= tmp & 31; ltime->month= (tmp >> 5) & 15; ltime->year= (tmp >> 9); - ltime->time_type=TIMESTAMP_DATE; + ltime->time_type= MYSQL_TIMESTAMP_DATE; ltime->hour= ltime->minute= ltime->second= ltime->second_part= ltime->neg= 0; return (!fuzzydate && (!ltime->month || !ltime->day)) ? 1 : 0; } @@ -3939,14 +3943,13 @@ int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs) int error; ulonglong tmp= 0; - if (str_to_TIME(from, len, &time_tmp, 1, &error) > - TIMESTAMP_DATETIME_ERROR) + if (str_to_datetime(from, len, &time_tmp, 1, &error) > MYSQL_TIMESTAMP_ERROR) tmp= TIME_to_ulonglong_datetime(&time_tmp); if (error) set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - from, len, TIMESTAMP_DATETIME, 1); + from, len, MYSQL_TIMESTAMP_DATETIME, 1); #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) @@ -3967,7 +3970,7 @@ int Field_datetime::store(double nr) { set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, - nr, TIMESTAMP_DATETIME); + nr, MYSQL_TIMESTAMP_DATETIME); nr=0.0; error= 1; } @@ -3987,7 +3990,7 @@ int Field_datetime::store(longlong nr) if (error) set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, initial_nr, - TIMESTAMP_DATETIME, 1); + MYSQL_TIMESTAMP_DATETIME, 1); #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) @@ -4004,7 +4007,7 @@ int Field_datetime::store(longlong nr) void Field_datetime::store_time(TIME *ltime,timestamp_type type) { longlong tmp; - if (type == TIMESTAMP_DATE || type == TIMESTAMP_DATETIME) + if (type == MYSQL_TIMESTAMP_DATE || type == MYSQL_TIMESTAMP_DATETIME) tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*LL(1000000)+ (ltime->hour*10000L+ltime->minute*100+ltime->second)); else @@ -4103,7 +4106,7 @@ bool Field_datetime::get_date(TIME *ltime, uint fuzzydate) part1=(uint32) (tmp/LL(1000000)); part2=(uint32) (tmp - (ulonglong) part1*LL(1000000)); - ltime->time_type= TIMESTAMP_DATETIME; + ltime->time_type= MYSQL_TIMESTAMP_DATETIME; ltime->neg= 0; ltime->second_part= 0; ltime->second= (int) (part2%100); @@ -4681,6 +4684,42 @@ uint32 Field_blob::get_length(const char *pos) } +/* + Put a blob length field into a record buffer. + + SYNOPSIS + Field_blob::put_length() + pos Pointer into the record buffer. + length The length value to put. + + DESCRIPTION + Depending on the maximum length of a blob, its length field is + put into 1 to 4 bytes. This is a property of the blob object, + described by 'packlength'. + + RETURN + nothing +*/ + +void Field_blob::put_length(char *pos, uint32 length) +{ + switch (packlength) { + case 1: + *pos= (char) length; + break; + case 2: + int2store(pos, length); + break; + case 3: + int3store(pos, length); + break; + case 4: + int4store(pos, length); + break; + } +} + + int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) { if (!length) @@ -5055,6 +5094,50 @@ char *Field_blob::pack_key(char *to, const char *from, uint max_length) return to+length; } + +/* + Unpack a blob key into a record buffer. + + SYNOPSIS + Field_blob::unpack_key() + to Pointer into the record buffer. + from Pointer to the packed key. + max_length Key length limit from key description. + + DESCRIPTION + A blob key has a maximum size of 64K-1. + In its packed form, the length field is one or two bytes long, + depending on 'max_length'. + Depending on the maximum length of a blob, its length field is + put into 1 to 4 bytes. This is a property of the blob object, + described by 'packlength'. + Blobs are internally stored apart from the record buffer, which + contains a pointer to the blob buffer. + + RETURN + Pointer into 'from' past the last byte copied from packed key. +*/ + +const char *Field_blob::unpack_key(char *to, const char *from, uint max_length) +{ + /* get length of the blob key */ + uint32 length= *((uchar*) from++); + if (max_length > 255) + length+= (*((uchar*) from++)) << 8; + + /* put the length into the record buffer */ + put_length(to, length); + + /* put the address of the blob buffer or NULL */ + if (length) + memcpy_fixed(to + packlength, &from, sizeof(from)); + else + bzero(to + packlength, sizeof(from)); + + /* point to first byte of next field in 'from' */ + return from + length; +} + /* Create a packed key that will be used for storage from a MySQL key */ char *Field_blob::pack_key_from_key_image(char *to, const char *from, diff --git a/sql/field.h b/sql/field.h index e7a30372e43..a2fe77e18a3 100644 --- a/sql/field.h +++ b/sql/field.h @@ -251,6 +251,10 @@ public: { return pack(to,from,max_length); } + virtual const char *unpack_key(char* to, const char *from, uint max_length) + { + return unpack(to,from); + } virtual uint packed_col_length(const char *to, uint length) { return length;} virtual uint max_packed_col_length(uint max_length) @@ -1017,6 +1021,7 @@ public: inline uint32 get_length(uint row_offset=0) { return get_length(ptr+row_offset); } uint32 get_length(const char *ptr); + void put_length(char *pos, uint32 length); inline void get_ptr(char **str) { memcpy_fixed(str,ptr+packlength,sizeof(char*)); @@ -1049,6 +1054,7 @@ public: const char *unpack(char *to, const char *from); char *pack_key(char *to, const char *from, uint max_length); char *pack_key_from_key_image(char* to, const char *from, uint max_length); + const char *unpack_key(char* to, const char *from, uint max_length); int pack_cmp(const char *a, const char *b, uint key_length); int pack_cmp(const char *b, uint key_length); uint packed_col_length(const char *col_ptr, uint length); diff --git a/sql/filesort.cc b/sql/filesort.cc index fc8b529712c..a84fa4fe6f4 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -330,7 +330,7 @@ static BUFFPEK *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count) { my_free((char*) tmp, MYF(0)); tmp=0; - } + } } DBUG_RETURN(tmp); } @@ -373,7 +373,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, if (sort_form->key_read) // QQ Can be removed after the reset file->extra(HA_EXTRA_KEYREAD); // QQ is removed next_pos=(byte*) 0; /* Find records in sequence */ - file->rnd_init(); + file->ha_rnd_init(1); file->extra_opt(HA_EXTRA_CACHE, current_thd->variables.read_buff_size); } @@ -415,7 +415,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, { DBUG_PRINT("info",("Sort killed by user")); (void) file->extra(HA_EXTRA_NO_CACHE); - file->rnd_end(); + file->ha_rnd_end(); DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */ } if (error == 0) @@ -435,7 +435,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, file->unlock_row(); } (void) file->extra(HA_EXTRA_NO_CACHE); /* End cacheing of records */ - file->rnd_end(); + if (!next_pos) + file->ha_rnd_end(); DBUG_PRINT("test",("error: %d indexpos: %d",error,indexpos)); if (error != HA_ERR_END_OF_FILE) { diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index a13b6147468..4bed33af15b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -442,7 +442,6 @@ berkeley_key_cmp(TABLE *table, KEY *key_info, const char *key, uint key_length) return 0; // Identical keys } - int ha_berkeley::open(const char *name, int mode, uint test_if_locked) { char name_buff[FN_REFLEN]; @@ -725,8 +724,8 @@ void ha_berkeley::unpack_key(char *record, DBT *key, uint index) } record[key_part->null_offset]&= ~key_part->null_bit; } - pos= (char*) key_part->field->unpack(record + key_part->field->offset(), - pos); + pos= (char*) key_part->field->unpack_key(record + key_part->field->offset(), + pos, key_part->length); } } @@ -1350,6 +1349,7 @@ int ha_berkeley::index_end() error=cursor->c_close(cursor); cursor=0; } + active_index=MAX_KEY; DBUG_RETURN(error); } @@ -1411,7 +1411,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key, statistic_increment(ha_read_key_count,&LOCK_status); DBUG_ENTER("index_read_idx"); current_row.flags=DB_DBT_REALLOC; - active_index= (uint) -1; + active_index=MAX_KEY; DBUG_RETURN(read_row(key_file[keynr]->get(key_file[keynr], transaction, pack_key(&last_key, keynr, key_buff, key, key_len), @@ -1482,7 +1482,7 @@ int ha_berkeley::index_read(byte * buf, const byte * key, bzero((char*) &row, sizeof(row)); error= read_row(cursor->c_get(cursor, &last_key, &row, DB_PREV), (char*) buf, active_index, &row, &last_key, 1); - } + } DBUG_RETURN(error); } @@ -1630,20 +1630,51 @@ int ha_berkeley::rnd_pos(byte * buf, byte *pos) statistic_increment(ha_read_rnd_count,&LOCK_status); DBUG_ENTER("ha_berkeley::rnd_pos"); - active_index= (uint) -1; // Don't delete via cursor + active_index= MAX_KEY; DBUG_RETURN(read_row(file->get(file, transaction, get_pos(&db_pos, pos), ¤t_row, 0), (char*) buf, primary_key, ¤t_row, (DBT*) 0, 0)); } +/* + Set a reference to the current record in (ref,ref_length). + + SYNOPSIS + ha_berkeley::position() + record The current record buffer + + DESCRIPTION + The BDB handler stores the primary key in (ref,ref_length). + There is either an explicit primary key, or an implicit (hidden) + primary key. + During open(), 'ref_length' is calculated as the maximum primary + key length. When an actual key is shorter than that, the rest of + the buffer must be cleared out. The row cannot be identified, if + garbage follows behind the end of the key. There is no length + field for the current key, so that the whole ref_length is used + for comparison. + + RETURN + nothing +*/ + void ha_berkeley::position(const byte *record) { DBT key; + DBUG_ENTER("ha_berkeley::position"); if (hidden_primary_key) + { + DBUG_ASSERT(ref_length == BDB_HIDDEN_PRIMARY_KEY_LENGTH); memcpy_fixed(ref, (char*) current_ident, BDB_HIDDEN_PRIMARY_KEY_LENGTH); + } else + { create_key(&key, primary_key, (char*) ref, record); + if (key.size < ref_length) + bzero(ref + key.size, ref_length - key.size); + } + DBUG_VOID_RETURN; } diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h index 4bc8e3a5777..3afb73808fc 100644 --- a/sql/ha_berkeley.h +++ b/sql/ha_berkeley.h @@ -87,24 +87,25 @@ class ha_berkeley: public handler public: ha_berkeley(TABLE *table): handler(table), alloc_ptr(0),rec_buff(0), file(0), - int_table_flags(HA_REC_NOT_IN_SEQ | - HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER | HA_FAST_KEY_READ | - HA_NULL_KEY | HA_BLOB_KEY | HA_NOT_EXACT_COUNT | - HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE | - HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX | - HA_KEY_READ_WRONG_STR | HA_FILE_BASED), - changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0) - { - } + int_table_flags(HA_REC_NOT_IN_SEQ | HA_FAST_KEY_READ | + HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_NOT_EXACT_COUNT | + HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | + HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX), + changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0) {} ~ha_berkeley() {} const char *table_type() const { return "BerkeleyDB"; } + ulong ha_berkeley::index_flags(uint idx, uint part) const + { + ulong flags=HA_READ_NEXT | HA_READ_PREV; + if (part == (uint)~0 || + table->key_info[idx].key_part[part].field->key_type() != HA_KEYTYPE_TEXT) + flags|= HA_READ_ORDER | HA_KEYREAD_ONLY | HA_READ_RANGE; + return flags; + } const char *index_type(uint key_number) { return "BTREE"; } const char **bas_ext() const; ulong table_flags(void) const { return int_table_flags; } - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return MAX_KEY-1; } - uint max_key_parts() const { return MAX_REF_PARTS; } - uint max_key_length() const { return MAX_KEY_LENGTH; } + uint max_supported_keys() const { return MAX_KEY-1; } uint extra_rec_buf_length() { return BDB_HIDDEN_PRIMARY_KEY_LENGTH; } ha_rows estimate_number_of_rows(); const key_map *keys_to_use_for_scanning() { return &key_map_full; } @@ -128,7 +129,7 @@ class ha_berkeley: public handler int index_prev(byte * buf); int index_first(byte * buf); int index_last(byte * buf); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_end(); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index c375614ac95..cc828b6e6b2 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -111,6 +111,7 @@ int ha_heap::delete_row(const byte * buf) int ha_heap::index_read(byte * buf, const byte * key, uint key_len, enum ha_rkey_function find_flag) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_key_count, &LOCK_status); int error = heap_rkey(file,buf,active_index, key, key_len, find_flag); table->status = error ? STATUS_NOT_FOUND : 0; @@ -119,6 +120,7 @@ int ha_heap::index_read(byte * buf, const byte * key, uint key_len, int ha_heap::index_read_last(byte *buf, const byte *key, uint key_len) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_key_count, &LOCK_status); int error= heap_rkey(file, buf, active_index, key, key_len, HA_READ_PREFIX_LAST); @@ -137,6 +139,7 @@ int ha_heap::index_read_idx(byte * buf, uint index, const byte * key, int ha_heap::index_next(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_next_count,&LOCK_status); int error=heap_rnext(file,buf); table->status=error ? STATUS_NOT_FOUND: 0; @@ -145,6 +148,7 @@ int ha_heap::index_next(byte * buf) int ha_heap::index_prev(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_prev_count,&LOCK_status); int error=heap_rprev(file,buf); table->status=error ? STATUS_NOT_FOUND: 0; @@ -153,6 +157,7 @@ int ha_heap::index_prev(byte * buf) int ha_heap::index_first(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_first_count,&LOCK_status); int error=heap_rfirst(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -161,6 +166,7 @@ int ha_heap::index_first(byte * buf) int ha_heap::index_last(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_last_count,&LOCK_status); int error=heap_rlast(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; diff --git a/sql/ha_heap.h b/sql/ha_heap.h index f55eda91149..f05146acdc4 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -40,21 +40,18 @@ class ha_heap: public handler const char **bas_ext() const; ulong table_flags() const { - return (HA_READ_RND_SAME | HA_FAST_KEY_READ | HA_KEYPOS_TO_RNDPOS | - HA_NO_BLOBS | HA_NULL_KEY | HA_REC_NOT_IN_SEQ); + return (HA_FAST_KEY_READ | HA_NO_BLOBS | HA_NULL_IN_KEY | + HA_REC_NOT_IN_SEQ | HA_READ_RND_SAME | + HA_CAN_INSERT_DELAYED); } - ulong index_flags(uint inx) const + ulong index_flags(uint inx, uint part) const { return ((table->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? - (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER) : - (HA_ONLY_WHOLE_INDEX | HA_WRONG_ASCII_ORDER | - HA_NOT_READ_PREFIX_LAST)); + HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE : + HA_ONLY_WHOLE_INDEX); } const key_map *keys_to_use_for_scanning() { return &btree_keys; } - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return MAX_KEY; } - uint max_key_parts() const { return MAX_REF_PARTS; } - uint max_key_length() const { return HA_MAX_REC_LENGTH; } + uint max_supported_keys() const { return MAX_KEY; } double scan_time() { return (double) (records+deleted) / 20.0+10; } double read_time(uint index, uint ranges, ha_rows rows) { return (double) rows / 20.0+1; } @@ -75,7 +72,7 @@ class ha_heap: public handler int index_prev(byte * buf); int index_first(byte * buf); int index_last(byte * buf); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 133ebc87377..6eae315e443 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -407,7 +407,7 @@ innobase_mysql_print_thd( May 14, 2004 probably no race any more, but better be safe */ } - + /* Use strmake to reduce the timeframe for a race, compared to fwrite() */ i= (uint) (strmake(buf, s, len) - buf); @@ -1436,9 +1436,6 @@ ha_innobase::open( last_query_id = (ulong)-1; - active_index = 0; - active_index_before_scan = (uint)-1; /* undefined value */ - if (!(share=get_share(name))) { DBUG_RETURN(1); @@ -1582,15 +1579,6 @@ ha_innobase::open( DBUG_RETURN(0); } -/********************************************************************* -Does nothing. */ - -void -ha_innobase::initialize(void) -/*=========================*/ -{ -} - /********************************************************************** Closes a handle to an InnoDB table. */ @@ -2660,7 +2648,7 @@ ha_innobase::index_end(void) { int error = 0; DBUG_ENTER("index_end"); - + active_index=MAX_KEY; DBUG_RETURN(error); } @@ -3131,8 +3119,6 @@ ha_innobase::rnd_init( /* Store the active index value so that we can restore the original value after a scan */ - active_index_before_scan = active_index; - if (prebuilt->clust_index_was_generated) { err = change_active_index(MAX_KEY); } else { @@ -3152,19 +3138,7 @@ ha_innobase::rnd_end(void) /*======================*/ /* out: 0 or error number */ { - /* Restore the old active_index back; MySQL may assume that a table - scan does not change active_index. We only restore the value if - MySQL has called rnd_init before: sometimes MySQL seems to call - rnd_end WITHOUT calling rnd_init. */ - - if (active_index_before_scan != (uint)-1) { - - change_active_index(active_index_before_scan); - - active_index_before_scan = (uint)-1; - } - - return(index_end()); + return(index_end()); } /********************************************************************* @@ -5213,4 +5187,19 @@ innobase_store_binlog_offset_and_flush_log( /* Syncronous flush of the log buffer to disk */ log_buffer_flush_to_disk(); } + +char *ha_innobase::get_mysql_bin_log_name() +{ + return trx_sys_mysql_bin_log_name; +} + +ulonglong ha_innobase::get_mysql_bin_log_pos() +{ + /* + trx... is ib_longlong, which is a typedef for a 64-bit integer (__int64 or + longlong) so it's ok to cast it to ulonglong. + */ + return trx_sys_mysql_bin_log_pos; +} + #endif /* HAVE_INNOBASE_DB */ diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 4ad7633f9c3..7e05488289e 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -61,20 +61,11 @@ class ha_innobase: public handler ulong start_of_scan; /* this is set to 1 when we are starting a table scan but have not yet fetched any row, else 0 */ - uint active_index_before_scan; - /* since a table scan in InnoDB is - always done through an index, a table - scan may change active_index; but - MySQL may assume that active_index - after a table scan is the same as - before; we store the value here so - that we can restore the value after - a scan */ uint last_match_mode;/* match mode of the latest search: ROW_SEL_EXACT, ROW_SEL_EXACT_PREFIX, or undefined */ longlong auto_inc_counter_for_this_stat; - ulong max_row_length(const byte *buf); + ulong max_supported_row_length(const byte *buf); uint store_key_val_for_row(uint keynr, char* buff, uint buff_len, const byte* record); @@ -87,13 +78,10 @@ class ha_innobase: public handler public: ha_innobase(TABLE *table): handler(table), int_table_flags(HA_REC_NOT_IN_SEQ | - HA_KEYPOS_TO_RNDPOS | - HA_LASTKEY_ORDER | - HA_NULL_KEY | HA_FAST_KEY_READ | - HA_BLOB_KEY | + HA_NULL_IN_KEY | HA_FAST_KEY_READ | + HA_CAN_INDEX_BLOBS | HA_CAN_SQL_HANDLER | HA_NOT_EXACT_COUNT | - HA_NO_WRITE_DELAYED | HA_PRIMARY_KEY_IN_READ_INDEX | HA_TABLE_SCAN_ON_INDEX), last_dup_key((uint) -1), @@ -106,14 +94,12 @@ class ha_innobase: public handler const char *index_type(uint key_number) { return "BTREE"; } const char** bas_ext() const; ulong table_flags() const { return int_table_flags; } - ulong index_flags(uint idx) const + ulong index_flags(uint idx, uint part) const { - return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | - HA_KEY_READ_ONLY); + return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE | + HA_KEYREAD_ONLY); } - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return MAX_KEY; } - uint max_key_parts() const { return MAX_REF_PARTS; } + uint max_supported_keys() const { return MAX_KEY; } /* An InnoDB page must store >= 2 keys; a secondary key record must also contain the primary key value: @@ -121,15 +107,12 @@ class ha_innobase: public handler less than 1 / 4 of page size which is 16 kB; but currently MySQL does not work with keys whose size is > MAX_KEY_LENGTH */ - uint max_key_length() const { return((MAX_KEY_LENGTH <= 3500) ? - MAX_KEY_LENGTH : 3500);} - uint max_key_part_length() { return((MAX_KEY_LENGTH <= 3500) ? - MAX_KEY_LENGTH : 3500);} + uint max_supported_key_length() const { return 3500; } + uint max_supported_key_part_length() const { return 3500; } const key_map *keys_to_use_for_scanning() { return &key_map_full; } bool has_transactions() { return 1;} int open(const char *name, int mode, uint test_if_locked); - void initialize(void); int close(void); double scan_time(); double read_time(uint index, uint ranges, ha_rows rows); @@ -151,7 +134,7 @@ class ha_innobase: public handler int index_first(byte * buf); int index_last(byte * buf); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_end(); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); @@ -183,6 +166,9 @@ class ha_innobase: public handler void init_table_handle_for_HANDLER(); longlong get_auto_increment(); uint8 table_cache_type() { return HA_CACHE_TBL_ASKTRANSACT; } + + static char *get_mysql_bin_log_name(); + static ulonglong get_mysql_bin_log_pos(); }; extern uint innobase_init_flags, innobase_lock_type; diff --git a/sql/ha_isam.h b/sql/ha_isam.h index 8a887ababde..521946a17b5 100644 --- a/sql/ha_isam.h +++ b/sql/ha_isam.h @@ -32,19 +32,20 @@ class ha_isam: public handler public: ha_isam(TABLE *table) :handler(table), file(0), - int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER | - HA_KEY_READ_WRONG_STR | HA_DUPP_POS | - HA_NOT_DELETE_WITH_CACHE | HA_FILE_BASED) + int_table_flags(HA_READ_RND_SAME | + HA_DUPP_POS | HA_NOT_DELETE_WITH_CACHE | HA_FILE_BASED) {} ~ha_isam() {} + ulong index_flags(uint idx, uint part) const + { return HA_READ_NEXT; } // but no HA_READ_PREV here!!! const char *table_type() const { return "ISAM"; } const char *index_type(uint key_number) { return "BTREE"; } const char **bas_ext() const; ulong table_flags() const { return int_table_flags; } - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return N_MAXKEY; } - uint max_key_parts() const { return N_MAXKEY_SEG; } - uint max_key_length() const { return N_MAX_KEY_LENGTH; } + uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } + uint max_supported_keys() const { return N_MAXKEY; } + uint max_supported_key_parts() const { return N_MAXKEY_SEG; } + uint max_supported_key_length() const { return N_MAX_KEY_LENGTH; } uint min_record_length(uint options) const; bool low_byte_first() const { return 0; } @@ -62,11 +63,10 @@ class ha_isam: public handler int index_prev(byte * buf); int index_first(byte * buf); int index_last(byte * buf); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - my_off_t row_position() { return nisam_position(file); } void info(uint); int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); diff --git a/sql/ha_isammrg.h b/sql/ha_isammrg.h index 289277a9dac..166a96cf9e4 100644 --- a/sql/ha_isammrg.h +++ b/sql/ha_isammrg.h @@ -32,14 +32,11 @@ class ha_isammrg: public handler ~ha_isammrg() {} const char *table_type() const { return "MRG_ISAM"; } const char **bas_ext() const; - ulong table_flags() const { return (HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | + ulong table_flags() const { return (HA_READ_RND_SAME | HA_REC_NOT_IN_SEQ | HA_FILE_BASED); } - ulong index_flags(uint idx) const { return HA_NOT_READ_PREFIX_LAST; } + ulong index_flags(uint idx, uint part) const { DBUG_ASSERT(0); return 0; } - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return 0; } - uint max_key_parts() const { return 0; } - uint max_key_length() const { return 0; } + uint max_supported_keys() const { return 0; } bool low_byte_first() const { return 0; } uint min_record_length(uint options) const; @@ -56,11 +53,10 @@ class ha_isammrg: public handler int index_prev(byte * buf); int index_first(byte * buf); int index_last(byte * buf); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); - my_off_t row_position() { return mrg_position(file); } void info(uint); int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 318e0fbb507..77615d68fe4 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1004,8 +1004,10 @@ bool ha_myisam::check_and_repair(THD *thd) { int error=0; int marked_crashed; + char *old_query; + uint old_query_length; HA_CHECK_OPT check_opt; - DBUG_ENTER("ha_myisam::auto_check_and_repair"); + DBUG_ENTER("ha_myisam::check_and_repair"); check_opt.init(); check_opt.flags= T_MEDIUM | T_AUTO_REPAIR; @@ -1013,7 +1015,15 @@ bool ha_myisam::check_and_repair(THD *thd) if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK)) check_opt.flags|=T_QUICK; sql_print_error("Warning: Checking table: '%s'",table->path); - if ((marked_crashed=mi_is_crashed(file)) || check(thd, &check_opt)) + + old_query= thd->query; + old_query_length= thd->query_length; + pthread_mutex_lock(&LOCK_thread_count); + thd->query= table->real_name; + thd->query_length= strlen(table->real_name); + pthread_mutex_unlock(&LOCK_thread_count); + + if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt)) { sql_print_error("Warning: Recovering table: '%s'",table->path); check_opt.flags= @@ -1024,6 +1034,10 @@ bool ha_myisam::check_and_repair(THD *thd) if (repair(thd, &check_opt)) error=1; } + pthread_mutex_lock(&LOCK_thread_count); + thd->query= old_query; + thd->query_length= old_query_length; + pthread_mutex_unlock(&LOCK_thread_count); DBUG_RETURN(error); } @@ -1050,6 +1064,7 @@ int ha_myisam::delete_row(const byte * buf) int ha_myisam::index_read(byte * buf, const byte * key, uint key_len, enum ha_rkey_function find_flag) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_key_count,&LOCK_status); int error=mi_rkey(file,buf,active_index, key, key_len, find_flag); table->status=error ? STATUS_NOT_FOUND: 0; @@ -1067,6 +1082,7 @@ int ha_myisam::index_read_idx(byte * buf, uint index, const byte * key, int ha_myisam::index_read_last(byte * buf, const byte * key, uint key_len) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_key_count,&LOCK_status); int error=mi_rkey(file,buf,active_index, key, key_len, HA_READ_PREFIX_LAST); table->status=error ? STATUS_NOT_FOUND: 0; @@ -1075,6 +1091,7 @@ int ha_myisam::index_read_last(byte * buf, const byte * key, uint key_len) int ha_myisam::index_next(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_next_count,&LOCK_status); int error=mi_rnext(file,buf,active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -1083,6 +1100,7 @@ int ha_myisam::index_next(byte * buf) int ha_myisam::index_prev(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_prev_count,&LOCK_status); int error=mi_rprev(file,buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -1091,6 +1109,7 @@ int ha_myisam::index_prev(byte * buf) int ha_myisam::index_first(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_first_count,&LOCK_status); int error=mi_rfirst(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -1099,6 +1118,7 @@ int ha_myisam::index_first(byte * buf) int ha_myisam::index_last(byte * buf) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_last_count,&LOCK_status); int error=mi_rlast(file, buf, active_index); table->status=error ? STATUS_NOT_FOUND: 0; @@ -1109,6 +1129,7 @@ int ha_myisam::index_next_same(byte * buf, const byte *key __attribute__((unused)), uint length __attribute__((unused))) { + DBUG_ASSERT(inited==INDEX); statistic_increment(ha_read_next_count,&LOCK_status); int error=mi_rnext_same(file,buf); table->status=error ? STATUS_NOT_FOUND: 0; diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index 77887220903..ef3f00577dd 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -44,10 +44,10 @@ class ha_myisam: public handler public: ha_myisam(TABLE *table): handler(table), file(0), - int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER | - HA_NULL_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | - HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY | - HA_FILE_BASED | HA_HAS_GEOMETRY), + int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | + HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | + HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME | + HA_CAN_INSERT_DELAYED), can_enable_indexes(1) {} ~ha_myisam() {} @@ -55,17 +55,15 @@ class ha_myisam: public handler const char *index_type(uint key_number); const char **bas_ext() const; ulong table_flags() const { return int_table_flags; } - ulong index_flags(uint inx) const + ulong index_flags(uint inx, uint part) const { - ulong flags=(HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER); - return (flags | ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? - 0 : HA_KEY_READ_ONLY)); + return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? + 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | + HA_READ_ORDER | HA_KEYREAD_ONLY); } - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return MI_MAX_KEY; } - uint max_key_parts() const { return MAX_REF_PARTS; } - uint max_key_length() const { return MI_MAX_KEY_LENGTH; } - uint max_key_part_length() { return MI_MAX_KEY_LENGTH; } + uint max_supported_keys() const { return MI_MAX_KEY; } + uint max_supported_key_length() const { return MI_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; } uint checksum() const; int open(const char *name, int mode, uint test_if_locked); @@ -94,12 +92,11 @@ class ha_myisam: public handler FT_INFO *ft_init_ext(uint flags, uint inx,const byte *key, uint keylen) { return ft_init_search(flags,file,inx,(byte*) key,keylen, table->record[0]); } int ft_read(byte *buf); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); int restart_rnd_next(byte *buf, byte *pos); void position(const byte *record); - my_off_t row_position() { return mi_position(file); } void info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h index fd36c78202d..995cfe9ad4a 100644 --- a/sql/ha_myisammrg.h +++ b/sql/ha_myisammrg.h @@ -34,21 +34,20 @@ class ha_myisammrg: public handler const char **bas_ext() const; ulong table_flags() const { - return (HA_REC_NOT_IN_SEQ | HA_READ_RND_SAME | HA_AUTO_PART_KEY | - HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER | - HA_NULL_KEY | HA_BLOB_KEY | HA_FILE_BASED); + return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME | + HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED | + HA_CAN_INSERT_DELAYED); } - ulong index_flags(uint inx) const + ulong index_flags(uint inx, uint part) const { - ulong flags=(HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER); - return (flags | ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? - 0 : HA_KEY_READ_ONLY)); + return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? + 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | + HA_READ_ORDER | HA_KEYREAD_ONLY); } - uint max_record_length() const { return HA_MAX_REC_LENGTH; } - uint max_keys() const { return MI_MAX_KEY; } - uint max_key_parts() const { return MAX_REF_PARTS; } - uint max_key_length() const { return MAX_KEY_LENGTH; } - virtual double scan_time() + uint max_supported_keys() const { return MI_MAX_KEY; } + uint max_supported_key_length() const { return MI_MAX_KEY_LENGTH; } + uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; } + double scan_time() { return ulonglong2double(data_file_length) / IO_SIZE + file->tables; } int open(const char *name, int mode, uint test_if_locked); @@ -66,12 +65,11 @@ class ha_myisammrg: public handler int index_first(byte * buf); int index_last(byte * buf); int index_next_same(byte *buf, const byte *key, uint keylen); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_next(byte *buf); int rnd_pos(byte * buf, byte *pos); void position(const byte *record); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); - my_off_t row_position() { return myrg_position(file); } void info(uint); int extra(enum ha_extra_function operation); int extra_opt(enum ha_extra_function operation, ulong cache_size); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 1b7c504aff3..09a94e51068 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -474,33 +474,28 @@ static const ulong index_type_flags[]= 0, /* PRIMARY_KEY_INDEX */ - HA_NOT_READ_PREFIX_LAST | - HA_ONLY_WHOLE_INDEX | - HA_WRONG_ASCII_ORDER, + HA_ONLY_WHOLE_INDEX, /* PRIMARY_KEY_ORDERED_INDEX */ /* - Enable HA_KEY_READ_ONLY when "sorted" indexes are supported, + Enable HA_KEYREAD_ONLY when "sorted" indexes are supported, thus ORDERD BY clauses can be optimized by reading directly through the index. */ - HA_NOT_READ_PREFIX_LAST | - HA_WRONG_ASCII_ORDER, + // HA_KEYREAD_ONLY | + HA_READ_NEXT | + HA_READ_RANGE, /* UNIQUE_INDEX */ - HA_NOT_READ_PREFIX_LAST | - HA_ONLY_WHOLE_INDEX | - HA_WRONG_ASCII_ORDER, + HA_ONLY_WHOLE_INDEX, /* UNIQUE_ORDERED_INDEX */ - HA_NOT_READ_PREFIX_LAST | - HA_WRONG_ASCII_ORDER, + HA_READ_NEXT | + HA_READ_RANGE, /* ORDERED_INDEX */ HA_READ_NEXT | - HA_READ_PREV | - HA_NOT_READ_PREFIX_LAST | - HA_WRONG_ASCII_ORDER + HA_READ_RANGE, }; static const int index_flags_size= sizeof(index_type_flags)/sizeof(ulong); @@ -529,7 +524,7 @@ inline NDB_INDEX_TYPE ha_ndbcluster::get_index_type(uint idx_no) const flags depending on the type of the index. */ -inline ulong ha_ndbcluster::index_flags(uint idx_no) const +inline ulong ha_ndbcluster::index_flags(uint idx_no, uint part) const { DBUG_ENTER("index_flags"); DBUG_PRINT("info", ("idx_no: %d", idx_no)); @@ -1390,6 +1385,7 @@ void ha_ndbcluster::print_results() switch (col->getType()) { case NdbDictionary::Column::Blob: + case NdbDictionary::Column::Clob: case NdbDictionary::Column::Undefined: fprintf(DBUG_FILE, "Unknown type: %d", col->getType()); break; @@ -2622,13 +2618,9 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): m_ndb(NULL), m_table(NULL), m_table_flags(HA_REC_NOT_IN_SEQ | - HA_KEYPOS_TO_RNDPOS | HA_NOT_EXACT_COUNT | - HA_NO_WRITE_DELAYED | HA_NO_PREFIX_CHAR_KEYS | - HA_NO_BLOBS | - HA_DROP_BEFORE_CREATE | - HA_NOT_READ_AFTER_KEY), + HA_NO_BLOBS), m_use_write(false), retrieve_all_fields(FALSE), rows_to_insert(0), diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index b8c6493b9d9..a60432ca5e6 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -75,7 +75,7 @@ class ha_ndbcluster: public handler int index_prev(byte *buf); int index_first(byte *buf); int index_last(byte *buf); - int rnd_init(bool scan=1); + int rnd_init(bool scan); int rnd_end(); int rnd_next(byte *buf); int rnd_pos(byte *buf, byte *pos); @@ -95,11 +95,12 @@ class ha_ndbcluster: public handler const char * table_type() const { return("ndbcluster");} const char ** bas_ext() const; ulong table_flags(void) const { return m_table_flags; } - ulong index_flags(uint idx) const; - uint max_record_length() const { return NDB_MAX_TUPLE_SIZE; }; - uint max_keys() const { return MAX_KEY; } - uint max_key_parts() const { return NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; }; - uint max_key_length() const { return NDB_MAX_KEY_SIZE;}; + ulong index_flags(uint idx, uint part) const; + uint max_supported_record_length() const { return NDB_MAX_TUPLE_SIZE; }; + uint max_supported_keys() const { return MAX_KEY; } + uint max_supported_key_parts() const + { return NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; }; + uint max_supported_key_length() const { return NDB_MAX_KEY_SIZE;}; int rename_table(const char *from, const char *to); int delete_table(const char *name); diff --git a/sql/handler.cc b/sql/handler.cc index c729b80d0ce..017b9d9d4c8 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -40,8 +40,6 @@ #endif #ifdef HAVE_INNOBASE_DB #include "ha_innodb.h" -#else -#define innobase_query_caching_of_table_permitted(X,Y,Z) 1 #endif #ifdef HAVE_NDBCLUSTER_DB #include "ha_ndbcluster.h" @@ -219,6 +217,16 @@ handler *get_new_handler(TABLE *table, enum db_type db_type) } } +bool ha_caching_allowed(THD* thd, char* table_key, + uint key_length, uint8 cache_type) +{ +#ifdef HAVE_INNOBASE_DB + if (cache_type == HA_CACHE_TBL_ASKTRANSACT) + return innobase_query_caching_of_table_permitted(thd, table_key, key_length); +#endif + return 1; +} + int ha_init() { int error= 0; @@ -375,17 +383,25 @@ int ha_report_binlog_offset_and_commit(THD *thd, #ifdef HAVE_INNOBASE_DB THD_TRANS *trans; trans = &thd->transaction.all; - if (trans->innobase_tid) + if (trans->innodb_active_trans) { + /* + If we updated some InnoDB tables (innodb_active_trans is true), the + binlog coords will be reported into InnoDB during the InnoDB commit + (innobase_report_binlog_offset_and_commit). But if we updated only + non-InnoDB tables, we need an explicit call to report it. + */ if ((error=innobase_report_binlog_offset_and_commit(thd, - trans->innobase_tid, - log_file_name, - end_offset))) + trans->innobase_tid, + log_file_name, + end_offset))) { my_error(ER_ERROR_DURING_COMMIT, MYF(0), error); error=1; } } + else if (opt_innodb_safe_binlog) // Don't report if not useful + innobase_store_binlog_offset_and_flush_log(log_file_name, end_offset); #endif return error; } @@ -478,7 +494,10 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans) { if ((error=ndbcluster_commit(thd,trans->ndb_tid))) { - ndbcluster_print_error(error); + if (error == -1) + my_error(ER_ERROR_DURING_COMMIT, MYF(0), error); + else + ndbcluster_print_error(error); error=1; } if (trans == &thd->transaction.all) @@ -544,7 +563,10 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) { if ((error=ndbcluster_rollback(thd, trans->ndb_tid))) { - ndbcluster_print_error(error); + if (error == -1) + my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error); + else + ndbcluster_print_error(error); error=1; } trans->ndb_tid = 0; @@ -578,10 +600,11 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) if ((trans == &thd->transaction.all) && mysql_bin_log.is_open()) { /* - Update the binary log with a BEGIN/ROLLBACK block if we have cached some - queries and we updated some non-transactional table. Such cases should - be rare (updating a non-transactional table inside a transaction...). - Count disk writes to trans_log in any case. + Update the binary log with a BEGIN/ROLLBACK block if we have + cached some queries and we updated some non-transactional + table. Such cases should be rare (updating a + non-transactional table inside a transaction...). Count disk + writes to trans_log in any case. */ if (my_b_tell(&thd->transaction.trans_log)) { @@ -602,13 +625,12 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) reinit_io_cache(&thd->transaction.trans_log, WRITE_CACHE, (my_off_t) 0, 0, 1); thd->transaction.trans_log.end_of_file= max_binlog_cache_size; + if (operation_done) + thd->transaction.cleanup(); } thd->variables.tx_isolation=thd->session_tx_isolation; if (operation_done) - { statistic_increment(ha_rollback_count,&LOCK_status); - thd->transaction.cleanup(); - } } #endif /* USING_TRANSACTIONS */ DBUG_RETURN(error); @@ -626,12 +648,12 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) simply truncate the binlog cache, we lose the part of the binlog cache where the update is. If we want to not lose it, we need to write the SAVEPOINT command and the ROLLBACK TO SAVEPOINT command to the binlog cache. The latter - is easy: it's just write at the end of the binlog cache, but the former should - be *inserted* to the place where the user called SAVEPOINT. The solution is - that when the user calls SAVEPOINT, we write it to the binlog cache (so no - need to later insert it). As transactions are never intermixed in the binary log - (i.e. they are serialized), we won't have conflicts with savepoint names when - using mysqlbinlog or in the slave SQL thread. + is easy: it's just write at the end of the binlog cache, but the former + should be *inserted* to the place where the user called SAVEPOINT. The + solution is that when the user calls SAVEPOINT, we write it to the binlog + cache (so no need to later insert it). As transactions are never intermixed + in the binary log (i.e. they are serialized), we won't have conflicts with + savepoint names when using mysqlbinlog or in the slave SQL thread. Then when ROLLBACK TO SAVEPOINT is called, if we updated some non-transactional table, we don't truncate the binlog cache but instead write ROLLBACK TO SAVEPOINT to it; otherwise we truncate the binlog cache (which @@ -865,46 +887,6 @@ int handler::ha_open(const char *name, int mode, int test_if_locked) DBUG_RETURN(error); } -int handler::check(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::backup(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::restore(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::repair(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::optimize(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::analyze(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - -int handler::preload_keys(THD* thd, HA_CHECK_OPT* check_opt) -{ - return HA_ADMIN_NOT_IMPLEMENTED; -} - /* Read first row (only) from a table This is never called for InnoDB or BDB tables, as these table types @@ -922,35 +904,23 @@ int handler::read_first_row(byte * buf, uint primary_key) If there is very few deleted rows in the table, find the first row by scanning the table. */ - if (deleted < 10 || primary_key >= MAX_KEY || - !(index_flags(primary_key) & HA_READ_ORDER)) + if (deleted < 10 || primary_key >= MAX_KEY) { - (void) rnd_init(); + (void) ha_rnd_init(1); while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ; - (void) rnd_end(); + (void) ha_rnd_end(); } else { /* Find the first row through the primary key */ - (void) index_init(primary_key); + (void) ha_index_init(primary_key); error=index_first(buf); - (void) index_end(); + (void) ha_index_end(); } DBUG_RETURN(error); } -/* - The following function is only needed for tables that may be temporary tables - during joins -*/ - -int handler::restart_rnd_next(byte *buf, byte *pos) -{ - return HA_ERR_WRONG_COMMAND; -} - - /* Set a timestamp in record */ void handler::update_timestamp(byte *record) @@ -1165,7 +1135,7 @@ void handler::print_error(int error, myf errflag) bool handler::get_error_message(int error, String* buf) { - return false; + return FALSE; } @@ -1234,28 +1204,6 @@ int handler::index_next_same(byte *buf, const byte *key, uint keylen) } -/* - This is called to delete all rows in a table - If the handler don't support this, then this function will - return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one - by one. -*/ - -int handler::delete_all_rows() -{ - return (my_errno=HA_ERR_WRONG_COMMAND); -} - -bool handler::caching_allowed(THD* thd, char* table_key, - uint key_length, uint8 cache_type) -{ - if (cache_type == HA_CACHE_TBL_ASKTRANSACT) - return innobase_query_caching_of_table_permitted(thd, table_key, - key_length); - else - return 1; -} - /**************************************************************************** ** Some general functions that isn't in the handler class ****************************************************************************/ @@ -1278,8 +1226,6 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info, if (update_create_info) { update_create_info_from_table(create_info, &table); - if (table.file->table_flags() & HA_DROP_BEFORE_CREATE) - table.file->delete_table(name); } if (lower_case_table_names == 2 && !(table.file->table_flags() & HA_FILE_BASED)) @@ -1536,3 +1482,15 @@ int handler::compare_key(key_range *range) cmp= key_compare_result_on_equal; return cmp; } + +int handler::index_read_idx(byte * buf, uint index, const byte * key, + uint key_len, enum ha_rkey_function find_flag) +{ + int error= ha_index_init(index); + if (!error) + error= index_read(buf, key, key_len, find_flag); + if (!error) + error= ha_index_end(); + return error; +} + diff --git a/sql/handler.h b/sql/handler.h index c8d3d30aa23..ca452b6dedf 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -46,51 +46,42 @@ #define HA_ADMIN_TRY_ALTER -7 /* Bits in table_flags() to show what database can do */ -#define HA_READ_RND_SAME 1 /* Read RND-record to KEY-record - (To update with RND-read) */ -#define HA_KEYPOS_TO_RNDPOS 2 /* ha_info gives pos to record */ -#define HA_TABLE_SCAN_ON_INDEX 4 /* No separate data/index file */ -#define HA_REC_NOT_IN_SEQ 8 /* ha_info don't return recnumber; +#define HA_READ_RND_SAME (1 << 0) /* can switch index during the scan + with ::rnd_same() - not used yet. + see mi_rsame/heap_rsame/myrg_rsame */ +#define HA_TABLE_SCAN_ON_INDEX (1 << 2) /* No separate data/index file */ +#define HA_REC_NOT_IN_SEQ (1 << 3) /* ha_info don't return recnumber; It returns a position to ha_r_rnd */ -#define HA_HAS_GEOMETRY (1 << 4) +#define HA_CAN_GEOMETRY (1 << 4) #define HA_FAST_KEY_READ (1 << 5) /* no need for a record cache in filesort */ -#define HA_KEY_READ_WRONG_STR (1 << 6) /* keyread returns converted strings */ -#define HA_NULL_KEY (1 << 7) /* One can have keys with NULL */ -#define HA_DUPP_POS (1 << 8) /* ha_position() gives dupp row */ +#define HA_NULL_IN_KEY (1 << 7) /* One can have keys with NULL */ +#define HA_DUPP_POS (1 << 8) /* ha_position() gives dup row */ #define HA_NO_BLOBS (1 << 9) /* Doesn't support blobs */ -#define HA_BLOB_KEY (1 << 10) /* key on blob */ -#define HA_AUTO_PART_KEY (1 << 11) -#define HA_REQUIRE_PRIMARY_KEY (1 << 12) +#define HA_CAN_INDEX_BLOBS (1 << 10) +#define HA_AUTO_PART_KEY (1 << 11) /* auto-increment in multi-part key */ +#define HA_REQUIRE_PRIMARY_KEY (1 << 12) /* .. and can't create a hidden one */ #define HA_NOT_EXACT_COUNT (1 << 13) -#define HA_NO_WRITE_DELAYED (1 << 14) +#define HA_CAN_INSERT_DELAYED (1 << 14) /* only handlers with table-level locks + need no special code to support + INSERT DELAYED */ #define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15) -#define HA_DROP_BEFORE_CREATE (1 << 16) -#define HA_NOT_READ_AFTER_KEY (1 << 17) #define HA_NOT_DELETE_WITH_CACHE (1 << 18) -#define HA_NO_TEMP_TABLES (1 << 19) #define HA_NO_PREFIX_CHAR_KEYS (1 << 20) #define HA_CAN_FULLTEXT (1 << 21) #define HA_CAN_SQL_HANDLER (1 << 22) #define HA_NO_AUTO_INCREMENT (1 << 23) #define HA_HAS_CHECKSUM (1 << 24) -/* - Next record gives next record according last record read (even - if database is updated after read). Not used at this point. -*/ -#define HA_LASTKEY_ORDER (1 << 25) -/* Table data are stored in separate files */ +/* Table data are stored in separate files (for lower_case_table_names) */ #define HA_FILE_BASED (1 << 26) /* bits in index_flags(index_number) for what you can do with index */ -#define HA_WRONG_ASCII_ORDER 1 /* Can't use sorting through key */ -#define HA_READ_NEXT 2 /* Read next record with same key */ -#define HA_READ_PREV 4 /* Read prev. record with same key */ -#define HA_READ_ORDER 8 /* Read through record-keys in order */ +#define HA_READ_NEXT 1 /* TODO really use this flag */ +#define HA_READ_PREV 2 /* supports ::index_prev */ +#define HA_READ_ORDER 4 /* index_next/prev follow sort order */ +#define HA_READ_RANGE 8 /* can find all records in a range */ #define HA_ONLY_WHOLE_INDEX 16 /* Can't use part key searches */ -#define HA_NOT_READ_PREFIX_LAST 32 /* No support for index_read_last() */ -#define HA_KEY_READ_ONLY 64 /* Support HA_EXTRA_KEYREAD */ - +#define HA_KEYREAD_ONLY 64 /* Support HA_EXTRA_KEYREAD */ /* operations for disable/enable indexes */ #define HA_KEY_SWITCH_NONUNIQ 0 @@ -109,9 +100,6 @@ #define HA_DDL_WITH_LOCK 2 /* Can create/drop with locked table */ #define HA_DDL_ONLINE 4 /* Can create/drop without lock */ -/* Return value for ddl methods */ -#define HA_DDL_NOT_IMPLEMENTED -1 - /* Parameters for open() (in register form->filestat) HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED @@ -240,6 +228,18 @@ class handler :public Sql_alloc protected: struct st_table *table; /* The table definition */ + virtual int index_init(uint idx) { active_index=idx; return 0; } + virtual int index_end() { active_index=MAX_KEY; return 0; } + /* + rnd_init() can be called two times without rnd_end() in between + (it only makes sense if scan=1). + then the second call should prepare for the new table scan (e.g + if rnd_init allocates the cursor, second call should position it + to the start of the table, no need to deallocate and allocate it again + */ + virtual int rnd_init(bool scan) =0; + virtual int rnd_end() { return 0; } + public: byte *ref; /* Pointer to current row */ byte *dupp_ref; /* Pointer to dupp row */ @@ -271,6 +271,7 @@ public: uint block_size; /* index block size */ uint raid_type,raid_chunks; FT_INFO *ft_handler; + enum {NONE=0, INDEX, RND} inited; bool auto_increment_column_changed; bool implicit_emptied; /* Can be !=0 only if HEAP */ @@ -280,11 +281,11 @@ public: delete_length(0), auto_increment_value(0), records(0), deleted(0), mean_rec_length(0), create_time(0), check_time(0), update_time(0), - key_used_on_scan(MAX_KEY), active_index(MAX_REF_PARTS), + key_used_on_scan(MAX_KEY), active_index(MAX_KEY), ref_length(sizeof(my_off_t)), block_size(0), - raid_type(0), ft_handler(0), implicit_emptied(0) + raid_type(0), ft_handler(0), inited(NONE), implicit_emptied(0) {} - virtual ~handler(void) {} + virtual ~handler(void) { /* TODO: DBUG_ASSERT(inited == NONE); */ } int ha_open(const char *name, int mode, int test_if_locked); void update_timestamp(byte *record); void update_auto_increment(); @@ -300,88 +301,140 @@ public: virtual bool has_transactions(){ return 0;} virtual uint extra_rec_buf_length() { return 0; } virtual ha_rows estimate_number_of_rows() { return records+EXTRA_RECORDS; } - virtual const char *index_type(uint key_number) { return "";} - virtual int index_init(uint idx) { active_index=idx; return 0;} - virtual int index_end() {return 0; } + virtual const char *index_type(uint key_number) { DBUG_ASSERT(0); return "";} + + int ha_index_init(uint idx) + { + DBUG_ASSERT(inited==NONE); + inited=INDEX; + return index_init(idx); + } + int ha_index_end() + { + DBUG_ASSERT(inited==INDEX); + inited=NONE; + return index_end(); + } + int ha_rnd_init(bool scan) + { + DBUG_ASSERT(inited==NONE || (inited==RND && scan)); + inited=RND; + return rnd_init(scan); + } + int ha_rnd_end() + { + DBUG_ASSERT(inited==RND); + inited=NONE; + return rnd_end(); + } + /* this is neseccary in many places, e.g. in HANDLER command */ + int ha_index_or_rnd_end() + { + return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0; + } uint get_index(void) const { return active_index; } virtual int open(const char *name, int mode, uint test_if_locked)=0; - virtual void initialize(void) {} virtual int close(void)=0; - virtual int write_row(byte * buf)=0; - virtual int update_row(const byte * old_data, byte * new_data)=0; - virtual int delete_row(const byte * buf)=0; + virtual int write_row(byte * buf) { return HA_ERR_WRONG_COMMAND; } + virtual int update_row(const byte * old_data, byte * new_data) + { return HA_ERR_WRONG_COMMAND; } + virtual int delete_row(const byte * buf) + { return HA_ERR_WRONG_COMMAND; } virtual int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag)=0; + uint key_len, enum ha_rkey_function find_flag) + { return HA_ERR_WRONG_COMMAND; } virtual int index_read_idx(byte * buf, uint index, const byte * key, - uint key_len, enum ha_rkey_function find_flag)=0; - virtual int index_next(byte * buf)=0; - virtual int index_prev(byte * buf)=0; - virtual int index_first(byte * buf)=0; - virtual int index_last(byte * buf)=0; + uint key_len, enum ha_rkey_function find_flag); + virtual int index_next(byte * buf) + { return HA_ERR_WRONG_COMMAND; } + virtual int index_prev(byte * buf) + { return HA_ERR_WRONG_COMMAND; } + virtual int index_first(byte * buf) + { return HA_ERR_WRONG_COMMAND; } + virtual int index_last(byte * buf) + { return HA_ERR_WRONG_COMMAND; } virtual int index_next_same(byte *buf, const byte *key, uint keylen); virtual int index_read_last(byte * buf, const byte * key, uint key_len) - { - return (my_errno=HA_ERR_WRONG_COMMAND); - } + { return (my_errno=HA_ERR_WRONG_COMMAND); } virtual int read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range, bool sorted); virtual int read_range_next(); int compare_key(key_range *range); - virtual int ft_init() - { return -1; } + virtual int ft_init() { return HA_ERR_WRONG_COMMAND; } virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key, uint keylen) { return NULL; } - virtual int ft_read(byte *buf) { return -1; } - virtual int rnd_init(bool scan=1)=0; - virtual int rnd_end() { return 0; } + virtual int ft_read(byte *buf) { return HA_ERR_WRONG_COMMAND; } virtual int rnd_next(byte *buf)=0; virtual int rnd_pos(byte * buf, byte *pos)=0; virtual int read_first_row(byte *buf, uint primary_key); - virtual int restart_rnd_next(byte *buf, byte *pos); + /* + The following function is only needed for tables that may be temporary + tables during joins + */ + virtual int restart_rnd_next(byte *buf, byte *pos) + { return HA_ERR_WRONG_COMMAND; } + virtual int rnd_same(byte *buf, uint inx) + { return HA_ERR_WRONG_COMMAND; } virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) { return (ha_rows) 10; } virtual void position(const byte *record)=0; - virtual my_off_t row_position() { return HA_OFFSET_ERROR; } virtual void info(uint)=0; - virtual int extra(enum ha_extra_function operation)=0; + virtual int extra(enum ha_extra_function operation) + { return 0; } virtual int extra_opt(enum ha_extra_function operation, ulong cache_size) - { - return extra(operation); - } + { return extra(operation); } virtual int reset() { return extra(HA_EXTRA_RESET); } virtual int external_lock(THD *thd, int lock_type)=0; virtual void unlock_row() {} virtual int start_stmt(THD *thd) {return 0;} - virtual int delete_all_rows(); + /* + This is called to delete all rows in a table + If the handler don't support this, then this function will + return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one + by one. + */ + virtual int delete_all_rows() + { return (my_errno=HA_ERR_WRONG_COMMAND); } virtual longlong get_auto_increment(); virtual void update_create_info(HA_CREATE_INFO *create_info) {} - virtual int check(THD* thd, HA_CHECK_OPT* check_opt ); - virtual int repair(THD* thd, HA_CHECK_OPT* check_opt); - virtual bool check_and_repair(THD *thd) {return 1;} - virtual int optimize(THD* thd,HA_CHECK_OPT* check_opt); - virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt); - virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt); - virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); - virtual int backup(THD* thd, HA_CHECK_OPT* check_opt); + + /* admin commands - called from mysql_admin_table */ + virtual int check(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } + virtual int backup(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } /* restore assumes .frm file must exist, and that generate_table() has been called; It will just copy the data file and run repair. */ - virtual int restore(THD* thd, HA_CHECK_OPT* check_opt); - virtual int dump(THD* thd, int fd = -1) { return ER_DUMP_NOT_IMPLEMENTED; } + virtual int restore(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } + virtual int repair(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } + virtual int optimize(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } + virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } + virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } + virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt) + { return HA_ADMIN_NOT_IMPLEMENTED; } + /* end of the list of admin commands */ + + virtual bool check_and_repair(THD *thd) { return HA_ERR_WRONG_COMMAND; } + virtual int dump(THD* thd, int fd = -1) { return HA_ERR_WRONG_COMMAND; } virtual int disable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; } virtual int enable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; } virtual int indexes_are_disabled(void) {return 0;} virtual void start_bulk_insert(ha_rows rows) {} virtual int end_bulk_insert() {return 0; } - virtual int discard_or_import_tablespace(my_bool discard) {return -1;} - // not implemented by default - virtual int net_read_dump(NET* net) - { return ER_DUMP_NOT_IMPLEMENTED; } + virtual int discard_or_import_tablespace(my_bool discard) + {return HA_ERR_WRONG_COMMAND;} + virtual int net_read_dump(NET* net) { return HA_ERR_WRONG_COMMAND; } virtual char *update_table_comment(const char * comment) { return (char*) comment;} virtual void append_create_info(String *packet) {} @@ -396,38 +449,47 @@ public: virtual const char *table_type() const =0; virtual const char **bas_ext() const =0; virtual ulong table_flags(void) const =0; - virtual ulong index_flags(uint idx) const - { - return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_KEY_READ_ONLY); - } + virtual ulong index_flags(uint idx, uint part=~0) const =0; virtual ulong index_ddl_flags(KEY *wanted_index) const - { - return (HA_DDL_SUPPORT); - } + { return (HA_DDL_SUPPORT); } virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) - { - my_error(ER_NOT_SUPPORTED_YET, MYF(0), "online add index"); - return (HA_DDL_NOT_IMPLEMENTED); - } + { return (HA_ERR_WRONG_COMMAND); } virtual int drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys) - { - my_error(ER_NOT_SUPPORTED_YET, MYF(0), "online drop index"); - return (HA_DDL_NOT_IMPLEMENTED); - } - virtual uint max_record_length() const =0; - virtual uint max_keys() const =0; - virtual uint max_key_parts() const =0; - virtual uint max_key_length()const =0; - virtual uint max_key_part_length() { return 255; } + { return (HA_ERR_WRONG_COMMAND); } + + uint max_record_length() const + { return min(HA_MAX_REC_LENGTH, max_supported_record_length()); } + uint max_keys() const + { return min(MAX_KEY, max_supported_keys()); } + uint max_key_parts() const + { return min(MAX_REF_PARTS, max_supported_key_parts()); } + uint max_key_length() const + { return min(MAX_KEY_LENGTH, max_supported_key_length()); } + uint max_key_part_length() const + { return min(MAX_KEY_LENGTH, max_supported_key_part_length()); } + + virtual uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } + virtual uint max_supported_keys() const { return 0; } + virtual uint max_supported_key_parts() const { return MAX_REF_PARTS; } + virtual uint max_supported_key_length() const { return MAX_KEY_LENGTH; } + virtual uint max_supported_key_part_length() const { return 255; } virtual uint min_record_length(uint options) const { return 1; } + virtual bool low_byte_first() const { return 1; } virtual uint checksum() const { return 0; } virtual bool is_crashed() const { return 0; } virtual bool auto_repair() const { return 0; } + /* + default rename_table() and delete_table() rename/delete files with a + given name and extensions from bas_ext() + */ virtual int rename_table(const char *from, const char *to); virtual int delete_table(const char *name); + virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0; + + /* lock_count() can be more than one if the table is a MERGE */ virtual uint lock_count(void) const { return 1; } virtual THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, @@ -439,8 +501,6 @@ public: Is query with this table cachable (have sense only for ASKTRANSACT tables) */ - static bool caching_allowed(THD* thd, char* table_key, - uint key_length, uint8 cahe_type); }; /* Some extern variables used with handlers */ @@ -457,6 +517,8 @@ extern TYPELIB tx_isolation_typelib; #define ha_supports_generate(T) (T != DB_TYPE_INNODB) +bool ha_caching_allowed(THD* thd, char* table_key, + uint key_length, uint8 cache_type); enum db_type ha_resolve_by_name(const char *name, uint namelen); const char *ha_get_storage_engine(enum db_type db_type); handler *get_new_handler(TABLE *table, enum db_type db_type); diff --git a/sql/item.cc b/sql/item.cc index 35e1312b540..658f5c42a43 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -228,8 +228,8 @@ bool Item::get_date(TIME *ltime,uint fuzzydate) char buff[40]; String tmp(buff,sizeof(buff), &my_charset_bin),*res; if (!(res=val_str(&tmp)) || - str_to_TIME_with_warn(res->ptr(),res->length(),ltime,fuzzydate) <= - TIMESTAMP_DATETIME_ERROR) + str_to_datetime_with_warn(res->ptr(), res->length(), + ltime, fuzzydate) <= MYSQL_TIMESTAMP_ERROR) { bzero((char*) ltime,sizeof(*ltime)); return 1; @@ -759,9 +759,13 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) switch (entry->type) { case REAL_RESULT: set_double(*(double*)entry->value); + item_type= Item::REAL_ITEM; + item_result_type= REAL_RESULT; break; case INT_RESULT: set_int(*(longlong*)entry->value, 21); + item_type= Item::INT_ITEM; + item_result_type= INT_RESULT; break; case STRING_RESULT: { diff --git a/sql/item.h b/sql/item.h index fe8c2cb0df1..70663546880 100644 --- a/sql/item.h +++ b/sql/item.h @@ -422,7 +422,7 @@ public: class Item_param :public Item { -public: +public: enum enum_item_param_state { NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE, @@ -442,8 +442,8 @@ public: String str_value_ptr; union { - longlong integer; - double real; + longlong integer; + double real; /* Character sets conversion info for string values. Character sets of client and connection defined at bind time are used @@ -456,7 +456,7 @@ public: /* This points at character set of connection if conversion to it is required (i. e. if placeholder typecode is not BLOB). - Otherwise it's equal to character_set_client (to simplify + Otherwise it's equal to character_set_client (to simplify check in convert_str_value()). */ CHARSET_INFO *final_character_set_of_str_value; @@ -477,10 +477,10 @@ public: supply for this placeholder in mysql_stmt_execute. */ enum enum_field_types param_type; - /* + /* Offset of placeholder inside statement text. Used to create no-placeholders version of this statement for the binary log. - */ + */ uint pos_in_query; Item_param(uint pos_in_query_arg); @@ -515,16 +515,18 @@ public: const String *query_val_str(String *str) const; bool convert_str_value(THD *thd); - + Item *new_item() { return new Item_param(pos_in_query); } - /* - If value for parameter was not set we treat it as non-const - so noone will use parameters value in fix_fields still + /* + If value for parameter was not set we treat it as non-const + so noone will use parameters value in fix_fields still parameter is constant during execution. */ virtual table_map used_tables() const { return state != NO_VALUE ? (table_map)0 : PARAM_TABLE_BIT; } void print(String *str) { str->append('?'); } + /* parameter never equal to other parameter of other item */ + bool eq(const Item *item, bool binary_cmp) const { return 0; } }; class Item_int :public Item_num diff --git a/sql/item_create.cc b/sql/item_create.cc index 4977ba2c5d3..4290a25e348 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -154,7 +154,7 @@ Item *create_func_found_rows(void) { THD *thd=current_thd; thd->lex->safe_to_cache_query= 0; - return new Item_int(NullS,(longlong) thd->found_rows(),21); + return new Item_func_found_rows(); } Item *create_func_from_days(Item* a) diff --git a/sql/item_func.cc b/sql/item_func.cc index 192ed118766..e3874d8e4fa 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3234,3 +3234,12 @@ longlong Item_func_is_used_lock::val_int() null_value=0; return ull->thread_id; } + + +longlong Item_func_found_rows::val_int() +{ + DBUG_ASSERT(fixed == 1); + THD *thd= current_thd; + + return thd->found_rows(); +} diff --git a/sql/item_func.h b/sql/item_func.h index 39c0a47ed7c..c05c1b01259 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1071,3 +1071,13 @@ enum Cast_target ITEM_CAST_BINARY, ITEM_CAST_SIGNED_INT, ITEM_CAST_UNSIGNED_INT, ITEM_CAST_DATE, ITEM_CAST_TIME, ITEM_CAST_DATETIME, ITEM_CAST_CHAR }; + + +class Item_func_found_rows :public Item_int_func +{ +public: + Item_func_found_rows() :Item_int_func() {} + longlong val_int(); + const char *func_name() const { return "found_rows"; } + void fix_length_and_dec() { decimals= 0; maybe_null=0; } +}; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 691ec5f4c7b..4c1ffeecc97 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -74,6 +74,11 @@ void Item_subselect::init(st_select_lex *select_lex, else engine= new subselect_single_select_engine(select_lex, result, this); } + { + SELECT_LEX *upper= unit->outer_select(); + if (upper->parsing_place == SELECT_LEX_NODE::IN_HAVING) + upper->subquery_in_having= 1; + } DBUG_VOID_RETURN; } @@ -1188,7 +1193,7 @@ int subselect_single_select_engine::exec() join->thd->where= save_where; executed= 1; join->thd->lex->current_select= save_select; - DBUG_RETURN(join->error?join->error:1); + DBUG_RETURN(join->error ? join->error : 1); } if (item->engine_changed) { @@ -1240,6 +1245,8 @@ int subselect_uniquesubquery_engine::exec() } else { + if (!table->file->inited) + table->file->ha_index_init(tab->ref.key); error= table->file->index_read(table->record[0], tab->ref.key_buff, tab->ref.key_length,HA_READ_KEY_EXACT); @@ -1261,7 +1268,7 @@ int subselect_uniquesubquery_engine::exec() subselect_uniquesubquery_engine::~subselect_uniquesubquery_engine() { /* Tell handler we don't need the index anymore */ - tab->table->file->index_end(); + tab->table->file->ha_index_end(); } @@ -1288,6 +1295,8 @@ int subselect_indexsubquery_engine::exec() } else { + if (!table->file->inited) + table->file->ha_index_init(tab->ref.key); error= table->file->index_read(table->record[0], tab->ref.key_buff, tab->ref.key_length,HA_READ_KEY_EXACT); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index a5ea72374c1..786bcf434ed 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -425,21 +425,21 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, str->append(month_names[l_time->month-1],3); break; case 'W': - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; weekday= calc_weekday(calc_daynr(l_time->year,l_time->month, l_time->day),0); str->append(day_names[weekday]); break; case 'a': - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; weekday=calc_weekday(calc_daynr(l_time->year,l_time->month, l_time->day),0); str->append(day_names[weekday],3); break; case 'D': - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; length= int10_to_str(l_time->day, intbuff, 10) - intbuff; str->append_with_prefill(intbuff, length, 1, '0'); @@ -507,7 +507,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, str->append_with_prefill(intbuff, length, 2, '0'); break; case 'j': - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; length= int10_to_str(calc_daynr(l_time->year,l_time->month, l_time->day) - @@ -555,7 +555,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, case 'u': { uint year; - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; length= int10_to_str(calc_week(l_time, (*ptr) == 'U' ? @@ -569,7 +569,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, case 'V': { uint year; - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; length= int10_to_str(calc_week(l_time, ((*ptr) == 'V' ? @@ -584,7 +584,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, case 'X': { uint year; - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; (void) calc_week(l_time, ((*ptr) == 'X' ? @@ -596,7 +596,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, } break; case 'w': - if (type == TIMESTAMP_TIME) + if (type == MYSQL_TIMESTAMP_TIME) return 1; weekday=calc_weekday(calc_daynr(l_time->year,l_time->month, l_time->day),1); @@ -1107,7 +1107,7 @@ int Item_date::save_in_field(Field *field, bool no_conversions) if (get_date(<ime, TIME_FUZZY_DATE)) return set_field_to_null(field); field->set_notnull(); - field->store_time(<ime, TIMESTAMP_DATE); + field->store_time(<ime, MYSQL_TIMESTAMP_DATE); return 0; } @@ -1129,7 +1129,7 @@ bool Item_func_from_days::get_date(TIME *ltime, uint fuzzy_date) return 1; bzero(ltime, sizeof(TIME)); get_date_from_daynr((long) value, <ime->year, <ime->month, <ime->day); - ltime->time_type= TIMESTAMP_DATE; + ltime->time_type= MYSQL_TIMESTAMP_DATE; return 0; } @@ -1144,7 +1144,7 @@ void Item_func_curdate::fix_length_and_dec() /* We don't need to set second_part and neg because they already 0 */ ltime.hour= ltime.minute= ltime.second= 0; - ltime.time_type=TIMESTAMP_DATE; + ltime.time_type= MYSQL_TIMESTAMP_DATE; value= (longlong) TIME_to_ulonglong_date(<ime); } @@ -1308,7 +1308,7 @@ bool Item_func_now::get_date(TIME *res, int Item_func_now::save_in_field(Field *to, bool no_conversions) { to->set_notnull(); - to->store_time(<ime,TIMESTAMP_DATETIME); + to->store_time(<ime, MYSQL_TIMESTAMP_DATETIME); return 0; } @@ -1494,7 +1494,9 @@ String *Item_func_date_format::val_str(String *str) /* Create the result string */ if (!make_date_time(&date_time_format, &l_time, - is_time_format ? TIMESTAMP_TIME : TIMESTAMP_DATE, str)) + is_time_format ? MYSQL_TIMESTAMP_TIME : + MYSQL_TIMESTAMP_DATE, + str)) return str; null_date: @@ -1713,7 +1715,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date) case INTERVAL_DAY_HOUR: { longlong sec, days, daynr, microseconds, extra_sec; - ltime->time_type=TIMESTAMP_DATETIME; // Return full date + ltime->time_type= MYSQL_TIMESTAMP_DATETIME; // Return full date microseconds= ltime->second_part + sign*interval.second_part; extra_sec= microseconds/1000000L; microseconds= microseconds%1000000L; @@ -1798,7 +1800,7 @@ String *Item_date_add_interval::val_str(String *str) if (Item_date_add_interval::get_date(<ime,0)) return 0; - if (ltime.time_type == TIMESTAMP_DATE) + if (ltime.time_type == MYSQL_TIMESTAMP_DATE) format= DATE_ONLY; else if (ltime.second_part) format= DATE_TIME_MICROSECOND; @@ -1821,7 +1823,7 @@ longlong Item_date_add_interval::val_int() if (Item_date_add_interval::get_date(<ime,0)) return (longlong) 0; date = (ltime.year*100L + ltime.month)*100L + ltime.day; - return ltime.time_type == TIMESTAMP_DATE ? date : + return ltime.time_type == MYSQL_TIMESTAMP_DATE ? date : ((date*100L + ltime.hour)*100L+ ltime.minute)*100L + ltime.second; } @@ -2069,7 +2071,7 @@ String *Item_datetime_typecast::val_str(String *str) bool Item_time_typecast::get_time(TIME *ltime) { bool res= get_arg0_time(ltime); - ltime->time_type= TIMESTAMP_TIME; + ltime->time_type= MYSQL_TIMESTAMP_TIME; return res; } @@ -2092,7 +2094,7 @@ String *Item_time_typecast::val_str(String *str) bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date) { bool res= get_arg0_date(ltime,1); - ltime->time_type= TIMESTAMP_DATE; + ltime->time_type= MYSQL_TIMESTAMP_DATE; return res; } @@ -2198,17 +2200,17 @@ String *Item_func_add_time::val_str(String *str) { if (get_arg0_date(&l_time1,1) || args[1]->get_time(&l_time2) || - l_time1.time_type == TIMESTAMP_TIME || - l_time2.time_type != TIMESTAMP_TIME) + l_time1.time_type == MYSQL_TIMESTAMP_TIME || + l_time2.time_type != MYSQL_TIMESTAMP_TIME) goto null_date; } else // ADDTIME function { if (args[0]->get_time(&l_time1) || args[1]->get_time(&l_time2) || - l_time2.time_type == TIMESTAMP_DATETIME) + l_time2.time_type == MYSQL_TIMESTAMP_DATETIME) goto null_date; - is_time= (l_time1.time_type == TIMESTAMP_TIME); + is_time= (l_time1.time_type == MYSQL_TIMESTAMP_TIME); if (is_time && (l_time2.neg == l_time1.neg && l_time1.neg)) l_time3.neg= 1; } @@ -2324,7 +2326,7 @@ String *Item_func_timediff::val_str(String *str) if (l_time1.neg != l_time2.neg) l_sign= -l_sign; - if (l_time1.time_type == TIMESTAMP_TIME) // Time value + if (l_time1.time_type == MYSQL_TIMESTAMP_TIME) // Time value days= l_time1.day - l_sign*l_time2.day; else // DateTime value days= (calc_daynr((uint) l_time1.year, @@ -2466,13 +2468,13 @@ void Item_func_get_format::print(String *str) str->append('('); switch (type) { - case TIMESTAMP_DATE: + case MYSQL_TIMESTAMP_DATE: str->append("DATE, "); break; - case TIMESTAMP_DATETIME: + case MYSQL_TIMESTAMP_DATETIME: str->append("DATETIME, "); break; - case TIMESTAMP_TIME: + case MYSQL_TIMESTAMP_TIME: str->append("TIME, "); break; default: @@ -2555,25 +2557,25 @@ void Item_func_str_to_date::fix_length_and_dec() decimals=0; cached_field_type= MYSQL_TYPE_STRING; max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; - cached_timestamp_type= TIMESTAMP_NONE; + cached_timestamp_type= MYSQL_TIMESTAMP_NONE; if ((const_item= args[1]->const_item())) { format= args[1]->val_str(&format_str); cached_format_type= check_result_type(format->ptr(), format->length()); switch (cached_format_type) { case DATE_ONLY: - cached_timestamp_type= TIMESTAMP_DATE; + cached_timestamp_type= MYSQL_TIMESTAMP_DATE; cached_field_type= MYSQL_TYPE_DATE; max_length= MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; break; case TIME_ONLY: case TIME_MICROSECOND: - cached_timestamp_type= TIMESTAMP_TIME; + cached_timestamp_type= MYSQL_TIMESTAMP_TIME; cached_field_type= MYSQL_TYPE_TIME; max_length= MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; break; default: - cached_timestamp_type= TIMESTAMP_DATETIME; + cached_timestamp_type= MYSQL_TIMESTAMP_DATETIME; cached_field_type= MYSQL_TYPE_DATETIME; break; } @@ -2599,7 +2601,7 @@ bool Item_func_str_to_date::get_date(TIME *ltime, uint fuzzy_date) if (extract_date_time(&date_time_format, val->ptr(), val->length(), ltime, cached_timestamp_type)) goto null_date; - if (cached_timestamp_type == TIMESTAMP_TIME && ltime->day) + if (cached_timestamp_type == MYSQL_TIMESTAMP_TIME && ltime->day) { /* Day part for time type can be nonzero value and so @@ -2640,6 +2642,6 @@ bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date) ltime->day= days_in_month[month_idx]; if ( month_idx == 1 && calc_days_in_year(ltime->year) == 366) ltime->day= 29; - ltime->time_type= TIMESTAMP_DATE; + ltime->time_type= MYSQL_TIMESTAMP_DATE; return 0; } diff --git a/sql/lex.h b/sql/lex.h index b1626c75c28..218a1762a5c 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -211,7 +211,7 @@ static SYMBOL symbols[] = { { "IGNORE", SYM(IGNORE_SYM)}, { "IMPORT", SYM(IMPORT)}, { "IN", SYM(IN_SYM)}, - { "INDEX", SYM(INDEX)}, + { "INDEX", SYM(INDEX_SYM)}, { "INDEXES", SYM(INDEXES)}, { "INFILE", SYM(INFILE)}, { "INNER", SYM(INNER_SYM)}, diff --git a/sql/log.cc b/sql/log.cc index 09e83392dac..124439ae9eb 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -25,6 +25,7 @@ #include "mysql_priv.h" #include "sql_acl.h" #include "sql_repl.h" +#include "ha_innodb.h" // necessary to cut the binlog when crash recovery #include <my_dir.h> #include <stdarg.h> @@ -296,6 +297,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, if ((index_file_nr= my_open(index_file_name, O_RDWR | O_CREAT | O_BINARY , MYF(MY_WME))) < 0 || + my_sync(index_file_nr, MYF(MY_WME)) || init_io_cache(&index_file, index_file_nr, IO_SIZE, WRITE_CACHE, my_seek(index_file_nr,0L,MY_SEEK_END,MYF(0)), @@ -315,16 +317,21 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, s.set_log_pos(this); s.write(&log_file); } - if (flush_io_cache(&log_file)) + if (flush_io_cache(&log_file) || + my_sync(log_file.file, MYF(MY_WME))) goto err; if (write_file_name_to_index_file) { - /* As this is a new log file, we write the file name to the index file */ + /* + As this is a new log file, we write the file name to the index + file. As every time we write to the index file, we sync it. + */ if (my_b_write(&index_file, (byte*) log_file_name, strlen(log_file_name)) || my_b_write(&index_file, (byte*) "\n", 1) || - flush_io_cache(&index_file)) + flush_io_cache(&index_file) || + my_sync(index_file.file, MYF(MY_WME))) goto err; } break; @@ -405,7 +412,8 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset) goto err; } /* The following will either truncate the file or fill the end with \n' */ - if (my_chsize(file, offset - init_offset, '\n', MYF(MY_WME))) + if (my_chsize(file, offset - init_offset, '\n', MYF(MY_WME)) || + my_sync(file, MYF(MY_WME))) goto err; /* Reset data in old index cache */ @@ -995,6 +1003,8 @@ void MYSQL_LOG::new_file(bool need_lock) open(old_name, save_log_type, new_name_ptr, index_file_name, io_cache_type, no_auto_events, max_size); + if (this == &mysql_bin_log) + report_pos_in_innodb(); my_free(old_name,MYF(0)); end: @@ -1258,12 +1268,12 @@ bool MYSQL_LOG::write(Log_event* event_info) { char buf[200]; int written= my_snprintf(buf, sizeof(buf)-1, - "SET ONE_SHOT CHARACTER_SET_CLIENT=%lu,\ -COLLATION_CONNECTION=%lu,COLLATION_DATABASE=%lu,COLLATION_SERVER=%lu", - thd->variables.character_set_client->number, - thd->variables.collation_connection->number, - thd->variables.collation_database->number, - thd->variables.collation_server->number); + "SET ONE_SHOT CHARACTER_SET_CLIENT=%u,\ +COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", + (uint) thd->variables.character_set_client->number, + (uint) thd->variables.collation_connection->number, + (uint) thd->variables.collation_database->number, + (uint) thd->variables.collation_server->number); Query_log_event e(thd, buf, written, 0); e.set_log_pos(this); if (e.write(file)) @@ -1406,6 +1416,30 @@ COLLATION_CONNECTION=%lu,COLLATION_DATABASE=%lu,COLLATION_SERVER=%lu", if (event_info->get_type_code() == QUERY_EVENT || event_info->get_type_code() == EXEC_LOAD_EVENT) { +#ifndef DBUG_OFF + if (unlikely(opt_crash_binlog_innodb)) + { + /* + This option is for use in rpl_crash_binlog_innodb.test. + 1st we want to verify that Binlog_dump thread cannot send the + event now (because of LOCK_log): we here tell the Binlog_dump + thread to wake up, sleep for the slave to have time to possibly + receive data from the master (it should not), and then crash. + 2nd we want to verify that at crash recovery the rolled back + event is cut from the binlog. + */ + if (!(--opt_crash_binlog_innodb)) + { + signal_update(); + sleep(2); + fprintf(stderr,"This is a normal crash because of" + " --crash-binlog-innodb\n"); + assert(0); + } + DBUG_PRINT("info",("opt_crash_binlog_innodb: %d", + opt_crash_binlog_innodb)); + } +#endif error = ha_report_binlog_offset_and_commit(thd, log_file_name, file->pos_in_file); called_handler_commit=1; @@ -1561,6 +1595,22 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) write_error=1; // Don't give more errors goto err; } +#ifndef DBUG_OFF + if (unlikely(opt_crash_binlog_innodb)) + { + /* see the previous MYSQL_LOG::write() method for a comment */ + if (!(--opt_crash_binlog_innodb)) + { + signal_update(); + sleep(2); + fprintf(stderr, "This is a normal crash because of" + " --crash-binlog-innodb\n"); + assert(0); + } + DBUG_PRINT("info",("opt_crash_binlog_innodb: %d", + opt_crash_binlog_innodb)); + } +#endif if ((ha_report_binlog_offset_and_commit(thd, log_file_name, log_file.pos_in_file))) goto err; @@ -1978,4 +2028,138 @@ bool flush_error_log() } +/* + If the server has InnoDB on, and InnoDB has published the position of the + last committed transaction (which happens only if a crash recovery occured at + this startup) then truncate the previous binary log at the position given by + InnoDB. If binlog is shorter than the position, print a message to the error + log. + + SYNOPSIS + cut_spurious_tail() + + RETURN VALUES + 1 Error + 0 Ok +*/ +bool MYSQL_LOG::cut_spurious_tail() +{ + int error= 0; + char llbuf1[22], llbuf2[22]; + ulonglong actual_size; + + DBUG_ENTER("cut_spurious_tail"); +#ifdef HAVE_INNOBASE_DB + if (have_innodb != SHOW_OPTION_YES) + DBUG_RETURN(0); + /* + This is the place where we use information from InnoDB to cut the + binlog. + */ + char *name= ha_innobase::get_mysql_bin_log_name(); + ulonglong pos= ha_innobase::get_mysql_bin_log_pos(); + if (name[0] == 0 || pos == ULONGLONG_MAX) + { + DBUG_PRINT("info", ("InnoDB has not set binlog info")); + DBUG_RETURN(0); + } + /* The binlog given by InnoDB normally is never an active binlog */ + if (is_open() && is_active(name)) + { + sql_print_error("Warning: after InnoDB crash recovery, InnoDB says that " + "the binary log of the previous run has the same name " + "'%s' as the current one; this is likely to be abnormal.", + name); + DBUG_RETURN(1); + } + sql_print_error("After InnoDB crash recovery, checking if the binary log " + "'%s' contains rolled back transactions which must be " + "removed from it...", name); + /* If we have a too long binlog, cut. If too short, print error */ + int fd= my_open(name, O_EXCL | O_APPEND | O_BINARY | O_WRONLY, MYF(MY_WME)); + if (fd < 0) + { + int save_errno= my_errno; + sql_print_error("Could not open the binary log '%s' for truncation.", + name); + if (save_errno != ENOENT) + sql_print_error("The binary log '%s' should not be used for " + "replication.", name); + DBUG_RETURN(1); + } + + if (pos > (actual_size= my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME)))) + { + /* + Note that when we have MyISAM rollback this error message should be + reconsidered. + */ + sql_print_error("The binary log '%s' is shorter than its expected size " + "(actual: %s, expected: %s) so it misses at least one " + "committed transaction; so it should not be used for " + "replication or point-in-time recovery. You would need " + "to restart slaves from a fresh master's data " + "snapshot ", + name, llstr(actual_size, llbuf1), + llstr(pos, llbuf2)); + error= 1; + goto err; + } + if (pos < actual_size) + { + sql_print_error("The binary log '%s' is bigger than its expected size " + "(actual: %s, expected: %s) so it contains a rolled back " + "transaction; now truncating that.", name, + llstr(actual_size, llbuf1), llstr(pos, llbuf2)); + /* + As on some OS, my_chsize() can only pad with 0s instead of really + truncating. Then mysqlbinlog (and Binlog_dump thread) will error on + these zeroes. This is annoying, but not more (you just need to manually + switch replication to the next binlog). Fortunately, in my_chsize.c, it + says that all modern machines support real ftruncate(). + + */ + if ((error= my_chsize(fd, pos, 0, MYF(MY_WME)))) + goto err; + } +err: + if (my_close(fd, MYF(MY_WME))) + error= 1; +#endif + DBUG_RETURN(error); +} + + +/* + If the server has InnoDB on, store the binlog name and position into + InnoDB. This function is used every time we create a new binlog. + + SYNOPSIS + report_pos_in_innodb() + + NOTES + This cannot simply be done in MYSQL_LOG::open(), because when we create + the first binlog at startup, we have not called ha_init() yet so we cannot + write into InnoDB yet. + + RETURN VALUES + 1 Error + 0 Ok +*/ + +void MYSQL_LOG::report_pos_in_innodb() +{ + DBUG_ENTER("report_pos_in_innodb"); +#ifdef HAVE_INNOBASE_DB + if (is_open() && have_innodb == SHOW_OPTION_YES) + { + DBUG_PRINT("info", ("Reporting binlog info into InnoDB - " + "name: '%s' position: %d", + log_file_name, my_b_tell(&log_file))); + innobase_store_binlog_offset_and_flush_log(log_file_name, + my_b_tell(&log_file)); + } +#endif + DBUG_VOID_RETURN; +} diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index db8d534064d..72ac3af70ff 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -18,6 +18,7 @@ #include <mysql_version.h> #include <mysql_embed.h> #include <my_sys.h> +#include <my_time.h> #include <m_string.h> #include <hash.h> #include <signal.h> @@ -39,14 +40,6 @@ extern const key_map key_map_empty; extern const key_map key_map_full; extern const char *primary_key_name; -/* - Portable time_t replacement. - Should be signed and hold seconds for 1902-2038 range. -*/ -typedef long my_time_t; -#define MY_TIME_T_MAX LONG_MAX -#define MY_TIME_T_MIN LONG_MIN - #include "mysql_com.h" #include <violite.h> #include "unireg.h" @@ -670,8 +663,9 @@ my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show); /* sql_handler.cc */ int mysql_ha_open(THD *thd, TABLE_LIST *tables); -int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok=0); -int mysql_ha_closeall(THD *thd, TABLE_LIST *tables); +int mysql_ha_close(THD *thd, TABLE_LIST *tables, + bool dont_send_ok=0, bool dont_lock=0, bool no_alias=0); +int mysql_ha_close_list(THD *thd, TABLE_LIST *tables, bool flushed=0); int mysql_ha_read(THD *, TABLE_LIST *,enum enum_ha_read_modes,char *, List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows); @@ -869,7 +863,7 @@ extern ulong rpl_recovery_rank, thread_cache_size; extern ulong com_stat[(uint) SQLCOM_END], com_other, back_log; extern ulong specialflag, current_pid; extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter; -extern my_bool relay_log_purge; +extern my_bool relay_log_purge, opt_innodb_safe_binlog; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version, mysqld_port, dropping_tables; extern uint delay_key_write_options, lower_case_table_names; @@ -886,6 +880,7 @@ extern my_bool opt_slave_compressed_protocol, use_temp_pool; extern my_bool opt_readonly, lower_case_file_system; extern my_bool opt_enable_named_pipe, opt_sync_frm; extern my_bool opt_secure_auth; +extern uint opt_crash_binlog_innodb; extern char *shared_memory_base_name, *mysqld_unix_port; extern bool opt_enable_shared_memory; extern char *default_tz_name; @@ -1001,12 +996,9 @@ void get_date_from_daynr(long daynr,uint *year, uint *month, void init_time(void); my_time_t my_system_gmt_sec(const TIME *, long *current_timezone, bool *not_exist); my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *not_exist); -bool str_to_time(const char *str,uint length,TIME *l_time, int *was_cut); bool str_to_time_with_warn(const char *str,uint length,TIME *l_time); -timestamp_type str_to_TIME(const char *str, uint length, TIME *l_time, - uint flags, int *was_cut); -timestamp_type str_to_TIME_with_warn(const char *str, uint length, - TIME *l_time, uint flags); +timestamp_type str_to_datetime_with_warn(const char *str, uint length, + TIME *l_time, uint flags); longlong number_to_TIME(longlong nr, TIME *time_res, bool fuzzy_date, int *was_cut); void localtime_to_TIME(TIME *to, struct tm *from); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3c23ecd3c3d..436f693d734 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -269,11 +269,13 @@ my_bool opt_secure_auth= 0; my_bool opt_short_log_format= 0; my_bool opt_log_queries_not_using_indexes= 0; my_bool lower_case_file_system= 0; +my_bool opt_innodb_safe_binlog= 0; volatile bool mqh_used = 0; uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options; uint delay_key_write_options, protocol_version; uint lower_case_table_names; +uint opt_crash_binlog_innodb; uint volatile thread_count, thread_running, kill_cached_threads, wake_thread; ulong back_log, connect_timeout, concurrency; @@ -309,15 +311,6 @@ ulong my_bind_addr; /* the address we bind to */ volatile ulong cached_thread_count= 0; double log_10[32]; /* 10 potences */ -ulonglong log_10_int[20]= -{ - 1, 10, 100, 1000, 10000UL, 100000UL, 1000000UL, 10000000UL, - ULL(100000000), ULL(1000000000), ULL(10000000000), ULL(100000000000), - ULL(1000000000000), ULL(10000000000000), ULL(100000000000000), - ULL(1000000000000000), ULL(10000000000000000), ULL(100000000000000000), - ULL(1000000000000000000), ULL(10000000000000000000) -}; - time_t start_time; char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30]; @@ -1253,6 +1246,12 @@ static void server_init(void) { DBUG_PRINT("general",("UNIX Socket is %s",mysqld_unix_port)); + if (strlen(mysqld_unix_port) > (sizeof(UNIXaddr.sun_path) - 1)) + { + sql_print_error("The socket file path is too long (> %d): %s", + sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port); + unireg_abort(1); + } if ((unix_sock= socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { sql_perror("Can't start server : UNIX Socket "); /* purecov: inspected */ @@ -2534,6 +2533,41 @@ server."); } } + if (opt_innodb_safe_binlog) + { + if (have_innodb != SHOW_OPTION_YES) + sql_print_error("Warning: --innodb-safe-binlog is meaningful only if " + "the InnoDB storage engine is enabled in the server."); +#ifdef HAVE_INNOBASE_DB + if (innobase_flush_log_at_trx_commit != 1) + { + sql_print_error("Warning: --innodb-safe-binlog is meaningful only if " + "innodb_flush_log_at_trx_commit is 1; now setting it " + "to 1."); + innobase_flush_log_at_trx_commit= 1; + } + if (innobase_unix_file_flush_method) + { + /* + This option has so many values that it's hard to know which value is + good (especially "littlesync", and on Windows... see + srv/srv0start.c). + */ + sql_print_error("Warning: --innodb-safe-binlog requires that " + "the innodb_flush_method actually synchronizes the " + "InnoDB log to disk; it is your responsibility " + "to verify that the method you chose does it."); + } + if (sync_binlog_period != 1) + { + sql_print_error("Warning: --innodb-safe-binlog is meaningful only if " + "the global sync_binlog variable is 1; now setting it " + "to 1."); + sync_binlog_period= 1; + } +#endif + } + if (ha_init()) { sql_print_error("Can't init databases"); @@ -2542,6 +2576,18 @@ server."); if (opt_myisam_log) (void) mi_log(1); + /* + Now that InnoDB is initialized, we can know the last good binlog position + and cut the binlog if needed. This function does nothing if there was no + crash recovery by InnoDB. + */ + if (opt_innodb_safe_binlog) + { + /* not fatal if fails (but print errors) */ + mysql_bin_log.cut_spurious_tail(); + } + mysql_bin_log.report_pos_in_innodb(); + /* call ha_init_key_cache() on all key caches to init them */ process_key_caches(&ha_init_key_cache); /* We must set dflt_key_cache in case we are using ISAM tables */ @@ -3816,8 +3862,8 @@ enum options_mysqld OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT, OPT_INNODB_FLUSH_METHOD, OPT_INNODB_FAST_SHUTDOWN, - OPT_INNODB_FILE_PER_TABLE, - OPT_SAFE_SHOW_DB, + OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB, + OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG, OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, @@ -4498,6 +4544,12 @@ replicating a LOAD DATA INFILE command.", "The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'.", (gptr*) &connect_timeout, (gptr*) &connect_timeout, 0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 }, +#ifdef HAVE_REPLICATION + {"crash_binlog_innodb", OPT_CRASH_BINLOG_INNODB, + "Used only for testing, to crash when writing Nth event to binlog.", + (gptr*) &opt_crash_binlog_innodb, (gptr*) &opt_crash_binlog_innodb, + 0, GET_UINT, REQUIRED_ARG, 0, 0, ~(uint)0, 0, 1, 0}, +#endif {"delayed_insert_timeout", OPT_DELAYED_INSERT_TIMEOUT, "How long a INSERT DELAYED thread should wait for INSERT statements before terminating.", (gptr*) &delayed_insert_timeout, (gptr*) &delayed_insert_timeout, 0, @@ -4577,6 +4629,26 @@ replicating a LOAD DATA INFILE command.", "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back.", (gptr*) &innobase_lock_wait_timeout, (gptr*) &innobase_lock_wait_timeout, 0, GET_LONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0}, +#ifdef HAVE_REPLICATION + /* + Disabled for the 4.1.3 release. Disabling just this paragraph of code is + enough, as then user can't set it to 1 so it will always be ignored in the + rest of code. + */ +#if MYSQL_VERSION_ID >= 40103 + /* + innodb_safe_binlog is not a variable, just an option. Does not make + sense to make it a variable, as it is only used at startup (and so the + value would be lost at next startup, so setting it on the fly would have no + effect). + */ + {"innodb_safe_binlog", OPT_INNODB_SAFE_BINLOG, + "After a crash recovery by InnoDB, truncate the binary log after the last " + "not-rolled-back statement/transaction.", + (gptr*) &opt_innodb_safe_binlog, (gptr*) &opt_innodb_safe_binlog, + 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, +#endif +#endif {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY, "Helps in performance tuning in heavily concurrent environments.", (gptr*) &innobase_thread_concurrency, (gptr*) &innobase_thread_concurrency, @@ -4928,18 +5000,18 @@ The minimum value for this variable is 4096.", 0, GET_ULONG, REQUIRED_ARG, 0, 0, 7L, 0, 1, 0}, { "date-format", OPT_DATE_FORMAT, "The DATE format (For future).", - (gptr*) &opt_date_time_formats[TIMESTAMP_DATE], - (gptr*) &opt_date_time_formats[TIMESTAMP_DATE], + (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], + (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATE], 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { "datetime-format", OPT_DATETIME_FORMAT, "The DATETIME/TIMESTAMP format (for future).", - (gptr*) &opt_date_time_formats[TIMESTAMP_DATETIME], - (gptr*) &opt_date_time_formats[TIMESTAMP_DATETIME], + (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], + (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_DATETIME], 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, { "time-format", OPT_TIME_FORMAT, "The TIME format (for future).", - (gptr*) &opt_date_time_formats[TIMESTAMP_TIME], - (gptr*) &opt_date_time_formats[TIMESTAMP_TIME], + (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], + (gptr*) &opt_date_time_formats[MYSQL_TIMESTAMP_TIME], 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -6045,11 +6117,11 @@ static void get_options(int argc,char **argv) if (opt_log_queries_not_using_indexes) opt_specialflag|= SPECIAL_LOG_QUERIES_NOT_USING_INDEXES; - if (init_global_datetime_format(TIMESTAMP_DATE, + if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE, &global_system_variables.date_format) || - init_global_datetime_format(TIMESTAMP_TIME, + init_global_datetime_format(MYSQL_TIMESTAMP_TIME, &global_system_variables.time_format) || - init_global_datetime_format(TIMESTAMP_DATETIME, + init_global_datetime_format(MYSQL_TIMESTAMP_DATETIME, &global_system_variables.datetime_format)) exit(1); } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 41ba09a3e70..32a0391a777 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -413,7 +413,8 @@ QUICK_SELECT::~QUICK_SELECT() { if (!dont_free) { - file->index_end(); + if (file->inited) + file->ha_index_end(); free_root(&alloc,MYF(0)); } } @@ -609,7 +610,6 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, table_map prev_tables, ha_rows limit, bool force_quick_range) { - uint basflag; uint idx; double scan_time; DBUG_ENTER("test_quick_select"); @@ -623,14 +623,13 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, if (!cond || (specialflag & SPECIAL_SAFE_MODE) && ! force_quick_range || !limit) DBUG_RETURN(0); /* purecov: inspected */ - if (!((basflag= head->file->table_flags()) & HA_KEYPOS_TO_RNDPOS) && - keys_to_use.is_set_all() || keys_to_use.is_clear_all()) - DBUG_RETURN(0); /* Not smart database */ + if (keys_to_use.is_clear_all()) + DBUG_RETURN(0); records=head->file->records; if (!records) records++; /* purecov: inspected */ scan_time=(double) records / TIME_FOR_COMPARE+1; - read_time=(double) head->file->scan_time()+ scan_time + 1.0; + read_time=(double) head->file->scan_time()+ scan_time + 1.1; if (head->force_index) scan_time= read_time= DBL_MAX; if (limit < records) @@ -651,7 +650,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, /* set up parameter that is passed to all functions */ param.thd= thd; - param.baseflag=basflag; + param.baseflag=head->file->table_flags(); param.prev_tables=prev_tables | const_tables; param.read_tables=read_tables; param.current_table= head->map; @@ -728,7 +727,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, found_records=check_quick_select(¶m, idx, *key); if (found_records != HA_POS_ERROR && found_records > 2 && head->used_keys.is_set(keynr) && - (head->file->index_flags(keynr) & HA_KEY_READ_ONLY)) + (head->file->index_flags(keynr) & HA_KEYREAD_ONLY)) { /* We can resolve this by only reading through this key. @@ -747,6 +746,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, param.range_count, found_records)+ (double) found_records / TIME_FOR_COMPARE); + DBUG_PRINT("info",("read_time: %g found_read_time: %g", + read_time, found_read_time)); if (read_time > found_read_time && found_records != HA_POS_ERROR) { read_time=found_read_time; @@ -2368,7 +2369,7 @@ get_quick_select(PARAM *param,uint idx,SEL_ARG *key_tree) 0); else quick=new QUICK_SELECT(param->thd, param->table, param->real_keynr[idx]); - + if (quick) { if (quick->error || @@ -2542,7 +2543,6 @@ static bool null_part_in_key(KEY_PART *key_part, const char *key, uint length) QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref) { - table->file->index_end(); // Remove old cursor QUICK_SELECT *quick=new QUICK_SELECT(thd, table, ref->key, 1); KEY *key_info = &table->key_info[ref->key]; KEY_PART *key_part; @@ -2703,20 +2703,12 @@ int QUICK_SELECT_GEOM::get_next() QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_SELECT *q, uint used_key_parts) : QUICK_SELECT(*q), rev_it(rev_ranges) { - bool not_read_after_key = file->table_flags() & HA_NOT_READ_AFTER_KEY; QUICK_RANGE *r; it.rewind(); for (r = it++; r; r = it++) { rev_ranges.push_front(r); - if (not_read_after_key && range_reads_after_key(r)) - { - it.rewind(); // Reset range - error = HA_ERR_UNSUPPORTED; - dont_free=1; // Don't free memory from 'q' - return; - } } /* Remove EQ_RANGE flag for keys that are not using the full key */ for (r = rev_it++; r; r = rev_it++) @@ -2786,29 +2778,10 @@ int QUICK_SELECT_DESC::get_next() else { DBUG_ASSERT(range->flag & NEAR_MAX || range_reads_after_key(range)); -#ifndef NOT_IMPLEMENTED_YET result=file->index_read(record, (byte*) range->max_key, range->max_length, ((range->flag & NEAR_MAX) ? HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV)); -#else - /* - Heikki changed Sept 11, 2002: since InnoDB does not store the cursor - position if READ_KEY_EXACT is used to a primary key with all - key columns specified, we must use below HA_READ_KEY_OR_NEXT, - so that InnoDB stores the cursor position and is able to move - the cursor one step backward after the search. - */ - /* - Note: even if max_key is only a prefix, HA_READ_AFTER_KEY will - do the right thing - go past all keys which match the prefix - */ - result=file->index_read(record, (byte*) range->max_key, - range->max_length, - ((range->flag & NEAR_MAX) ? - HA_READ_KEY_OR_NEXT : HA_READ_AFTER_KEY)); - result = file->index_prev(record); -#endif } if (result) { diff --git a/sql/opt_range.h b/sql/opt_range.h index 2072ded15d1..9b2e9e45bac 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -90,7 +90,7 @@ public: int init() { key_part_info= head->key_info[index].key_part; - return error=file->index_init(index); + return error=file->ha_index_init(index); } virtual int get_next(); virtual bool reverse_sorted() { return 0; } diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index 8c1cd9ce1cb..75b00b97ce7 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -46,9 +46,9 @@ #include "mysql_priv.h" #include "sql_select.h" -static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, - Field* field, COND *cond, - uint *range_fl, uint *key_prefix_length); +static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, Field* field, + COND *cond, uint *range_fl, + uint *key_prefix_length); static int reckey_in_range(bool max_fl, TABLE_REF *ref, Field* field, COND *cond, uint range_fl, uint prefix_len); static int maxmin_in_range(bool max_fl, Field* field, COND *cond); @@ -166,11 +166,6 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) Item_field *item_field= ((Item_field*) expr); TABLE *table= item_field->field->table; - if ((table->file->table_flags() & HA_NOT_READ_AFTER_KEY)) - { - const_result=0; - break; - } /* Look for a partial key that can be used for optimization. If we succeed, ref.key_length will contain the length of @@ -186,7 +181,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) const_result= 0; break; } - error= table->file->index_init((uint) ref.key); + error= table->file->ha_index_init((uint) ref.key); if (!ref.key_length) error= table->file->index_first(table->record[0]); @@ -206,7 +201,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) table->key_read= 0; table->file->extra(HA_EXTRA_NO_KEYREAD); } - table->file->index_end(); + table->file->ha_index_end(); if (error) { if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE) @@ -260,12 +255,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) const_result= 0; break; } - if ((table->file->table_flags() & HA_NOT_READ_AFTER_KEY)) - { - const_result= 0; - break; - } - error= table->file->index_init((uint) ref.key); + error= table->file->ha_index_init((uint) ref.key); if (!ref.key_length) error= table->file->index_last(table->record[0]); @@ -285,7 +275,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds) table->key_read=0; table->file->extra(HA_EXTRA_NO_KEYREAD); } - table->file->index_end(); + table->file->ha_index_end(); if (error) { if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE) @@ -648,7 +638,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref, keyinfo != keyinfo_end; keyinfo++,idx++) { - if (table->file->index_flags(idx) & HA_WRONG_ASCII_ORDER) + if (!(table->file->index_flags(idx) & HA_READ_ORDER)) break; KEY_PART_INFO *part,*part_end; diff --git a/sql/records.cc b/sql/records.cc index ca00658cdae..94634d30759 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -70,7 +70,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, info->io_cache=tempfile; reinit_io_cache(info->io_cache,READ_CACHE,0L,0,0); info->ref_pos=table->file->ref; - table->file->rnd_init(0); + if (!table->file->inited) + table->file->ha_rnd_init(0); /* table->sort.addon_field is checked because if we use addon fields, @@ -105,7 +106,7 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, else if (table->sort.record_pointers) { DBUG_PRINT("info",("using record_pointers")); - table->file->rnd_init(0); + table->file->ha_rnd_init(0); info->cache_pos=table->sort.record_pointers; info->cache_end=info->cache_pos+ table->sort.found_records*info->ref_length; @@ -116,7 +117,7 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, { DBUG_PRINT("info",("using rr_sequential")); info->read_record=rr_sequential; - table->file->rnd_init(); + table->file->ha_rnd_init(1); /* We can use record cache if we don't update dynamic length tables */ if (!table->no_cache && (use_record_cache > 0 || @@ -142,7 +143,8 @@ void end_read_record(READ_RECORD *info) { filesort_free_buffers(info->table); (void) info->file->extra(HA_EXTRA_NO_CACHE); - (void) info->file->rnd_end(); + if (info->read_record != rr_quick) // otherwise quick_range does it + (void) info->file->ha_index_or_rnd_end(); info->table=0; } } diff --git a/sql/set_var.cc b/sql/set_var.cc index aa45afc3c30..840a7ae075a 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -351,13 +351,13 @@ sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_p sys_var_thd_date_time_format sys_time_format("time_format", &SV::time_format, - TIMESTAMP_TIME); + MYSQL_TIMESTAMP_TIME); sys_var_thd_date_time_format sys_date_format("date_format", &SV::date_format, - TIMESTAMP_DATE); + MYSQL_TIMESTAMP_DATE); sys_var_thd_date_time_format sys_datetime_format("datetime_format", &SV::datetime_format, - TIMESTAMP_DATETIME); + MYSQL_TIMESTAMP_DATETIME); /* Variables that are bits in THD */ diff --git a/sql/set_var.h b/sql/set_var.h index c2b4ca34b2d..a51e44285d6 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -669,7 +669,7 @@ public: class sys_var_thd_date_time_format :public sys_var_thd { DATE_TIME_FORMAT *SV::*offset; - enum timestamp_type date_time_type; + timestamp_type date_time_type; public: sys_var_thd_date_time_format(const char *name_arg, DATE_TIME_FORMAT *SV::*offset_arg, diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d552429af4b..a03e371dd63 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1428,8 +1428,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(combo.user.str,combo.user.length, &my_charset_latin1); - table->file->index_init(0); - if (table->file->index_read(table->record[0], + if (table->file->index_read_idx(table->record[0], 0, (byte*) table->field[0]->ptr,0, HA_READ_KEY_EXACT)) { @@ -1440,7 +1439,6 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, else my_error(ER_NO_PERMISSION_TO_CREATE_USER, MYF(0), thd->user, thd->host_or_ip); - error= -1; goto end; } old_row_exists = 0; @@ -1577,7 +1575,6 @@ end: &thd->lex->mqh, rights); } - table->file->index_end(); DBUG_RETURN(error); } @@ -1613,8 +1610,7 @@ static int replace_db_table(TABLE *table, const char *db, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(db,(uint) strlen(db), &my_charset_latin1); table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); - table->file->index_init(0); - if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr,0, + if (table->file->index_read_idx(table->record[0],0,(byte*) table->field[0]->ptr,0, HA_READ_KEY_EXACT)) { if (what == 'N') @@ -1668,13 +1664,11 @@ static int replace_db_table(TABLE *table, const char *db, acl_update_db(combo.user.str,combo.host.str,db,rights); else acl_insert_db(combo.user.str,combo.host.str,db,rights); - table->file->index_end(); DBUG_RETURN(0); /* This could only happen if the grant tables got corrupted */ table_error: table->file->print_error(error,MYF(0)); /* purecov: deadcode */ - table->file->index_end(); abort: DBUG_RETURN(-1); @@ -1796,8 +1790,7 @@ GRANT_TABLE::GRANT_TABLE(TABLE *form, TABLE *col_privs) col_privs->field[3]->pack_length()); key_copy(key,col_privs,0,key_len); col_privs->field[4]->store("",0, &my_charset_latin1); - col_privs->file->index_init(0); - if (col_privs->file->index_read(col_privs->record[0], + if (col_privs->file->index_read_idx(col_privs->record[0],0, (byte*) col_privs->field[0]->ptr, key_len, HA_READ_KEY_EXACT)) { @@ -1912,7 +1905,7 @@ static int replace_column_table(GRANT_TABLE *g_t, List_iterator <LEX_COLUMN> iter(columns); class LEX_COLUMN *xx; - table->file->index_init(0); + table->file->ha_index_init(0); while ((xx=iter++)) { ulong privileges = xx->rights; @@ -1982,7 +1975,6 @@ static int replace_column_table(GRANT_TABLE *g_t, my_hash_insert(&g_t->hash_columns,(byte*) grant_column); } } - table->file->index_end(); /* If revoke of privileges on the table level, remove all such privileges @@ -1991,7 +1983,6 @@ static int replace_column_table(GRANT_TABLE *g_t, if (revoke_grant) { - table->file->index_init(0); if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr, key_length, HA_READ_KEY_EXACT)) goto end; @@ -2047,7 +2038,7 @@ static int replace_column_table(GRANT_TABLE *g_t, } end: - table->file->index_end(); + table->file->ha_index_end(); DBUG_RETURN(result); } @@ -2560,15 +2551,13 @@ my_bool grant_init(THD *org_thd) goto end; t_table = tables[0].table; c_table = tables[1].table; - t_table->file->index_init(0); + t_table->file->ha_index_init(0); if (t_table->file->index_first(t_table->record[0])) { - t_table->file->index_end(); return_val= 0; goto end_unlock; } grant_option= TRUE; - t_table->file->index_end(); /* Will be restored by org_thd->store_globals() */ my_pthread_setspecific_ptr(THR_MALLOC,&memex); @@ -2588,7 +2577,7 @@ my_bool grant_init(THD *org_thd) { sql_print_error("Warning: 'tables_priv' entry '%s %s@%s' " "ignored in --skip-name-resolve mode.", - mem_check->tname, mem_check->user, + mem_check->tname, mem_check->user, mem_check->host, mem_check->host); continue; } @@ -2605,6 +2594,7 @@ my_bool grant_init(THD *org_thd) return_val=0; // Return ok end_unlock: + t_table->file->ha_index_end(); mysql_unlock_tables(thd, lock); thd->version--; // Force close to free memory @@ -3548,12 +3538,10 @@ int mysql_drop_user(THD *thd, List <LEX_USER> &list) record[0]))) { tables[0].table->file->print_error(error, MYF(0)); - tables[0].table->file->index_end(); DBUG_RETURN(-1); } delete_dynamic_element(&acl_users, acl_userd); } - tables[0].table->file->index_end(); } VOID(pthread_mutex_unlock(&acl_cache->lock)); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f705b592e5a..b6d14092885 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -300,6 +300,7 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, thd->proc_info="Flushing tables"; close_old_data_files(thd,thd->open_tables,1,1); + mysql_ha_close_list(thd, tables); bool found=1; /* Wait until all threads has closed all the tables we had locked */ DBUG_PRINT("info", @@ -850,6 +851,9 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name, DBUG_RETURN(0); } + /* close handler tables which are marked for flush */ + mysql_ha_close_list(thd, (TABLE_LIST*) NULL, /*flushed*/ 1); + for (table=(TABLE*) hash_search(&open_cache,(byte*) key,key_length) ; table && table->in_use ; table = (TABLE*) hash_next(&open_cache,(byte*) key,key_length)) @@ -1220,6 +1224,7 @@ bool wait_for_tables(THD *thd) { thd->some_tables_deleted=0; close_old_data_files(thd,thd->open_tables,0,dropping_tables != 0); + mysql_ha_close_list(thd, (TABLE_LIST*) NULL, /*flushed*/ 1); if (!table_is_used(thd->open_tables,1)) break; (void) pthread_cond_wait(&COND_refresh,&LOCK_open); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 5c6215e6fb9..5fe21d79aa0 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1044,9 +1044,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) goto err_unlock; // Parse query } #endif /*!NO_EMBEDDED_ACCESS_CHECKS*/ - if (check_tables && !handler::caching_allowed(thd, table->db(), - table->key_length(), - table->type())) + if (check_tables && !ha_caching_allowed(thd, table->db(), + table->key_length(), + table->type())) { DBUG_PRINT("qcache", ("Handler does not allow caching for %s.%s", table_list.db, table_list.alias)); @@ -2687,9 +2687,9 @@ my_bool Query_cache::ask_handler_allowance(THD *thd, for (; tables_used; tables_used= tables_used->next) { TABLE *table= tables_used->table; - if (!handler::caching_allowed(thd, table->table_cache_key, - table->key_length, - table->file->table_cache_type())) + if (!ha_caching_allowed(thd, table->table_cache_key, + table->key_length, + table->file->table_cache_type())) { DBUG_PRINT("qcache", ("Handler does not allow caching for %s.%s", tables_used->db, tables_used->alias)); diff --git a/sql/sql_class.h b/sql/sql_class.h index 01387e28402..64fed055c80 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -169,6 +169,8 @@ public: int purge_first_log(struct st_relay_log_info* rli, bool included); bool reset_logs(THD* thd); void close(uint exiting); + bool cut_spurious_tail(); + void report_pos_in_innodb(); // iterating through the log index file int find_log_pos(LOG_INFO* linfo, const char* log_name, diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 48497636186..b76bad2805b 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -197,6 +197,7 @@ cleanup: query_cache_invalidate3(thd, table_list, 1); } + delete select; transactional_table= table->file->has_transactions(); log_delayed= (transactional_table || table->tmp_table); /* @@ -214,7 +215,7 @@ cleanup: { if (error <= 0) thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, + Query_log_event qinfo(thd, thd->query, thd->query_length, log_delayed); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; @@ -233,7 +234,6 @@ cleanup: mysql_unlock_tables(thd, thd->lock); thd->lock=0; } - delete select; free_underlaid_joins(thd, &thd->lex->select_lex); if (error >= 0 || thd->net.report_error) send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN: 0); diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index fcc56cbf9c9..56c1b0a1b51 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -43,7 +43,9 @@ thd->handler_tables=tmp; } static TABLE **find_table_ptr_by_name(THD *thd,const char *db, - const char *table_name, bool is_alias); + const char *table_name, + bool is_alias, bool dont_lock, + bool *was_flushed); int mysql_ha_open(THD *thd, TABLE_LIST *tables) { @@ -66,24 +68,61 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables) return 0; } -int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok) + +/* + Close a HANDLER table. + + SYNOPSIS + mysql_ha_close() + thd Thread identifier. + tables A list of tables with the first entry to close. + dont_send_ok Suppresses the commands' ok message and + error message and error return. + dont_lock Suppresses the normal locking of LOCK_open. + + DESCRIPTION + Though this function takes a list of tables, only the first list entry + will be closed. Broadcasts a COND_refresh condition. + If mysql_ha_close() is not called from the parser, 'dont_send_ok' + must be set. + If the caller did already lock LOCK_open, it must set 'dont_lock'. + + IMPLEMENTATION + find_table_ptr_by_name() closes the table, if a FLUSH TABLE is outstanding. + It returns a NULL pointer in this case, but flags the situation in + 'was_flushed'. In that case the normal ER_UNKNOWN_TABLE error messages + is suppressed. + + RETURN + 0 ok + -1 error +*/ + +int mysql_ha_close(THD *thd, TABLE_LIST *tables, + bool dont_send_ok, bool dont_lock, bool no_alias) { - TABLE **ptr=find_table_ptr_by_name(thd, tables->db, tables->alias, 1); + TABLE **table_ptr; + bool was_flushed; - if (*ptr) + table_ptr= find_table_ptr_by_name(thd, tables->db, tables->alias, + !no_alias, dont_lock, &was_flushed); + if (*table_ptr) { - VOID(pthread_mutex_lock(&LOCK_open)); - if (close_thread_table(thd, ptr)) + (*table_ptr)->file->ha_index_or_rnd_end(); + if (!dont_lock) + VOID(pthread_mutex_lock(&LOCK_open)); + if (close_thread_table(thd, table_ptr)) { /* Tell threads waiting for refresh that something has happened */ VOID(pthread_cond_broadcast(&COND_refresh)); } - VOID(pthread_mutex_unlock(&LOCK_open)); + if (!dont_lock) + VOID(pthread_mutex_unlock(&LOCK_open)); } - else + else if (!was_flushed && !dont_send_ok) { - my_printf_error(ER_UNKNOWN_TABLE,ER(ER_UNKNOWN_TABLE),MYF(0), - tables->alias, "HANDLER"); + my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0), + tables->alias, "HANDLER"); return -1; } if (!dont_send_ok) @@ -91,13 +130,65 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok) return 0; } -int mysql_ha_closeall(THD *thd, TABLE_LIST *tables) + +/* + Close a list of HANDLER tables. + + SYNOPSIS + mysql_ha_close_list() + thd Thread identifier. + tables The list of tables to close. If NULL, + close all HANDLER tables. + flushed Close only tables which are marked flushed. + Used only if tables is NULL. + + DESCRIPTION + The list of HANDLER tables may be NULL, in which case all HANDLER + tables are closed. Broadcasts a COND_refresh condition, for + every table closed. If 'tables' is NULL and 'flushed' is set, + all HANDLER tables marked for flush are closed. + The caller must lock LOCK_open. + + IMPLEMENTATION + find_table_ptr_by_name() closes the table, if it is marked for flush. + It returns a NULL pointer in this case, but flags the situation in + 'was_flushed'. In that case the normal ER_UNKNOWN_TABLE error messages + is suppressed. + + RETURN + 0 ok +*/ + +int mysql_ha_close_list(THD *thd, TABLE_LIST *tables, bool flushed) { - TABLE **ptr=find_table_ptr_by_name(thd, tables->db, tables->real_name, 0); - if (*ptr && close_thread_table(thd, ptr)) + TABLE_LIST *tl_item; + TABLE **table_ptr; + + if (tables) { - /* Tell threads waiting for refresh that something has happened */ - VOID(pthread_cond_broadcast(&COND_refresh)); + for (tl_item= tables ; tl_item; tl_item= tl_item->next) + { + mysql_ha_close(thd, tl_item, /*dont_send_ok*/ 1, + /*dont_lock*/ 1, /*no_alias*/ 1); + } + } + else + { + table_ptr= &(thd->handler_tables); + while (*table_ptr) + { + if (! flushed || ((*table_ptr)->version != refresh_version)) + { + (*table_ptr)->file->ha_index_or_rnd_end(); + if (close_thread_table(thd, table_ptr)) + { + /* Tell threads waiting for refresh that something has happened */ + VOID(pthread_cond_broadcast(&COND_refresh)); + } + continue; + } + table_ptr= &((*table_ptr)->next); + } } return 0; } @@ -112,7 +203,10 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, ha_rows select_limit,ha_rows offset_limit) { int err, keyno=-1; - TABLE *table=*find_table_ptr_by_name(thd, tables->db, tables->alias, 1); + bool was_flushed; + TABLE *table= *find_table_ptr_by_name(thd, tables->db, tables->alias, + /*is_alias*/ 1, /*dont_lock*/ 0, + &was_flushed); if (!table) { my_printf_error(ER_UNKNOWN_TABLE,ER(ER_UNKNOWN_TABLE),MYF(0), @@ -136,7 +230,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, keyname,tables->alias); return -1; } - table->file->index_init(keyno); + table->file->ha_index_or_rnd_end(); + table->file->ha_index_init(keyno); } List<Item> list; @@ -148,8 +243,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, uint num_rows; byte *key; uint key_len; - LINT_INIT(key); - LINT_INIT(key_len); + LINT_INIT(key); + LINT_INIT(key_len); it++; // Skip first NULL field @@ -180,7 +275,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, err=table->file->index_first(table->record[0]); else { - if (!(err=table->file->rnd_init(1))) + table->file->ha_index_or_rnd_end(); + if (!(err=table->file->ha_rnd_init(1))) err=table->file->rnd_next(table->record[0]); } mode=RNEXT; @@ -291,17 +387,51 @@ err0: } +/* + Find a HANDLER table by name. + + SYNOPSIS + find_table_ptr_by_name() + thd Thread identifier. + db Database (schema) name. + table_name Table name ;-). + is_alias Table name may be an alias name. + dont_lock Suppresses the normal locking of LOCK_open. + + DESCRIPTION + Find the table 'db'.'table_name' in the list of HANDLER tables of the + thread 'thd'. If the table has been marked by FLUSH TABLE(S), close it, + flag this situation in '*was_flushed' and broadcast a COND_refresh + condition. + An empty database (schema) name matches all database (schema) names. + If the caller did already lock LOCK_open, it must set 'dont_lock'. + + IMPLEMENTATION + Just in case that the table is twice in 'thd->handler_tables' (!?!), + the loop does not break when the table was flushed. If another table + by that name was found and not flushed, '*was_flushed' is cleared again, + since a pointer to an open HANDLER table is returned. + + RETURN + *was_flushed Table has been closed due to FLUSH TABLE. + NULL A HANDLER Table by that name does not exist (any more). + != NULL Pointer to the TABLE structure. +*/ + static TABLE **find_table_ptr_by_name(THD *thd, const char *db, - const char *table_name, bool is_alias) + const char *table_name, + bool is_alias, bool dont_lock, + bool *was_flushed) { int dblen; - TABLE **ptr; + TABLE **table_ptr; DBUG_ASSERT(db); dblen= strlen(db); - ptr= &(thd->handler_tables); + table_ptr= &(thd->handler_tables); + *was_flushed= FALSE; - for (TABLE *table= *ptr; table ; table= *ptr) + for (TABLE *table= *table_ptr; table ; table= *table_ptr) { if ((db == any_db || !memcmp(table->table_cache_key, db, dblen)) && !my_strcasecmp(system_charset_info, @@ -310,18 +440,22 @@ static TABLE **find_table_ptr_by_name(THD *thd, const char *db, { if (table->version != refresh_version) { - VOID(pthread_mutex_lock(&LOCK_open)); - if (close_thread_table(thd, ptr)) + if (!dont_lock) + VOID(pthread_mutex_lock(&LOCK_open)); + if (close_thread_table(thd, table_ptr)) { /* Tell threads waiting for refresh that something has happened */ VOID(pthread_cond_broadcast(&COND_refresh)); } - VOID(pthread_mutex_unlock(&LOCK_open)); + if (!dont_lock) + VOID(pthread_mutex_unlock(&LOCK_open)); + *was_flushed= TRUE; continue; } + *was_flushed= FALSE; break; } - ptr= &(table->next); + table_ptr= &(table->next); } - return ptr; + return table_ptr; } diff --git a/sql/sql_help.cc b/sql/sql_help.cc index c5a49cab3b5..eabe66d33bf 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -22,8 +22,6 @@ struct st_find_field Field *field; }; -static void free_select(SQL_SELECT *sel); - /* Used fields */ static struct st_find_field init_used_fields[]= @@ -48,9 +46,9 @@ static struct st_find_field init_used_fields[]= enum enum_used_fields { help_topic_help_topic_id= 0, - help_topic_name, + help_topic_name, help_topic_help_category_id, - help_topic_description, + help_topic_description, help_topic_example, help_category_help_category_id, @@ -60,13 +58,13 @@ enum enum_used_fields help_keyword_help_keyword_id, help_keyword_name, - help_relation_help_topic_id, + help_relation_help_topic_id, help_relation_help_keyword_id }; /* - Fill st_find_field structure with pointers to fields + Fill st_find_field structure with pointers to fields SYNOPSIS init_fields() @@ -90,7 +88,7 @@ static bool init_fields(THD *thd, TABLE_LIST *tables, /* We have to use 'new' here as field will be re_linked on free */ Item_field *field= new Item_field("mysql", find_fields->table_name, find_fields->field_name); - if (!(find_fields->field= find_field_in_tables(thd, field, tables, + if (!(find_fields->field= find_field_in_tables(thd, field, tables, ¬_used, TRUE))) DBUG_RETURN(1); } @@ -119,12 +117,12 @@ static bool init_fields(THD *thd, TABLE_LIST *tables, NOTE Field 'names' is set only if more than one topic is found. - Fields 'name', 'description', 'example' are set only if + Fields 'name', 'description', 'example' are set only if found exactly one topic. */ void memorize_variant_topic(THD *thd, TABLE *topics, int count, - struct st_find_field *find_fields, + struct st_find_field *find_fields, List<String> *names, String *name, String *description, String *example) { @@ -136,7 +134,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count, get_field(mem_root,find_fields[help_topic_description].field, description); get_field(mem_root,find_fields[help_topic_example].field, example); } - else + else { if (count == 1) names->push_back(name); @@ -168,7 +166,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count, NOTE Field 'names' is set only if more than one topic was found. - Fields 'name', 'description', 'example' are set only if + Fields 'name', 'description', 'example' are set only if exactly one topic was found. */ @@ -179,12 +177,12 @@ int search_topics(THD *thd, TABLE *topics, struct st_find_field *find_fields, { DBUG_ENTER("search_topics"); int count= 0; - + READ_RECORD read_record_info; init_read_record(&read_record_info, thd, topics, select,1,0); while (!read_record_info.read_record(&read_record_info)) { - if (!select->cond->val_int()) // Dosn't match like + if (!select->cond->val_int()) // Doesn't match like continue; memorize_variant_topic(thd,topics,count,find_fields, names,name,description,example); @@ -219,7 +217,7 @@ int search_keyword(THD *thd, TABLE *keywords, struct st_find_field *find_fields, { DBUG_ENTER("search_keyword"); int count= 0; - + READ_RECORD read_record_info; init_read_record(&read_record_info, thd, keywords, select,1,0); while (!read_record_info.read_record(&read_record_info) && count<2) @@ -256,13 +254,13 @@ int search_keyword(THD *thd, TABLE *keywords, struct st_find_field *find_fields, description description of found topic (out) example example for found topic (out) - NOTE + NOTE Field 'names' is set only if more than one topic was found. - Fields 'name', 'description', 'example' are set only if + Fields 'name', 'description', 'example' are set only if exactly one topic was found. */ -int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, +int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, struct st_find_field *find_fields, int16 key_id, List<String> *names, String *name, String *description, String *example) @@ -273,7 +271,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, Field *rtopic_id, *rkey_id; DBUG_ENTER("get_topics_for_keyword"); - + if ((iindex_topic= find_type((char*) primary_key_name, &topics->keynames, 1+2)-1)<0 || (iindex_relations= find_type((char*) primary_key_name, @@ -284,18 +282,18 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, } rtopic_id= find_fields[help_relation_help_topic_id].field; rkey_id= find_fields[help_relation_help_keyword_id].field; - - topics->file->index_init(iindex_topic); - relations->file->index_init(iindex_relations); - + + topics->file->ha_index_init(iindex_topic); + relations->file->ha_index_init(iindex_relations); + rkey_id->store((longlong) key_id); rkey_id->get_key_image(buff, rkey_id->pack_length(), rkey_id->charset(), Field::itRAW); int key_res= relations->file->index_read(relations->record[0], (byte *)buff, rkey_id->pack_length(), HA_READ_KEY_EXACT); - - for ( ; + + for ( ; !key_res && key_id == (int16) rkey_id->val_int() ; key_res= relations->file->index_next(relations->record[0])) { @@ -305,7 +303,7 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, field->store((longlong) topic_id); field->get_key_image(topic_id_buff, field->pack_length(), field->charset(), Field::itRAW); - + if (!topics->file->index_read(topics->record[0], (byte *)topic_id_buff, field->pack_length(), HA_READ_KEY_EXACT)) { @@ -314,50 +312,12 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, count++; } } + topics->file->ha_index_end(); + relations->file->ha_index_end(); DBUG_RETURN(count); } /* - Look for topics with keyword by mask - - SYNOPSIS - search_topics_by_keyword() - thd Thread handler - keywords Table of keywords - topics Table of topics - relations Table of m:m relation "topic/keyword" - find_fields Filled array of info for fields - select Function to test for if matching help keyword. - Normally 'help_keyword.name like 'bit%' - - RETURN VALUES - # number of topics found - - names array of name of found topics (out) - - name name of found topic (out) - description description of found topic (out) - example example for found topic (out) - - NOTE - Field 'names' is set only if more than one topic was found. - Fields 'name', 'description', 'example' are set only if - exactly one topic was found. -*/ - -int search_topics_by_keyword(THD *thd, - TABLE *keywords, TABLE *topics, TABLE *relations, - struct st_find_field *find_fields, - SQL_SELECT *select, List<String> *names, - String *name, String *description, String *example) -{ - int key_id; - return search_keyword(thd,keywords,find_fields,select,&key_id)!=1 - ? 0 : get_topics_for_keyword(thd,topics,relations,find_fields,key_id, - names,name,description,example); -} - -/* Look for categories by mask SYNOPSIS @@ -382,10 +342,10 @@ int search_categories(THD *thd, TABLE *categories, Field *pfname= find_fields[help_category_name].field; Field *pcat_id= find_fields[help_category_help_category_id].field; int count= 0; - READ_RECORD read_record_info; + READ_RECORD read_record_info; DBUG_ENTER("search_categories"); - + init_read_record(&read_record_info, thd, categories, select,1,0); while (!read_record_info.read_record(&read_record_info)) { @@ -398,7 +358,7 @@ int search_categories(THD *thd, TABLE *categories, names->push_back(lname); } end_read_record(&read_record_info); - + DBUG_RETURN(count); } @@ -423,7 +383,7 @@ void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname, init_read_record(&read_record_info, thd, items, select,1,0); while (!read_record_info.read_record(&read_record_info)) { - if (!select->cond->val_int()) + if (!select->cond->val_int()) continue; String *name= new (&thd->mem_root) String(); get_field(&thd->mem_root,pfname,name); @@ -436,7 +396,7 @@ void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname, /* Send to client answer for help request - + SYNOPSIS send_answer_1() protocol - protocol for sending @@ -466,10 +426,10 @@ int send_answer_1(Protocol *protocol, String *s1, String *s2, String *s3) field_list.push_back(new Item_empty_string("name",64)); field_list.push_back(new Item_empty_string("description",1000)); field_list.push_back(new Item_empty_string("example",1000)); - + if (protocol->send_fields(&field_list,1)) DBUG_RETURN(1); - + protocol->prepare_for_resend(); protocol->store(s1); protocol->store(s2); @@ -539,7 +499,7 @@ extern "C" int string_ptr_cmp(const void* ptr1, const void* ptr2) SYNOPSIS send_variant_2_list() protocol Protocol for sending - names List of names + names List of names cat Value of the column <is_it_category> source_name name of category for all items.. @@ -548,8 +508,8 @@ extern "C" int string_ptr_cmp(const void* ptr1, const void* ptr2) 0 Data was successefully send */ -int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, - List<String> *names, +int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, + List<String> *names, const char *cat, String *source_name) { DBUG_ENTER("send_variant_2_list"); @@ -589,17 +549,22 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, table goal table error code of error (out) - + RETURN VALUES - # created SQL_SELECT + # created SQL_SELECT */ -SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, TABLE_LIST *tables, +SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, TABLE_LIST *tables, TABLE *table, int *error) { cond->fix_fields(thd, tables, &cond); // can never fail SQL_SELECT *res= make_select(table,0,0,cond,error); - return (*error || (res && res->check_quick(thd, 0, HA_POS_ERROR))) ? 0 : res; + if (*error || (res && res->check_quick(thd, 0, HA_POS_ERROR))) + { + delete res; + res=0; + } + return res; } /* @@ -615,9 +580,9 @@ SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, TABLE_LIST *tables, pfname field "name" in table error code of error (out) - + RETURN VALUES - # created SQL_SELECT + # created SQL_SELECT */ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen, @@ -649,12 +614,10 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen, int mysqld_help(THD *thd, const char *mask) { Protocol *protocol= thd->protocol; - SQL_SELECT *select_topics_by_name= 0, *select_keyword_by_name= 0, - *select_cat_by_name= 0, *select_topics_by_cat= 0, *select_cat_by_cat= 0, - *select_root_cats= 0; + SQL_SELECT *select; st_find_field used_fields[array_elements(init_used_fields)]; DBUG_ENTER("mysqld_help"); - + TABLE_LIST tables[4]; bzero((gptr)tables,sizeof(tables)); tables[0].alias= tables[0].real_name= (char*) "help_topic"; @@ -670,13 +633,13 @@ int mysqld_help(THD *thd, const char *mask) tables[3].lock_type= TL_READ; tables[3].next= 0; tables[0].db= tables[1].db= tables[2].db= tables[3].db= (char*) "mysql"; - + List<String> topics_list, categories_list, subcategories_list; String name, description, example; int res, count_topics, count_categories, error; uint mlen= strlen(mask); MEM_ROOT *mem_root= &thd->mem_root; - + if (open_and_lock_tables(thd, tables)) { res= -1; @@ -684,7 +647,7 @@ int mysqld_help(THD *thd, const char *mask) } /* Init tables and fields to be usable from items */ setup_tables(tables); - memcpy((char*) used_fields, (char*) init_used_fields, sizeof(used_fields)); + memcpy((char*) used_fields, (char*) init_used_fields, sizeof(used_fields)); if (init_fields(thd, tables, used_fields, array_elements(used_fields))) { res= -1; @@ -693,39 +656,55 @@ int mysqld_help(THD *thd, const char *mask) size_t i; for (i=0; i<sizeof(tables)/sizeof(TABLE_LIST); i++) tables[i].table->file->init_table_handle_for_HANDLER(); - - if (!(select_topics_by_name= + + if (!(select= prepare_select_for_name(thd,mask,mlen,tables,tables[0].table, - used_fields[help_topic_name].field,&error)) || - !(select_cat_by_name= - prepare_select_for_name(thd,mask,mlen,tables,tables[1].table, - used_fields[help_category_name].field,&error))|| - !(select_keyword_by_name= - prepare_select_for_name(thd,mask,mlen,tables,tables[3].table, - used_fields[help_keyword_name].field,&error))) + used_fields[help_topic_name].field,&error))) { res= -1; goto end; } res= 1; - count_topics= search_topics(thd,tables[0].table,used_fields, - select_topics_by_name,&topics_list, + count_topics= search_topics(thd,tables[0].table,used_fields, + select,&topics_list, &name, &description, &example); + delete select; if (count_topics == 0) - count_topics= search_topics_by_keyword(thd,tables[3].table,tables[0].table, - tables[2].table,used_fields, - select_keyword_by_name,&topics_list, - &name,&description,&example); - + { + int key_id; + if (!(select= + prepare_select_for_name(thd,mask,mlen,tables,tables[3].table, + used_fields[help_keyword_name].field,&error))) + { + res= -1; + goto end; + } + count_topics=search_keyword(thd,tables[3].table,used_fields,select,&key_id); + delete select; + count_topics= (count_topics != 1) ? 0 : + get_topics_for_keyword(thd,tables[0].table,tables[2].table, + used_fields,key_id,&topics_list,&name, + &description,&example); + } + if (count_topics == 0) { int16 category_id; Field *cat_cat_id= used_fields[help_category_parent_category_id].field; + if (!(select= + prepare_select_for_name(thd,mask,mlen,tables,tables[1].table, + used_fields[help_category_name].field,&error))) + { + res= -1; + goto end; + } + count_categories= search_categories(thd, tables[1].table, used_fields, - select_cat_by_name, + select, &categories_list,&category_id); + delete select; if (!count_categories) { if (send_header_2(protocol,FALSE)) @@ -746,22 +725,26 @@ int mysqld_help(THD *thd, const char *mask) Item *cond_cat_by_cat= new Item_func_equal(new Item_field(cat_cat_id), new Item_int((int32)category_id)); - if (!(select_topics_by_cat= prepare_simple_select(thd,cond_topic_by_cat, - tables,tables[0].table, - &error)) || - !(select_cat_by_cat= - prepare_simple_select(thd,cond_cat_by_cat,tables, - tables[1].table,&error))) + if (!(select= prepare_simple_select(thd,cond_topic_by_cat, + tables,tables[0].table,&error))) { res= -1; goto end; } get_all_items_for_category(thd,tables[0].table, used_fields[help_topic_name].field, - select_topics_by_cat,&topics_list); + select,&topics_list); + delete select; + if (!(select= prepare_simple_select(thd,cond_cat_by_cat,tables, + tables[1].table,&error))) + { + res= -1; + goto end; + } get_all_items_for_category(thd,tables[1].table, used_fields[help_category_name].field, - select_cat_by_cat,&subcategories_list); + select,&subcategories_list); + delete select; String *cat= categories_list.head(); if (send_header_2(protocol, true) || send_variant_2_list(mem_root,protocol,&topics_list, "N",cat) || @@ -780,30 +763,25 @@ int mysqld_help(THD *thd, const char *mask) if (send_header_2(protocol, FALSE) || send_variant_2_list(mem_root,protocol, &topics_list, "N", 0)) goto end; - search_categories(thd, tables[1].table, used_fields, - select_cat_by_name,&categories_list, 0); + if (!(select= + prepare_select_for_name(thd,mask,mlen,tables,tables[1].table, + used_fields[help_category_name].field,&error))) + { + res= -1; + goto end; + } + search_categories(thd, tables[1].table, used_fields, + select,&categories_list, 0); + delete select; /* Then send categories */ if (send_variant_2_list(mem_root,protocol, &categories_list, "Y", 0)) goto end; } res= 0; - + send_eof(thd); end: - free_select(select_topics_by_name); - free_select(select_keyword_by_name); - free_select(select_cat_by_name); - free_select(select_topics_by_cat); - free_select(select_cat_by_cat); - free_select(select_root_cats); - DBUG_RETURN(res); } - -static void free_select(SQL_SELECT *sel) -{ - if (sel) - delete sel->quick; -} diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index f7f30b079b8..b769178565b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1115,7 +1115,7 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg) thd->fatal_error(); // Abort waiting inserts goto end; } - if (di->table->file->has_transactions()) + if (!(di->table->file->table_flags() & HA_CAN_INSERT_DELAYED)) { thd->fatal_error(); my_error(ER_ILLEGAL_HA, MYF(0), di->table_list.real_name); @@ -1219,8 +1219,10 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg) di->status=0; if (!di->stacked_inserts && !di->tables_in_use && thd->lock) { - /* No one is doing a insert delayed; - Unlock it so that other threads can use it */ + /* + No one is doing a insert delayed + Unlock table so that other threads can use it + */ MYSQL_LOCK *lock=thd->lock; thd->lock=0; pthread_mutex_unlock(&di->mutex); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b6cb61fe10e..d945eef1425 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1008,7 +1008,7 @@ void st_select_lex::init_query() ref_pointer_array= 0; select_n_having_items= 0; prep_where= 0; - explicit_limit= 0; + subquery_in_having= explicit_limit= 0; } void st_select_lex::init_select() diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 54d9a09c1f3..328df2f6bb9 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -433,6 +433,11 @@ public: bool having_fix_field; /* explicit LIMIT clause was used */ bool explicit_limit; + /* + there are subquery in HAVING clause => we can't close tables before + query processing end even if we use temporary table + */ + bool subquery_in_having; /* SELECT for SELECT command st_select_lex. Used to privent scaning diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2d8facfa63f..0cc25c4fe6e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2938,7 +2938,7 @@ unsent_create_error: goto error; } /* grant is checked in mysqld_show_tables */ - if (select_lex->options & SELECT_DESCRIBE) + if (lex->describe) res= mysqld_extend_show_tables(thd,db, (lex->wild ? lex->wild->ptr() : NullS)); else @@ -3816,10 +3816,10 @@ bool check_stack_overrun(THD *thd,char *buf __attribute__((unused))) #define MY_YACC_INIT 1000 // Start with big alloc #define MY_YACC_MAX 32000 // Because of 'short' -bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, int *yystacksize) +bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize) { LEX *lex=current_lex; - int old_info=0; + ulong old_info=0; if ((uint) *yystacksize >= MY_YACC_MAX) return 1; if (!lex->yacc_yyvs) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 09b442f8dfc..91df364e531 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -361,7 +361,7 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) } tm.day= tm.year= tm.month= 0; - param->set_time(&tm, TIMESTAMP_TIME, + param->set_time(&tm, MYSQL_TIMESTAMP_TIME, MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } *pos+= length; @@ -396,7 +396,7 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len) tm.second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; - param->set_time(&tm, TIMESTAMP_DATETIME, + param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME, MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } *pos+= length; @@ -423,7 +423,7 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) tm.second_part= 0; tm.neg= 0; - param->set_time(&tm, TIMESTAMP_DATE, + param->set_time(&tm, MYSQL_TIMESTAMP_DATE, MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } *pos+= length; @@ -432,58 +432,25 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) #else/*!EMBEDDED_LIBRARY*/ void set_param_time(Item_param *param, uchar **pos, ulong len) { - TIME tm; MYSQL_TIME *to= (MYSQL_TIME*)*pos; - - tm.second_part= to->second_part; - - tm.day= to->day; - tm.hour= to->hour; - tm.minute= to->minute; - tm.second= to->second; - - tm.year= tm.month= 0; - tm.neg= to->neg; - param->set_time(&tm, TIMESTAMP_TIME, + param->set_time(to, MYSQL_TIMESTAMP_TIME, MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } void set_param_datetime(Item_param *param, uchar **pos, ulong len) { - TIME tm; MYSQL_TIME *to= (MYSQL_TIME*)*pos; - tm.second_part= to->second_part; - - tm.day= to->day; - tm.hour= to->hour; - tm.minute= to->minute; - tm.second= to->second; - tm.year= to->year; - tm.month= to->month; - tm.neg= 0; - - param->set_time(&tm, TIMESTAMP_DATETIME, + param->set_time(to, MYSQL_TIMESTAMP_DATETIME, MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } void set_param_date(Item_param *param, uchar **pos, ulong len) { - TIME tm; MYSQL_TIME *to= (MYSQL_TIME*)*pos; - - tm.second_part= to->second_part; - tm.day= to->day; - tm.year= to->year; - tm.month= to->month; - tm.neg= 0; - tm.hour= tm.minute= tm.second= 0; - tm.second_part= 0; - tm.neg= 0; - - param->set_time(&tm, TIMESTAMP_DATE, + param->set_time(to, MYSQL_TIMESTAMP_DATE, MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } #endif /*!EMBEDDED_LIBRARY*/ @@ -1115,22 +1082,22 @@ static int mysql_test_select(Prepared_statement *stmt, goto err; } + thd->used_tables= 0; // Updated by setup_fields + + // JOIN::prepare calls + if (unit->prepare(thd, 0, 0)) + { + send_error(thd); + goto err_prep; + } if (lex->describe) { if (!text_protocol && send_prep_stmt(stmt, 0)) - goto err; + goto err_prep; + unit->cleanup(); } else { - thd->used_tables= 0; // Updated by setup_fields - - // JOIN::prepare calls - if (unit->prepare(thd, 0, 0)) - { - send_error(thd); - goto err_prep; - } - if (!text_protocol) { if (send_prep_stmt(stmt, lex->select_lex.item_list.elements) || @@ -1610,7 +1577,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, if (name) { stmt->name.length= name->length; - if (!(stmt->name.str= memdup_root(&stmt->mem_root, (byte*)name->str, + if (!(stmt->name.str= memdup_root(&stmt->mem_root, (char*)name->str, name->length))) { delete stmt; @@ -1698,6 +1665,8 @@ static void reset_stmt_for_execute(Prepared_statement *stmt) for (; sl; sl= sl->next_select_in_list()) { + /* remove option which was put by mysql_explain_union() */ + sl->options&= ~SELECT_DESCRIBE; /* Copy WHERE clause pointers to avoid damaging they by optimisation */ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 09b0b66933a..2f8ede4b4cb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -125,13 +125,14 @@ static int remove_duplicates(JOIN *join,TABLE *entry,List<Item> &fields, Item *having); static int remove_dup_with_compare(THD *thd, TABLE *entry, Field **field, ulong offset,Item *having); -static int remove_dup_with_hash_index(THD *thd, TABLE *table, +static int remove_dup_with_hash_index(THD *thd,TABLE *table, uint field_count, Field **first_field, ulong key_length,Item *having); static int join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count); static ulong used_blob_length(CACHE_FIELD **ptr); static bool store_record_in_cache(JOIN_CACHE *cache); -static void reset_cache(JOIN_CACHE *cache); +static void reset_cache_read(JOIN_CACHE *cache); +static void reset_cache_write(JOIN_CACHE *cache); static void read_cached_record(JOIN_TAB *tab); static bool cmp_buffer_with_ref(JOIN_TAB *tab); static bool setup_new_fields(THD *thd,TABLE_LIST *tables,List<Item> &fields, @@ -602,7 +603,6 @@ JOIN::optimize() { zero_result_cause= "no matching row in const table"; DBUG_PRINT("error",("Error: %s", zero_result_cause)); - select_options= 0; //TODO why option in return_zero_rows was droped error= 0; DBUG_RETURN(0); } @@ -616,22 +616,8 @@ JOIN::optimize() } if (const_tables && !thd->locked_tables && !(select_options & SELECT_NO_UNLOCK)) - { - TABLE **curr_table, **end; - for (curr_table= table, end=curr_table + const_tables ; - curr_table != end; - curr_table++) - { - /* BDB tables require that we call index_end() before doing an unlock */ - if ((*curr_table)->key_read) - { - (*curr_table)->key_read=0; - (*curr_table)->file->extra(HA_EXTRA_NO_KEYREAD); - } - (*curr_table)->file->index_end(); - } mysql_unlock_some_tables(thd, table, const_tables); - } + if (!conds && outer_join) { /* Handle the case where we have an OUTER JOIN without a WHERE */ @@ -1088,12 +1074,14 @@ JOIN::exec() DBUG_ENTER("JOIN::exec"); error= 0; - thd->limit_found_rows= thd->examined_row_count= 0; if (procedure) { if (procedure->change_columns(fields_list) || result->prepare(fields_list, unit)) + { + thd->limit_found_rows= thd->examined_row_count= 0; DBUG_VOID_RETURN; + } } if (!tables_list) @@ -1119,8 +1107,10 @@ JOIN::exec() else error=(int) result->send_eof(); } + thd->limit_found_rows= thd->examined_row_count= 0; DBUG_VOID_RETURN; } + thd->limit_found_rows= thd->examined_row_count= 0; if (zero_result_cause) { @@ -1539,6 +1529,7 @@ JOIN::cleanup() } } tmp_join->tmp_join= 0; + tmp_table_param.copy_field=0; DBUG_RETURN(tmp_join->cleanup()); } @@ -2287,12 +2278,13 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level, case Item_func::OPTIMIZE_NONE: break; case Item_func::OPTIMIZE_KEY: - // BETWEEN or IN + // BETWEEN, IN, NOT if (cond_func->key_item()->real_item()->type() == Item::FIELD_ITEM && !(cond_func->used_tables() & OUTER_REF_TABLE_BIT)) add_key_field(key_fields,*and_level,cond_func, - ((Item_field*) (cond_func->key_item()->real_item()))-> - field, 0, + ((Item_field*)(cond_func->key_item()->real_item()))->field, + cond_func->argument_count() == 2 && + cond_func->functype() == Item_func::IN_FUNC, cond_func->arguments()+1, cond_func->argument_count()-1, usable_tables); break; @@ -3652,7 +3644,6 @@ make_join_readinfo(JOIN *join, uint options) } delete tab->quick; tab->quick=0; - table->file->index_init(tab->ref.key); tab->read_first_record= join_read_key; tab->read_record.read_record= join_no_more_records; if (table->used_keys.is_set(tab->ref.key) && @@ -3672,7 +3663,6 @@ make_join_readinfo(JOIN *join, uint options) } delete tab->quick; tab->quick=0; - table->file->index_init(tab->ref.key); if (table->used_keys.is_set(tab->ref.key) && !table->no_keyread) { @@ -3692,7 +3682,6 @@ make_join_readinfo(JOIN *join, uint options) break; case JT_FT: table->status=STATUS_NO_RECORD; - table->file->index_init(tab->ref.key); tab->read_first_record= join_ft_read_first; tab->read_record.read_record= join_ft_read_next; break; @@ -3762,7 +3751,6 @@ make_join_readinfo(JOIN *join, uint options) !(tab->select && tab->select->quick)) { // Only read index tree tab->index=find_shortest_key(table, & table->used_keys); - tab->table->file->index_init(tab->index); tab->read_first_record= join_read_first; tab->type=JT_NEXT; // Read with index_first / index_next } @@ -3836,9 +3824,7 @@ void JOIN_TAB::cleanup() table->key_read= 0; table->file->extra(HA_EXTRA_NO_KEYREAD); } - /* Don't free index if we are using read_record */ - if (!read_record.table) - table->file->index_end(); + table->file->ha_index_or_rnd_end(); /* We need to reset this for next select (Tested in part_of_refkey) @@ -3864,7 +3850,9 @@ void JOIN::join_free(bool full) { JOIN_TAB *tab,*end; - DBUG_ENTER("join_free"); + DBUG_ENTER("JOIN::join_free"); + + full= full || !select_lex->uncacheable; if (table) { @@ -3877,36 +3865,49 @@ JOIN::join_free(bool full) free_io_cache(table[const_tables]); filesort_free_buffers(table[const_tables]); } - if (!full && select_lex->uncacheable) + + for (SELECT_LEX_UNIT *unit= select_lex->first_inner_unit(); unit; + unit= unit->next_unit()) { - for (tab= join_tab, end= tab+tables; tab != end; tab++) - { - if (tab->table) - { - /* Don't free index if we are using read_record */ - if (!tab->read_record.table) - tab->table->file->index_end(); - } - } + JOIN *join; + for (SELECT_LEX *sl= unit->first_select_in_union(); sl; + sl= sl->next_select()) + if ((join= sl->join)) + join->join_free(full); } - else + + if (full) { for (tab= join_tab, end= tab+tables; tab != end; tab++) tab->cleanup(); table= 0; } + else + { + for (tab= join_tab, end= tab+tables; tab != end; tab++) + { + if (tab->table) + tab->table->file->ha_index_or_rnd_end(); + } + } } + /* We are not using tables anymore Unlock all tables. We may be in an INSERT .... SELECT statement. */ - if ((full || !select_lex->uncacheable) && - lock && thd->lock && - !(select_options & SELECT_NO_UNLOCK)) + if (full && lock && thd->lock && !(select_options & SELECT_NO_UNLOCK) && + !select_lex->subquery_in_having) { - mysql_unlock_read_tables(thd, lock);// Don't free join->lock - lock=0; + // TODO: unlock tables even if the join isn't top level select in the tree + if (select_lex == (thd->lex->unit.fake_select_lex ? + thd->lex->unit.fake_select_lex : &thd->lex->select_lex)) + { + mysql_unlock_read_tables(thd, lock); // Don't free join->lock + lock=0; + } } + if (full) { group_fields.delete_elements(); @@ -4128,6 +4129,8 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables, DBUG_RETURN(0); } + join->join_free(0); + if (send_row) { for (TABLE_LIST *table=tables; table ; table=table->next) @@ -4145,12 +4148,6 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables, item->no_rows_in_result(); result->send_data(fields); } - if (tables) // Not from do_select() - { - /* Close open cursors */ - for (TABLE_LIST *table=tables; table ; table=table->next) - table->table->file->index_end(); - } result->send_eof(); // Should be safe } /* Update results for FOUND_ROWS */ @@ -5557,8 +5554,8 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, goto err1; if (table->file->indexes_are_disabled()) new_table.file->disable_indexes(HA_KEY_SWITCH_ALL); - table->file->index_end(); - table->file->rnd_init(); + table->file->ha_index_or_rnd_end(); + table->file->ha_rnd_init(1); if (table->no_rows) { new_table.file->extra(HA_EXTRA_NO_ROWS); @@ -5580,7 +5577,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, } /* remove heap table and change to use myisam table */ - (void) table->file->rnd_end(); + (void) table->file->ha_rnd_end(); (void) table->file->close(); (void) table->file->delete_table(table->real_name); delete table->file; @@ -5594,7 +5591,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, err: DBUG_PRINT("error",("Got error: %d",write_err)); table->file->print_error(error,MYF(0)); // Give table is full error - (void) table->file->rnd_end(); + (void) table->file->ha_rnd_end(); (void) new_table.file->close(); err1: new_table.file->delete_table(new_table.real_name); @@ -5643,7 +5640,8 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) { DBUG_PRINT("info",("Using end_update")); end_select=end_update; - table->file->index_init(0); + if (!table->file->inited) + table->file->ha_index_init(0); } else { @@ -5721,9 +5719,9 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) my_errno= tmp; error= -1; } - if ((tmp=table->file->index_end())) + if ((tmp=table->file->ha_index_or_rnd_end())) { - DBUG_PRINT("error",("index_end() failed")); + DBUG_PRINT("error",("ha_index_or_rnd_end() failed")); my_errno= tmp; error= -1; } @@ -5867,8 +5865,7 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skip_last) /* read through all records */ if ((error=join_init_read_record(join_tab))) { - reset_cache(&join_tab->cache); - join_tab->cache.records=0; join_tab->cache.ptr_record= (uint) ~0; + reset_cache_write(&join_tab->cache); return -error; /* No records or error */ } @@ -5891,21 +5888,23 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skip_last) !join_tab->cache.select->skip_record())) { uint i; - reset_cache(&join_tab->cache); + reset_cache_read(&join_tab->cache); for (i=(join_tab->cache.records- (skip_last ? 1 : 0)) ; i-- > 0 ;) { read_cached_record(join_tab); if (!select || !select->skip_record()) if ((error=(join_tab->next_select)(join,join_tab+1,0)) < 0) + { + reset_cache_write(&join_tab->cache); return error; /* purecov: inspected */ + } } } } while (!(error=info->read_record(info))); if (skip_last) read_cached_record(join_tab); // Restore current record - reset_cache(&join_tab->cache); - join_tab->cache.records=0; join_tab->cache.ptr_record= (uint) ~0; + reset_cache_write(&join_tab->cache); if (error > 0) // Fatal error return -1; /* purecov: inspected */ for (JOIN_TAB *tmp2=join->join_tab; tmp2 != join_tab ; tmp2++) @@ -5990,6 +5989,11 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos) if (!table->outer_join || error > 0) DBUG_RETURN(error); } + if (table->key_read) + { + table->key_read=0; + table->file->extra(HA_EXTRA_NO_KEYREAD); + } } if (tab->on_expr && !table->null_row) { @@ -6068,6 +6072,8 @@ join_read_key(JOIN_TAB *tab) int error; TABLE *table= tab->table; + if (!table->file->inited) + table->file->ha_index_init(tab->ref.key); if (cmp_buffer_with_ref(tab) || (table->status & (STATUS_GARBAGE | STATUS_NO_PARENT | STATUS_NULL_ROW))) { @@ -6093,6 +6099,8 @@ join_read_always_key(JOIN_TAB *tab) int error; TABLE *table= tab->table; + if (!table->file->inited) + table->file->ha_index_init(tab->ref.key); if (cp_buffer_from_ref(&tab->ref)) return -1; if ((error=table->file->index_read(table->record[0], @@ -6118,6 +6126,8 @@ join_read_last_key(JOIN_TAB *tab) int error; TABLE *table= tab->table; + if (!table->file->inited) + table->file->ha_index_init(tab->ref.key); if (cp_buffer_from_ref(&tab->ref)) return -1; if ((error=table->file->index_read_last(table->record[0], @@ -6226,6 +6236,8 @@ join_read_first(JOIN_TAB *tab) tab->read_record.file=table->file; tab->read_record.index=tab->index; tab->read_record.record=table->record[0]; + if (!table->file->inited) + table->file->ha_index_init(tab->index); if ((error=tab->table->file->index_first(tab->table->record[0]))) { if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE) @@ -6263,6 +6275,8 @@ join_read_last(JOIN_TAB *tab) tab->read_record.file=table->file; tab->read_record.index=tab->index; tab->read_record.record=table->record[0]; + if (!table->file->inited) + table->file->ha_index_init(tab->index); if ((error= tab->table->file->index_last(tab->table->record[0]))) return report_error(table, error); return 0; @@ -6285,6 +6299,8 @@ join_ft_read_first(JOIN_TAB *tab) int error; TABLE *table= tab->table; + if (!table->file->inited) + table->file->ha_index_init(tab->ref.key); #if NOT_USED_YET if (cp_buffer_from_ref(&tab->ref)) // as ft-key doesn't use store_key's return -1; // see also FT_SELECT::init() @@ -6602,7 +6618,6 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), if (item->maybe_null) group->buff[-1]=item->null_value ? 1 : 0; } - // table->file->index_init(0); if (!table->file->index_read(table->record[1], join->tmp_table_param.group_buff,0, HA_READ_KEY_EXACT)) @@ -6633,7 +6648,7 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), error, 0)) DBUG_RETURN(-1); // Not a table_is_full error /* Change method to update rows */ - table->file->index_init(0); + table->file->ha_index_init(0); join->join_tab[join->tables-1].next_select=end_unique_update; } join->send_records++; @@ -7131,10 +7146,10 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, if (tab->ref.key >= 0) { tab->ref.key= new_ref_key; - table->file->index_init(new_ref_key); } else { + select->quick->file->ha_index_end(); select->quick->index= new_ref_key; select->quick->init(); } @@ -7156,7 +7171,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, */ if (!select->quick->reverse_sorted()) { - if (table->file->index_flags(ref_key) & HA_NOT_READ_PREFIX_LAST) + if (!(table->file->index_flags(ref_key) & HA_READ_PREV)) DBUG_RETURN(0); // Use filesort // ORDER BY range_key DESC QUICK_SELECT_DESC *tmp=new QUICK_SELECT_DESC(select->quick, @@ -7178,7 +7193,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, Use a traversal function that starts by reading the last row with key part (A) and then traverse the index backwards. */ - if (table->file->index_flags(ref_key) & HA_NOT_READ_PREFIX_LAST) + if (!(table->file->index_flags(ref_key) & HA_READ_PREV)) DBUG_RETURN(0); // Use filesort tab->read_first_record= join_read_last_key; tab->read_record.read_record= join_read_prev_same; @@ -7232,7 +7247,6 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, tab->index=nr; tab->read_first_record= (flag > 0 ? join_read_first: join_read_last); - table->file->index_init(nr); tab->type=JT_NEXT; // Read with index_first(), index_next() if (table->used_keys.is_set(nr)) { @@ -7493,7 +7507,7 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field, org_record=(char*) (record=table->record[0])+offset; new_record=(char*) table->record[1]+offset; - file->rnd_init(); + file->ha_rnd_init(1); error=file->rnd_next(record); for (;;) { @@ -7605,7 +7619,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, (*field_length++)= (*ptr)->pack_length(); } - file->rnd_init(); + file->ha_rnd_init(1); key_pos=key_buffer; for (;;) { @@ -7651,14 +7665,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, my_free((char*) key_buffer,MYF(0)); hash_free(&hash); file->extra(HA_EXTRA_NO_CACHE); - (void) file->rnd_end(); + (void) file->ha_rnd_end(); DBUG_RETURN(0); err: my_free((char*) key_buffer,MYF(0)); hash_free(&hash); file->extra(HA_EXTRA_NO_CACHE); - (void) file->rnd_end(); + (void) file->ha_rnd_end(); if (error) file->print_error(error,MYF(0)); DBUG_RETURN(1); @@ -7785,7 +7799,6 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) } } - cache->records=0; cache->ptr_record= (uint) ~0; cache->length=length+blobs*sizeof(char*); cache->blobs=blobs; *blob_ptr=0; /* End sequentel */ @@ -7793,7 +7806,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) if (!(cache->buff=(uchar*) my_malloc(size,MYF(0)))) DBUG_RETURN(1); /* Don't use cache */ /* purecov: inspected */ cache->end=cache->buff+size; - reset_cache(cache); + reset_cache_write(cache); DBUG_RETURN(0); } @@ -7877,13 +7890,21 @@ store_record_in_cache(JOIN_CACHE *cache) static void -reset_cache(JOIN_CACHE *cache) +reset_cache_read(JOIN_CACHE *cache) { cache->record_nr=0; cache->pos=cache->buff; } +static void reset_cache_write(JOIN_CACHE *cache) +{ + reset_cache_read(cache); + cache->records= 0; + cache->ptr_record= (uint) ~0; +} + + static void read_cached_record(JOIN_TAB *tab) { diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4642abfcfc4..823552be3a4 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -473,6 +473,8 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) field_list.push_back(item=new Item_empty_string("Name",NAME_LEN)); field_list.push_back(item=new Item_empty_string("Engine",10)); item->maybe_null=1; + field_list.push_back(item=new Item_int("Version", (longlong) 0, 21)); + item->maybe_null=1; field_list.push_back(item=new Item_empty_string("Row_format",10)); item->maybe_null=1; field_list.push_back(item=new Item_int("Rows",(longlong) 1,21)); @@ -533,6 +535,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) handler *file=table->file; file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_NO_LOCK); protocol->store(file->table_type(), system_charset_info); + protocol->store((ulonglong) table->frm_version); str= ((table->db_options_in_use & HA_OPTION_COMPRESS_RECORD) ? "Compressed" : (table->db_options_in_use & HA_OPTION_PACK_RECORD) ? diff --git a/sql/sql_table.cc b/sql/sql_table.cc index dc838f0e685..6c9ec41c728 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -191,7 +191,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, for (table=tables ; table ; table=table->next) { char *db=table->db; - mysql_ha_closeall(thd, table); + mysql_ha_close(thd, table, /*dont_send_ok*/ 1, /*dont_lock*/ 1); if (!close_temporary_table(thd, db, table->real_name)) { tmp_table_deleted=1; @@ -531,7 +531,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, break; case FIELD_TYPE_GEOMETRY: #ifdef HAVE_SPATIAL - if (!(file->table_flags() & HA_HAS_GEOMETRY)) + if (!(file->table_flags() & HA_CAN_GEOMETRY)) { my_printf_error(ER_CHECK_NOT_IMPLEMENTED, ER(ER_CHECK_NOT_IMPLEMENTED), MYF(0), "GEOMETRY"); @@ -669,7 +669,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, continue; } (*key_count)++; - tmp=max(file->max_key_parts(),MAX_REF_PARTS); + tmp=file->max_key_parts(); if (key->columns.elements > tmp) { my_error(ER_TOO_MANY_KEY_PARTS,MYF(0),tmp); @@ -721,7 +721,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } } - tmp=min(file->max_keys(), MAX_KEY); + tmp=file->max_keys(); if (*key_count > tmp) { my_error(ER_TOO_MANY_KEYS,MYF(0),tmp); @@ -881,7 +881,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, if (f_is_blob(sql_field->pack_flag)) { - if (!(file->table_flags() & HA_BLOB_KEY)) + if (!(file->table_flags() & HA_CAN_INDEX_BLOBS)) { my_printf_error(ER_BLOB_USED_AS_KEY,ER(ER_BLOB_USED_AS_KEY),MYF(0), column->field_name); @@ -918,7 +918,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, } else key_info->flags|= HA_NULL_PART_KEY; - if (!(file->table_flags() & HA_NULL_KEY)) + if (!(file->table_flags() & HA_NULL_IN_KEY)) { my_printf_error(ER_NULL_COLUMN_IN_INDEX,ER(ER_NULL_COLUMN_IN_INDEX), MYF(0),column->field_name); @@ -1050,7 +1050,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, if (!(key_info->flags & HA_NULL_PART_KEY)) unique_key=1; key_info->key_length=(uint16) key_length; - uint max_key_length= min(file->max_key_length(), MAX_KEY_LENGTH); + uint max_key_length= file->max_key_length(); if (key_length > max_key_length && key->type != Key::FULLTEXT) { my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length); @@ -1142,12 +1142,21 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, alias= table_case_name(create_info, table_name); file=get_new_handler((TABLE*) 0, create_info->db_type); +#ifdef NOT_USED + /* + if there is a technical reason for a handler not to have support + for temp. tables this code can be re-enabled. + Otherwise, if a handler author has a wish to prohibit usage of + temporary tables for his handler he should implement a check in + ::create() method + */ if ((create_info->options & HA_LEX_CREATE_TMP_TABLE) && (file->table_flags() & HA_NO_TEMP_TABLES)) { my_error(ER_ILLEGAL_HA,MYF(0),table_name); DBUG_RETURN(-1); } +#endif if (mysql_prepare_table(thd, create_info, fields, keys, tmp_table, db_options, file, @@ -1718,7 +1727,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, if (protocol->send_fields(&field_list, 1)) DBUG_RETURN(-1); - mysql_ha_closeall(thd, tables); + mysql_ha_close(thd, tables, /*dont_send_ok*/ 1, /*dont_lock*/ 1); for (table = tables; table; table = table->next) { char table_name[NAME_LEN*2+2]; @@ -2245,7 +2254,7 @@ int mysql_discard_or_import_tablespace(THD *thd, thd->tablespace_op=TRUE; /* we set this flag so that ha_innobase::open and ::external_lock() do not complain when we lock the table */ - mysql_ha_closeall(thd, table_list); + mysql_ha_close(thd, table_list, /*dont_send_ok*/ 1, /*dont_lock*/ 1); if (!(table=open_ltable(thd,table_list,TL_WRITE))) { @@ -2524,7 +2533,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, new_db= db; used_fields=create_info->used_fields; - mysql_ha_closeall(thd, table_list); + mysql_ha_close(thd, table_list, /*dont_send_ok*/ 1, /*dont_lock*/ 1); /* DISCARD/IMPORT TABLESPACE is always alone in an ALTER TABLE */ if (alter_info->tablespace_op != NO_TABLESPACE_OP) @@ -2579,7 +2588,10 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } } else - new_alias= new_name= table_name; + { + new_alias= (lower_case_table_names == 2) ? alias : table_name; + new_name= table_name; + } old_db_type=table->db_type; if (create_info->db_type == DB_TYPE_DEFAULT) @@ -3461,7 +3473,7 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) current query id */ t->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); - if (t->file->rnd_init(1)) + if (t->file->ha_rnd_init(1)) protocol->store_null(); else { @@ -3489,6 +3501,7 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) crc+= row_crc; } protocol->store((ulonglong)crc); + t->file->ha_rnd_end(); } } thd->clear_error(); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 9436db6c3b9..18394d007ed 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -319,6 +319,7 @@ int mysql_update(THD *thd, error= 1; // Aborted end_read_record(&info); free_io_cache(table); // If ORDER BY + delete select; thd->proc_info="end"; VOID(table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY)); @@ -358,7 +359,6 @@ int mysql_update(THD *thd, thd->lock=0; } - delete select; free_underlaid_joins(thd, &thd->lex->select_lex); if (error >= 0) send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0); /* purecov: inspected */ @@ -964,25 +964,24 @@ int multi_update::do_updates(bool from_send_error) TABLE_LIST *cur_table; int local_error; ha_rows org_updated; - TABLE *table; + TABLE *table, *tmp_table; DBUG_ENTER("do_updates"); - - do_update= 0; // Don't retry this function + + do_update= 0; // Don't retry this function if (!found) DBUG_RETURN(0); for (cur_table= update_tables; cur_table ; cur_table= cur_table->next) { byte *ref_pos; - TABLE *tmp_table; - + table = cur_table->table; if (table == table_to_update) continue; // Already updated org_updated= updated; tmp_table= tmp_tables[cur_table->shared]; tmp_table->file->extra(HA_EXTRA_CACHE); // Change to read cache - (void) table->file->rnd_init(0); + (void) table->file->ha_rnd_init(0); table->file->extra(HA_EXTRA_NO_CACHE); /* @@ -998,7 +997,7 @@ int multi_update::do_updates(bool from_send_error) } copy_field_end=copy_field_ptr; - if ((local_error = tmp_table->file->rnd_init(1))) + if ((local_error = tmp_table->file->ha_rnd_init(1))) goto err; ref_pos= (byte*) tmp_table->field[0]->ptr; @@ -1049,7 +1048,8 @@ int multi_update::do_updates(bool from_send_error) else trans_safe= 0; // Can't do safe rollback } - (void) table->file->rnd_end(); + (void) table->file->ha_rnd_end(); + (void) tmp_table->file->ha_rnd_end(); } DBUG_RETURN(0); @@ -1057,6 +1057,9 @@ err: if (!from_send_error) table->file->print_error(local_error,MYF(0)); + (void) table->file->ha_rnd_end(); + (void) tmp_table->file->ha_rnd_end(); + if (updated != org_updated) { if (table->tmp_table != NO_TMP_TABLE) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 49ef2f29dfc..6fa69f050b4 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -40,7 +40,7 @@ int yylex(void *yylval, void *yythd); -#define yyoverflow(A,B,C,D,E,F) if (my_yyoverflow((B),(D),(int*) (F))) { yyerror((char*) (A)); return 2; } +#define yyoverflow(A,B,C,D,E,F) {ulong val= *(F); if(my_yyoverflow((B), (D), &val)) { yyerror((char*) (A)); return 2; } else { *(F)= (YYSIZE_T)val; }} #define WARN_DEPRECATED(A,B) \ push_warning_printf(((THD *)yythd), MYSQL_ERROR::WARN_LEVEL_WARN, \ @@ -90,7 +90,7 @@ inline Item *or_or_concat(THD *thd, Item* A, Item* B) } %{ -bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); +bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %} %pure_parser /* We have threads */ @@ -255,7 +255,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token IDENT_QUOTED %token IGNORE_SYM %token IMPORT -%token INDEX +%token INDEX_SYM %token INDEXES %token INFILE %token INNER_SYM @@ -602,7 +602,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); opt_table_alias %type <table> - table_ident table_ident_ref references + table_ident table_ident_nodb references %type <simple_string> remember_name remember_end opt_ident opt_db text_or_password @@ -1028,7 +1028,7 @@ create: } create2 { Lex->current_select= &Lex->select_lex; } - | CREATE opt_unique_or_fulltext INDEX ident key_alg ON table_ident + | CREATE opt_unique_or_fulltext INDEX_SYM ident key_alg ON table_ident { LEX *lex=Lex; lex->sql_command= SQLCOM_CREATE_INDEX; @@ -1212,7 +1212,7 @@ create_table_option: | INSERT_METHOD opt_equal merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;} | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.data_file_name= $4.str; } - | INDEX DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; }; + | INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys { Lex->create_info.index_file_name= $4.str; }; storage_engines: ident_or_text @@ -1733,7 +1733,7 @@ constraint_key_type: key_or_index: KEY_SYM {} - | INDEX {}; + | INDEX_SYM {}; opt_key_or_index: /* empty */ {} @@ -1742,7 +1742,7 @@ opt_key_or_index: keys_or_index: KEYS {} - | INDEX {} + | INDEX_SYM {} | INDEXES {}; opt_unique_or_fulltext: @@ -1817,7 +1817,7 @@ alter: lex->create_info.db_type= DB_TYPE_DEFAULT; lex->create_info.default_table_charset= thd->variables.collation_database; lex->create_info.row_type= ROW_TYPE_NOT_USED; - lex->alter_info.clear(); + lex->alter_info.reset(); lex->alter_info.is_simple= 1; lex->alter_info.flags= 0; } @@ -2221,7 +2221,7 @@ table_to_table: }; keycache: - CACHE_SYM INDEX keycache_list IN_SYM key_cache_name + CACHE_SYM INDEX_SYM keycache_list IN_SYM key_cache_name { LEX *lex=Lex; lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE; @@ -2252,7 +2252,7 @@ key_cache_name: ; preload: - LOAD INDEX INTO CACHE_SYM + LOAD INDEX_SYM INTO CACHE_SYM { LEX *lex=Lex; lex->sql_command=SQLCOM_PRELOAD_KEYS; @@ -3530,9 +3530,9 @@ interval: | YEAR_SYM { $$=INTERVAL_YEAR; }; date_time_type: - DATE_SYM {$$=TIMESTAMP_DATE;} - | TIME_SYM {$$=TIMESTAMP_TIME;} - | DATETIME {$$=TIMESTAMP_DATETIME;}; + DATE_SYM {$$=MYSQL_TIMESTAMP_DATE;} + | TIME_SYM {$$=MYSQL_TIMESTAMP_TIME;} + | DATETIME {$$=MYSQL_TIMESTAMP_DATETIME;}; table_alias: /* empty */ @@ -3859,7 +3859,7 @@ drop: lex->drop_temporary= $2; lex->drop_if_exists= $4; } - | DROP INDEX ident ON table_ident {} + | DROP INDEX_SYM ident ON table_ident {} { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_INDEX; @@ -4228,13 +4228,12 @@ show_param: LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_TABLES; lex->select_lex.db= $2; - lex->select_lex.options= 0; } | TABLE_SYM STATUS_SYM opt_db wild { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_TABLES; - lex->select_lex.options|= SELECT_DESCRIBE; + lex->describe= DESCRIBE_EXTENDED; lex->select_lex.db= $3; } | OPEN_SYM TABLES opt_db wild @@ -4242,7 +4241,6 @@ show_param: LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_OPEN_TABLES; lex->select_lex.db= $3; - lex->select_lex.options= 0; } | ENGINE_SYM storage_engines { Lex->create_info.db_type= $2; } @@ -4874,9 +4872,8 @@ table_ident: | '.' ident { $$=new Table_ident($2);} /* For Delphi */ ; -table_ident_ref: +table_ident_nodb: ident { LEX_STRING db={(char*) any_db,3}; $$=new Table_ident(YYTHD, db,$1,0); } - | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);} ; IDENT_sys: @@ -5410,14 +5407,14 @@ handler: if (!lex->current_select->add_table_to_list(lex->thd, $2, $4, 0)) YYABORT; } - | HANDLER_SYM table_ident_ref CLOSE_SYM + | HANDLER_SYM table_ident_nodb CLOSE_SYM { LEX *lex= Lex; lex->sql_command = SQLCOM_HA_CLOSE; if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0)) YYABORT; } - | HANDLER_SYM table_ident_ref READ_SYM + | HANDLER_SYM table_ident_nodb READ_SYM { LEX *lex=Lex; lex->sql_command = SQLCOM_HA_READ; @@ -5527,7 +5524,7 @@ grant_privilege: | REFERENCES { Lex->which_columns = REFERENCES_ACL;} opt_column_list {} | DELETE_SYM { Lex->grant |= DELETE_ACL;} | USAGE {} - | INDEX { Lex->grant |= INDEX_ACL;} + | INDEX_SYM { Lex->grant |= INDEX_ACL;} | ALTER { Lex->grant |= ALTER_ACL;} | CREATE { Lex->grant |= CREATE_ACL;} | DROP { Lex->grant |= DROP_ACL;} diff --git a/sql/structs.h b/sql/structs.h index ee231186e1a..c30d85f59cb 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -130,23 +130,14 @@ typedef struct st_read_record { /* Parameter to read_record */ } READ_RECORD; -enum timestamp_type -{ - TIMESTAMP_NONE= -2, TIMESTAMP_DATETIME_ERROR= -1, - TIMESTAMP_DATE= 0, TIMESTAMP_DATETIME= 1, TIMESTAMP_TIME= 2 -}; - -/* Parameters to str_to_TIME */ -#define TIME_FUZZY_DATE 1 -#define TIME_DATETIME_ONLY 2 - - -typedef struct st_time { - uint year,month,day,hour,minute,second; - ulong second_part; - bool neg; - timestamp_type time_type; -} TIME; +/* + Originally MySQL used TIME structure inside server only, but since + 4.1 it's exported to user in the new client API. Define aliases for + new names to keep existing code simple. +*/ + +typedef struct st_mysql_time TIME; +typedef enum enum_mysql_timestamp_type timestamp_type; typedef struct { diff --git a/sql/table.cc b/sql/table.cc index e053eba7b6c..5024015c382 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -126,6 +126,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, goto err_not_open; /* purecov: inspected */ *fn_ext(index_file)='\0'; // Remove .frm extension + outparam->frm_version= head[2]; outparam->db_type=ha_checktype((enum db_type) (uint) *(head+3)); outparam->db_create_options=db_create_options=uint2korr(head+30); outparam->db_options_in_use=outparam->db_create_options; @@ -494,15 +495,13 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, for (uint key=0 ; key < outparam->keys ; key++,keyinfo++) { uint usable_parts=0; - ulong index_flags; keyinfo->name=(char*) outparam->keynames.type_names[key]; /* Fix fulltext keys for old .frm files */ if (outparam->key_info[key].flags & HA_FULLTEXT) outparam->key_info[key].algorithm= HA_KEY_ALG_FULLTEXT; /* This has to be done after the above fulltext correction */ - index_flags=outparam->file->index_flags(key); - if (!(index_flags & HA_KEY_READ_ONLY)) + if (!(outparam->file->index_flags(key) & HA_KEYREAD_ONLY)) { outparam->read_only_keys.set_bit(key); outparam->keys_for_keyread.clear_bit(key); @@ -577,15 +576,9 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (field->key_length() == key_part->length && !(field->flags & BLOB_FLAG)) { - if ((index_flags & HA_KEY_READ_ONLY) && - (field->key_type() != HA_KEYTYPE_TEXT || - (!((ha_option & HA_KEY_READ_WRONG_STR) || - (field->flags & BINARY_FLAG)) && - !(keyinfo->flags & HA_FULLTEXT)))) + if (outparam->file->index_flags(key, i) & HA_KEYREAD_ONLY) field->part_of_key.set_bit(key); - if ((field->key_type() != HA_KEYTYPE_TEXT || - !(keyinfo->flags & HA_FULLTEXT)) && - !(index_flags & HA_WRONG_ASCII_ORDER)) + if (outparam->file->index_flags(key, i) & HA_READ_ORDER) field->part_of_sortkey.set_bit(key); } if (!(key_part->key_part_flag & HA_REVERSE_SORT) && diff --git a/sql/table.h b/sql/table.h index b558436de1d..f111377bc85 100644 --- a/sql/table.h +++ b/sql/table.h @@ -156,6 +156,7 @@ struct st_table { uint quick_key_parts[MAX_KEY]; key_part_map const_key_parts[MAX_KEY]; ulong query_id; + uchar frm_version; union /* Temporary variables */ { diff --git a/sql/time.cc b/sql/time.cc index b5550b98e8c..132612e53c5 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -345,364 +345,19 @@ ulong convert_month_to_period(ulong month) } -/* Position for YYYY-DD-MM HH-MM-DD.FFFFFF AM in default format */ - -static uchar internal_format_positions[]= -{0, 1, 2, 3, 4, 5, 6, (uchar) 255}; - -static char time_separator=':'; - -/* - Convert a timestamp string to a TIME value. - - SYNOPSIS - str_to_TIME() - str String to parse - length Length of string - l_time Date is stored here - flags Bitmap of following items - TIME_FUZZY_DATE Set if we should allow partial dates - TIME_DATETIME_ONLY Set if we only allow full datetimes. - was_cut Set to 1 if value was cut during conversion or to 0 - otherwise. - - DESCRIPTION - At least the following formats are recogniced (based on number of digits) - YYMMDD, YYYYMMDD, YYMMDDHHMMSS, YYYYMMDDHHMMSS - YY-MM-DD, YYYY-MM-DD, YY-MM-DD HH.MM.SS - YYYYMMDDTHHMMSS where T is a the character T (ISO8601) - Also dates where all parts are zero are allowed - - The second part may have an optional .###### fraction part. - - NOTES - This function should work with a format position vector as long as the - following things holds: - - All date are kept together and all time parts are kept together - - Date and time parts must be separated by blank - - Second fractions must come after second part and be separated - by a '.'. (The second fractions are optional) - - AM/PM must come after second fractions (or after seconds if no fractions) - - Year must always been specified. - - If time is before date, then we will use datetime format only if - the argument consist of two parts, separated by space. - Otherwise we will assume the argument is a date. - - The hour part must be specified in hour-minute-second order. - - RETURN VALUES - TIMESTAMP_NONE String wasn't a timestamp, like - [DD [HH:[MM:[SS]]]].fraction. - l_time is not changed. - TIMESTAMP_DATE DATE string (YY MM and DD parts ok) - TIMESTAMP_DATETIME Full timestamp - TIMESTAMP_DATETIME_ERROR Timestamp with wrong values. - All elements in l_time is set to 0 -*/ - -#define MAX_DATE_PARTS 8 - -timestamp_type -str_to_TIME(const char *str, uint length, TIME *l_time, uint flags, - int *was_cut) -{ - uint field_length, year_length, digits, i, number_of_fields; - uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; - uint add_hours= 0, start_loop; - ulong not_zero_date, allow_space; - bool is_internal_format; - const char *pos, *last_field_pos; - const char *end=str+length; - const uchar *format_position; - bool found_delimitier= 0, found_space= 0; - uint frac_pos, frac_len; - DBUG_ENTER("str_to_TIME"); - DBUG_PRINT("ENTER",("str: %.*s",length,str)); - - LINT_INIT(field_length); - LINT_INIT(year_length); - LINT_INIT(last_field_pos); - - *was_cut= 0; - - // Skip space at start - for (; str != end && my_isspace(&my_charset_latin1, *str) ; str++) - ; - if (str == end || ! my_isdigit(&my_charset_latin1, *str)) - { - *was_cut= 1; - DBUG_RETURN(TIMESTAMP_NONE); - } - - is_internal_format= 0; - /* This has to be changed if want to activate different timestamp formats */ - format_position= internal_format_positions; - - /* - Calculate number of digits in first part. - If length= 8 or >= 14 then year is of format YYYY. - (YYYY-MM-DD, YYYYMMDD, YYYYYMMDDHHMMSS) - */ - for (pos=str; pos != end && my_isdigit(&my_charset_latin1,*pos) ; pos++) - ; - - digits= (uint) (pos-str); - start_loop= 0; // Start of scan loop - date_len[format_position[0]]= 0; // Length of year field - if (pos == end) - { - /* Found date in internal format (only numbers like YYYYMMDD) */ - year_length= (digits == 4 || digits == 8 || digits >= 14) ? 4 : 2; - field_length=year_length-1; - is_internal_format= 1; - format_position= internal_format_positions; - } - else - { - if (format_position[0] >= 3) // If year is after HHMMDD - { - /* - If year is not in first part then we have to determinate if we got - a date field or a datetime field. - We do this by checking if there is two numbers separated by - space in the input. - */ - while (pos < end && !my_isspace(&my_charset_latin1, *pos)) - pos++; - while (pos < end && !my_isdigit(&my_charset_latin1, *pos)) - pos++; - if (pos == end) - { - if (flags & TIME_DATETIME_ONLY) - { - *was_cut= 1; - DBUG_RETURN(TIMESTAMP_NONE); // Can't be a full datetime - } - /* Date field. Set hour, minutes and seconds to 0 */ - date[0]= date[1]= date[2]= date[3]= date[4]= 0; - start_loop= 5; // Start with first date part - } - } - } - - /* - Only allow space in the first "part" of the datetime field and: - - after days, part seconds - - before and after AM/PM (handled by code later) - - 2003-03-03 20:00:20 AM - 20:00:20.000000 AM 03-03-2000 - */ - i= max((uint) format_position[0], (uint) format_position[1]); - set_if_bigger(i, (uint) format_position[2]); - allow_space= ((1 << i) | (1 << format_position[6])); - allow_space&= (1 | 2 | 4 | 8); - - not_zero_date= 0; - for (i = start_loop; - i < MAX_DATE_PARTS-1 && str != end && - my_isdigit(&my_charset_latin1,*str); - i++) - { - const char *start= str; - ulong tmp_value= (uint) (uchar) (*str++ - '0'); - while (str != end && my_isdigit(&my_charset_latin1,str[0]) && - (!is_internal_format || field_length--)) - { - tmp_value=tmp_value*10 + (ulong) (uchar) (*str - '0'); - str++; - } - date_len[i]= (uint) (str - start); - if (tmp_value > 999999) // Impossible date part - { - *was_cut= 1; - DBUG_RETURN(TIMESTAMP_NONE); - } - date[i]=tmp_value; - not_zero_date|= tmp_value; - - /* Length-1 of next field */ - field_length= format_position[i+1] == 0 ? 3 : 1; - - if ((last_field_pos= str) == end) - { - i++; // Register last found part - break; - } - /* Allow a 'T' after day to allow CCYYMMDDT type of fields */ - if (i == format_position[2] && *str == 'T') - { - str++; // ISO8601: CCYYMMDDThhmmss - continue; - } - if (i == format_position[5]) // Seconds - { - if (*str == '.') // Followed by part seconds - { - str++; - field_length= 5; // 5 digits after first (=6) - } - continue; - - /* No part seconds */ - date[++i]= 0; - } - while (str != end && - (my_ispunct(&my_charset_latin1,*str) || - my_isspace(&my_charset_latin1,*str))) - { - if (my_isspace(&my_charset_latin1,*str)) - { - if (!(allow_space & (1 << i))) - { - *was_cut= 1; - DBUG_RETURN(TIMESTAMP_NONE); - } - found_space= 1; - } - str++; - found_delimitier= 1; // Should be a 'normal' date - } - /* Check if next position is AM/PM */ - if (i == format_position[6]) // Seconds, time for AM/PM - { - i++; // Skip AM/PM part - if (format_position[7] != 255) // If using AM/PM - { - if (str+2 <= end && (str[1] == 'M' || str[1] == 'm')) - { - if (str[0] == 'p' || str[0] == 'P') - add_hours= 12; - else if (str[0] != 'a' || str[0] != 'A') - continue; // Not AM/PM - str+= 2; // Skip AM/PM - /* Skip space after AM/PM */ - while (str != end && my_isspace(&my_charset_latin1,*str)) - str++; - } - } - } - last_field_pos= str; - } - if (found_delimitier && !found_space && (flags & TIME_DATETIME_ONLY)) - { - *was_cut= 1; - DBUG_RETURN(TIMESTAMP_NONE); // Can't be a datetime - } - - str= last_field_pos; - - number_of_fields= i - start_loop; - while (i < MAX_DATE_PARTS) - { - date_len[i]= 0; - date[i++]= 0; - } - - if (!is_internal_format) - { - year_length= date_len[(uint) format_position[0]]; - if (!year_length) // Year must be specified - { - *was_cut= 1; - DBUG_RETURN(TIMESTAMP_NONE); - } - - l_time->year= date[(uint) format_position[0]]; - l_time->month= date[(uint) format_position[1]]; - l_time->day= date[(uint) format_position[2]]; - l_time->hour= date[(uint) format_position[3]]; - l_time->minute= date[(uint) format_position[4]]; - l_time->second= date[(uint) format_position[5]]; - - frac_pos= (uint) format_position[6]; - frac_len= date_len[frac_pos]; - if (frac_len < 6) - date[frac_pos]*= (uint) log_10_int[6 - frac_len]; - l_time->second_part= date[frac_pos]; - - if (format_position[7] != (uchar) 255) - { - if (l_time->hour > 12) - { - *was_cut= 1; - goto err; - } - l_time->hour= l_time->hour%12 + add_hours; - } - } - else - { - l_time->year= date[0]; - l_time->month= date[1]; - l_time->day= date[2]; - l_time->hour= date[3]; - l_time->minute= date[4]; - l_time->second= date[5]; - if (date_len[6] < 6) - date[6]*= (uint) log_10_int[6 - date_len[6]]; - l_time->second_part=date[6]; - } - l_time->neg= 0; - - if (year_length == 2 && i >= format_position[1] && i >=format_position[2] && - (l_time->month || l_time->day)) - l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900); - - if (number_of_fields < 3 || l_time->month > 12 || - l_time->day > 31 || l_time->hour > 23 || - l_time->minute > 59 || l_time->second > 59 || - (!(flags & TIME_FUZZY_DATE) && (l_time->month == 0 || l_time->day == 0))) - { - /* Only give warning for a zero date if there is some garbage after */ - if (!not_zero_date) // If zero date - { - for (; str != end ; str++) - { - if (!my_isspace(&my_charset_latin1, *str)) - { - not_zero_date= 1; // Give warning - break; - } - } - } - if (not_zero_date) - *was_cut= 1; - goto err; - } - - l_time->time_type= (number_of_fields <= 3 ? - TIMESTAMP_DATE : TIMESTAMP_DATETIME); - - for (; str != end ; str++) - { - if (!my_isspace(&my_charset_latin1,*str)) - { - *was_cut= 1; - break; - } - } - - DBUG_RETURN(l_time->time_type= - (number_of_fields <= 3 ? TIMESTAMP_DATE : TIMESTAMP_DATETIME)); - -err: - bzero((char*) l_time, sizeof(*l_time)); - DBUG_RETURN(TIMESTAMP_DATETIME_ERROR); -} - - /* Convert a timestamp string to a TIME value and produce a warning if string was truncated during conversion. NOTE - See description of str_to_TIME() for more information. + See description of str_to_datetime() for more information. */ timestamp_type -str_to_TIME_with_warn(const char *str, uint length, TIME *l_time, uint flags) +str_to_datetime_with_warn(const char *str, uint length, TIME *l_time, + uint flags) { int was_cut; - timestamp_type ts_type= str_to_TIME(str, length, l_time, flags, &was_cut); + timestamp_type ts_type= str_to_datetime(str, length, l_time, flags, &was_cut); if (was_cut) make_truncated_value_warning(current_thd, str, length, ts_type); return ts_type; @@ -748,190 +403,6 @@ my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *in_dst_time_gap) /* - Convert a time string to a TIME struct. - - SYNOPSIS - str_to_time() - str A string in full TIMESTAMP format or - [-] DAYS [H]H:MM:SS, [H]H:MM:SS, [M]M:SS, [H]HMMSS, - [M]MSS or [S]S - There may be an optional [.second_part] after seconds - length Length of str - l_time Store result here - was_cut Set to 1 if value was cut during conversion or to 0 - otherwise. - - NOTES - Because of the extra days argument, this function can only - work with times where the time arguments are in the above order. - - RETURN - 0 ok - 1 error -*/ - -bool str_to_time(const char *str, uint length, TIME *l_time, int *was_cut) -{ - long date[5],value; - const char *end=str+length, *end_of_days; - bool found_days,found_hours; - uint state; - - l_time->neg=0; - *was_cut= 0; - for (; str != end && my_isspace(&my_charset_latin1,*str) ; str++) - length--; - if (str != end && *str == '-') - { - l_time->neg=1; - str++; - length--; - } - if (str == end) - return 1; - - /* Check first if this is a full TIMESTAMP */ - if (length >= 12) - { // Probably full timestamp - enum timestamp_type res= str_to_TIME(str,length,l_time, - (TIME_FUZZY_DATE | - TIME_DATETIME_ONLY), - was_cut); - if ((int) res >= (int) TIMESTAMP_DATETIME_ERROR) - return res == TIMESTAMP_DATETIME_ERROR; - /* We need to restore was_cut flag since str_to_TIME can modify it */ - *was_cut= 0; - } - - /* Not a timestamp. Try to get this as a DAYS_TO_SECOND string */ - for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++) - value=value*10L + (long) (*str - '0'); - - /* Skip all space after 'days' */ - end_of_days= str; - for (; str != end && my_isspace(&my_charset_latin1, str[0]) ; str++) - ; - - LINT_INIT(state); - found_days=found_hours=0; - if ((uint) (end-str) > 1 && str != end_of_days && - my_isdigit(&my_charset_latin1, *str)) - { // Found days part - date[0]= value; - state= 1; // Assume next is hours - found_days= 1; - } - else if ((end-str) > 1 && *str == time_separator && - my_isdigit(&my_charset_latin1, str[1])) - { - date[0]=0; // Assume we found hours - date[1]=value; - state=2; - found_hours=1; - str++; // skip ':' - } - else - { - /* String given as one number; assume HHMMSS format */ - date[0]= 0; - date[1]= value/10000; - date[2]= value/100 % 100; - date[3]= value % 100; - state=4; - goto fractional; - } - - /* Read hours, minutes and seconds */ - for (;;) - { - for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++) - value=value*10L + (long) (*str - '0'); - date[state++]=value; - if (state == 4 || (end-str) < 2 || *str != time_separator || - !my_isdigit(&my_charset_latin1,str[1])) - break; - str++; // Skip time_separator (':') - } - - if (state != 4) - { // Not HH:MM:SS - /* Fix the date to assume that seconds was given */ - if (!found_hours && !found_days) - { - bmove_upp((char*) (date+4), (char*) (date+state), - sizeof(long)*(state-1)); - bzero((char*) date, sizeof(long)*(4-state)); - } - else - bzero((char*) (date+state), sizeof(long)*(4-state)); - } - -fractional: - /* Get fractional second part */ - if ((end-str) >= 2 && *str == '.' && my_isdigit(&my_charset_latin1,str[1])) - { - uint field_length=5; - str++; value=(uint) (uchar) (*str - '0'); - while (++str != end && - my_isdigit(&my_charset_latin1,str[0]) && - field_length--) - value=value*10 + (uint) (uchar) (*str - '0'); - if (field_length) - value*= (long) log_10_int[field_length]; - date[4]=value; - } - else - date[4]=0; - - if (internal_format_positions[7] != 255) - { - /* Read a possible AM/PM */ - while (str != end && my_isspace(&my_charset_latin1, *str)) - str++; - if (str+2 <= end && (str[1] == 'M' || str[1] == 'm')) - { - if (str[0] == 'p' || str[0] == 'P') - { - str+= 2; - date[1]= date[1]%12 + 12; - } - else if (str[0] == 'a' || str[0] == 'A') - str+=2; - } - } - - /* Some simple checks */ - if (date[2] >= 60 || date[3] >= 60) - { - *was_cut= 1; - return 1; - } - l_time->year= 0; // For protocol::store_time - l_time->month= 0; - l_time->day= date[0]; - l_time->hour= date[1]; - l_time->minute= date[2]; - l_time->second= date[3]; - l_time->second_part= date[4]; - l_time->time_type= TIMESTAMP_TIME; - - /* Check if there is garbage at end of the TIME specification */ - if (str != end) - { - do - { - if (!my_isspace(&my_charset_latin1,*str)) - { - *was_cut= 1; - break; - } - } while (++str != end); - } - return 0; -} - - -/* Convert a time string to a TIME struct and produce a warning if string was cut during conversion. @@ -944,7 +415,7 @@ str_to_time_with_warn(const char *str, uint length, TIME *l_time) int was_cut; bool ret_val= str_to_time(str, length, l_time, &was_cut); if (was_cut) - make_truncated_value_warning(current_thd, str, length, TIMESTAMP_TIME); + make_truncated_value_warning(current_thd, str, length, MYSQL_TIMESTAMP_TIME); return ret_val; } @@ -1210,10 +681,10 @@ bool parse_date_time_format(timestamp_type format_type, The last test is to ensure that %p is used if and only if it's needed. */ - if ((format_type == TIMESTAMP_DATETIME && + if ((format_type == MYSQL_TIMESTAMP_DATETIME && !test_all_bits(part_map, (1 | 2 | 4 | 8 | 16 | 32))) || - (format_type == TIMESTAMP_DATE && part_map != (1 | 2 | 4)) || - (format_type == TIMESTAMP_TIME && + (format_type == MYSQL_TIMESTAMP_DATE && part_map != (1 | 2 | 4)) || + (format_type == MYSQL_TIMESTAMP_TIME && !test_all_bits(part_map, 8 | 16 | 32)) || !allow_separator || // %option should be last (need_p && dt_pos[6] +1 != dt_pos[7]) || @@ -1256,10 +727,10 @@ bool parse_date_time_format(timestamp_type format_type, format_str= 0; switch (format_type) { - case TIMESTAMP_DATE: + case MYSQL_TIMESTAMP_DATE: format_str= known_date_time_formats[INTERNAL_FORMAT].date_format; /* fall through */ - case TIMESTAMP_TIME: + case MYSQL_TIMESTAMP_TIME: if (!format_str) format_str=known_date_time_formats[INTERNAL_FORMAT].time_format; @@ -1274,7 +745,7 @@ bool parse_date_time_format(timestamp_type format_type, return 0; if (separator_map == (1 | 2)) { - if (format_type == TIMESTAMP_TIME) + if (format_type == MYSQL_TIMESTAMP_TIME) { if (*(format+2) != *(format+5)) break; // Error @@ -1284,7 +755,7 @@ bool parse_date_time_format(timestamp_type format_type, return 0; } break; - case TIMESTAMP_DATETIME: + case MYSQL_TIMESTAMP_DATETIME: /* If there is no separators, allow the internal format as we can read this. If separators are used, they must be between each part. @@ -1403,11 +874,11 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format, timestamp_type type) { switch (type) { - case TIMESTAMP_DATE: + case MYSQL_TIMESTAMP_DATE: return format->date_format; - case TIMESTAMP_DATETIME: + case MYSQL_TIMESTAMP_DATETIME: return format->datetime_format; - case TIMESTAMP_TIME: + case MYSQL_TIMESTAMP_TIME: return format->time_format; default: DBUG_ASSERT(0); // Impossible @@ -1489,13 +960,13 @@ void make_truncated_value_warning(THD *thd, const char *str_val, str.append('\0'); switch (time_type) { - case TIMESTAMP_DATE: + case MYSQL_TIMESTAMP_DATE: type_str= "date"; break; - case TIMESTAMP_TIME: + case MYSQL_TIMESTAMP_TIME: type_str= "time"; break; - case TIMESTAMP_DATETIME: // FALLTHROUGH + case MYSQL_TIMESTAMP_DATETIME: // FALLTHROUGH default: type_str= "datetime"; break; @@ -1565,14 +1036,14 @@ ulonglong TIME_to_ulonglong_time(const TIME *time) ulonglong TIME_to_ulonglong(const TIME *time) { switch (time->time_type) { - case TIMESTAMP_DATETIME: + case MYSQL_TIMESTAMP_DATETIME: return TIME_to_ulonglong_datetime(time); - case TIMESTAMP_DATE: + case MYSQL_TIMESTAMP_DATE: return TIME_to_ulonglong_date(time); - case TIMESTAMP_TIME: + case MYSQL_TIMESTAMP_TIME: return TIME_to_ulonglong_time(time); - case TIMESTAMP_NONE: - case TIMESTAMP_DATETIME_ERROR: + case MYSQL_TIMESTAMP_NONE: + case MYSQL_TIMESTAMP_ERROR: return ULL(0); default: DBUG_ASSERT(0); @@ -1595,17 +1066,17 @@ ulonglong TIME_to_ulonglong(const TIME *time) void TIME_to_string(const TIME *time, String *str) { switch (time->time_type) { - case TIMESTAMP_DATETIME: + case MYSQL_TIMESTAMP_DATETIME: make_datetime((DATE_TIME_FORMAT*) 0, time, str); break; - case TIMESTAMP_DATE: + case MYSQL_TIMESTAMP_DATE: make_date((DATE_TIME_FORMAT*) 0, time, str); break; - case TIMESTAMP_TIME: + case MYSQL_TIMESTAMP_TIME: make_time((DATE_TIME_FORMAT*) 0, time, str); break; - case TIMESTAMP_NONE: - case TIMESTAMP_DATETIME_ERROR: + case MYSQL_TIMESTAMP_NONE: + case MYSQL_TIMESTAMP_ERROR: str->length(0); str->set_charset(&my_charset_bin); break; diff --git a/sql/tztime.cc b/sql/tztime.cc index 0b0ae2839df..aab0d36b61e 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -15,8 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* - Most of the following code and structures were derived from - public domain code from ftp://elsie.nci.nih.gov/pub + Most of the following code and structures were derived from + public domain code from ftp://elsie.nci.nih.gov/pub (We will refer to this code as to elsie-code further.) */ @@ -24,13 +24,22 @@ #pragma implementation // gcc: Class implementation #endif - +/* + We should not include mysql_priv.h in mysql_tzinfo_to_sql utility since + it creates unsolved link dependencies on some platforms. +*/ +#if !defined(TZINFO2SQL) && !defined(TESTTIME) #include "mysql_priv.h" +#else +#include <my_global.h> +#include "tztime.h" +#include <my_sys.h> +#endif + #include "tzfile.h" #include <m_string.h> #include <my_dir.h> - /* Now we don't use abbreviations in server but we will do this in future. */ @@ -52,25 +61,25 @@ typedef struct ttinfo #ifdef ABBR_ARE_USED uint tt_abbrind; // Index of start of abbreviation for this time type. #endif - /* - We don't use tt_ttisstd and tt_ttisgmt members of original elsie-code struct - since we don't support POSIX-style TZ descriptions in variables. + /* + We don't use tt_ttisstd and tt_ttisgmt members of original elsie-code + struct since we don't support POSIX-style TZ descriptions in variables. */ } TRAN_TYPE_INFO; /* Structure describing leap-second corrections. */ -typedef struct lsinfo -{ +typedef struct lsinfo +{ my_time_t ls_trans; // Transition time long ls_corr; // Correction to apply } LS_INFO; /* - Structure with information describing ranges of my_time_t shifted to local + Structure with information describing ranges of my_time_t shifted to local time (my_time_t + offset). Used for local TIME -> my_time_t conversion. See comments for TIME_to_gmt_sec() for more info. */ -typedef struct revtinfo +typedef struct revtinfo { long rt_offset; // Offset of local time from UTC in seconds uint rt_type; // Type of period 0 - Normal period. 1 - Spring time-gap @@ -84,10 +93,10 @@ typedef struct revtinfo #endif /* - Structure which fully describes time zone which is + Structure which fully describes time zone which is described in our db or in zoneinfo files. */ -typedef struct st_time_zone_info +typedef struct st_time_zone_info { uint leapcnt; // Number of leap-second corrections uint timecnt; // Number of transitions between time types @@ -102,13 +111,13 @@ typedef struct st_time_zone_info /* Storage for local time types abbreviations. They are stored as ASCIIZ */ char *chars; #endif - /* - Leap seconds corrections descriptions, this array is shared by + /* + Leap seconds corrections descriptions, this array is shared by all time zones who use leap seconds. */ LS_INFO *lsis; - /* - Starting points and descriptions of shifted my_time_t (my_time_t + offset) + /* + Starting points and descriptions of shifted my_time_t (my_time_t + offset) ranges on which shifted my_time_t -> my_time_t mapping is linear or undefined. Used for tm -> my_time_t conversion. */ @@ -119,7 +128,7 @@ typedef struct st_time_zone_info there are no transitions at all. */ TRAN_TYPE_INFO *fallback_tti; - + } TIME_ZONE_INFO; @@ -130,11 +139,11 @@ static my_bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage); /* Load time zone description from zoneinfo (TZinfo) file. - + SYNOPSIS tz_load() name - path to zoneinfo file - sp - TIME_ZONE_INFO structure to fill + sp - TIME_ZONE_INFO structure to fill RETURN VALUES 0 - Ok @@ -147,7 +156,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) int read_from_file; uint i; FILE *file; - + if (!(file= my_fopen(name, O_RDONLY|O_BINARY, MYF(MY_WME)))) return 1; { @@ -164,7 +173,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) uint ttisstdcnt; uint ttisgmtcnt; char *tzinfo_buf; - + read_from_file= my_fread(file, u.buf, sizeof(u.buf), MYF(MY_WME)); if (my_fclose(file, MYF(MY_WME)) != 0) @@ -172,7 +181,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) if (read_from_file < (int)sizeof(struct tzhead)) return 1; - + ttisstdcnt= int4net(u.tzhead.tzh_ttisgmtcnt); ttisgmtcnt= int4net(u.tzhead.tzh_ttisstdcnt); sp->leapcnt= int4net(u.tzhead.tzh_leapcnt); @@ -187,7 +196,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) (ttisstdcnt != sp->typecnt && ttisstdcnt != 0) || (ttisgmtcnt != sp->typecnt && ttisgmtcnt != 0)) return 1; - if ((uint)(read_from_file - (p - u.buf)) < + if ((uint)(read_from_file - (p - u.buf)) < sp->timecnt * 4 + /* ats */ sp->timecnt + /* types */ sp->typecnt * (4 + 2) + /* ttinfos */ @@ -208,7 +217,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) #endif sp->leapcnt * sizeof(LS_INFO)))) return 1; - + sp->ats= (my_time_t *)tzinfo_buf; tzinfo_buf+= ALIGN_SIZE(sp->timecnt * sizeof(my_time_t)); sp->types= (unsigned char *)tzinfo_buf; @@ -220,10 +229,10 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) tzinfo_buf+= ALIGN_SIZE(sp->charcnt); #endif sp->lsis= (LS_INFO *)tzinfo_buf; - + for (i= 0; i < sp->timecnt; i++, p+= 4) sp->ats[i]= int4net(p); - + for (i= 0; i < sp->timecnt; i++) { sp->types[i]= (unsigned char) *p++; @@ -233,7 +242,7 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) for (i= 0; i < sp->typecnt; i++) { TRAN_TYPE_INFO * ttisp; - + ttisp= &sp->ttis[i]; ttisp->tt_gmtoff= int4net(p); p+= 4; @@ -250,57 +259,57 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) for (i= 0; i < sp->leapcnt; i++) { LS_INFO *lsisp; - + lsisp= &sp->lsis[i]; lsisp->ls_trans= int4net(p); p+= 4; lsisp->ls_corr= int4net(p); p+= 4; } - /* + /* Since we don't support POSIX style TZ definitions in variables we - don't read further like glibc or elsie code. + don't read further like glibc or elsie code. */ } - + return prepare_tz_info(sp, storage); } #endif /* defined(TZINFO2SQL) || defined(TESTTIME) */ /* - Finish preparation of time zone description for use in TIME_to_gmt_sec() + Finish preparation of time zone description for use in TIME_to_gmt_sec() and gmt_sec_to_TIME() functions. - + SYNOPSIS prepare_tz_info() sp - pointer to time zone description storage - pointer to MEM_ROOT where arrays for map allocated - + DESCRIPTION - First task of this function is to find fallback time type which will - be used if there are no transitions or we have moment in time before - any transitions. - Second task is to build "shifted my_time_t" -> my_time_t map used in + First task of this function is to find fallback time type which will + be used if there are no transitions or we have moment in time before + any transitions. + Second task is to build "shifted my_time_t" -> my_time_t map used in TIME -> my_time_t conversion. - Note: See description of TIME_to_gmt_sec() function first. - In order to perform TIME -> my_time_t conversion we need to build table - which defines "shifted by tz offset and leap seconds my_time_t" -> - my_time_t function wich is almost the same (except ranges of ambiguity) - as reverse function to piecewise linear function used for my_time_t -> + Note: See description of TIME_to_gmt_sec() function first. + In order to perform TIME -> my_time_t conversion we need to build table + which defines "shifted by tz offset and leap seconds my_time_t" -> + my_time_t function wich is almost the same (except ranges of ambiguity) + as reverse function to piecewise linear function used for my_time_t -> "shifted my_time_t" conversion and which is also specified as table in zoneinfo file or in our db (It is specified as start of time type ranges - and time type offsets). So basic idea is very simple - let us iterate + and time type offsets). So basic idea is very simple - let us iterate through my_time_t space from one point of discontinuity of my_time_t -> "shifted my_time_t" function to another and build our approximation of - reverse function. (Actually we iterate through ranges on which + reverse function. (Actually we iterate through ranges on which my_time_t -> "shifted my_time_t" is linear function). - + RETURN VALUES 0 Ok - 1 Error + 1 Error */ -static my_bool +static my_bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) { my_time_t cur_t= MY_TIME_T_MIN; @@ -309,7 +318,7 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) long cur_offset, cur_corr, cur_off_and_corr; uint next_trans_idx, next_leap_idx; uint i; - /* + /* Temporary arrays where we will store tables. Needed because we don't know table sizes ahead. (Well we can estimate their upper bound but this will take extra space.) @@ -319,10 +328,10 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) LINT_INIT(end_l); - /* - Let us setup fallback time type which will be used if we have not any - transitions or if we have moment of time before first transition. - We will find first non-DST local time type and use it (or use first + /* + Let us setup fallback time type which will be used if we have not any + transitions or if we have moment of time before first transition. + We will find first non-DST local time type and use it (or use first local time type if all of them are DST types). */ for (i= 0; i < sp->typecnt && sp->ttis[i].tt_isdst; i++) @@ -330,17 +339,17 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) if (i == sp->typecnt) i= 0; sp->fallback_tti= &(sp->ttis[i]); - - - /* - Let us build shifted my_time_t -> my_time_t map. + + + /* + Let us build shifted my_time_t -> my_time_t map. */ sp->revcnt= 0; - + /* Let us find initial offset */ if (sp->timecnt == 0 || cur_t < sp->ats[0]) { - /* + /* If we have not any transitions or t is before first transition we are using already found fallback time type which index is already in i. */ @@ -357,7 +366,7 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) /* let us find leap correction... unprobable, but... */ - for (next_leap_idx= 0; next_leap_idx < sp->leapcnt && + for (next_leap_idx= 0; next_leap_idx < sp->leapcnt && cur_t >= sp->lsis[next_leap_idx].ls_trans; ++next_leap_idx) continue; @@ -371,35 +380,35 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) while (sp->revcnt < TZ_MAX_REV_RANGES - 1) { cur_off_and_corr= cur_offset - cur_corr; - - /* + + /* We assuming that cur_t could be only overflowed downwards, we also assume that end_t won't be overflowed in this case. */ - if (cur_off_and_corr < 0 && + if (cur_off_and_corr < 0 && cur_t < MY_TIME_T_MIN - cur_off_and_corr) cur_t= MY_TIME_T_MIN - cur_off_and_corr; - + cur_l= cur_t + cur_off_and_corr; - - /* + + /* Let us choose end_t as point before next time type change or leap second correction. */ end_t= min((next_trans_idx < sp->timecnt) ? sp->ats[next_trans_idx] - 1: MY_TIME_T_MAX, - (next_leap_idx < sp->leapcnt) ? + (next_leap_idx < sp->leapcnt) ? sp->lsis[next_leap_idx].ls_trans - 1: MY_TIME_T_MAX); - /* + /* again assuming that end_t can be overlowed only in positive side we also assume that end_t won't be overflowed in this case. */ if (cur_off_and_corr > 0 && end_t > MY_TIME_T_MAX - cur_off_and_corr) end_t= MY_TIME_T_MAX - cur_off_and_corr; - + end_l= end_t + cur_off_and_corr; - + if (end_l > cur_max_seen_l) { @@ -425,7 +434,7 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) break; /* That was too much */ cur_max_seen_l= cur_l - 1; } - + /* Assume here end_l > cur_max_seen_l (because end_l>=cur_l) */ revts[sp->revcnt]= cur_max_seen_l + 1; @@ -436,28 +445,28 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) } } - if (end_t == MY_TIME_T_MAX || - (cur_off_and_corr > 0) && + if (end_t == MY_TIME_T_MAX || + (cur_off_and_corr > 0) && (end_t >= MY_TIME_T_MAX - cur_off_and_corr)) /* end of t space */ break; - + cur_t= end_t + 1; - /* + /* Let us find new offset and correction. Because of our choice of end_t - cur_t can only be point where new time type starts or/and leap + cur_t can only be point where new time type starts or/and leap correction is performed. */ if (sp->timecnt != 0 && cur_t >= sp->ats[0]) /* else reuse old offset */ - if (next_trans_idx < sp->timecnt && + if (next_trans_idx < sp->timecnt && cur_t == sp->ats[next_trans_idx]) { /* We are at offset point */ cur_offset= sp->ttis[sp->types[next_trans_idx]].tt_gmtoff; ++next_trans_idx; } - + if (next_leap_idx < sp->leapcnt && cur_t == sp->lsis[next_leap_idx].ls_trans) { @@ -466,7 +475,7 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) ++next_leap_idx; } } - + /* check if we have had enough space */ if (sp->revcnt == TZ_MAX_REV_RANGES - 1) return 1; @@ -483,11 +492,13 @@ prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) memcpy(sp->revts, revts, sizeof(my_time_t) * (sp->revcnt + 1)); memcpy(sp->revtis, revtis, sizeof(REVT_INFO) * sp->revcnt); - + return 0; } +#if !defined(TZINFO2SQL) + static const uint mon_lengths[2][MONS_PER_YEAR]= { { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, @@ -508,20 +519,20 @@ static const uint year_lengths[2]= #define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400) -/* - Converts time from my_time_t representation (seconds in UTC since Epoch) +/* + Converts time from my_time_t representation (seconds in UTC since Epoch) to broken down representation using given local time zone offset. - + SYNOPSIS sec_to_TIME() tmp - pointer to structure for broken down representation t - my_time_t value to be converted offset - local time zone offset - + DESCRIPTION - Convert my_time_t with offset to TIME struct. Differs from timesub - (from elsie code) because doesn't contain any leap correction and - TM_GMTOFF and is_dst setting and contains some MySQL specific + Convert my_time_t with offset to TIME struct. Differs from timesub + (from elsie code) because doesn't contain any leap correction and + TM_GMTOFF and is_dst setting and contains some MySQL specific initialization. Funny but with removing of these we almost have glibc's offtime function. */ @@ -536,9 +547,9 @@ sec_to_TIME(TIME * tmp, my_time_t t, long offset) days= t / SECS_PER_DAY; rem= t % SECS_PER_DAY; - - /* - We do this as separate step after dividing t, because this + + /* + We do this as separate step after dividing t, because this allows us handle times near my_time_t bounds without overflows. */ rem+= offset; @@ -560,12 +571,12 @@ sec_to_TIME(TIME * tmp, my_time_t t, long offset) representation. This uses "... ??:59:60" et seq. */ tmp->second= (uint)(rem % SECS_PER_MIN); - + y= EPOCH_YEAR; while (days < 0 || days >= (long)year_lengths[yleap= isleap(y)]) { int newy; - + newy= y + days / DAYS_PER_NYEAR; if (days < 0) newy--; @@ -575,7 +586,7 @@ sec_to_TIME(TIME * tmp, my_time_t t, long offset) y= newy; } tmp->year= y; - + ip= mon_lengths[yleap]; for (tmp->month= 0; days >= (long) ip[tmp->month]; tmp->month++) days= days - (long) ip[tmp->month]; @@ -584,49 +595,49 @@ sec_to_TIME(TIME * tmp, my_time_t t, long offset) /* filling MySQL specific TIME members */ tmp->neg= 0; tmp->second_part= 0; - tmp->time_type= TIMESTAMP_DATETIME; + tmp->time_type= MYSQL_TIMESTAMP_DATETIME; } /* Find time range wich contains given my_time_t value - + SYNOPSIS find_time_range() - t - my_time_t value for which we looking for range + t - my_time_t value for which we looking for range range_boundaries - sorted array of range starts. higher_bound - number of ranges - + DESCRIPTION - Performs binary search for range which contains given my_time_t value. + Performs binary search for range which contains given my_time_t value. It has sense if number of ranges is greater than zero and my_time_t value is greater or equal than beginning of first range. It also assumes that t belongs to some range specified or end of last is MY_TIME_T_MAX. - + With this localtime_r on real data may takes less time than with linear search (I've seen 30% speed up). - + RETURN VALUE Index of range to which t belongs */ -static uint +static uint find_time_range(my_time_t t, const my_time_t *range_boundaries, uint higher_bound) { uint i, lower_bound= 0; - - /* + + /* Function will work without this assertion but result would be meaningless. */ DBUG_ASSERT(higher_bound > 0 && t >= range_boundaries[0]); - + /* Do binary search for minimal interval which contain t. We preserve: - range_boundaries[lower_bound] <= t < range_boundaries[higher_bound] - invariant and decrease this higher_bound - lower_bound gap twice + range_boundaries[lower_bound] <= t < range_boundaries[higher_bound] + invariant and decrease this higher_bound - lower_bound gap twice times on each step. */ - + while (higher_bound - lower_bound > 1) { i= (lower_bound + higher_bound) >> 1; @@ -639,33 +650,33 @@ find_time_range(my_time_t t, const my_time_t *range_boundaries, } /* - Find local time transition for given my_time_t. - + Find local time transition for given my_time_t. + SYNOPSIS find_transition_type() t - my_time_t value to be converted sp - pointer to struct with time zone description - + RETURN VALUE Pointer to structure in time zone description describing local time type for given my_time_t. */ static -const TRAN_TYPE_INFO * +const TRAN_TYPE_INFO * find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp) { if (unlikely(sp->timecnt == 0 || t < sp->ats[0])) { - /* + /* If we have not any transitions or t is before first transition let us use fallback time type. */ return sp->fallback_tti; } - + /* Do binary search for minimal interval between transitions which - contain t. With this localtime_r on real data may takes less + contain t. With this localtime_r on real data may takes less time than with linear search (I've seen 30% speed up). */ return &(sp->ttis[sp->types[find_time_range(t, sp->ats, sp->timecnt)]]); @@ -675,7 +686,7 @@ find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp) /* Converts time in my_time_t representation (seconds in UTC since Epoch) to broken down TIME representation in local time zone. - + SYNOPSIS gmt_sec_to_TIME() tmp - pointer to structure for broken down represenatation @@ -683,14 +694,14 @@ find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp) sp - pointer to struct with time zone description TODO - We can improve this function by creating joined array of transitions and + We can improve this function by creating joined array of transitions and leap corrections. This will require adding extra field to TRAN_TYPE_INFO - for storing number of "extra" seconds to minute occured due to correction - (60th and 61st second, look how we calculate them as "hit" in this + for storing number of "extra" seconds to minute occured due to correction + (60th and 61st second, look how we calculate them as "hit" in this function). - Under realistic assumptions about frequency of transitions the same array - can be used fot TIME -> my_time_t conversion. For this we need to - implement tweaked binary search which will take into account that some + Under realistic assumptions about frequency of transitions the same array + can be used fot TIME -> my_time_t conversion. For this we need to + implement tweaked binary search which will take into account that some TIME has two matching my_time_t ranges and some of them have none. */ static void @@ -702,19 +713,19 @@ gmt_sec_to_TIME(TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp) int hit= 0; int i; - /* + /* Find proper transition (and its local time type) for our sec_in_utc value. - Funny but again by separating this step in function we receive code + Funny but again by separating this step in function we receive code which very close to glibc's code. No wonder since they obviously use the same base and all steps are sensible. */ ttisp= find_transition_type(sec_in_utc, sp); - /* + /* Let us find leap correction for our sec_in_utc value and number of extra secs to add to this minute. - This loop is rarely used because most users will use time zones without - leap seconds, and even in case when we have such time zone there won't + This loop is rarely used because most users will use time zones without + leap seconds, and even in case when we have such time zone there won't be many iterations (we have about 22 corrections at this moment (2004)). */ for ( i= sp->leapcnt; i-- > 0; ) @@ -741,7 +752,7 @@ gmt_sec_to_TIME(TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp) break; } } - + sec_to_TIME(tmp, sec_in_utc, ttisp->tt_gmtoff - corr); tmp->second+= hit; @@ -751,25 +762,25 @@ gmt_sec_to_TIME(TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp) /* Converts local time in broken down representation to local time zone analog of my_time_t represenation. - + SYNOPSIS sec_since_epoch() year, mon, mday, hour, min, sec - broken down representation. - + DESCRIPTION Converts time in broken down representation to my_time_t representation ignoring time zone. Note that we cannot convert back some valid _local_ - times near ends of my_time_t range because of my_time_t overflow. But we + times near ends of my_time_t range because of my_time_t overflow. But we ignore this fact now since MySQL will never pass such argument. - + RETURN VALUE Seconds since epoch time representation. */ -static my_time_t +static my_time_t sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) { #ifndef WE_WANT_TO_HANDLE_UNORMALIZED_DATES - /* + /* It turns out that only whenever month is normalized or unnormalized plays role. */ @@ -789,7 +800,7 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) #endif days+= mday - 1; - return ((days * HOURS_PER_DAY + hour) * MINS_PER_HOUR + min) * + return ((days * HOURS_PER_DAY + hour) * MINS_PER_HOUR + min) * SECS_PER_MIN + sec; } @@ -797,73 +808,73 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) /* Converts local time in broken down TIME representation to my_time_t representation. - + SYNOPSIS TIME_to_gmt_sec() t - pointer to structure for broken down represenatation sp - pointer to struct with time zone description - in_dst_time_gap - pointer to bool which is set to true if datetime + in_dst_time_gap - pointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into spring time-gap) and is not touched otherwise. - + DESCRIPTION - This is mktime analog for MySQL. It is essentially different + This is mktime analog for MySQL. It is essentially different from mktime (or hypotetical my_mktime) because: - - It has no idea about tm_isdst member so if it + - It has no idea about tm_isdst member so if it has two answers it will give the smaller one - - If we are in spring time gap then it will return + - If we are in spring time gap then it will return beginning of the gap - - It can give wrong results near the ends of my_time_t due to - overflows, but we are safe since in MySQL we will never + - It can give wrong results near the ends of my_time_t due to + overflows, but we are safe since in MySQL we will never call this function for such dates (its restriction for year between 1970 and 2038 gives us several days of reserve). - - By default it doesn't support un-normalized input. But if + - By default it doesn't support un-normalized input. But if sec_since_epoch() function supports un-normalized dates - then this function should handle un-normalized input right, + then this function should handle un-normalized input right, altough it won't normalize structure TIME. - - Traditional approach to problem of conversion from broken down - representation to time_t is iterative. Both elsie's and glibc - implementation try to guess what time_t value should correspond to - this broken-down value. They perform localtime_r function on their - guessed value and then calculate the difference and try to improve + + Traditional approach to problem of conversion from broken down + representation to time_t is iterative. Both elsie's and glibc + implementation try to guess what time_t value should correspond to + this broken-down value. They perform localtime_r function on their + guessed value and then calculate the difference and try to improve their guess. Elsie's code guesses time_t value in bit by bit manner, - Glibc's code tries to add difference between broken-down value + Glibc's code tries to add difference between broken-down value corresponding to guess and target broken-down value to current guess. - It also uses caching of last found correction... So Glibc's approach - is essentially faster but introduces some undetermenism (in case if + It also uses caching of last found correction... So Glibc's approach + is essentially faster but introduces some undetermenism (in case if is_dst member of broken-down representation (tm struct) is not known and we have two possible answers). - We use completely different approach. It is better since it is both + We use completely different approach. It is better since it is both faster than iterative implementations and fully determenistic. If you look at my_time_t to TIME conversion then you'll find that it consist of two steps: The first is calculating shifted my_time_t value and the second - TIME - calculation from shifted my_time_t value (well it is a bit simplified + calculation from shifted my_time_t value (well it is a bit simplified picture). The part in which we are interested in is my_time_t -> shifted my_time_t conversion. It is piecewise linear function which is defined - by combination of transition times as break points and times offset - as changing function parameter. The possible inverse function for this - converison would be ambiguos but with MySQL's restrictions we can use - some function which is the same as inverse function on unambigiuos - ranges and coincides with one of branches of inverse function in - other ranges. Thus we just need to build table which will determine - this shifted my_time_t -> my_time_t conversion similar to existing - (my_time_t -> shifted my_time_t table). We do this in + by combination of transition times as break points and times offset + as changing function parameter. The possible inverse function for this + converison would be ambiguos but with MySQL's restrictions we can use + some function which is the same as inverse function on unambigiuos + ranges and coincides with one of branches of inverse function in + other ranges. Thus we just need to build table which will determine + this shifted my_time_t -> my_time_t conversion similar to existing + (my_time_t -> shifted my_time_t table). We do this in prepare_tz_info function. - + TODO - If we can even more improve this function. For doing this we will need to + If we can even more improve this function. For doing this we will need to build joined map of transitions and leap corrections for gmt_sec_to_TIME() - function (similar to revts/revtis). Under realistic assumptions about + function (similar to revts/revtis). Under realistic assumptions about frequency of transitions we can use the same array for TIME_to_gmt_sec(). We need to implement special version of binary search for this. Such step will be beneficial to CPU cache since we will decrease data-set used for conversion twice. - + RETURN VALUE - Seconds in UTC since Epoch. + Seconds in UTC since Epoch. 0 in case of error. */ static my_time_t @@ -874,20 +885,20 @@ TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) uint i; DBUG_ENTER("TIME_to_gmt_sec"); - + /* We need this for correct leap seconds handling */ if (t->second < SECS_PER_MIN) saved_seconds= 0; else saved_seconds= t->second; - /* + /* NOTE If we want to convert full my_time_t range without MySQL restrictions we should catch overflow here somehow. */ - + local_t= sec_since_epoch(t->year, t->month, t->day, - t->hour, t->minute, + t->hour, t->minute, saved_seconds ? 0 : t->second); /* We have at least one range */ @@ -895,7 +906,7 @@ TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) if (local_t < sp->revts[0] || local_t > sp->revts[sp->revcnt]) { - /* + /* This means that source time can't be represented as my_time_t due to limited my_time_t range. */ @@ -904,10 +915,10 @@ TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) /* binary search for our range */ i= find_time_range(local_t, sp->revts, sp->revcnt); - + if (sp->revtis[i].rt_type) { - /* + /* Oops! We are in spring time gap. May be we should return error here? Now we are returning my_time_t value corresponding to the @@ -922,8 +933,9 @@ TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) /* - End of elsie derived code. + End of elsie derived code. */ +#endif /* !defined(TZINFO2SQL) */ #if !defined(TESTTIME) && !defined(TZINFO2SQL) @@ -935,19 +947,19 @@ static const String tz_SYSTEM_name("SYSTEM", 6, &my_charset_latin1); /* - Instance of this class represents local time zone used on this system + Instance of this class represents local time zone used on this system (specified by TZ environment variable or via any other system mechanism). - It uses system functions (localtime_r, my_system_gmt_sec) for conversion + It uses system functions (localtime_r, my_system_gmt_sec) for conversion and is always available. Because of this it is used by default - if there were no explicit time zone specified. On the other hand because of this - conversion methods provided by this class is significantly slower and - possibly less multi-threaded-friendly than corresponding Time_zone_db + conversion methods provided by this class is significantly slower and + possibly less multi-threaded-friendly than corresponding Time_zone_db methods so the latter should be preffered there it is possible. */ -class Time_zone_system : public Time_zone +class Time_zone_system : public Time_zone { public: - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; @@ -955,31 +967,31 @@ public: /* - Converts local time in system time zone in TIME representation + Converts local time in system time zone in TIME representation to its my_time_t representation. - + SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time in + t - pointer to TIME structure with local time in broken-down representation. - in_dst_time_gap - pointer to bool which is set to true if datetime + in_dst_time_gap - pointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into spring time-gap) and is not touched otherwise. DESCRIPTION This method uses system function (localtime_r()) for conversion - local time in system time zone in TIME structure to its my_time_t + local time in system time zone in TIME structure to its my_time_t representation. Unlike the same function for Time_zone_db class - it it won't handle unnormalized input properly. Still it will - return lowest possible my_time_t in case of ambiguity or if we + it it won't handle unnormalized input properly. Still it will + return lowest possible my_time_t in case of ambiguity or if we provide time corresponding to the time-gap. - + You should call init_time() function before using this function. RETURN VALUE Corresponding my_time_t value or 0 in case of error */ -my_time_t +my_time_t Time_zone_system::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const { long not_used; @@ -990,20 +1002,20 @@ Time_zone_system::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const /* Converts time from UTC seconds since Epoch (my_time_t) representation to system local time zone broken-down representation. - + SYNOPSIS gmt_sec_to_TIME() tmp - pointer to TIME structure to fill-in - t - my_time_t value to be converted + t - my_time_t value to be converted - NOTE + NOTE We assume that value passed to this function will fit into time_t range - supported by localtime_r. This conversion is putting restriction on + supported by localtime_r. This conversion is putting restriction on TIMESTAMP range in MySQL. If we can get rid of SYSTEM time zone at least - for interaction with client then we can extend TIMESTAMP range down to + for interaction with client then we can extend TIMESTAMP range down to the 1902 easily. */ -void +void Time_zone_system::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const { struct tm tmp_tm; @@ -1011,13 +1023,13 @@ Time_zone_system::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const localtime_r(&tmp_t, &tmp_tm); localtime_to_TIME(tmp, &tmp_tm); - tmp->time_type= TIMESTAMP_DATETIME; + tmp->time_type= MYSQL_TIMESTAMP_DATETIME; } /* Get name of time zone - + SYNOPSIS get_name() @@ -1032,15 +1044,15 @@ Time_zone_system::get_name() const /* - Instance of this class represents UTC time zone. It uses system gmtime_r - function for conversions and is always available. It is used only for - my_time_t -> TIME conversions in various UTC_... functions, it is not + Instance of this class represents UTC time zone. It uses system gmtime_r + function for conversions and is always available. It is used only for + my_time_t -> TIME conversions in various UTC_... functions, it is not intended for TIME -> my_time_t conversions and shouldn't be exposed to user. */ -class Time_zone_utc : public Time_zone +class Time_zone_utc : public Time_zone { public: - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; @@ -1049,66 +1061,66 @@ public: /* Convert UTC time from TIME representation to its my_time_t representation. - + SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time + t - pointer to TIME structure with local time in broken-down representation. - in_dst_time_gap - pointer to bool which is set to true if datetime + in_dst_time_gap - pointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into spring time-gap) and is not touched otherwise. DESCRIPTION - Since Time_zone_utc is used only internally for my_time_t -> TIME - conversions, this function of Time_zone interface is not implemented for + Since Time_zone_utc is used only internally for my_time_t -> TIME + conversions, this function of Time_zone interface is not implemented for this class and should not be called. RETURN VALUE 0 */ -my_time_t +my_time_t Time_zone_utc::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const { /* Should be never called */ DBUG_ASSERT(0); return 0; } - + /* Converts time from UTC seconds since Epoch (my_time_t) representation to broken-down representation (also in UTC). - + SYNOPSIS gmt_sec_to_TIME() tmp - pointer to TIME structure to fill-in - t - my_time_t value to be converted - + t - my_time_t value to be converted + NOTE See note for apropriate Time_zone_system method. */ -void +void Time_zone_utc::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const { struct tm tmp_tm; time_t tmp_t= (time_t)t; gmtime_r(&tmp_t, &tmp_tm); localtime_to_TIME(tmp, &tmp_tm); - tmp->time_type= TIMESTAMP_DATETIME; + tmp->time_type= MYSQL_TIMESTAMP_DATETIME; } /* Get name of time zone - + SYNOPSIS get_name() DESCRIPTION - Since Time_zone_utc is used only internally by SQL's UTC_* functions it - is not accessible directly, and hence this function of Time_zone + Since Time_zone_utc is used only internally by SQL's UTC_* functions it + is not accessible directly, and hence this function of Time_zone interface is not implemented for this class and should not be called. - + RETURN VALUE 0 */ @@ -1122,14 +1134,14 @@ Time_zone_utc::get_name() const /* - Instance of this class represents some time zone which is - described in mysql.time_zone family of tables. + Instance of this class represents some time zone which is + described in mysql.time_zone family of tables. */ -class Time_zone_db : public Time_zone +class Time_zone_db : public Time_zone { public: Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg); - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; @@ -1140,19 +1152,19 @@ private: /* - Initializes object representing time zone described by mysql.time_zone + Initializes object representing time zone described by mysql.time_zone tables. - + SYNOPSIS Time_zone_db() - tz_info_arg - pointer to TIME_ZONE_INFO structure which is filled - according to db or other time zone description + tz_info_arg - pointer to TIME_ZONE_INFO structure which is filled + according to db or other time zone description (for example by my_tz_init()). - Several Time_zone_db instances can share one + Several Time_zone_db instances can share one TIME_ZONE_INFO structure. tz_name_arg - name of time zone. */ -Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, +Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String *tz_name_arg): tz_info(tz_info_arg), tz_name(tz_name_arg) { @@ -1160,25 +1172,25 @@ Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, /* - Converts local time in time zone described from TIME + Converts local time in time zone described from TIME representation to its my_time_t representation. - + SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time + t - pointer to TIME structure with local time in broken-down representation. - in_dst_time_gap - pointer to bool which is set to true if datetime + in_dst_time_gap - pointer to bool which is set to true if datetime value passed doesn't really exist (i.e. falls into spring time-gap) and is not touched otherwise. DESCRIPTION - Please see ::TIME_to_gmt_sec for function description and + Please see ::TIME_to_gmt_sec for function description and parameter restrictions. RETURN VALUE Corresponding my_time_t value or 0 in case of error */ -my_time_t +my_time_t Time_zone_db::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const { return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap); @@ -1188,13 +1200,13 @@ Time_zone_db::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const /* Converts time from UTC seconds since Epoch (my_time_t) representation to local time zone described in broken-down representation. - + SYNOPSIS gmt_sec_to_TIME() tmp - pointer to TIME structure to fill-in - t - my_time_t value to be converted + t - my_time_t value to be converted */ -void +void Time_zone_db::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const { ::gmt_sec_to_TIME(tmp, t, tz_info); @@ -1203,7 +1215,7 @@ Time_zone_db::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const /* Get name of time zone - + SYNOPSIS get_name() @@ -1218,18 +1230,18 @@ Time_zone_db::get_name() const /* - Instance of this class represents time zone which + Instance of this class represents time zone which was specified as offset from UTC. */ -class Time_zone_offset : public Time_zone +class Time_zone_offset : public Time_zone { public: Time_zone_offset(long tz_offset_arg); - virtual my_time_t TIME_to_gmt_sec(const TIME *t, + virtual my_time_t TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const; virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; virtual const String * get_name() const; - /* + /* This have to be public because we want to be able to access it from my_offset_tzs_get_key() function */ @@ -1243,10 +1255,10 @@ private: /* Initializes object representing time zone described by its offset from UTC. - + SYNOPSIS Time_zone_offset() - tz_offset_arg - offset from UTC in seconds. + tz_offset_arg - offset from UTC in seconds. Positive for direction to east. */ Time_zone_offset::Time_zone_offset(long tz_offset_arg): @@ -1254,7 +1266,7 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg): { uint hours= abs((int)(offset / SECS_PER_HOUR)); uint minutes= abs((int)(offset % SECS_PER_HOUR / SECS_PER_MIN)); - ulong length= my_snprintf(name_buff, sizeof(name_buff), "%s%02d:%02d", + ulong length= my_snprintf(name_buff, sizeof(name_buff), "%s%02d:%02d", (offset>=0) ? "+" : "-", hours, minutes); name.set(name_buff, length, &my_charset_latin1); } @@ -1263,21 +1275,21 @@ Time_zone_offset::Time_zone_offset(long tz_offset_arg): /* Converts local time in time zone described as offset from UTC from TIME representation to its my_time_t representation. - + SYNOPSIS TIME_to_gmt_sec() - t - pointer to TIME structure with local time + t - pointer to TIME structure with local time in broken-down representation. - in_dst_time_gap - pointer to bool which should be set to true if - datetime value passed doesn't really exist - (i.e. falls into spring time-gap) and is not + in_dst_time_gap - pointer to bool which should be set to true if + datetime value passed doesn't really exist + (i.e. falls into spring time-gap) and is not touched otherwise. It is not really used in this class. RETURN VALUE Corresponding my_time_t value or 0 in case of error */ -my_time_t +my_time_t Time_zone_offset::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const { return sec_since_epoch(t->year, t->month, t->day, @@ -1288,15 +1300,15 @@ Time_zone_offset::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const /* Converts time from UTC seconds since Epoch (my_time_t) representation - to local time zone described as offset from UTC and in broken-down + to local time zone described as offset from UTC and in broken-down representation. - + SYNOPSIS gmt_sec_to_TIME() tmp - pointer to TIME structure to fill-in - t - my_time_t value to be converted + t - my_time_t value to be converted */ -void +void Time_zone_offset::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const { sec_to_TIME(tmp, t, offset); @@ -1305,7 +1317,7 @@ Time_zone_offset::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const /* Get name of time zone - + SYNOPSIS get_name() @@ -1329,14 +1341,15 @@ static HASH tz_names; static HASH offset_tzs; static MEM_ROOT tz_storage; -/* +/* These mutex protects offset_tzs and tz_storage. - These protection needed only when we are trying to set - time zone which is specified as offset, and searching for existing + These protection needed only when we are trying to set + time zone which is specified as offset, and searching for existing time zone in offset_tzs or creating if it didn't existed before in tz_storage. So contention is low. */ static pthread_mutex_t tz_LOCK; +static bool tz_inited= 0; /* This two static variables are inteded for holding info about leap seconds @@ -1345,7 +1358,7 @@ static pthread_mutex_t tz_LOCK; static uint tz_leapcnt= 0; static LS_INFO *tz_lsis= 0; - + typedef struct st_tz_names_entry: public Sql_alloc { String name; @@ -1354,8 +1367,8 @@ typedef struct st_tz_names_entry: public Sql_alloc /* - We are going to call both of these functions from C code so - they should obey C calling conventions. + We are going to call both of these functions from C code so + they should obey C calling conventions. */ extern "C" byte* my_tz_names_get_key(TZ_NAMES_ENTRY *entry, uint *length, @@ -1381,7 +1394,7 @@ extern "C" byte* my_offset_tzs_get_key(Time_zone_offset *entry, uint *length, thd - current thread object default_tzname - default time zone or 0 if none. bootstrap - indicates whenever we are in bootstrap mode - + DESCRIPTION This function will init memory structures needed for time zone support, it will register mandatory SYSTEM time zone in them. It will try to open @@ -1393,12 +1406,12 @@ extern "C" byte* my_offset_tzs_get_key(Time_zone_offset *entry, uint *length, we are in bootstrap mode and won't load time zone descriptions unless someone specifies default time zone which is supposedly stored in those tables. It'll also set default time zone if it is specified. - + RETURN VALUES 0 - ok - 1 - Error + 1 - Error */ -my_bool +my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) { THD *thd; @@ -1410,7 +1423,6 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) my_bool return_val= 1; int res; uint not_used; - DBUG_ENTER("my_tz_init"); /* @@ -1436,6 +1448,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) } init_alloc_root(&tz_storage, 32 * 1024, 0); VOID(pthread_mutex_init(&tz_LOCK, MY_MUTEX_INIT_FAST)); + tz_inited= 1; /* Add 'SYSTEM' time zone to tz_names hash */ if (!(tmp_tzname= new (&tz_storage) TZ_NAMES_ENTRY())) @@ -1450,15 +1463,15 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) sql_print_error("Fatal error: OOM while initializing time zones"); goto end_with_cleanup; } - + if (bootstrap) { /* If we are in bootstrap mode we should not load time zone tables */ return_val= 0; goto end_with_setting_default_tz; } - - /* + + /* After this point all memory structures are inited and we even can live without time zone description tables. Now try to load information about leap seconds shared by all time zones. @@ -1470,7 +1483,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) tables.alias= tables.real_name= (char*)"time_zone_leap_second"; tables.lock_type= TL_READ; tables.db= thd->db; - + if (open_tables(thd, &tables, ¬_used)) { sql_print_error("Warning: Can't open time zone table: %s " @@ -1479,15 +1492,15 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) return_val= 0; goto end_with_setting_default_tz; } - + lock_ptr= tables.table; if (!(lock= mysql_lock_tables(thd, &lock_ptr, 1))) { sql_print_error("Fatal error: Can't lock time zone table: %s", thd->net.last_error); - goto end_with_cleanup; + goto end_with_close; } - + /* Now we are going to load leap seconds descriptions that are shared @@ -1502,11 +1515,11 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) "mysql.time_zone_leap_second table"); goto end_with_unlock; } - + table= tables.table; - table->file->index_init(0); + table->file->ha_index_init(0); tz_leapcnt= 0; - + res= table->file->index_first(table->record[0]); while (!res) @@ -1515,10 +1528,10 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) { sql_print_error("Fatal error: While loading mysql.time_zone_leap_second" " table: too much leaps"); - table->file->index_end(); + table->file->ha_index_end(); goto end_with_unlock; } - + tz_lsis[tz_leapcnt].ls_trans= (my_time_t)table->field[0]->val_int(); tz_lsis[tz_leapcnt].ls_corr= (long)table->field[1]->val_int(); @@ -1526,14 +1539,14 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) DBUG_PRINT("info", ("time_zone_leap_second table: tz_leapcnt=%u tt_time=%lld offset=%ld", - tz_leapcnt, (longlong)tz_lsis[tz_leapcnt-1].ls_trans, + tz_leapcnt, (longlong)tz_lsis[tz_leapcnt-1].ls_trans, tz_lsis[tz_leapcnt-1].ls_corr)); - + res= table->file->index_next(table->record[0]); } - table->file->index_end(); - + table->file->ha_index_end(); + if (res != HA_ERR_END_OF_FILE) { sql_print_error("Fatal error: Error while loading " @@ -1544,12 +1557,15 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) /* Loading of info about leap seconds succeeded */ - + return_val= 0; - + end_with_unlock: mysql_unlock_tables(thd, lock); + +end_with_close: + close_thread_tables(thd); thd->version--; /* Force close to free memory */ end_with_setting_default_tz: @@ -1564,14 +1580,13 @@ end_with_setting_default_tz: return_val= 1; } } - + end_with_cleanup: - + /* if there were error free time zone describing structs */ if (return_val) my_tz_free(); end: - close_thread_tables(thd); delete thd; if (org_thd) org_thd->store_globals(); /* purecov: inspected */ @@ -1591,12 +1606,17 @@ end: SYNOPSIS my_tz_free() */ + void my_tz_free() { - VOID(pthread_mutex_destroy(&tz_LOCK)); - hash_free(&offset_tzs); - hash_free(&tz_names); - free_root(&tz_storage, MYF(0)); + if (tz_inited) + { + tz_inited= 0; + VOID(pthread_mutex_destroy(&tz_LOCK)); + hash_free(&offset_tzs); + hash_free(&tz_names); + free_root(&tz_storage, MYF(0)); + } } @@ -1607,17 +1627,17 @@ void my_tz_free() tz_load_from_db() thd - current thread object tz_name - name of time zone that should be loaded. - + DESCRIPTION This function will try to open system tables describing time zones and to load information about time zone specified. It will also update information in hash used for time zones lookup. - + RETURN VALUES Returns pointer to newly created Time_zone object or 0 in case of error. */ -static Time_zone* +static Time_zone* tz_load_from_db(THD *thd, const String *tz_name) { TABLE_LIST tables[4]; @@ -1636,7 +1656,7 @@ tz_load_from_db(THD *thd, const String *tz_name) char buff[MAX_FIELD_WIDTH]; String abbr(buff, sizeof(buff), &my_charset_latin1); char *alloc_buff, *tz_name_buff; - /* + /* Temporary arrays that are used for loading of data for filling TIME_ZONE_INFO structure */ @@ -1649,8 +1669,8 @@ tz_load_from_db(THD *thd, const String *tz_name) uint not_used; DBUG_ENTER("tz_load_from_db"); - - + + /* Prepare tz_info for loading also let us make copy of time zone name */ if (!(alloc_buff= alloc_root(&tz_storage, sizeof(TIME_ZONE_INFO) + tz_name->length() + 1))) @@ -1666,7 +1686,7 @@ tz_load_from_db(THD *thd, const String *tz_name) By writing zero to the end we guarantee that we can call ptr() instead of c_ptr() for time zone name. */ - strmake(tz_name_buff, tz_name->ptr(), tz_name->length()); + strmake(tz_name_buff, tz_name->ptr(), tz_name->length()); /* Open and lock time zone description tables @@ -1675,7 +1695,7 @@ tz_load_from_db(THD *thd, const String *tz_name) db_length_save= thd->db_length; thd->db= system_db_name; thd->db_length= 5; - + bzero((char*) &tables,sizeof(tables)); tables[0].alias= tables[0].real_name= (char*)"time_zone_name"; tables[1].alias= tables[1].real_name= (char*)"time_zone"; @@ -1684,88 +1704,88 @@ tz_load_from_db(THD *thd, const String *tz_name) tables[0].next= tables+1; tables[1].next= tables+2; tables[2].next= tables+3; - tables[0].lock_type= tables[1].lock_type= tables[2].lock_type= + tables[0].lock_type= tables[1].lock_type= tables[2].lock_type= tables[3].lock_type= TL_READ; tables[0].db= tables[1].db= tables[2].db= tables[3].db= thd->db; if (open_tables(thd, tables, ¬_used)) { - sql_print_error("Error: Can't open time zone tables: %s", + sql_print_error("Error: Can't open time zone tables: %s", thd->net.last_error); goto end; } - + lock_ptr[0]= tables[0].table; lock_ptr[1]= tables[1].table; lock_ptr[2]= tables[2].table; lock_ptr[3]= tables[3].table; if (!(lock= mysql_lock_tables(thd, lock_ptr, 4))) { - sql_print_error("Error: Can't lock time zone tables: %s", + sql_print_error("Error: Can't lock time zone tables: %s", thd->net.last_error); goto end_with_close; } - - /* - Let us find out time zone id by its name (there is only one index + + /* + Let us find out time zone id by its name (there is only one index and it is specifically for this purpose). */ table= tables[0].table; - + table->field[0]->store(tz_name->ptr(), tz_name->length(), &my_charset_latin1); - table->file->index_init(0); - + table->file->ha_index_init(0); + if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 0, HA_READ_KEY_EXACT)) { sql_print_error("Error: Can't find description of time zone."); goto end_with_unlock; } - - tzid= table->field[1]->val_int(); - - table->file->index_end(); - /* + tzid= (uint)table->field[1]->val_int(); + + table->file->ha_index_end(); + + /* Now we need to lookup record in mysql.time_zone table in order to understand whenever this timezone uses leap seconds (again we are using the only index in this table). */ table= tables[1].table; table->field[0]->store((longlong)tzid); - table->file->index_init(0); - + table->file->ha_index_init(0); + if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 0, HA_READ_KEY_EXACT)) { sql_print_error("Error: Can't find description of time zone."); goto end_with_unlock; } - + /* If Uses_leap_seconds == 'Y' */ if (table->field[1]->val_int() == 1) { tz_info->leapcnt= tz_leapcnt; tz_info->lsis= tz_lsis; } - - table->file->index_end(); - - /* - Now we will iterate through records for out time zone in - mysql.time_zone_transition_type table. Because we want records - only for our time zone guess what are we doing? + + table->file->ha_index_end(); + + /* + Now we will iterate through records for out time zone in + mysql.time_zone_transition_type table. Because we want records + only for our time zone guess what are we doing? Right - using special index. */ table= tables[3].table; table->field[0]->store((longlong)tzid); - table->file->index_init(0); - + table->file->ha_index_init(0); + // FIXME Is there any better approach than explicitly specifying 4 ??? res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 4, HA_READ_KEY_EXACT); while (!res) { - ttid= table->field[1]->val_int(); + ttid= (uint)table->field[1]->val_int(); if (ttid > TZ_MAX_TYPES) { @@ -1775,7 +1795,7 @@ tz_load_from_db(THD *thd, const String *tz_name) goto end_with_unlock; } - ttis[ttid].tt_gmtoff= table->field[2]->val_int(); + ttis[ttid].tt_gmtoff= (long)table->field[2]->val_int(); ttis[ttid].tt_isdst= (table->field[3]->val_int() > 0); #ifdef ABBR_ARE_USED @@ -1793,10 +1813,10 @@ tz_load_from_db(THD *thd, const String *tz_name) tz_info->charcnt+= abbr.length(); chars[tz_info->charcnt]= 0; tz_info->charcnt++; - + DBUG_PRINT("info", ("time_zone_transition_type table: tz_id=%u tt_id=%u tt_gmtoff=%ld " - "abbr='%s' tt_isdst=%u", tzid, ttid, ttis[ttid].tt_gmtoff, + "abbr='%s' tt_isdst=%u", tzid, ttid, ttis[ttid].tt_gmtoff, chars + ttis[ttid].tt_abbrind, ttis[ttid].tt_isdst)); #else DBUG_PRINT("info", @@ -1806,13 +1826,13 @@ tz_load_from_db(THD *thd, const String *tz_name) /* ttid is increasing because we are reading using index */ DBUG_ASSERT(ttid >= tz_info->typecnt); - + tz_info->typecnt= ttid + 1; - - res= table->file->index_next_same(table->record[0], + + res= table->file->index_next_same(table->record[0], (byte*)table->field[0]->ptr, 4); } - + if (res != HA_ERR_END_OF_FILE) { sql_print_error("Error while loading time zone description from " @@ -1820,18 +1840,18 @@ tz_load_from_db(THD *thd, const String *tz_name) goto end_with_unlock; } - table->file->index_end(); + table->file->ha_index_end(); + - /* - At last we are doing the same thing for records in - mysql.time_zone_transition table. Here we additionaly need records + At last we are doing the same thing for records in + mysql.time_zone_transition table. Here we additionaly need records in ascending order by index scan also satisfies us. */ table= tables[2].table; table->field[0]->store((longlong)tzid); - table->file->index_init(0); - + table->file->ha_index_init(0); + // FIXME Is there any better approach than explicitly specifying 4 ??? res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 4, HA_READ_KEY_EXACT); @@ -1854,7 +1874,7 @@ tz_load_from_db(THD *thd, const String *tz_name) "bad transition type id"); goto end_with_unlock; } - + ats[tz_info->timecnt]= ttime; types[tz_info->timecnt]= ttid; tz_info->timecnt++; @@ -1862,12 +1882,12 @@ tz_load_from_db(THD *thd, const String *tz_name) DBUG_PRINT("info", ("time_zone_transition table: tz_id=%u tt_time=%lld tt_id=%u", tzid, (longlong)ttime, ttid)); - - res= table->file->index_next_same(table->record[0], + + res= table->file->index_next_same(table->record[0], (byte*)table->field[0]->ptr, 4); } - /* + /* We have to allow HA_ERR_KEY_NOT_FOUND because some time zones for example UTC have no transitons. */ @@ -1877,14 +1897,14 @@ tz_load_from_db(THD *thd, const String *tz_name) "mysql.time_zone_transition table"); goto end_with_unlock; } - - table->file->index_end(); + + table->file->ha_index_end(); table= 0; - + /* Now we will allocate memory and init TIME_ZONE_INFO structure. */ - if (!(alloc_buff= alloc_root(&tz_storage, + if (!(alloc_buff= alloc_root(&tz_storage, ALIGN_SIZE(sizeof(my_time_t) * tz_info->timecnt) + ALIGN_SIZE(tz_info->timecnt) + @@ -1898,7 +1918,7 @@ tz_load_from_db(THD *thd, const String *tz_name) goto end_with_unlock; } - + tz_info->ats= (my_time_t *)alloc_buff; memcpy(tz_info->ats, ats, tz_info->timecnt * sizeof(my_time_t)); alloc_buff+= ALIGN_SIZE(sizeof(my_time_t) * tz_info->timecnt); @@ -1912,9 +1932,9 @@ tz_load_from_db(THD *thd, const String *tz_name) #endif tz_info->ttis= (TRAN_TYPE_INFO *)alloc_buff; memcpy(tz_info->ttis, ttis, tz_info->typecnt * sizeof(TRAN_TYPE_INFO)); - + /* - Let us check how correct our time zone description and build + Let us check how correct our time zone description and build reversed map. We don't check for tz->timecnt < 1 since it ok for GMT. */ if (tz_info->typecnt < 1) @@ -1927,12 +1947,12 @@ tz_load_from_db(THD *thd, const String *tz_name) sql_print_error("Error: Unable to build mktime map for time zone"); goto end_with_unlock; } - - + + if (!(tmp_tzname= new (&tz_storage) TZ_NAMES_ENTRY()) || - !(tmp_tzname->tz= new (&tz_storage) Time_zone_db(tz_info, + !(tmp_tzname->tz= new (&tz_storage) Time_zone_db(tz_info, &(tmp_tzname->name))) || - (tmp_tzname->name.set(tz_name_buff, tz_name->length(), + (tmp_tzname->name.set(tz_name_buff, tz_name->length(), &my_charset_latin1), my_hash_insert(&tz_names, (const byte *)tmp_tzname))) { @@ -1944,17 +1964,17 @@ tz_load_from_db(THD *thd, const String *tz_name) Loading of time zone succeeded */ return_val= tmp_tzname->tz; - + end_with_unlock: if (table) - table->file->index_end(); - + table->file->ha_index_end(); + mysql_unlock_tables(thd, lock); end_with_close: close_thread_tables(thd); - + end: thd->db= db_save; thd->db_length= db_length_save; @@ -1967,15 +1987,15 @@ end: SYNOPSIS str_to_offset() - str - pointer to string which contains offset + str - pointer to string which contains offset length - length of string offset - out parameter for storing found offset in seconds. DESCRIPTION - This function parses string which contains time zone offset - in form similar to '+10:00' and converts found value to + This function parses string which contains time zone offset + in form similar to '+10:00' and converts found value to seconds from UTC form (east is positive). - + RETURN VALUE 0 - Ok 1 - String doesn't contain valid time zone offset @@ -1987,10 +2007,10 @@ str_to_offset(const char *str, uint length, long *offset) my_bool negative; ulong number_tmp; long offset_tmp; - + if (length < 4) return 1; - + if (*str == '+') negative= 0; else if (*str == '-') @@ -2006,13 +2026,13 @@ str_to_offset(const char *str, uint length, long *offset) number_tmp= number_tmp*10 + *str - '0'; str++; } - + if (str + 1 >= end || *str != ':') return 1; str++; offset_tmp = number_tmp * MINS_PER_HOUR; number_tmp= 0; - + while (str < end && my_isdigit(&my_charset_latin1, *str)) { number_tmp= number_tmp * 10 + *str - '0'; @@ -2027,17 +2047,17 @@ str_to_offset(const char *str, uint length, long *offset) if (negative) offset_tmp= -offset_tmp; - /* + /* Check if offset is in range prescribed by standard (from -12:59 to 13:00). */ - + if (number_tmp > 59 || offset_tmp < -13 * SECS_PER_HOUR + 1 || offset_tmp > 13 * SECS_PER_HOUR) return 1; - + *offset= offset_tmp; - + return 0; } @@ -2052,56 +2072,56 @@ str_to_offset(const char *str, uint length, long *offset) DESCRIPTION This function checks if name is one of time zones described in db, - predefined SYSTEM time zone or valid time zone specification as + predefined SYSTEM time zone or valid time zone specification as offset from UTC (In last case it will create proper Time_zone_offset object if there were not any.). If name is ok it returns corresponding Time_zone object. - Clients of this function are not responsible for releasing resources - occupied by returned Time_zone object so they can just forget pointers + Clients of this function are not responsible for releasing resources + occupied by returned Time_zone object so they can just forget pointers to Time_zone object if they are not needed longer. - + Other important property of this function: if some Time_zone found once it will be for sure found later, so this function can also be used for checking if proper Time_zone object exists (and if there will be error it will be reported during first call). If name pointer is 0 then this function returns 0 (this allows to pass 0 - values as parameter without additional external check and this property + values as parameter without additional external check and this property is used by @@time_zone variable handling code). It will perform lookup in system tables (mysql.time_zone*) if needed. - + RETURN VALUE - Pointer to corresponding Time_zone object. 0 - in case of bad time zone + Pointer to corresponding Time_zone object. 0 - in case of bad time zone specification or other error. - + */ -Time_zone * +Time_zone * my_tz_find(THD *thd, const String * name) { TZ_NAMES_ENTRY *tmp_tzname; Time_zone *result_tz= 0; long offset; - + DBUG_ENTER("my_tz_find"); - DBUG_PRINT("enter", ("time zone name='%s'", + DBUG_PRINT("enter", ("time zone name='%s'", name ? ((String *)name)->c_ptr() : "NULL")); if (!name) DBUG_RETURN(0); - + VOID(pthread_mutex_lock(&tz_LOCK)); - + if (!str_to_offset(name->ptr(), name->length(), &offset)) { - + if (!(result_tz= (Time_zone_offset *)hash_search(&offset_tzs, - (const byte *)&offset, + (const byte *)&offset, sizeof(long)))) { DBUG_PRINT("info", ("Creating new Time_zone_offset object")); - + if (!(result_tz= new (&tz_storage) Time_zone_offset(offset)) || my_hash_insert(&offset_tzs, (const byte *) result_tz)) { @@ -2111,13 +2131,14 @@ my_tz_find(THD *thd, const String * name) } } } else { - if ((tmp_tzname= (TZ_NAMES_ENTRY *)hash_search(&tz_names, name->ptr(), + if ((tmp_tzname= (TZ_NAMES_ENTRY *)hash_search(&tz_names, + (const byte *)name->ptr(), name->length()))) result_tz= tmp_tzname->tz; else result_tz= tz_load_from_db(thd, name); } - + VOID(pthread_mutex_unlock(&tz_LOCK)); DBUG_RETURN(result_tz); @@ -2135,13 +2156,13 @@ my_tz_find(THD *thd, const String * name) /* - Print info about time zone described by TIME_ZONE_INFO struct as + Print info about time zone described by TIME_ZONE_INFO struct as SQL statements populating mysql.time_zone* tables. SYNOPSIS print_tz_as_sql() tz_name - name of time zone - sp - structure describing time zone + sp - structure describing time zone */ void print_tz_as_sql(const char* tz_name, const TIME_ZONE_INFO *sp) @@ -2149,7 +2170,7 @@ print_tz_as_sql(const char* tz_name, const TIME_ZONE_INFO *sp) uint i; /* Here we assume that all time zones have same leap correction tables */ - printf("INSERT INTO time_zone (Use_leap_seconds) VALUES ('%s');\n", + printf("INSERT INTO time_zone (Use_leap_seconds) VALUES ('%s');\n", sp->leapcnt ? "Y" : "N"); printf("SET @time_zone_id= LAST_INSERT_ID();\n"); printf("INSERT INTO time_zone_name (Name, Time_zone_id) VALUES \ @@ -2164,13 +2185,13 @@ print_tz_as_sql(const char* tz_name, const TIME_ZONE_INFO *sp) (uint)sp->types[i]); printf(";\n"); } - + printf("INSERT INTO time_zone_transition_type \ (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES\n"); - + for (i= 0; i < sp->typecnt; i++) printf("%s(@time_zone_id, %u, %ld, %d, '%s')\n", (i == 0 ? " " : ","), i, - sp->ttis[i].tt_gmtoff, sp->ttis[i].tt_isdst, + sp->ttis[i].tt_gmtoff, sp->ttis[i].tt_isdst, sp->chars + sp->ttis[i].tt_abbrind); printf(";\n"); } @@ -2182,25 +2203,25 @@ print_tz_as_sql(const char* tz_name, const TIME_ZONE_INFO *sp) SYNOPSIS print_tz_leaps_as_sql() - sp - structure describing time zone + sp - structure describing time zone */ void print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp) { uint i; - /* - We are assuming that there are only one list of leap seconds + /* + We are assuming that there are only one list of leap seconds For all timezones. */ printf("TRUNCATE TABLE time_zone_leap_second;\n"); - + if (sp->leapcnt) { printf("INSERT INTO time_zone_leap_second \ (Transition_time, Correction) VALUES\n"); for (i= 0; i < sp->leapcnt; i++) - printf("%s(%ld, %ld)\n", (i == 0 ? " " : ","), + printf("%s(%ld, %ld)\n", (i == 0 ? " " : ","), sp->lsis[i].ls_trans, sp->lsis[i].ls_corr); printf(";\n"); } @@ -2210,7 +2231,7 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp) /* - Some variables used as temporary or as parameters + Some variables used as temporary or as parameters in recursive scan_tz_dir() code. */ TIME_ZONE_INFO tz_info; @@ -2222,23 +2243,23 @@ char *root_name_end; /* Recursively scan zoneinfo directory and print all found time zone descriptions as SQL. - + SYNOPSIS - scan_tz_dir() + scan_tz_dir() name_end - pointer to end of path to directory to be searched. - + DESCRIPTION - This auxiliary recursive function also uses several global + This auxiliary recursive function also uses several global variables as in parameters and for storing temporary values. - + fullname - path to directory that should be scanned. - root_name_end - pointer to place in fullname where part with + root_name_end - pointer to place in fullname where part with path to initial directory ends. current_tz_id - last used time zone id - + RETURN VALUE 0 - Ok, 1 - Fatal error - + */ my_bool scan_tz_dir(char * name_end) @@ -2246,12 +2267,12 @@ scan_tz_dir(char * name_end) MY_DIR *cur_dir; char *name_end_tmp; uint i; - + if (!(cur_dir= my_dir(fullname, MYF(MY_WANT_STAT)))) return 1; name_end= strmake(name_end, "/", FN_REFLEN - (name_end - fullname)); - + for (i= 0; i < cur_dir->number_off_files; i++) { if (cur_dir->dir_entry[i].name[0] != '.') @@ -2307,19 +2328,19 @@ main(int argc, char **argv) if (argc == 2) { root_name_end= strmake(fullname, argv[1], FN_REFLEN); - + printf("TRUNCATE TABLE time_zone;\n"); printf("TRUNCATE TABLE time_zone_name;\n"); printf("TRUNCATE TABLE time_zone_transition;\n"); printf("TRUNCATE TABLE time_zone_transition_type;\n"); - + if (scan_tz_dir(root_name_end)) { fprintf(stderr, "There were fatal errors during processing " "of zoneinfo directory\n"); return 1; } - + printf("ALTER TABLE time_zone_transition " "ORDER BY Time_zone_id, Transition_time;\n"); printf("ALTER TABLE time_zone_transition_type " @@ -2328,7 +2349,7 @@ main(int argc, char **argv) else { init_alloc_root(&tz_storage, 32768, 0); - + if (strcmp(argv[1], "--leap") == 0) { if (tz_load(argv[2], &tz_info, &tz_storage)) @@ -2347,7 +2368,7 @@ main(int argc, char **argv) } print_tz_as_sql(argv[2], &tz_info); } - + free_root(&tz_storage, MYF(0)); } @@ -2371,7 +2392,7 @@ main(int argc, char **argv) #ifndef TYPE_BIT #define TYPE_BIT(type) (sizeof (type) * CHAR_BIT) -#endif +#endif #ifndef TYPE_SIGNED #define TYPE_SIGNED(type) (((type) -1) < 0) @@ -2411,7 +2432,7 @@ main(int argc, char **argv) /* let us set some well known timezone */ setenv("TZ", "MET", 1); tzset(); - + /* Some initial time zone related system info */ printf("time_t: %s %u bit\n", TYPE_SIGNED(time_t) ? "signed" : "unsigned", (uint)TYPE_BIT(time_t)); @@ -2420,13 +2441,13 @@ main(int argc, char **argv) t= -100; localtime_negative= test(localtime_r(&t, &tmp) != 0); printf("localtime_r %s negative params \ - (time_t=%d is %d-%d-%d %d:%d:%d)\n", + (time_t=%d is %d-%d-%d %d:%d:%d)\n", (localtime_negative ? "supports" : "doesn't support"), (int)t, - TM_YEAR_BASE + tmp.tm_year, tmp.tm_mon + 1, tmp.tm_mday, + TM_YEAR_BASE + tmp.tm_year, tmp.tm_mon + 1, tmp.tm_mday, tmp.tm_hour, tmp.tm_min, tmp.tm_sec); - + printf("mktime %s negative results (%d)\n", - (t == mktime(&tmp) ? "doesn't support" : "supports"), + (t == mktime(&tmp) ? "doesn't support" : "supports"), (int)mktime(&tmp)); } @@ -2435,13 +2456,13 @@ main(int argc, char **argv) t= mktime(&tmp); printf("mktime returns %s for spring time gap (%d)\n", (t != (time_t)-1 ? "something" : "error"), (int)t); - + tmp.tm_year= 103; tmp.tm_mon= 8; tmp.tm_mday= 1; tmp.tm_hour= 0; tmp.tm_min= 0; tmp.tm_sec= 0; tmp.tm_isdst= 0; t= mktime(&tmp); printf("mktime returns %s for non existing date (%d)\n", (t != (time_t)-1 ? "something" : "error"), (int)t); - + tmp.tm_year= 103; tmp.tm_mon= 8; tmp.tm_mday= 1; tmp.tm_hour= 25; tmp.tm_min=0; tmp.tm_sec=0; tmp.tm_isdst=1; t= mktime(&tmp); @@ -2458,13 +2479,13 @@ main(int argc, char **argv) tmp.tm_hour= 2; tmp.tm_isdst= -1; t1= mktime(&tmp); printf("mktime is %s (%d %d)\n", - (t == t1 ? "determenistic" : "is non-determenistic"), + (t == t1 ? "determenistic" : "is non-determenistic"), (int)t, (int)t1); /* Let us load time zone description */ str_end= strmake(fullname, TZDIR, FN_REFLEN); strmake(str_end, "/MET", FN_REFLEN - (str_end - fullname)); - + if (tz_load(fullname, &tz_info, &tz_storage)) { printf("Unable to load time zone info from '%s'\n", fullname); @@ -2473,7 +2494,7 @@ main(int argc, char **argv) } printf("Testing our implementation\n"); - + if (TYPE_SIGNED(time_t) && localtime_negative) { for (t= -40000; t < 20000; t++) @@ -2489,12 +2510,12 @@ main(int argc, char **argv) } printf("gmt_sec_to_TIME = localtime for time_t in [-40000,20000) range\n"); } - + for (t= 1000000000; t < 1100000000; t+= 13) { localtime_r(&t,&tmp); gmt_sec_to_TIME(&time_tmp, (my_time_t)t, &tz_info); - + if (!is_equal_TIME_tm(&time_tmp, &tmp)) { printf("Problem with time_t = %d\n", (int)t); @@ -2505,14 +2526,14 @@ main(int argc, char **argv) printf("gmt_sec_to_TIME = localtime for time_t in [1000000000,1100000000) range\n"); init_time(); - + /* Be careful here! my_system_gmt_sec doesn't fully handle unnormalized dates. */ for (time_tmp.year= 1980; time_tmp.year < 2010; time_tmp.year++) for (time_tmp.month= 1; time_tmp.month < 13; time_tmp.month++) - for (time_tmp.day= 1; + for (time_tmp.day= 1; time_tmp.day < mon_lengths[isleap(time_tmp.year)][time_tmp.month-1]; time_tmp.day++) for (time_tmp.hour= 0; time_tmp.hour < 24; time_tmp.hour++) @@ -2523,11 +2544,11 @@ main(int argc, char **argv) t1= (time_t)TIME_to_gmt_sec(&time_tmp, &tz_info, ¬_used_2); if (t != t1) { - /* + /* We need special handling during autumn since my_system_gmt_sec prefers greater time_t values (in MET) for ambiguity. And BTW that is a bug which should be fixed !!! - */ + */ tmp.tm_year= time_tmp.year - TM_YEAR_BASE; tmp.tm_mon= time_tmp.month - 1; tmp.tm_mday= time_tmp.day; @@ -2540,17 +2561,17 @@ main(int argc, char **argv) if (t1 == t2) continue; - + printf("Problem: %u/%u/%u %u:%u:%u with times t=%d, t1=%d\n", time_tmp.year, time_tmp.month, time_tmp.day, time_tmp.hour, time_tmp.minute, time_tmp.second, (int)t,(int)t1); - + free_root(&tz_storage, MYF(0)); return 1; } } - + printf("TIME_to_gmt_sec = my_system_gmt_sec for test range\n"); free_root(&tz_storage, MYF(0)); diff --git a/sql/tztime.h b/sql/tztime.h index ed92441d790..334b14f4fc4 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -19,6 +19,14 @@ #pragma interface /* gcc class interface */ #endif +/* + Portable time_t replacement. + Should be signed and hold seconds for 1902-2038 range. +*/ +typedef long my_time_t; +#define MY_TIME_T_MAX LONG_MAX +#define MY_TIME_T_MIN LONG_MIN + #if !defined(TESTTIME) && !defined(TZINFO2SQL) /* This class represents abstract time zone and provides diff --git a/sql/unireg.cc b/sql/unireg.cc index c2666be804d..b5f6c3546a4 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -29,7 +29,6 @@ #include <m_ctype.h> #define FCOMP 17 /* Bytes for a packed field */ -#define FCOMP 17 /* Bytes for a packed field */ static uchar * pack_screens(List<create_field> &create_fields, uint *info_length, uint *screens, bool small_file); diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index c3d74b147f3..0d6863d24cd 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -292,7 +292,7 @@ install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql # Save manual to avoid rebuilding mv Docs/manual.ps Docs/manual.ps.save -make distclean +make clean mv Docs/manual.ps.save Docs/manual.ps # RPM:s destroys Makefile.in files, so we generate them here @@ -482,6 +482,7 @@ fi %attr(755, root, root) %{_bindir}/mysql_install_db %attr(755, root, root) %{_bindir}/mysql_secure_installation %attr(755, root, root) %{_bindir}/mysql_setpermission +%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql %attr(755, root, root) %{_bindir}/mysql_zap %attr(755, root, root) %{_bindir}/mysqlbug %attr(755, root, root) %{_bindir}/mysqld_multi @@ -578,6 +579,11 @@ fi # The spec file changelog only includes changes made to the spec file # itself %changelog +* Thu Jun 24 2004 Lenz Grimmer <lenz@mysql.com> + +- added mysql_tzinfo_to_sql to the server subpackage +- run "make clean" instead of "make distclean" + * Mon Apr 05 2004 Lenz Grimmer <lenz@mysql.com> - added ncurses-devel to the build prerequisites (BUG 3377) diff --git a/tests/client_test.c b/tests/client_test.c index c035691fe47..3652c0f7c8e 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -435,7 +435,7 @@ uint my_process_stmt_result(MYSQL_STMT *stmt) buffer[i].buffer_type= MYSQL_TYPE_STRING; buffer[i].buffer_length= MAX_FIELD_DATA_SIZE; buffer[i].length= &length[i]; - buffer[i].buffer= (char*) data[i]; + buffer[i].buffer= (void *) data[i]; buffer[i].is_null= &is_null[i]; } my_print_result_metadata(result); @@ -1102,26 +1102,26 @@ static void test_prepare() /* tinyint */ bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (char *)&tiny_data; + bind[0].buffer= (void *)&tiny_data; /* string */ bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)str_data; + bind[1].buffer= (void *)str_data; bind[1].buffer_length= 1000; /* Max string length */ /* integer */ bind[2].buffer_type= MYSQL_TYPE_LONG; - bind[2].buffer= (char *)&int_data; + bind[2].buffer= (void *)&int_data; /* short */ bind[3].buffer_type= MYSQL_TYPE_SHORT; - bind[3].buffer= (char *)&small_data; + bind[3].buffer= (void *)&small_data; /* bigint */ bind[4].buffer_type= MYSQL_TYPE_LONGLONG; - bind[4].buffer= (char *)&big_data; + bind[4].buffer= (void *)&big_data; /* float */ bind[5].buffer_type= MYSQL_TYPE_FLOAT; - bind[5].buffer= (char *)&real_data; + bind[5].buffer= (void *)&real_data; /* double */ bind[6].buffer_type= MYSQL_TYPE_DOUBLE; - bind[6].buffer= (char *)&double_data; + bind[6].buffer= (void *)&double_data; for (i= 0; i < (int) array_elements(bind); i++) { @@ -1274,18 +1274,18 @@ static void test_double_compare() /* tinyint */ bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (char *)&tiny_data; + bind[0].buffer= (void *)&tiny_data; /* string->float */ bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)&real_data; + bind[1].buffer= (void *)&real_data; bind[1].buffer_length= sizeof(real_data); bind[1].length= &length[1]; length[1]= 10; /* double */ bind[2].buffer_type= MYSQL_TYPE_DOUBLE; - bind[2].buffer= (char *)&double_data; + bind[2].buffer= (void *)&double_data; tiny_data= 1; strmov(real_data, "10.2"); @@ -1389,7 +1389,7 @@ static void test_null() /* Fetch results */ bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&nData; /* this buffer won't be altered */ + bind[0].buffer= (void *)&nData; /* this buffer won't be altered */ bind[0].length= 0; bind[1]= bind[0]; bind[0].is_null= &is_null[0]; @@ -1458,7 +1458,7 @@ static void test_ps_null_param() in_bind.buffer_type= MYSQL_TYPE_LONG; in_bind.is_null= &in_is_null; in_bind.length= 0; - in_bind.buffer= (char*)&in_long; + in_bind.buffer= (void *)&in_long; in_is_null= 1; in_long= 1; @@ -1532,7 +1532,7 @@ static void test_fetch_null() bind[i].is_null= &is_null[i]; bind[i].length= &length[i]; } - bind[i-1].buffer= (char *)&nData; /* Last column is not null */ + bind[i-1].buffer= (void *)&nData; /* Last column is not null */ strmov((char *)query , "SELECT * FROM test_fetch_null"); @@ -1760,12 +1760,12 @@ static void test_select() nData= 10; strmov(szData, (char *)"venu"); bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)szData; + bind[1].buffer= (void *)szData; bind[1].buffer_length= 4; bind[1].length= &length[1]; length[1]= 4; - bind[0].buffer= (char *)&nData; + bind[0].buffer= (void *)&nData; bind[0].buffer_type= MYSQL_TYPE_LONG; rc= mysql_stmt_bind_param(stmt, bind); @@ -1816,10 +1816,10 @@ static void test_ps_conj_select() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&int_data; + bind[0].buffer= (void *)&int_data; bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[1].buffer= (char *)str_data; + bind[1].buffer= (void *)str_data; bind[1].buffer_length= array_elements(str_data); bind[1].length= &str_length; @@ -1895,7 +1895,7 @@ session_id char(9) NOT NULL, \ strmov(szData, (char *)"abc"); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)szData; + bind[0].buffer= (void *)szData; bind[0].buffer_length= 10; bind[0].length= &length[0]; length[0]= 3; @@ -1910,7 +1910,7 @@ session_id char(9) NOT NULL, \ strmov(szData, (char *)"venu"); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)szData; + bind[0].buffer= (void *)szData; bind[0].buffer_length= 10; bind[0].length= &length[0]; length[0]= 4; @@ -1926,7 +1926,7 @@ session_id char(9) NOT NULL, \ strmov(szData, (char *)"abc"); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)szData; + bind[0].buffer= (void *)szData; bind[0].buffer_length= 10; bind[0].length= &length[0]; length[0]= 3; @@ -1976,7 +1976,7 @@ static void test_bug1180() strmov(szData, (char *)"abc"); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)szData; + bind[0].buffer= (void *)szData; bind[0].buffer_length= 10; bind[0].length= &length[0]; length[0]= 3; @@ -1992,7 +1992,7 @@ static void test_bug1180() strmov(szData, (char *)"1111"); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)szData; + bind[0].buffer= (void *)szData; bind[0].buffer_length= 10; bind[0].length= &length[0]; length[0]= 4; @@ -2008,7 +2008,7 @@ static void test_bug1180() strmov(szData, (char *)"abc"); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)szData; + bind[0].buffer= (void *)szData; bind[0].buffer_length= 10; bind[0].length= &length[0]; length[0]= 3; @@ -2064,7 +2064,7 @@ static void test_bug1644() for (i= 0 ; i < 4 ; i++) { bind[i].buffer_type= MYSQL_TYPE_LONG; - bind[i].buffer= (char *)# + bind[i].buffer= (void *)# bind[i].is_null= &isnull; } @@ -2243,7 +2243,7 @@ static void test_simple_update() bind[0].length= &length[0]; length[0]= my_sprintf(szData, (szData, "updated-data")); - bind[1].buffer= (char *) &nData; + bind[1].buffer= (void *) &nData; bind[1].buffer_type= MYSQL_TYPE_LONG; rc= mysql_stmt_bind_param(stmt, bind); @@ -2307,7 +2307,7 @@ static void test_long_data() /* Always bzero all members of bind parameter */ bzero((char*) bind, sizeof(bind)); - bind[0].buffer= (char *)&int_data; + bind[0].buffer= (void *)&int_data; bind[0].buffer_type= MYSQL_TYPE_LONG; bind[1].buffer_type= MYSQL_TYPE_STRING; @@ -2386,7 +2386,7 @@ static void test_long_data_str() /* Always bzero all members of bind parameter */ bzero((char*) bind, sizeof(bind)); - bind[0].buffer= (char *)&length; + bind[0].buffer= (void *)&length; bind[0].buffer_type= MYSQL_TYPE_LONG; bind[0].is_null= &is_null[0]; is_null[0]= 0; @@ -2566,7 +2566,7 @@ static void test_long_data_str1() /* Fetch results into a data buffer that is smaller than data */ bzero((char*) bind, sizeof(*bind)); bind[0].buffer_type= MYSQL_TYPE_BLOB; - bind[0].buffer= (char *) &data; /* this buffer won't be altered */ + bind[0].buffer= (void *) &data; /* this buffer won't be altered */ bind[0].buffer_length= 16; bind[0].length= &blob_length; rc= mysql_stmt_bind_result(stmt, bind); @@ -2579,7 +2579,7 @@ static void test_long_data_str1() /* Fetch all data */ bzero((char*) (bind+1), sizeof(*bind)); bind[1].buffer_type= MYSQL_TYPE_BLOB; - bind[1].buffer= (char *) &data; /* this buffer won't be altered */ + bind[1].buffer= (void *) &data; /* this buffer won't be altered */ bind[1].buffer_length= sizeof(data); bind[1].length= &blob_length; bzero(data, sizeof(data)); @@ -2627,7 +2627,7 @@ static void test_long_data_bin() /* Always bzero all members of bind parameter */ bzero((char*) bind, sizeof(bind)); - bind[0].buffer= (char *)&length; + bind[0].buffer= (void *)&length; bind[0].buffer_type= MYSQL_TYPE_LONG; length= 0; @@ -2721,7 +2721,7 @@ static void test_simple_delete() bind[1].length= &length[1]; length[1]= 5; - bind[0].buffer= (char *)&nData; + bind[0].buffer= (void *)&nData; bind[0].buffer_type= MYSQL_TYPE_LONG; rc= mysql_stmt_bind_param(stmt, bind); @@ -2792,7 +2792,7 @@ static void test_update() bind[0].length= &length[0]; length[0]= my_sprintf(szData, (szData, "inserted-data")); - bind[1].buffer= (char *)&nData; + bind[1].buffer= (void *)&nData; bind[1].buffer_type= MYSQL_TYPE_LONG; rc= mysql_stmt_bind_param(stmt, bind); @@ -2821,7 +2821,7 @@ static void test_update() bind[0].length= &length[0]; length[0]= my_sprintf(szData, (szData, "updated-data")); - bind[1].buffer= (char *)&nData; + bind[1].buffer= (void *)&nData; bind[1].buffer_type= MYSQL_TYPE_LONG; rc= mysql_stmt_bind_param(stmt, bind); @@ -2931,7 +2931,7 @@ static void test_bind_result() /* fetch */ bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *) &nData; /* integer data */ + bind[0].buffer= (void *) &nData; /* integer data */ bind[0].is_null= &is_null[0]; bind[0].length= 0; @@ -3029,30 +3029,30 @@ static void test_bind_result_ext() } bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (char *)&t_data; + bind[0].buffer= (void *)&t_data; bind[1].buffer_type= MYSQL_TYPE_SHORT; bind[2].buffer_type= MYSQL_TYPE_LONG; bind[3].buffer_type= MYSQL_TYPE_LONGLONG; - bind[1].buffer= (char *)&s_data; + bind[1].buffer= (void *)&s_data; - bind[2].buffer= (char *)&i_data; - bind[3].buffer= (char *)&b_data; + bind[2].buffer= (void *)&i_data; + bind[3].buffer= (void *)&b_data; bind[4].buffer_type= MYSQL_TYPE_FLOAT; - bind[4].buffer= (char *)&f_data; + bind[4].buffer= (void *)&f_data; bind[5].buffer_type= MYSQL_TYPE_DOUBLE; - bind[5].buffer= (char *)&d_data; + bind[5].buffer= (void *)&d_data; bind[6].buffer_type= MYSQL_TYPE_STRING; - bind[6].buffer= (char *)szData; + bind[6].buffer= (void *)szData; bind[6].buffer_length= sizeof(szData); bind[6].length= &szLength; bind[7].buffer_type= MYSQL_TYPE_TINY_BLOB; - bind[7].buffer= (char *)&bData; + bind[7].buffer= (void *)&bData; bind[7].length= &bLength; bind[7].buffer_length= sizeof(bData); @@ -3139,35 +3139,35 @@ static void test_bind_result_ext1() myquery(rc); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *) t_data; + bind[0].buffer= (void *) t_data; bind[0].buffer_length= sizeof(t_data); bind[1].buffer_type= MYSQL_TYPE_FLOAT; - bind[1].buffer= (char *)&s_data; + bind[1].buffer= (void *)&s_data; bind[1].buffer_length= 0; bind[2].buffer_type= MYSQL_TYPE_SHORT; - bind[2].buffer= (char *)&i_data; + bind[2].buffer= (void *)&i_data; bind[2].buffer_length= 0; bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (char *)&b_data; + bind[3].buffer= (void *)&b_data; bind[3].buffer_length= 0; bind[4].buffer_type= MYSQL_TYPE_LONG; - bind[4].buffer= (char *)&f_data; + bind[4].buffer= (void *)&f_data; bind[4].buffer_length= 0; bind[5].buffer_type= MYSQL_TYPE_STRING; - bind[5].buffer= (char *)d_data; + bind[5].buffer= (void *)d_data; bind[5].buffer_length= sizeof(d_data); bind[6].buffer_type= MYSQL_TYPE_LONG; - bind[6].buffer= (char *)&bData; + bind[6].buffer= (void *)&bData; bind[6].buffer_length= 0; bind[7].buffer_type= MYSQL_TYPE_DOUBLE; - bind[7].buffer= (char *)&szData; + bind[7].buffer= (void *)&szData; bind[7].buffer_length= 0; for (i= 0; i < array_elements(bind); i++) @@ -3251,7 +3251,7 @@ static void bind_fetch(int row_count) for (i= 0; i < (int) array_elements(bind); i++) { bind[i].buffer_type= MYSQL_TYPE_LONG; - bind[i].buffer= (char *) &data[i]; + bind[i].buffer= (void *) &data[i]; } rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); @@ -3281,31 +3281,31 @@ static void bind_fetch(int row_count) for (i= 0; i < (int) array_elements(bind); i++) { - bind[i].buffer= (char *) &data[i]; + bind[i].buffer= (void *) &data[i]; bind[i].length= &length[i]; bind[i].is_null= &is_null[i]; } bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (char *)&i8_data; + bind[0].buffer= (void *)&i8_data; bind[1].buffer_type= MYSQL_TYPE_SHORT; - bind[1].buffer= (char *)&i16_data; + bind[1].buffer= (void *)&i16_data; bind[2].buffer_type= MYSQL_TYPE_LONG; - bind[2].buffer= (char *)&i32_data; + bind[2].buffer= (void *)&i32_data; bind[3].buffer_type= MYSQL_TYPE_LONGLONG; - bind[3].buffer= (char *)&i64_data; + bind[3].buffer= (void *)&i64_data; bind[4].buffer_type= MYSQL_TYPE_FLOAT; - bind[4].buffer= (char *)&f_data; + bind[4].buffer= (void *)&f_data; bind[5].buffer_type= MYSQL_TYPE_DOUBLE; - bind[5].buffer= (char *)&d_data; + bind[5].buffer= (void *)&d_data; bind[6].buffer_type= MYSQL_TYPE_STRING; - bind[6].buffer= (char *)&s_data; + bind[6].buffer= (void *)&s_data; bind[6].buffer_length= sizeof(s_data); rc= mysql_stmt_bind_result(stmt, bind); @@ -3425,34 +3425,34 @@ static void test_fetch_date() bind[0].buffer_type= MYSQL_TYPE_STRING; bind[1]= bind[2]= bind[0]; - bind[0].buffer= (char *)&date; + bind[0].buffer= (void *)&date; bind[0].buffer_length= sizeof(date); bind[0].length= &d_length; - bind[1].buffer= (char *)&time; + bind[1].buffer= (void *)&time; bind[1].buffer_length= sizeof(time); bind[1].length= &t_length; - bind[2].buffer= (char *)&ts; + bind[2].buffer= (void *)&ts; bind[2].buffer_length= sizeof(ts); bind[2].length= &ts_length; bind[3].buffer_type= MYSQL_TYPE_LONG; - bind[3].buffer= (char *)&year; + bind[3].buffer= (void *)&year; bind[3].length= &y_length; bind[4].buffer_type= MYSQL_TYPE_STRING; - bind[4].buffer= (char *)&dt; + bind[4].buffer= (void *)&dt; bind[4].buffer_length= sizeof(dt); bind[4].length= &dt_length; bind[5].buffer_type= MYSQL_TYPE_STRING; - bind[5].buffer= (char *)&ts_4; + bind[5].buffer= (void *)&ts_4; bind[5].buffer_length= sizeof(ts_4); bind[5].length= &ts4_length; bind[6].buffer_type= MYSQL_TYPE_STRING; - bind[6].buffer= (char *)&ts_6; + bind[6].buffer= (void *)&ts_6; bind[6].buffer_length= sizeof(ts_6); bind[6].length= &ts6_length; @@ -3743,27 +3743,27 @@ static void test_prepare_ext() /*tinyint*/ bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (char *)&tData; + bind[0].buffer= (void *)&tData; /*smallint*/ bind[1].buffer_type= MYSQL_TYPE_SHORT; - bind[1].buffer= (char *)&sData; + bind[1].buffer= (void *)&sData; /*mediumint*/ bind[2].buffer_type= MYSQL_TYPE_LONG; - bind[2].buffer= (char *)&nData; + bind[2].buffer= (void *)&nData; /*int*/ bind[3].buffer_type= MYSQL_TYPE_LONG; - bind[3].buffer= (char *)&nData; + bind[3].buffer= (void *)&nData; /*integer*/ bind[4].buffer_type= MYSQL_TYPE_LONG; - bind[4].buffer= (char *)&nData; + bind[4].buffer= (void *)&nData; /*bigint*/ bind[5].buffer_type= MYSQL_TYPE_LONGLONG; - bind[5].buffer= (char *)&bData; + bind[5].buffer= (void *)&bData; rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); @@ -3928,7 +3928,7 @@ static void test_insert() /* tinyint */ bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (char *)&tiny_data; + bind[0].buffer= (void *)&tiny_data; /* string */ bind[1].buffer_type= MYSQL_TYPE_STRING; @@ -4138,7 +4138,7 @@ static void test_stmt_close() */ bzero((char*) bind, sizeof(bind)); - bind[0].buffer= (char *)&count; + bind[0].buffer= (void *)&count; bind[0].buffer_type= MYSQL_TYPE_LONG; count= 100; @@ -4190,13 +4190,13 @@ static void test_set_variable() bzero((char*) get_bind, sizeof(get_bind)); get_bind[0].buffer_type= MYSQL_TYPE_STRING; - get_bind[0].buffer= (char *)var; + get_bind[0].buffer= (void *)var; get_bind[0].length= &length; get_bind[0].buffer_length= (int)NAME_LEN; length= NAME_LEN; get_bind[1].buffer_type= MYSQL_TYPE_LONG; - get_bind[1].buffer= (char *)&get_count; + get_bind[1].buffer= (void *)&get_count; get_bind[1].is_null= 0; get_bind[1].length= 0; @@ -4222,7 +4222,7 @@ static void test_set_variable() bzero((char*) set_bind, sizeof(set_bind)); set_bind[0].buffer_type= MYSQL_TYPE_LONG; - set_bind[0].buffer= (char *)&set_count; + set_bind[0].buffer= (void *)&set_count; rc= mysql_stmt_bind_param(stmt, set_bind); check_execute(stmt, rc); @@ -4579,14 +4579,14 @@ static void test_multi_stmt() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&id; + bind[0].buffer= (void *)&id; bind[0].is_null= &is_null[0]; bind[0].length= &length[0]; is_null[0]= 0; length[0]= 0; bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)name; + bind[1].buffer= (void *)name; bind[1].buffer_length= sizeof(name); bind[1].length= &length[1]; bind[1].is_null= &is_null[1]; @@ -4729,16 +4729,16 @@ static void test_manual_sample() /* INTEGER PART */ bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&int_data; + bind[0].buffer= (void *)&int_data; /* STRING PART */ bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[1].buffer= (char *)str_data; + bind[1].buffer= (void *)str_data; bind[1].buffer_length= sizeof(str_data); /* SMALLINT PART */ bind[2].buffer_type= MYSQL_TYPE_SHORT; - bind[2].buffer= (char *)&small_data; + bind[2].buffer= (void *)&small_data; bind[2].is_null= &is_null; is_null= 0; @@ -4853,7 +4853,7 @@ static void test_prepare_alter() is_null= 0; bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (char *)&id; + bind[0].buffer= (void *)&id; bind[0].is_null= &is_null; rc= mysql_stmt_bind_param(stmt, bind); @@ -5067,7 +5067,7 @@ static void test_store_result() /* fetch */ bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char*) &nData; /* integer data */ + bind[0].buffer= (void *) &nData; /* integer data */ bind[0].length= &length; bind[0].is_null= &is_null[0]; @@ -5248,7 +5248,7 @@ static void test_store_result2() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *) &nData; /* integer data */ + bind[0].buffer= (void *) &nData; /* integer data */ bind[0].length= &length; bind[0].is_null= 0; @@ -5339,7 +5339,7 @@ static void test_subselect() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *) &id; + bind[0].buffer= (void *) &id; bind[0].length= 0; bind[0].is_null= 0; @@ -5445,7 +5445,7 @@ static void test_bind_date_conv(uint row_count) for (i= 0; i < (int) array_elements(bind); i++) { - bind[i].buffer= (char *) &tm[i]; + bind[i].buffer= (void *) &tm[i]; bind[i].is_null= &is_null[i]; bind[i].length= &length[i]; bind[i].buffer_length= 30; @@ -5772,7 +5772,7 @@ static void test_buffers() bind[0].is_null= &is_null; bind[0].buffer_length= 1; bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)buffer; + bind[0].buffer= (void *)buffer; rc= mysql_stmt_bind_result(stmt, bind); check_execute(stmt, rc); @@ -5946,14 +5946,14 @@ static void test_fetch_nobuffs() assert(rc == 1); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)str[0]; + bind[0].buffer= (void *)str[0]; bind[0].is_null= 0; bind[0].length= 0; bind[0].buffer_length= sizeof(str[0]); bind[1]= bind[2]= bind[3]= bind[0]; - bind[1].buffer= (char *)str[1]; - bind[2].buffer= (char *)str[2]; - bind[3].buffer= (char *)str[3]; + bind[1].buffer= (void *)str[1]; + bind[2].buffer= (void *)str[2]; + bind[3].buffer= (void *)str[3]; rc= mysql_stmt_bind_result(stmt, bind); check_execute(stmt, rc); @@ -6012,22 +6012,22 @@ static void test_ushort_bug() check_execute(stmt, rc); bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (char *)&short_value; + bind[0].buffer= (void *)&short_value; bind[0].is_null= 0; bind[0].length= &s_length; bind[1].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer= (char *)&long_value; + bind[1].buffer= (void *)&long_value; bind[1].is_null= 0; bind[1].length= &l_length; bind[2].buffer_type= MYSQL_TYPE_LONGLONG; - bind[2].buffer= (char *)&longlong_value; + bind[2].buffer= (void *)&longlong_value; bind[2].is_null= 0; bind[2].length= &ll_length; bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (char *)&tiny_value; + bind[3].buffer= (void *)&tiny_value; bind[3].is_null= 0; bind[3].length= &t_length; @@ -6096,22 +6096,22 @@ static void test_sshort_bug() check_execute(stmt, rc); bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (char *)&short_value; + bind[0].buffer= (void *)&short_value; bind[0].is_null= 0; bind[0].length= &s_length; bind[1].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer= (char *)&long_value; + bind[1].buffer= (void *)&long_value; bind[1].is_null= 0; bind[1].length= &l_length; bind[2].buffer_type= MYSQL_TYPE_LONGLONG; - bind[2].buffer= (char *)&longlong_value; + bind[2].buffer= (void *)&longlong_value; bind[2].is_null= 0; bind[2].length= &ll_length; bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (char *)&tiny_value; + bind[3].buffer= (void *)&tiny_value; bind[3].is_null= 0; bind[3].length= &t_length; @@ -6180,22 +6180,22 @@ static void test_stiny_bug() check_execute(stmt, rc); bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (char *)&short_value; + bind[0].buffer= (void *)&short_value; bind[0].is_null= 0; bind[0].length= &s_length; bind[1].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer= (char *)&long_value; + bind[1].buffer= (void *)&long_value; bind[1].is_null= 0; bind[1].length= &l_length; bind[2].buffer_type= MYSQL_TYPE_LONGLONG; - bind[2].buffer= (char *)&longlong_value; + bind[2].buffer= (void *)&longlong_value; bind[2].is_null= 0; bind[2].length= &ll_length; bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (char *)&tiny_value; + bind[3].buffer= (void *)&tiny_value; bind[3].is_null= 0; bind[3].length= &t_length; @@ -6622,8 +6622,8 @@ static void test_frm_bug() row= mysql_fetch_row(result); mytest(row); - fprintf(stdout, "\n Comment: %s", row[16]); - assert(row[16] != 0); + fprintf(stdout, "\n Comment: %s", row[17]); + assert(row[17] != 0); mysql_free_result(result); mysql_stmt_close(stmt); @@ -6666,7 +6666,7 @@ static void test_decimal_bug() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)data; + bind[0].buffer= (void *)data; bind[0].buffer_length= 25; bind[0].is_null= &is_null; @@ -7056,10 +7056,10 @@ static void test_logs() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (char *)&id; + bind[0].buffer= (void *)&id; bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)&data; + bind[1].buffer= (void *)&data; bind[1].buffer_length= 255; bind[1].length= &length; @@ -7198,7 +7198,7 @@ static void test_nstmts() */ bzero((char*) bind, sizeof(bind)); - bind[0].buffer= (char *)&i; + bind[0].buffer= (void *)&i; bind[0].buffer_type= MYSQL_TYPE_LONG; for (i= 0; i < total_stmts; i++) @@ -7269,19 +7269,19 @@ static void test_fetch_seek() check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&c1; + bind[0].buffer= (void *)&c1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= 0; bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)c2; + bind[1].buffer= (void *)c2; bind[1].buffer_length= sizeof(c2); bind[1].is_null= 0; bind[1].length= 0; bind[2]= bind[1]; - bind[2].buffer= (char *)c3; + bind[2].buffer= (void *)c3; bind[2].buffer_length= sizeof(c3); rc= mysql_stmt_execute(stmt); @@ -7364,7 +7364,7 @@ static void test_fetch_offset() check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)data; + bind[0].buffer= (void *)data; bind[0].buffer_length= 11; bind[0].is_null= &is_null; bind[0].length= &length; @@ -7445,12 +7445,12 @@ static void test_fetch_column() check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&bc1; + bind[0].buffer= (void *)&bc1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= &bl1; bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)bc2; + bind[1].buffer= (void *)bc2; bind[1].buffer_length= 7; bind[1].is_null= 0; bind[1].length= &bl2; @@ -7474,7 +7474,7 @@ static void test_fetch_column() c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)c2; + bind[0].buffer= (void *)c2; bind[0].buffer_length= 7; bind[0].is_null= 0; bind[0].length= &l2; @@ -7492,7 +7492,7 @@ static void test_fetch_column() c1= 0; bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&c1; + bind[0].buffer= (void *)&c1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= &l1; @@ -7509,7 +7509,7 @@ static void test_fetch_column() c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)c2; + bind[0].buffer= (void *)c2; bind[0].buffer_length= 7; bind[0].is_null= 0; bind[0].length= &l2; @@ -7527,7 +7527,7 @@ static void test_fetch_column() c1= 0; bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&c1; + bind[0].buffer= (void *)&c1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= &l1; @@ -7678,7 +7678,7 @@ static void test_free_result() check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&bc1; + bind[0].buffer= (void *)&bc1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= &bl1; @@ -7694,7 +7694,7 @@ static void test_free_result() c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)c2; + bind[0].buffer= (void *)c2; bind[0].buffer_length= 7; bind[0].is_null= 0; bind[0].length= &l2; @@ -7709,7 +7709,7 @@ static void test_free_result() c1= 0, l2= 0; bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&c1; + bind[0].buffer= (void *)&c1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= &l2; @@ -7757,7 +7757,7 @@ static void test_free_store_result() check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&bc1; + bind[0].buffer= (void *)&bc1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= &bl1; @@ -7776,7 +7776,7 @@ static void test_free_store_result() c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)c2; + bind[0].buffer= (void *)c2; bind[0].buffer_length= 7; bind[0].is_null= 0; bind[0].length= &l2; @@ -7791,7 +7791,7 @@ static void test_free_store_result() c1= 0, l2= 0; bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&c1; + bind[0].buffer= (void *)&c1; bind[0].buffer_length= 0; bind[0].is_null= 0; bind[0].length= &l2; @@ -7848,11 +7848,11 @@ static void test_sqlmode() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)c1; + bind[0].buffer= (void *)c1; bind[0].buffer_length= 2; bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char *)c2; + bind[1].buffer= (void *)c2; bind[1].buffer_length= 3; rc= mysql_stmt_bind_param(stmt, bind); @@ -7978,13 +7978,13 @@ static void test_ts() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP; - bind[0].buffer= (char *)&ts; + bind[0].buffer= (void *)&ts; bind[0].buffer_length= sizeof(ts); bind[2]= bind[1]= bind[0]; bind[3].buffer_type= MYSQL_TYPE_STRING; - bind[3].buffer= (char *)strts; + bind[3].buffer= (void *)strts; bind[3].buffer_length= sizeof(strts); bind[3].length= &length; @@ -8077,11 +8077,11 @@ static void test_bug1500() */ bzero((char*) bind, sizeof(bind)); - bind[0].buffer= (char *)int_data; + bind[0].buffer= (void *)int_data; bind[0].buffer_type= MYSQL_TYPE_LONG; bind[2]= bind[1]= bind[0]; - bind[1].buffer= (char *)(int_data + 1); - bind[2].buffer= (char *)(int_data + 2); + bind[1].buffer= (void *)(int_data + 1); + bind[2].buffer= (void *)(int_data + 2); rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); @@ -8114,7 +8114,7 @@ static void test_bug1500() data= "Dogs"; bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *) data; + bind[0].buffer= (void *) data; bind[0].buffer_length= strlen(data); bind[0].is_null= 0; bind[0].length= 0; @@ -8142,7 +8142,7 @@ static void test_bug1500() data= "Grave"; bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *) data; + bind[0].buffer= (void *) data; bind[0].buffer_length= strlen(data); rc= mysql_stmt_bind_param(stmt, bind); @@ -8542,7 +8542,7 @@ static void test_bug3117() bzero((char*) &buffer, sizeof(buffer)); buffer.buffer_type= MYSQL_TYPE_LONGLONG; buffer.buffer_length= sizeof(lii); - buffer.buffer= (char *)&lii; + buffer.buffer= (void *)&lii; buffer.length= &length; buffer.is_null= &is_null; @@ -8847,7 +8847,7 @@ static void test_multi() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)¶m; + bind[0].buffer= (void *)¶m; bind[0].length= &length; rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1, t2"); @@ -8988,7 +8988,7 @@ static void test_bind_nagative() bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&my_val; + bind[0].buffer= (void *)&my_val; bind[0].length= &my_length; bind[0].is_null= (char*)&my_null; @@ -9037,7 +9037,7 @@ TYPE=InnoDB DEFAULT CHARSET=utf8"); bzero((char*) bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char *)&my_val; + bind[0].buffer= (void *)&my_val; bind[0].length= &my_length; bind[0].is_null= (char*)&my_null; my_val= 1; @@ -9167,31 +9167,31 @@ static void test_bug3035() bzero(bind_array, sizeof(bind_array)); bind_array[0].buffer_type= MYSQL_TYPE_TINY; - bind_array[0].buffer= (char*) &int8_val; + bind_array[0].buffer= (void *) &int8_val; bind_array[1].buffer_type= MYSQL_TYPE_TINY; - bind_array[1].buffer= (char*) &uint8_val; + bind_array[1].buffer= (void *) &uint8_val; bind_array[1].is_unsigned= 1; bind_array[2].buffer_type= MYSQL_TYPE_SHORT; - bind_array[2].buffer= (char*) &int16_val; + bind_array[2].buffer= (void *) &int16_val; bind_array[3].buffer_type= MYSQL_TYPE_SHORT; - bind_array[3].buffer= (char*) &uint16_val; + bind_array[3].buffer= (void *) &uint16_val; bind_array[3].is_unsigned= 1; bind_array[4].buffer_type= MYSQL_TYPE_LONG; - bind_array[4].buffer= (char*) &int32_val; + bind_array[4].buffer= (void *) &int32_val; bind_array[5].buffer_type= MYSQL_TYPE_LONG; - bind_array[5].buffer= (char*) &uint32_val; + bind_array[5].buffer= (void *) &uint32_val; bind_array[5].is_unsigned= 1; bind_array[6].buffer_type= MYSQL_TYPE_LONGLONG; - bind_array[6].buffer= (char*) &int64_val; + bind_array[6].buffer= (void *) &int64_val; bind_array[7].buffer_type= MYSQL_TYPE_LONGLONG; - bind_array[7].buffer= (char*) &uint64_val; + bind_array[7].buffer= (void *) &uint64_val; bind_array[7].is_unsigned= 1; stmt= mysql_stmt_init(mysql); @@ -9239,17 +9239,17 @@ static void test_bug3035() check_execute(stmt, rc); bind_array[8].buffer_type= MYSQL_TYPE_DOUBLE; - bind_array[8].buffer= (char*) &udouble_val; + bind_array[8].buffer= (void *) &udouble_val; bind_array[9].buffer_type= MYSQL_TYPE_DOUBLE; - bind_array[9].buffer= (char*) &double_val; + bind_array[9].buffer= (void *) &double_val; bind_array[10].buffer_type= MYSQL_TYPE_STRING; - bind_array[10].buffer= (char*) &ulonglong_as_string; + bind_array[10].buffer= (void *) &ulonglong_as_string; bind_array[10].buffer_length= sizeof(ulonglong_as_string); bind_array[11].buffer_type= MYSQL_TYPE_STRING; - bind_array[11].buffer= (char*) &longlong_as_string; + bind_array[11].buffer= (void *) &longlong_as_string; bind_array[11].buffer_length= sizeof(longlong_as_string); mysql_stmt_bind_result(stmt, bind_array); @@ -9362,10 +9362,10 @@ static void test_bug1664() bzero(&bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char *)str_data; + bind[0].buffer= (void *)str_data; bind[0].buffer_length= strlen(str_data); - bind[1].buffer= (char *)&int_data; + bind[1].buffer= (void *)&int_data; bind[1].buffer_type= MYSQL_TYPE_LONG; rc= mysql_stmt_bind_param(stmt, bind); @@ -9601,11 +9601,11 @@ static void test_ps_i18n() bzero(bind_array, sizeof(bind_array)); bind_array[0].buffer_type= MYSQL_TYPE_STRING; - bind_array[0].buffer= (char*) koi8; + bind_array[0].buffer= (void *) koi8; bind_array[0].buffer_length= strlen(koi8); bind_array[1].buffer_type= MYSQL_TYPE_STRING; - bind_array[1].buffer= (char*) koi8; + bind_array[1].buffer= (void *) koi8; bind_array[1].buffer_length= strlen(koi8); stmt= mysql_stmt_init(mysql); @@ -9677,11 +9677,11 @@ static void test_ps_i18n() /* this data must be converted */ bind_array[0].buffer_type= MYSQL_TYPE_STRING; - bind_array[0].buffer= (char*) koi8; + bind_array[0].buffer= (void *) koi8; bind_array[0].buffer_length= strlen(koi8); bind_array[1].buffer_type= MYSQL_TYPE_STRING; - bind_array[1].buffer= (char*) koi8; + bind_array[1].buffer= (void *) koi8; bind_array[1].buffer_length= strlen(koi8); mysql_stmt_bind_param(stmt, bind_array); @@ -9693,11 +9693,11 @@ static void test_ps_i18n() /* this data must not be converted */ bind_array[0].buffer_type= MYSQL_TYPE_BLOB; - bind_array[0].buffer= (char*) cp1251; + bind_array[0].buffer= (void *) cp1251; bind_array[0].buffer_length= strlen(cp1251); bind_array[1].buffer_type= MYSQL_TYPE_BLOB; - bind_array[1].buffer= (char*) cp1251; + bind_array[1].buffer= (void *) cp1251; bind_array[1].buffer_length= strlen(cp1251); mysql_stmt_bind_param(stmt, bind_array); @@ -9785,7 +9785,7 @@ static void test_bug3796() bzero(bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char*) concat_arg0; + bind[0].buffer= (void *) concat_arg0; bind[0].buffer_length= strlen(concat_arg0); mysql_stmt_bind_param(stmt, bind); @@ -9794,7 +9794,7 @@ static void test_bug3796() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bind[0].buffer= (char*) out_buff; + bind[0].buffer= (void *) out_buff; bind[0].buffer_length= OUT_BUFF_SIZE; bind[0].length= &out_length; @@ -9854,9 +9854,9 @@ static void test_bug4026() bzero(&datetime_out, sizeof(datetime_out)); bind[0].buffer_type= MYSQL_TYPE_TIME; - bind[0].buffer= (char*) &time_in; + bind[0].buffer= (void *) &time_in; bind[1].buffer_type= MYSQL_TYPE_DATETIME; - bind[1].buffer= (char*) &datetime_in; + bind[1].buffer= (void *) &datetime_in; time_in.hour= 23; time_in.minute= 59; @@ -9874,8 +9874,8 @@ static void test_bug4026() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bind[0].buffer= (char*) &time_out; - bind[1].buffer= (char*) &datetime_out; + bind[0].buffer= (void *) &time_out; + bind[1].buffer= (void *) &datetime_out; mysql_stmt_bind_result(stmt, bind); @@ -9923,7 +9923,7 @@ static void test_bug4079() bzero(bind, sizeof(bind)); bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (char*) &res; + bind[0].buffer= (void *) &res; mysql_stmt_bind_result(stmt, bind); @@ -9964,6 +9964,80 @@ static void test_bug4236() } +static void test_bug4030() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[3]; + MYSQL_TIME time_canonical, time_out; + MYSQL_TIME date_canonical, date_out; + MYSQL_TIME datetime_canonical, datetime_out; + const char *stmt_text; + int rc; + + myheader("test_bug4030"); + + /* Check that microseconds are inserted and selected successfully */ + + /* Execute a query with time values in prepared mode */ + stmt= mysql_stmt_init(mysql); + stmt_text= "SELECT '23:59:59.123456', '2003-12-31', " + "'2003-12-31 23:59:59.123456'"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + /* Bind output buffers */ + bzero(bind, sizeof(bind)); + bzero(&time_canonical, sizeof(time_canonical)); + bzero(&time_out, sizeof(time_out)); + bzero(&date_canonical, sizeof(date_canonical)); + bzero(&date_out, sizeof(date_out)); + bzero(&datetime_canonical, sizeof(datetime_canonical)); + bzero(&datetime_out, sizeof(datetime_out)); + + bind[0].buffer_type= MYSQL_TYPE_TIME; + bind[0].buffer= (void *) &time_out; + bind[1].buffer_type= MYSQL_TYPE_DATE; + bind[1].buffer= (void *) &date_out; + bind[2].buffer_type= MYSQL_TYPE_DATETIME; + bind[2].buffer= (void *) &datetime_out; + + time_canonical.hour= 23; + time_canonical.minute= 59; + time_canonical.second= 59; + time_canonical.second_part= 123456; + time_canonical.time_type= MYSQL_TIMESTAMP_TIME; + + date_canonical.year= 2003; + date_canonical.month= 12; + date_canonical.day= 31; + date_canonical.time_type= MYSQL_TIMESTAMP_DATE; + + datetime_canonical= time_canonical; + datetime_canonical.year= 2003; + datetime_canonical.month= 12; + datetime_canonical.day= 31; + datetime_canonical.time_type= MYSQL_TIMESTAMP_DATETIME; + + mysql_stmt_bind_result(stmt, bind); + + rc= mysql_stmt_fetch(stmt); + assert(rc == 0); + printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, + time_out.second_part); + printf("%d-%d-%d\n", date_out.year, date_out.month, date_out.day); + printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, + datetime_out.day, datetime_out.hour, + datetime_out.minute, datetime_out.second, + datetime_out.second_part); + assert(memcmp(&time_canonical, &time_out, sizeof(time_out)) == 0); + assert(memcmp(&date_canonical, &date_out, sizeof(date_out)) == 0); + assert(memcmp(&datetime_canonical, &datetime_out, sizeof(datetime_out)) == 0); + mysql_stmt_close(stmt); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -10259,6 +10333,8 @@ int main(int argc, char **argv) test_bug4026(); /* test microseconds precision of time types */ test_bug4079(); /* erroneous subquery in prepared statement */ test_bug4236(); /* init -> execute */ + test_bug4030(); /* test conversion string -> time types in + libmysql */ /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c index 71b194838c7..d05e50af16b 100644 --- a/vio/test-sslserver.c +++ b/vio/test-sslserver.c @@ -91,7 +91,12 @@ main(int argc __attribute__((unused)), char** argv) struct sockaddr_in sa_cli; int listen_sd; int err; + +#if defined(__sgi) && _NO_XOPEN4 && _NO_XOPEN5 + socklen_t client_len; +#else size_t client_len; +#endif int reuseaddr = 1; /* better testing, uh? */ MY_INIT(argv[0]); |