mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Merge work:/home/bk/mysql-4.0
into serg.mysql.com:/usr/home/serg/Abk/mysql-4.0 include/my_global.h: Auto merged sql/handler.h: Auto merged sql/lex.h: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
commit
c20a4e6e02
39 changed files with 181 additions and 5331 deletions
|
@ -1,10 +1,21 @@
|
|||
AM_MAKEFLAGS="-j 2"
|
||||
make -k clean
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
aclocal; autoheader; aclocal; automake; autoconf
|
||||
|
||||
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd bdb/dist && sh s_all)
|
||||
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi
|
||||
|
||||
export PATH=/usr/local/pgcc/bin:$PATH
|
||||
CFLAGS="-O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=gcc CXXFLAGS="-O6 -mpentiumpro -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charsets=complex --enable-thread-safe-client
|
||||
make -j 2
|
||||
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O6 -fomit-frame-pointer -mpentiumpro -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
|
||||
|
||||
gmake -j 4
|
||||
|
||||
mkdir -p tmp
|
||||
nm --numeric-sort sql/mysqld > tmp/mysqld.sym
|
||||
objdump -d sql/mysqld > tmp/mysqld.S
|
||||
strip sql/mysqld
|
||||
|
|
|
@ -19,7 +19,7 @@ if ($opt_innodb || $opt_bdb)
|
|||
|
||||
chomp($host=`hostname`);
|
||||
$full_host_name=$host;
|
||||
info("Compiling MySQL$version_suffix at $host$suffix, stage: $opt_stage\n");
|
||||
info("Compiling MySQL$version_suffix at $host, stage: $opt_stage\n");
|
||||
$connect_option= ($opt_tcpip ? "--host=$host" : "");
|
||||
$host =~ /^([^.-]*)/;
|
||||
$host=$1 . $opt_suffix;
|
||||
|
@ -65,10 +65,11 @@ $sendmail=find("/usr/lib/sendmail","/usr/sbin/sendmail");
|
|||
$sur= $opt_sur ? "/my/local/bin/sur" : "";
|
||||
delete $ENV{'MYSQL_PWD'}; # Reset possibly password
|
||||
delete $ENV{'MY_BASEDIR_VERSION'};
|
||||
$ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread;
|
||||
$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;
|
||||
$manager_port=$mysql_tcp_port+1;
|
||||
|
||||
if (-x "$host/bin/mysqladmin")
|
||||
{
|
||||
|
@ -78,6 +79,7 @@ if (-x "$host/bin/mysqladmin")
|
|||
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9306 -h $host -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9307 -h $host -s shutdown");
|
||||
}
|
||||
kill_all("mysqlmanager");
|
||||
|
||||
if ($opt_stage == 0)
|
||||
{
|
||||
|
@ -110,7 +112,7 @@ if ($opt_stage == 0 && ! $opt_use_old_distribution)
|
|||
|
||||
# Fix file times; This is needed because the time for files may be
|
||||
# in the future
|
||||
system("touch timestamp; find $var -newer timestamp -print | xargs touch; rm -f timestamp");
|
||||
system("touch timestamp; find . -newer timestamp -print | xargs touch; rm -f timestamp");
|
||||
sleep(2);
|
||||
# Ensure that files we don't want to rebuild are newer than other files
|
||||
foreach $name ("configure",
|
||||
|
@ -207,13 +209,13 @@ if ($opt_stage <= 4 && !$opt_no_test)
|
|||
$tar_file =~ /(mysql-[^\/]*)\.tar/;
|
||||
$ver=$1;
|
||||
$test_dir="$pwd/$host/test/$ver";
|
||||
$ENV{"LD_LIBRARY_PATH"}= "$testdir/lib:" . $ENV{"LD_LIBRARY_PATH"};
|
||||
$ENV{"LD_LIBRARY_PATH"}= "$test_dir/lib:" . $ENV{"LD_LIBRARY_PATH"};
|
||||
|
||||
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
|
||||
{
|
||||
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
|
||||
safe_cd("${test_dir}/mysql-test");
|
||||
check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --sleep=10", "tests were successful");
|
||||
check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --sleep=10", "tests were successful");
|
||||
}
|
||||
|
||||
# Start the server if we are going to run any of the benchmarks
|
||||
|
@ -235,7 +237,7 @@ if (!$opt_no_test)
|
|||
{
|
||||
$extra.=" --innodb_data_file_path=ibdata1:100M";
|
||||
}
|
||||
safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-l\ocking $extra >> $log 2>&1 &");
|
||||
safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-locking $extra >> $log 2>&1 &");
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
|
@ -315,7 +317,7 @@ exit 0;
|
|||
sub usage
|
||||
{
|
||||
print <<EOF;
|
||||
$0 version 1.2
|
||||
$0 version 1.3
|
||||
|
||||
$0 takes the following options:
|
||||
|
||||
|
@ -329,7 +331,7 @@ Compile with support for Innodb tables
|
|||
Compile with support for Berkeley DB tables
|
||||
|
||||
--user 'user_name'
|
||||
Mail 'user_name'\@analytikerna.se if something went wrong.
|
||||
Mail 'user_name'\@mysql.com if something went wrong.
|
||||
If user is empty then no mail is sent.
|
||||
|
||||
--distribution 'distribution_file'
|
||||
|
@ -528,3 +530,43 @@ sub rm_all
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub kill_all
|
||||
{
|
||||
my ($pattern) = @_;
|
||||
my ($USER,$BSD,$LINUX,$pscmd, $user, $pid);
|
||||
$user=$ENV{'USER'};
|
||||
$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4";
|
||||
$LINUX = $^O eq 'linux';
|
||||
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";
|
||||
|
||||
open(PS, "$pscmd|") || die "can't run $pscmd: $!";
|
||||
|
||||
# Catch any errors with eval. A bad pattern, for instance.
|
||||
process:
|
||||
while ($cand = <PS>)
|
||||
{
|
||||
chop($cand);
|
||||
($pid_user, $pid) = split(' ', $cand);
|
||||
next if $pid == $$;
|
||||
next process if (! ($cand =~ $pattern) || $pid_user ne $user)
|
||||
&killpid($pid);
|
||||
}
|
||||
}
|
||||
|
||||
sub killpid
|
||||
{
|
||||
local($pid) = @_;
|
||||
kill 15, $pid;
|
||||
for (1..5)
|
||||
{
|
||||
sleep 2;
|
||||
return if kill(0, $pid) == 0;
|
||||
}
|
||||
kill 9, $pid;
|
||||
for (1..5) {
|
||||
sleep 2;
|
||||
return if kill(0, $pid) == 0;
|
||||
}
|
||||
print LOG "$pid will not die!\n";
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
function copy_to_bmachine
|
||||
{
|
||||
if [ x$local_build = x1 ]; then
|
||||
rm -f $2
|
||||
cp $1 $2
|
||||
else
|
||||
scp $1 $owner@$bmachine:$2
|
||||
|
@ -14,6 +15,7 @@ function copy_to_bmachine
|
|||
function copy_from_bmachine
|
||||
{
|
||||
if [ x$local_build = x1 ]; then
|
||||
rm -f $2
|
||||
cp $1 $2
|
||||
else
|
||||
scp $owner@$bmachine:$1 $2
|
||||
|
@ -90,10 +92,7 @@ while test $# -gt 0; do
|
|||
done
|
||||
|
||||
echo "Removing old MySQL packages"
|
||||
rm -rf $rpmdir/BUILD/mysql-*
|
||||
rm -f $rpmdir/SOURCES/mysql-*
|
||||
rm -f $rpmdir/SRPMS/MySQL-*
|
||||
rm -f $rpmdir/SPEC/mysql-*
|
||||
rm -f $bpath/NEW-RPMS/MySQL-*rpm
|
||||
|
||||
if [ ! -d "$logdir" ]; then
|
||||
echo "$logdir does not exist, creating"
|
||||
|
@ -105,12 +104,20 @@ if [ ! -f "$tarball" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building RPM for MySQL version $VER on $bmachine"
|
||||
|
||||
log=$logdir/Log-RPM-`date +%y%m%d-%H%M`
|
||||
|
||||
echo "Building RPM for MySQL version $VER on $bmachine"
|
||||
echo "Details in $log"
|
||||
|
||||
(
|
||||
set -x
|
||||
# remove old stuff
|
||||
rm -rf $rpmdir/BUILD/mysql-*
|
||||
rm -f $rpmdir/SOURCES/mysql-*
|
||||
rm -f $rpmdir/SRPMS/MySQL-*
|
||||
rm -f $rpmdir/SPECS/mysql-*
|
||||
rm -rf /var/tmp/mysql
|
||||
|
||||
# Copy MySQL source and spec files
|
||||
|
||||
#Sasha: I left the scp stuff commented out instead of deleted to make it
|
||||
|
@ -156,7 +163,7 @@ if [ ! x$skip_perl=x1 ]; then
|
|||
set -x
|
||||
|
||||
# First clean up so we do not get old versions when wildcard matching
|
||||
rm -f $rpmdir/SOURCES/DBI-*.spec
|
||||
rm -f $rpmdir/SOURCES/DBI-*.spec $rpmdir/SOURCES/mysql*
|
||||
rm -f $rpmdir/RPMS/i386/Perl-*.rpm
|
||||
rm -f $rpmdir/SRPMS/Perl-*.rpm
|
||||
rm -f $rpmdir/RPMS/i386/MySQL*-$VER_NO_DASH*.rpm
|
||||
|
@ -226,5 +233,9 @@ if [ x$local_build != x1 ]; then
|
|||
# And the perl ones
|
||||
#scp $owner@$bmachine:$rpmdir/RPMS/i386/Perl*-*.rpm $bpath/NEW-RPMS
|
||||
#scp $owner@$bmachine:$rpmdir/SRPMS/Perl*-*.rpm $bpath/NEW-RPMS
|
||||
|
||||
#Remove some of the files that can interfere with future builds
|
||||
|
||||
rm -rf /var/tmp/mysql
|
||||
fi
|
||||
) > $log 2>&1
|
||||
|
|
|
@ -7605,6 +7605,10 @@ compile step will still try to build @code{mysql}, but you can ignore any
|
|||
warnings about @file{mysql.cc}. (If @code{make} stops, try @code{make -k}
|
||||
to tell it to continue with the rest of the build even if errors occur.)
|
||||
|
||||
@item
|
||||
If you want to get a embedded MySQL library (@code{libmysqld.a}) you should
|
||||
use the @code{--with-embedded-server} option.
|
||||
|
||||
@item
|
||||
If you don't want your log files and database directories located under
|
||||
@file{/usr/local/var}, use a @code{configure} command, something like one
|
||||
|
@ -7621,7 +7625,8 @@ installed under @file{/usr/local/mysql} rather than the default of
|
|||
@file{/usr/local}. The second command preserves the default installation
|
||||
prefix, but overrides the default location for database directories
|
||||
(normally @file{/usr/local/var}) and changes it to
|
||||
@code{/usr/local/mysql/data}.
|
||||
@code{/usr/local/mysql/data}. After you have compiled MySQL, you can
|
||||
change these options with option files. @xref{Option files}.
|
||||
|
||||
@cindex changing socket location
|
||||
@cindex socket location, changing
|
||||
|
@ -24201,17 +24206,11 @@ for most systems, but one should be aware of it.
|
|||
@cindex design, limitations
|
||||
@cindex limitations, design
|
||||
|
||||
Because MySQL uses extremely fast table locking (multiple readers /
|
||||
single writers) the biggest remaining problem is a mix of a steady stream of
|
||||
inserts and slow selects on the same table.
|
||||
|
||||
We believe that for a huge number of systems the extremely fast
|
||||
performance in other cases make this choice a win. This case is usually
|
||||
also possible to solve by having multiple copies of the table, but it
|
||||
takes more effort and hardware.
|
||||
|
||||
We are also working on some extensions to solve this problem for some
|
||||
common application niches.
|
||||
When using the MyISAM table handler, MySQL uses extremely fast table
|
||||
locking (multiple readers / single writers). The biggest problem with
|
||||
this table type is a if you have a mix of a steady stream of updates and
|
||||
slow selects on the same table. If this is a problem with some tables,
|
||||
you can use another table type for these. @xref{Table types}.
|
||||
|
||||
MySQL can work with both transactional and not transactional tables. To
|
||||
be able to work smoothly with not transactional tables (which can't
|
||||
|
@ -42350,6 +42349,9 @@ library. @xref{mysql_server_init}.
|
|||
@node libmysqld compiling, libmysqld restrictions, libmysqld overview, libmysqld
|
||||
@subsubsection Compiling Programs with @code{libmysqld}
|
||||
|
||||
To get a @code{libmysqld} library you should configure MySQL with the
|
||||
@code{--with-embedded-server} option.
|
||||
|
||||
When you link your program with @code{libmysqld}, you must also include
|
||||
the system specific @code{pthread} libraries and some libraries that
|
||||
@code{mysqld} uses. You can get the full list of libraries by executing
|
||||
|
@ -47361,6 +47363,8 @@ Added documentation for @code{libmysqld}, the embedded MySQL server
|
|||
library. Also added example programs (a @code{mysql} client and
|
||||
@code{mysqltest} test program) which use @code{libmysqld}.
|
||||
@item
|
||||
Removed all Gemini hooks from MySQL.
|
||||
@item
|
||||
Removed @code{my_thread_init()} and @code{my_thread_end()}
|
||||
from mysql_com.h, and added @code{mysql_thread_init()} and
|
||||
@code{mysql_thread_end()} to mysql.h.
|
||||
|
|
|
@ -81,6 +81,9 @@
|
|||
/* Using Innobase DB */
|
||||
#undef HAVE_INNOBASE_DB
|
||||
|
||||
/* Using old ISAM tables */
|
||||
#undef HAVE_ISAM
|
||||
|
||||
/* Define if we have GNU readline */
|
||||
#undef HAVE_LIBREADLINE
|
||||
|
||||
|
|
59
acinclude.m4
59
acinclude.m4
|
@ -814,6 +814,23 @@ AC_SUBST(orbit_libs)
|
|||
AC_SUBST(orbit_idl)
|
||||
])
|
||||
|
||||
AC_DEFUN([MYSQL_CHECK_ISAM], [
|
||||
AC_ARG_WITH([isam], [\
|
||||
--without-isam Disable the ISAM table type],
|
||||
[with_isam="$withval"],
|
||||
[with_isam=yes])
|
||||
|
||||
isam_libs=
|
||||
if test X"$with_isam" = X"yes"
|
||||
then
|
||||
AC_DEFINE(HAVE_ISAM)
|
||||
isam_libs="\$(top_builddir)/isam/libnisam.a\
|
||||
\$(top_builddir)/merge/libmerge.a"
|
||||
fi
|
||||
AC_SUBST(isam_libs)
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_CHECK_BDB
|
||||
dnl Sets HAVE_BERKELEY_DB if inst library is found
|
||||
|
@ -1158,48 +1175,6 @@ dnl ---------------------------------------------------------------------------
|
|||
dnl END OF MYSQL_CHECK_INNODB SECTION
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_CHECK_GEMINI
|
||||
dnl Sets HAVE_GEMINI_DB if --with-gemini is used
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([MYSQL_CHECK_GEMINI], [
|
||||
AC_ARG_WITH([gemini],
|
||||
[\
|
||||
--with-gemini[=DIR] Use Gemini DB located in DIR],
|
||||
[gemini="$withval"],
|
||||
[gemini=no])
|
||||
|
||||
AC_MSG_CHECKING([for Gemini DB])
|
||||
|
||||
dnl SORT OUT THE SUPPLIED ARGUMENTS TO DETERMINE WHAT TO DO
|
||||
dnl echo "DBG_GEM1: gemini='$gemini'"
|
||||
have_gemini_db=no
|
||||
gemini_includes=
|
||||
gemini_libs=
|
||||
case "$gemini" in
|
||||
no)
|
||||
AC_MSG_RESULT([Not using Gemini DB])
|
||||
;;
|
||||
yes | default | *)
|
||||
have_gemini_db="yes"
|
||||
gemini_includes="-I../gemini/incl -I../gemini"
|
||||
gemini_libs="\
|
||||
../gemini/api/libapi.a\
|
||||
../gemini/db/libdb.a\
|
||||
../gemini/dbut/libdbut.a"
|
||||
AC_MSG_RESULT([Using Gemini DB])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(gemini_includes)
|
||||
AC_SUBST(gemini_libs)
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl END OF MYSQL_CHECK_GEMINI SECTION
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Got this from the GNU tar 1.13.11 distribution
|
||||
dnl by Paul Eggert <eggert@twinsun.com>
|
||||
|
|
34
configure.in
34
configure.in
|
@ -2075,9 +2075,9 @@ EOF
|
|||
AC_MSG_RESULT([default: $default_charset; compiled in: $CHARSETS])
|
||||
|
||||
|
||||
MYSQL_CHECK_ISAM
|
||||
MYSQL_CHECK_BDB
|
||||
MYSQL_CHECK_INNODB
|
||||
MYSQL_CHECK_GEMINI
|
||||
|
||||
# If we have threads generate some library functions and test programs
|
||||
sql_server_dirs=
|
||||
|
@ -2107,12 +2107,23 @@ then
|
|||
AC_SUBST(THREAD_LPROGRAMS)
|
||||
THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o"
|
||||
AC_SUBST(THREAD_LOBJECTS)
|
||||
sql_server_dirs="strings dbug mysys extra regex isam merge myisam myisammrg heap vio sql"
|
||||
server_scripts="mysqld_safe mysql_install_db"
|
||||
sql_server_dirs="strings dbug mysys extra regex"
|
||||
|
||||
|
||||
#
|
||||
# Configuration for optional table handlers
|
||||
#
|
||||
|
||||
if test X"$have_isam" != Xno
|
||||
then
|
||||
sql_server_dirs="$sql_server_dirs isam merge"
|
||||
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="$have_berkeley_db $sql_server_dirs"
|
||||
sql_server_dirs="$sql_server_dirs $have_berkeley_db"
|
||||
|
||||
echo "CONFIGURING FOR BERKELEY DB"
|
||||
bdb_conf_flags=
|
||||
|
@ -2179,7 +2190,7 @@ EOF
|
|||
|
||||
if test X"$have_innodb" = Xyes
|
||||
then
|
||||
sql_server_dirs="innobase $sql_server_dirs"
|
||||
sql_server_dirs="$sql_server_dirs innobase"
|
||||
echo "CONFIGURING FOR INNODB"
|
||||
if test ! -d "innobase"; then
|
||||
# This should only happen when doing a VPATH build
|
||||
|
@ -2196,17 +2207,10 @@ EOF
|
|||
|
||||
echo "END OF INNODB CONFIGURATION"
|
||||
fi
|
||||
|
||||
if test "X$have_gemini_db" = "Xyes"; then
|
||||
sql_server_dirs="gemini $sql_server_dirs"
|
||||
echo "CONFIGURING FOR GEMINI DB"
|
||||
(cd gemini && sh ./configure) \
|
||||
|| AC_MSG_ERROR([could not configure Gemini DB])
|
||||
|
||||
echo "END OF GEMINI DB CONFIGURATION"
|
||||
|
||||
AC_DEFINE(HAVE_GEMINI_DB)
|
||||
fi
|
||||
#
|
||||
# END of configuration for optional table handlers
|
||||
#
|
||||
sql_server_dirs="$sql_server_dirs myisam myisammrg heap vio sql"
|
||||
|
||||
if test "$with_posix_threads" = "no" -o "$with_mit_threads" = "yes"
|
||||
then
|
||||
|
|
|
@ -454,7 +454,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||
/* Some things that this system doesn't have */
|
||||
|
||||
#define ONLY_OWN_DATABASES /* We are using only databases by monty */
|
||||
#define HAVE_ISAM /* TO BE DELETED */
|
||||
#define NO_HASH /* Not needed anymore */
|
||||
#ifdef __WIN__
|
||||
#define NO_DIR_LIBRARY /* Not standar dir-library */
|
||||
|
|
|
@ -148,7 +148,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
|||
*****************************************************************************/
|
||||
|
||||
int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
|
||||
uint timeout)
|
||||
uint timeout)
|
||||
{
|
||||
#if defined(__WIN__) || defined(OS2)
|
||||
return connect(s, (struct sockaddr*) name, namelen);
|
||||
|
|
|
@ -59,6 +59,18 @@ EXTRA_DIST = lib_vio.c
|
|||
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
|
||||
libmysqld_a_SOURCES=
|
||||
|
||||
# Don't depend on things from mit-pthreads
|
||||
|
||||
OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\
|
||||
__math.h time.h __time.h unistd.h __unistd.h types.h \
|
||||
xtypes.h ac-types.h posix.h string.h __string.h \
|
||||
errno.h socket.h inet.h dirent.h netdb.h \
|
||||
cleanup.h cond.h debug_out.h fd.h kernel.h mutex.h \
|
||||
prio_queue.h pthread_attr.h pthread_once.h queue.h\
|
||||
sleep.h specific.h version.h pwd.h timers.h uio.h \
|
||||
cdefs.h machdep.h signal.h __signal.h util.h lex.h \
|
||||
wait.h
|
||||
|
||||
# automake misses these
|
||||
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ usage: $0 [-g|-h|-r] [test-name ...]
|
|||
EOF
|
||||
}
|
||||
|
||||
init_args=""
|
||||
init_args="--server-arg=--language=$top_builddir/sql/share/english"
|
||||
while test $# -gt 0
|
||||
do
|
||||
arg=
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
-- require r/have_gemini.require
|
||||
disable_query_log;
|
||||
show variables like "have_gemini";
|
||||
enable_query_log;
|
|
@ -195,7 +195,7 @@ then
|
|||
fi
|
||||
|
||||
mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \
|
||||
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb --skip-gemini $EXTRA_ARG"
|
||||
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $EXTRA_ARG"
|
||||
echo "running $mysqld_boot"
|
||||
|
||||
if $mysqld_boot << END_OF_DATA
|
||||
|
|
|
@ -1,370 +0,0 @@
|
|||
id code name
|
||||
1 1 Tim
|
||||
2 1 Monty
|
||||
3 2 David
|
||||
4 2 Erik
|
||||
5 3 Sasha
|
||||
6 3 Jeremy
|
||||
7 4 Matt
|
||||
id code name
|
||||
2 1 Monty
|
||||
3 2 David
|
||||
4 2 Erik
|
||||
5 3 Sasha
|
||||
6 3 Jeremy
|
||||
7 4 Matt
|
||||
8 1 Sinisa
|
||||
id code name
|
||||
3 2 David
|
||||
4 2 Erik
|
||||
5 3 Sasha
|
||||
6 3 Jeremy
|
||||
7 4 Matt
|
||||
8 1 Sinisa
|
||||
12 1 Ralph
|
||||
id parent_id level
|
||||
8 102 2
|
||||
9 102 2
|
||||
15 102 2
|
||||
id parent_id level
|
||||
1001 100 0
|
||||
1003 101 1
|
||||
1004 101 1
|
||||
1008 102 2
|
||||
1009 102 2
|
||||
1017 103 2
|
||||
1022 104 2
|
||||
1024 104 2
|
||||
1028 105 2
|
||||
1029 105 2
|
||||
1030 105 2
|
||||
1031 106 2
|
||||
1032 106 2
|
||||
1033 106 2
|
||||
1203 107 2
|
||||
1202 107 2
|
||||
1020 103 2
|
||||
1157 100 0
|
||||
1193 105 2
|
||||
1040 107 2
|
||||
1002 101 1
|
||||
1015 102 2
|
||||
1006 101 1
|
||||
1034 106 2
|
||||
1035 106 2
|
||||
1016 103 2
|
||||
1007 101 1
|
||||
1036 107 2
|
||||
1018 103 2
|
||||
1026 105 2
|
||||
1027 105 2
|
||||
1183 104 2
|
||||
1038 107 2
|
||||
1025 105 2
|
||||
1037 107 2
|
||||
1021 104 2
|
||||
1019 103 2
|
||||
1005 101 1
|
||||
1179 105 2
|
||||
id parent_id level
|
||||
1001 100 0
|
||||
1003 101 1
|
||||
1004 101 1
|
||||
1008 102 2
|
||||
1010 102 2
|
||||
1017 103 2
|
||||
1023 104 2
|
||||
1024 104 2
|
||||
1028 105 2
|
||||
1029 105 2
|
||||
1030 105 2
|
||||
1031 106 2
|
||||
1032 106 2
|
||||
1033 106 2
|
||||
1204 107 2
|
||||
1203 107 2
|
||||
1020 103 2
|
||||
1158 100 0
|
||||
1194 105 2
|
||||
1041 107 2
|
||||
1002 101 1
|
||||
1015 102 2
|
||||
1006 101 1
|
||||
1034 106 2
|
||||
1035 106 2
|
||||
1016 103 2
|
||||
1007 101 1
|
||||
1036 107 2
|
||||
1018 103 2
|
||||
1026 105 2
|
||||
1027 105 2
|
||||
1184 104 2
|
||||
1039 107 2
|
||||
1025 105 2
|
||||
1038 107 2
|
||||
1022 104 2
|
||||
1019 103 2
|
||||
1005 101 1
|
||||
1180 105 2
|
||||
id parent_id level
|
||||
1008 102 2
|
||||
1010 102 2
|
||||
1015 102 2
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ref level level 1 const 6 where used; Using index
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ref level level 1 const 6 where used
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ref level level 1 const 6 where used
|
||||
level id
|
||||
1 1003
|
||||
1 1004
|
||||
1 1002
|
||||
1 1006
|
||||
1 1007
|
||||
1 1005
|
||||
level id parent_id
|
||||
1 1003 101
|
||||
1 1004 101
|
||||
1 1002 101
|
||||
1 1006 101
|
||||
1 1007 101
|
||||
1 1005 101
|
||||
gesuchnr benutzer_id
|
||||
1 1
|
||||
2 1
|
||||
a
|
||||
2
|
||||
user_id name phone ref_email detail
|
||||
10292 sanjeev 29153373 sansh777@hotmail.com xxx
|
||||
10292 shirish 2333604 shirish@yahoo.com ddsds
|
||||
10292 sonali 323232 sonali@bolly.com filmstar
|
||||
user_id name phone ref_email detail
|
||||
10292 sanjeev 29153373 sansh777@hotmail.com xxx
|
||||
10292 shirish 2333604 shirish@yahoo.com ddsds
|
||||
10292 sonali 323232 sonali@bolly.com filmstar
|
||||
user_id name phone ref_email detail
|
||||
10292 sanjeev 29153373 sansh777@hotmail.com xxx
|
||||
10292 shirish 2333604 shirish@yahoo.com ddsds
|
||||
10292 sonali 323232 sonali@bolly.com filmstar
|
||||
10293 shirish 2333604 shirish@yahoo.com ddsds
|
||||
user_id name phone ref_email detail
|
||||
10293 shirish 2333604 shirish@yahoo.com ddsds
|
||||
user_id name phone ref_email detail
|
||||
10291 sanjeev 29153373 sansh777@hotmail.com xxx
|
||||
a b
|
||||
1 3
|
||||
2 3
|
||||
3 3
|
||||
a b
|
||||
1 3
|
||||
2 3
|
||||
3 3
|
||||
a b
|
||||
a b
|
||||
1 3
|
||||
2 3
|
||||
3 3
|
||||
a b
|
||||
1 3
|
||||
2 3
|
||||
3 3
|
||||
id ggid email passwd
|
||||
1 test1 xxx
|
||||
id ggid email passwd
|
||||
1 test1 xxx
|
||||
id ggid email passwd
|
||||
2 test2 yyy
|
||||
id parent_id level
|
||||
8 102 2
|
||||
9 102 2
|
||||
15 102 2
|
||||
id parent_id level
|
||||
1001 100 0
|
||||
1003 101 1
|
||||
1004 101 1
|
||||
1008 102 2
|
||||
1024 102 2
|
||||
1017 103 2
|
||||
1022 104 2
|
||||
1024 104 2
|
||||
1028 105 2
|
||||
1029 105 2
|
||||
1030 105 2
|
||||
1031 106 2
|
||||
1032 106 2
|
||||
1033 106 2
|
||||
1203 107 2
|
||||
1202 107 2
|
||||
1020 103 2
|
||||
1157 100 0
|
||||
1193 105 2
|
||||
1040 107 2
|
||||
1002 101 1
|
||||
1015 102 2
|
||||
1006 101 1
|
||||
1034 106 2
|
||||
1035 106 2
|
||||
1016 103 2
|
||||
1007 101 1
|
||||
1036 107 2
|
||||
1018 103 2
|
||||
1026 105 2
|
||||
1027 105 2
|
||||
1183 104 2
|
||||
1038 107 2
|
||||
1025 105 2
|
||||
1037 107 2
|
||||
1021 104 2
|
||||
1019 103 2
|
||||
1005 101 1
|
||||
1179 105 2
|
||||
id parent_id level
|
||||
1002 100 0
|
||||
1004 101 1
|
||||
1005 101 1
|
||||
1009 102 2
|
||||
1025 102 2
|
||||
1018 103 2
|
||||
1023 104 2
|
||||
1025 104 2
|
||||
1029 105 2
|
||||
1030 105 2
|
||||
1031 105 2
|
||||
1032 106 2
|
||||
1033 106 2
|
||||
1034 106 2
|
||||
1204 107 2
|
||||
1203 107 2
|
||||
1021 103 2
|
||||
1158 100 0
|
||||
1194 105 2
|
||||
1041 107 2
|
||||
1003 101 1
|
||||
1016 102 2
|
||||
1007 101 1
|
||||
1035 106 2
|
||||
1036 106 2
|
||||
1017 103 2
|
||||
1008 101 1
|
||||
1037 107 2
|
||||
1019 103 2
|
||||
1027 105 2
|
||||
1028 105 2
|
||||
1184 104 2
|
||||
1039 107 2
|
||||
1026 105 2
|
||||
1038 107 2
|
||||
1022 104 2
|
||||
1020 103 2
|
||||
1006 101 1
|
||||
1180 105 2
|
||||
id parent_id level
|
||||
1009 102 2
|
||||
1025 102 2
|
||||
1016 102 2
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ref level level 1 const 6 where used; Using index
|
||||
level id
|
||||
1 1004
|
||||
1 1005
|
||||
1 1003
|
||||
1 1007
|
||||
1 1008
|
||||
1 1006
|
||||
level id parent_id
|
||||
1 1004 101
|
||||
1 1005 101
|
||||
1 1003 101
|
||||
1 1007 101
|
||||
1 1008 101
|
||||
1 1006 101
|
||||
level id
|
||||
1 1003
|
||||
1 1004
|
||||
1 1005
|
||||
1 1006
|
||||
1 1007
|
||||
1 1008
|
||||
id parent_id level
|
||||
1002 100 0
|
||||
1009 102 2
|
||||
1025 102 2
|
||||
1018 103 2
|
||||
1023 104 2
|
||||
1025 104 2
|
||||
1029 105 2
|
||||
1030 105 2
|
||||
1031 105 2
|
||||
1032 106 2
|
||||
1033 106 2
|
||||
1034 106 2
|
||||
1204 107 2
|
||||
1203 107 2
|
||||
1021 103 2
|
||||
1158 100 0
|
||||
1194 105 2
|
||||
1041 107 2
|
||||
1016 102 2
|
||||
1035 106 2
|
||||
1036 106 2
|
||||
1017 103 2
|
||||
1037 107 2
|
||||
1019 103 2
|
||||
1027 105 2
|
||||
1028 105 2
|
||||
1184 104 2
|
||||
1039 107 2
|
||||
1026 105 2
|
||||
1038 107 2
|
||||
1022 104 2
|
||||
1020 103 2
|
||||
1180 105 2
|
||||
count(*)
|
||||
1
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
test for rollback
|
||||
test for rollback
|
||||
n after rollback
|
||||
4 after rollback
|
||||
n after commit
|
||||
4 after commit
|
||||
5 after commit
|
||||
n after commit
|
||||
4 after commit
|
||||
5 after commit
|
||||
6 after commit
|
||||
n
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
afterbegin_id afterbegin_nom
|
||||
1 first
|
||||
2 hamdouni
|
||||
afterrollback_id afterrollback_nom
|
||||
1 first
|
||||
afterautocommit0_id afterautocommit0_nom
|
||||
1 first
|
||||
3 mysql
|
||||
afterrollback_id afterrollback_nom
|
||||
1 first
|
||||
id val
|
||||
id val
|
||||
pippo 12
|
||||
id val
|
||||
ID NAME
|
||||
1 Jochen
|
||||
_userid
|
||||
marc@anyware.co.uk
|
||||
_userid
|
||||
marc@anyware.co.uk
|
||||
f1
|
||||
65
|
||||
379
|
||||
468
|
||||
469
|
||||
508
|
|
@ -1,2 +0,0 @@
|
|||
Variable_name Value
|
||||
have_gemini YES
|
|
@ -1,61 +0,0 @@
|
|||
f1
|
||||
test1
|
||||
bar
|
||||
f1
|
||||
test2
|
||||
bar
|
||||
f1
|
||||
test3
|
||||
bar
|
||||
f1
|
||||
f1
|
||||
test4
|
||||
bar
|
||||
f1
|
||||
test5
|
||||
bar
|
||||
f1
|
||||
test6
|
||||
bar
|
||||
f1
|
||||
test7
|
||||
bar
|
||||
f1
|
||||
test8
|
||||
bar
|
||||
f1
|
||||
test9
|
||||
bar
|
||||
f1
|
||||
test10
|
||||
bar
|
||||
f1
|
||||
test11
|
||||
bar
|
||||
f1
|
||||
test12
|
||||
bar
|
||||
f1
|
||||
test13
|
||||
bar
|
||||
f1
|
||||
test14
|
||||
bar
|
||||
f1
|
||||
test15
|
||||
bar
|
||||
f1
|
||||
test16
|
||||
bar
|
||||
f1
|
||||
test17
|
||||
bar
|
||||
f1
|
||||
test18
|
||||
bar
|
||||
f1
|
||||
test19
|
||||
bar
|
||||
f1
|
||||
test20
|
||||
bar
|
|
@ -1,5 +0,0 @@
|
|||
65,-1,1
|
||||
379,-1,1
|
||||
468,-1,1
|
||||
469,-1,1
|
||||
508,-1,1
|
|
@ -1,355 +0,0 @@
|
|||
-- source include/have_gemini.inc
|
||||
|
||||
#
|
||||
# Small basic test with ignore
|
||||
#
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=gemini;
|
||||
|
||||
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
|
||||
select id, code, name from t1 order by id;
|
||||
|
||||
update ignore t1 set id = 8, name = 'Sinisa' where id < 3;
|
||||
select id, code, name from t1 order by id;
|
||||
update ignore t1 set id = id + 10, name = 'Ralph' where id < 4;
|
||||
select id, code, name from t1 order by id;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# A bit bigger test
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
parent_id int(11) DEFAULT '0' NOT NULL,
|
||||
level tinyint(4) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY parent_id (parent_id),
|
||||
KEY level (level)
|
||||
) type=gemini;
|
||||
INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2);
|
||||
update t1 set parent_id=parent_id+100;
|
||||
select * from t1 where parent_id=102;
|
||||
update t1 set id=id+1000;
|
||||
!$1062 update t1 set id=1024 where id=1009;
|
||||
select * from t1;
|
||||
update ignore t1 set id=id+1; # This will change all rows
|
||||
select * from t1;
|
||||
update ignore t1 set id=1023 where id=1010;
|
||||
select * from t1 where parent_id=102;
|
||||
explain select level from t1 where level=1;
|
||||
explain select level,id from t1 where level=1;
|
||||
explain select level,id,parent_id from t1 where level=1;
|
||||
select level,id from t1 where level=1;
|
||||
select level,id,parent_id from t1 where level=1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test replace
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
gesuchnr int(11) DEFAULT '0' NOT NULL,
|
||||
benutzer_id int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (gesuchnr,benutzer_id)
|
||||
) type=gemini;
|
||||
|
||||
replace into t1 (gesuchnr,benutzer_id) values (2,1);
|
||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# test delete using hidden_primary_key
|
||||
#
|
||||
|
||||
create table t1 (a int) type=gemini;
|
||||
insert into t1 values (1), (2);
|
||||
delete from t1 where a = 1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test auto_increment on sub key
|
||||
#
|
||||
|
||||
#create table t1 (a char(10) not null, b int not null auto_increment, primary key(a,b)) type=gemini;
|
||||
#insert into t1 values ("a",1),("b",2),("a",2),("c",1);
|
||||
#insert into t1 values ("a",NULL),("b",NULL),("c",NULL),("e",NULL);
|
||||
#insert into t1 (a) values ("a"),("b"),("c"),("d");
|
||||
#insert into t1 (a) values ('k'),('d');
|
||||
#insert into t1 (a) values ("a");
|
||||
#insert into t1 values ("d",last_insert_id());
|
||||
#select * from t1;
|
||||
#drop table t1;
|
||||
|
||||
#
|
||||
# Test when reading on part of unique key
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
user_id int(10) DEFAULT '0' NOT NULL,
|
||||
name varchar(100),
|
||||
phone varchar(100),
|
||||
ref_email varchar(100) DEFAULT '' NOT NULL,
|
||||
detail varchar(200),
|
||||
PRIMARY KEY (user_id,ref_email)
|
||||
)type=gemini;
|
||||
|
||||
INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar');
|
||||
select * from t1 where user_id=10292;
|
||||
INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds');
|
||||
select * from t1 where user_id=10292;
|
||||
select * from t1 where user_id>=10292;
|
||||
select * from t1 where user_id>10292;
|
||||
select * from t1 where user_id<10292;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test that keys are created in right order
|
||||
# - Needs ANALYZE TABLE to work - MikeF 2/12/01
|
||||
#
|
||||
#CREATE TABLE t1 (a int not null, b int not null,c int not null,
|
||||
#key(a),primary key(a,b), unique(c),key(a),unique(b)) type = gemini;
|
||||
#show index from t1;
|
||||
#drop table t1;
|
||||
|
||||
#
|
||||
# Test of ALTER TABLE and gemini tables
|
||||
#
|
||||
|
||||
#create table t1 (col1 int not null, col2 char(4) not null, primary key(col1));
|
||||
#alter table t1 type=gemini;
|
||||
#insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4');
|
||||
#select * from t1;
|
||||
#update t1 set col2='7' where col1='4';
|
||||
#select * from t1;
|
||||
#alter table t1 add co3 int not null;
|
||||
#select * from t1;
|
||||
#update t1 set col2='9' where col1='2';
|
||||
#select * from t1;
|
||||
#drop table t1;
|
||||
|
||||
#
|
||||
# INSERT INTO gemini tables
|
||||
#
|
||||
|
||||
create table t1 (a int not null , b int, primary key (a)) type = gemini;
|
||||
create table t2 (a int not null , b int, primary key (a)) type = myisam;
|
||||
insert into t1 VALUES (1,3) , (2,3), (3,3);
|
||||
select * from t1;
|
||||
insert into t2 select * from t1;
|
||||
select * from t2;
|
||||
delete from t1 where b = 3;
|
||||
select * from t1;
|
||||
insert into t1 select * from t2;
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Search on unique key
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
ggid varchar(32) binary DEFAULT '' NOT NULL,
|
||||
email varchar(64) DEFAULT '' NOT NULL,
|
||||
passwd varchar(32) binary DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE ggid (ggid)
|
||||
) TYPE=gemini;
|
||||
|
||||
insert into t1 (ggid,passwd) values ('test1','xxx');
|
||||
insert into t1 (ggid,passwd) values ('test2','yyy');
|
||||
|
||||
select * from t1 where ggid='test1';
|
||||
select * from t1 where passwd='xxx';
|
||||
select * from t1 where id=2;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# ORDER BY on not primary key
|
||||
#
|
||||
|
||||
#CREATE TABLE t1 (
|
||||
# user_name varchar(12),
|
||||
#password text,
|
||||
#subscribed char(1),
|
||||
#user_id int(11) DEFAULT '0' NOT NULL,
|
||||
#quota bigint(20),
|
||||
#weight double,
|
||||
#access_date date,
|
||||
#access_time time,
|
||||
#approved datetime,
|
||||
#dummy_primary_key int(11) NOT NULL auto_increment,
|
||||
#PRIMARY KEY (dummy_primary_key)
|
||||
#) TYPE=gemini;
|
||||
#INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1);
|
||||
#INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2);
|
||||
#INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3);
|
||||
#INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4);
|
||||
#INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5);
|
||||
#select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name;
|
||||
#drop table t1;
|
||||
|
||||
#
|
||||
# Testing of tables without primary keys
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
parent_id int(11) DEFAULT '0' NOT NULL,
|
||||
level tinyint(4) DEFAULT '0' NOT NULL,
|
||||
KEY (id),
|
||||
KEY parent_id (parent_id),
|
||||
KEY level (level)
|
||||
) type=gemini;
|
||||
INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1);
|
||||
INSERT INTO t1 values (179,5,2);
|
||||
update t1 set parent_id=parent_id+100;
|
||||
select * from t1 where parent_id=102;
|
||||
update t1 set id=id+1000;
|
||||
update t1 set id=1024 where id=1009;
|
||||
select * from t1;
|
||||
update ignore t1 set id=id+1; # This will change all rows
|
||||
select * from t1;
|
||||
update ignore t1 set id=1023 where id=1010;
|
||||
select * from t1 where parent_id=102;
|
||||
explain select level from t1 where level=1;
|
||||
select level,id from t1 where level=1;
|
||||
select level,id,parent_id from t1 where level=1;
|
||||
select level,id from t1 where level=1 order by id;
|
||||
delete from t1 where level=1;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test of index only reads
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
sca_code char(6) NOT NULL,
|
||||
cat_code char(6) NOT NULL,
|
||||
sca_desc varchar(50),
|
||||
lan_code char(2) NOT NULL,
|
||||
sca_pic varchar(100),
|
||||
sca_sdesc varchar(50),
|
||||
sca_sch_desc varchar(16),
|
||||
PRIMARY KEY (sca_code, cat_code, lan_code)
|
||||
) type = gemini ;
|
||||
|
||||
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING');
|
||||
select count(*) from t1 where sca_code = 'PD';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test of opening table twice
|
||||
#
|
||||
CREATE TABLE t1 (a int not null, primary key (a)) type=gemini;
|
||||
insert into t1 values(1),(2),(3);
|
||||
select t1.a from t1 natural join t1 as t2 order by t1.a;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test rollback
|
||||
#
|
||||
|
||||
select "test for rollback";
|
||||
create table t1 (n int not null primary key) type=gemini;
|
||||
set autocommit=0;
|
||||
insert into t1 values (4);
|
||||
commit;
|
||||
insert into t1 values (5);
|
||||
rollback;
|
||||
select n, "after rollback" from t1;
|
||||
insert into t1 values (5);
|
||||
commit;
|
||||
select n, "after commit" from t1;
|
||||
commit;
|
||||
insert into t1 values (6);
|
||||
!$1062 insert into t1 values (4);
|
||||
commit;
|
||||
select n, "after commit" from t1;
|
||||
set autocommit=1;
|
||||
insert into t1 values (7);
|
||||
!$1062 insert into t1 values (4);
|
||||
select n from t1;
|
||||
# nop
|
||||
rollback;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Testing transactions
|
||||
#
|
||||
|
||||
create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) type=gemini;
|
||||
insert into t1 values(1,'first');
|
||||
begin;
|
||||
insert into t1 values(2,'hamdouni');
|
||||
select id as afterbegin_id,nom as afterbegin_nom from t1;
|
||||
rollback;
|
||||
select id as afterrollback_id,nom as afterrollback_nom from t1;
|
||||
set autocommit=0;
|
||||
insert into t1 values(3,'mysql');
|
||||
select id as afterautocommit0_id,nom as afterautocommit0_nom from t1;
|
||||
rollback;
|
||||
select id as afterrollback_id,nom as afterrollback_nom from t1;
|
||||
set autocommit=1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Simple not autocommit test
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (id char(8) not null primary key, val int not null) type=gemini;
|
||||
insert into t1 values ('pippo', 12);
|
||||
!$1062 insert into t1 values ('pippo', 12); # Gives error
|
||||
delete from t1;
|
||||
delete from t1 where id = 'pippo';
|
||||
select * from t1;
|
||||
|
||||
insert into t1 values ('pippo', 12);
|
||||
set autocommit=0;
|
||||
delete from t1;
|
||||
rollback;
|
||||
select * from t1;
|
||||
delete from t1;
|
||||
commit;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
||||
#
|
||||
# The following simple tests failed at some point
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) TYPE=gemini;
|
||||
INSERT INTO t1 VALUES (1, 'Jochen');
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) TYPE=gemini;
|
||||
set autocommit=0;
|
||||
INSERT INTO t1 SET _userid='marc@anyware.co.uk';
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk';
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
||||
#
|
||||
# Test of load data infile
|
||||
#
|
||||
|
||||
CREATE TABLE if not exists `t1` (
|
||||
`f1` int(11) unsigned NOT NULL default '0',
|
||||
`f2` tinyint(3) unsigned NOT NULL default '0',
|
||||
`f3` tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`f1`)
|
||||
) TYPE=Gemini;
|
||||
lock table t1 write;
|
||||
load data infile ''../../std_data/gemini.dat' ignore into table t1 fields terminated by ',';
|
||||
select f1 from t1;
|
||||
drop table t1;
|
|
@ -1,209 +0,0 @@
|
|||
source include/have_gemini.inc
|
||||
source include/master-slave.inc;
|
||||
connection master;
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set autocommit=0;
|
||||
|
||||
insert into t1 (f1) values ("test1"), ("bar");
|
||||
connection master1;
|
||||
!$1030 select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
insert into t1 (f1) values ("test2"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level serializable;
|
||||
--error 1218
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
insert into t1 (f1) values ("test3"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read uncommitted;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
connection master1;
|
||||
set transaction isolation level read committed;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
insert into t1 (f1) values ("test4"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level repeatable read;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level serializable;
|
||||
insert into t1 (f1) values ("test5"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level serializable;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level serializable;
|
||||
insert into t1 (f1) values ("test6"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read uncommitted;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level serializable;
|
||||
insert into t1 (f1) values ("test7"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read committed;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level serializable;
|
||||
insert into t1 (f1) values ("test8"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level repeatable read;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read uncommitted;
|
||||
insert into t1 (f1) values ("test9"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level serializable;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read uncommitted;
|
||||
insert into t1 (f1) values ("test10"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read uncommitted;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read uncommitted;
|
||||
insert into t1 (f1) values ("test11"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read committed;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read uncommitted;
|
||||
insert into t1 (f1) values ("test12"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level repeatable read;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read committed;
|
||||
insert into t1 (f1) values ("test13"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level serializable;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read committed;
|
||||
insert into t1 (f1) values ("test14"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read uncommitted;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read committed;
|
||||
insert into t1 (f1) values ("test15"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read committed;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level read committed;
|
||||
insert into t1 (f1) values ("test16"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level repeatable read;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level repeatable read;
|
||||
insert into t1 (f1) values ("test17"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level serializable;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level repeatable read;
|
||||
insert into t1 (f1) values ("test18"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read uncommitted;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level repeatable read;
|
||||
insert into t1 (f1) values ("test19"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level read committed;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
|
||||
drop table if exists t1;
|
||||
create table t1 (f1 char(20) not null) type = gemini;
|
||||
set transaction isolation level repeatable read;
|
||||
insert into t1 (f1) values ("test20"), ("bar");
|
||||
connection master1;
|
||||
set transaction isolation level repeatable read;
|
||||
select * from t1;
|
||||
connection master;
|
||||
commit;
|
||||
drop table t1;
|
|
@ -294,7 +294,7 @@ fi
|
|||
|
||||
echo "Installing all prepared tables"
|
||||
if eval "$execdir/mysqld $defaults --bootstrap --skip-grant-tables \
|
||||
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-gemini --skip-bdb $args" << END_OF_DATA
|
||||
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" << END_OF_DATA
|
||||
use mysql;
|
||||
$c_d
|
||||
$i_d
|
||||
|
|
|
@ -21,7 +21,7 @@ MYSQLDATAdir = $(localstatedir)
|
|||
MYSQLSHAREdir = $(pkgdatadir)
|
||||
MYSQLBASEdir= $(prefix)
|
||||
INCLUDES = @MT_INCLUDES@ \
|
||||
@bdb_includes@ @innodb_includes@ @gemini_includes@ \
|
||||
@bdb_includes@ @innodb_includes@ \
|
||||
-I$(srcdir)/../include \
|
||||
-I$(srcdir)/../regex \
|
||||
-I$(srcdir) -I../include -I. $(openssl_includes)
|
||||
|
@ -30,8 +30,7 @@ SUBDIRS = share
|
|||
libexec_PROGRAMS = mysqld
|
||||
noinst_PROGRAMS = gen_lex_hash
|
||||
gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@
|
||||
LDADD = ../isam/libnisam.a \
|
||||
../merge/libmerge.a \
|
||||
LDADD = @isam_libs@ \
|
||||
../myisam/libmyisam.a \
|
||||
../myisammrg/libmyisammrg.a \
|
||||
../heap/libheap.a \
|
||||
|
@ -43,7 +42,7 @@ LDADD = ../isam/libnisam.a \
|
|||
|
||||
mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
|
||||
@bdb_libs@ @innodb_libs@ @pstack_libs@ \
|
||||
@gemini_libs@ @innodb_system_libs@ \
|
||||
@innodb_system_libs@ \
|
||||
$(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ @openssl_libs@
|
||||
noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
|
||||
item_strfunc.h item_timefunc.h item_uniq.h \
|
||||
|
@ -53,7 +52,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
|
|||
field.h handler.h \
|
||||
ha_isammrg.h ha_isam.h ha_myisammrg.h\
|
||||
ha_heap.h ha_myisam.h ha_berkeley.h ha_innobase.h \
|
||||
ha_gemini.h opt_range.h opt_ft.h \
|
||||
opt_range.h opt_ft.h \
|
||||
sql_select.h structs.h table.h sql_udf.h hash_filo.h\
|
||||
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
|
||||
log_event.h mini_client.h sql_repl.h slave.h \
|
||||
|
@ -75,7 +74,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
|
|||
time.cc opt_range.cc opt_sum.cc opt_ft.cc \
|
||||
records.cc filesort.cc handler.cc \
|
||||
ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
|
||||
ha_berkeley.cc ha_innobase.cc ha_gemini.cc \
|
||||
ha_berkeley.cc ha_innobase.cc \
|
||||
ha_isam.cc ha_isammrg.cc \
|
||||
sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
|
||||
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
|
||||
|
|
54
sql/field.cc
54
sql/field.cc
|
@ -4086,60 +4086,6 @@ const char *Field_blob::unpack(char *to, const char *from)
|
|||
return from+length;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
/* Blobs in Gemini tables are stored separately from the rows which contain
|
||||
** them (except for tiny blobs, which are stored in the row). For all other
|
||||
** blob types (blob, mediumblob, longblob), the row contains the length of
|
||||
** the blob data and a blob id. These methods (pack_id, get_id, and
|
||||
** unpack_id) handle packing and unpacking blob fields in Gemini rows.
|
||||
*/
|
||||
char *Field_blob::pack_id(char *to, const char *from, ulonglong id, uint max_length)
|
||||
{
|
||||
char *save=ptr;
|
||||
ptr=(char*) from;
|
||||
ulong length=get_length(); // Length of from string
|
||||
if (length > max_length)
|
||||
{
|
||||
ptr=to;
|
||||
length=max_length;
|
||||
store_length(length); // Store max length
|
||||
ptr=(char*) from;
|
||||
}
|
||||
else
|
||||
memcpy(to,from,packlength); // Copy length
|
||||
if (length)
|
||||
{
|
||||
int8store(to+packlength, id);
|
||||
}
|
||||
ptr=save; // Restore org row pointer
|
||||
return to+packlength+sizeof(id);
|
||||
}
|
||||
|
||||
|
||||
ulonglong Field_blob::get_id(const char *from)
|
||||
{
|
||||
ulonglong id = 0;
|
||||
ulong length=get_length(from);
|
||||
if (length)
|
||||
id=uint8korr(from+packlength);
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
const char *Field_blob::unpack_id(char *to, const char *from, const char *bdata)
|
||||
{
|
||||
memcpy(to,from,packlength);
|
||||
ulong length=get_length(from);
|
||||
from+=packlength;
|
||||
if (length)
|
||||
memcpy_fixed(to+packlength, &bdata, sizeof(bdata));
|
||||
else
|
||||
bzero(to+packlength,sizeof(bdata));
|
||||
return from+sizeof(ulonglong);
|
||||
}
|
||||
#endif /* HAVE_GEMINI_DB */
|
||||
|
||||
/* Keys for blobs are like keys on varchars */
|
||||
|
||||
int Field_blob::pack_cmp(const char *a, const char *b, uint key_length)
|
||||
|
|
15
sql/field.h
15
sql/field.h
|
@ -883,21 +883,6 @@ public:
|
|||
}
|
||||
char *pack(char *to, const char *from, uint max_length= ~(uint) 0);
|
||||
const char *unpack(char *to, const char *from);
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
char *pack_id(char *to, const char *from, ulonglong id,
|
||||
uint max_length= ~(uint) 0);
|
||||
ulonglong get_id(const char *from);
|
||||
const char *unpack_id(char *to, const char *from, const char *bdata);
|
||||
inline void get_ptr_from_key_image(char **str,char *key_str)
|
||||
{
|
||||
*str = key_str + sizeof(uint16);
|
||||
}
|
||||
inline uint get_length_from_key_image(char *key_str)
|
||||
{
|
||||
return uint2korr(key_str);
|
||||
}
|
||||
enum_field_types blobtype() { return (packlength == 1 ? FIELD_TYPE_TINY_BLOB : FIELD_TYPE_BLOB);}
|
||||
#endif
|
||||
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);
|
||||
int pack_cmp(const char *a, const char *b, uint key_length);
|
||||
|
|
3630
sql/ha_gemini.cc
3630
sql/ha_gemini.cc
File diff suppressed because it is too large
Load diff
208
sql/ha_gemini.h
208
sql/ha_gemini.h
|
@ -1,208 +0,0 @@
|
|||
/* Copyright (C) 2000 MySQL AB & NuSphere Corporation
|
||||
|
||||
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 */
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma interface /* gcc class implementation */
|
||||
#endif
|
||||
|
||||
#include "gem_my_global.h"
|
||||
#include "dstd.h"
|
||||
#include "dsmpub.h"
|
||||
|
||||
/* class for the the gemini handler */
|
||||
|
||||
enum enum_key_string_options{KEY_CREATE,KEY_DELETE,KEY_CHECK};
|
||||
typedef struct st_gemini_share {
|
||||
ha_rows *rec_per_key;
|
||||
THR_LOCK lock;
|
||||
pthread_mutex_t mutex;
|
||||
char *table_name;
|
||||
uint table_name_length,use_count;
|
||||
} GEM_SHARE;
|
||||
|
||||
typedef struct gemBlobDesc
|
||||
{
|
||||
dsmBlobId_t blobId;
|
||||
dsmBuffer_t *pBlob;
|
||||
} gemBlobDesc_t;
|
||||
|
||||
class ha_gemini: public handler
|
||||
{
|
||||
/* define file as an int for now until we have a real file struct */
|
||||
int file;
|
||||
uint int_option_flag;
|
||||
int tableNumber;
|
||||
dsmIndex_t *pindexNumbers; // dsm object numbers for the indexes on this table
|
||||
dsmRecid_t lastRowid;
|
||||
uint last_dup_key;
|
||||
bool fixed_length_row, key_read, using_ignore;
|
||||
byte *rec_buff;
|
||||
dsmKey_t *pbracketBase;
|
||||
dsmKey_t *pbracketLimit;
|
||||
dsmKey_t *pfoundKey;
|
||||
dsmMask_t tableStatus; // Crashed/repair status
|
||||
gemBlobDesc_t *pBlobDescs;
|
||||
|
||||
int index_open(char *tableName);
|
||||
int pack_row(byte **prow, int *ppackedLength, const byte *record,
|
||||
bool update);
|
||||
int unpack_row(char *record, char *prow);
|
||||
int findRow(THD *thd, dsmMask_t findMode, byte *buf);
|
||||
int fetch_row(void *gemini_context, const byte *buf);
|
||||
int handleIndexEntries(const byte * record, dsmRecid_t recid,
|
||||
enum_key_string_options option);
|
||||
|
||||
int handleIndexEntry(const byte * record, dsmRecid_t recid,
|
||||
enum_key_string_options option,uint keynr);
|
||||
|
||||
int createKeyString(const byte * record, KEY *pkeyinfo,
|
||||
unsigned char *pkeyBuf, int bufSize,
|
||||
int *pkeyStringLen, short geminiIndexNumber,
|
||||
bool *thereIsAnull);
|
||||
int fullCheck(THD *thd,byte *buf);
|
||||
|
||||
int pack_key( uint keynr, dsmKey_t *pkey,
|
||||
const byte *key_ptr, uint key_length);
|
||||
|
||||
void unpack_key(char *record, dsmKey_t *key, uint index);
|
||||
|
||||
int key_cmp(uint keynr, const byte * old_row,
|
||||
const byte * new_row, bool updateStats);
|
||||
|
||||
int saveKeyStats(THD *thd);
|
||||
void get_index_stats(THD *thd);
|
||||
|
||||
short cursorId; /* cursorId of active index cursor if any */
|
||||
dsmMask_t lockMode; /* Shared or exclusive */
|
||||
|
||||
/* FIXFIX Don't know why we need this because I don't know what
|
||||
store_lock method does but we core dump without this */
|
||||
THR_LOCK_DATA lock;
|
||||
GEM_SHARE *share;
|
||||
|
||||
public:
|
||||
ha_gemini(TABLE *table): handler(table), file(0),
|
||||
int_option_flag(HA_READ_NEXT | HA_READ_PREV |
|
||||
HA_REC_NOT_IN_SEQ |
|
||||
HA_KEYPOS_TO_RNDPOS | HA_READ_ORDER | HA_LASTKEY_ORDER |
|
||||
HA_LONGLONG_KEYS | HA_NULL_KEY | HA_HAVE_KEY_READ_ONLY |
|
||||
HA_BLOB_KEY |
|
||||
HA_NO_TEMP_TABLES | HA_NO_FULLTEXT_KEY |
|
||||
/*HA_NOT_EXACT_COUNT | */
|
||||
/*HA_KEY_READ_WRONG_STR |*/ HA_DROP_BEFORE_CREATE),
|
||||
pbracketBase(0),pbracketLimit(0),pfoundKey(0),
|
||||
cursorId(0)
|
||||
{
|
||||
}
|
||||
~ha_gemini() {}
|
||||
const char *table_type() const { return "Gemini"; }
|
||||
const char **bas_ext() const;
|
||||
ulong option_flag() const { return int_option_flag; }
|
||||
uint max_record_length() const { return MAXRECSZ; }
|
||||
uint max_keys() const { return MAX_KEY-1; }
|
||||
uint max_key_parts() const { return MAX_REF_PARTS; }
|
||||
uint max_key_length() const { return MAXKEYSZ / 2; }
|
||||
bool fast_key_read() { return 1;}
|
||||
bool has_transactions() { return 1;}
|
||||
|
||||
int open(const char *name, int mode, uint test_if_locked);
|
||||
int close(void);
|
||||
double scan_time();
|
||||
int write_row(byte * buf);
|
||||
int update_row(const byte * old_data, byte * new_data);
|
||||
int delete_row(const byte * buf);
|
||||
int index_init(uint index);
|
||||
int index_end();
|
||||
int index_read(byte * buf, const byte * key,
|
||||
uint key_len, enum ha_rkey_function find_flag);
|
||||
int index_read_idx(byte * buf, uint index, const byte * key,
|
||||
uint key_len, enum ha_rkey_function find_flag);
|
||||
int index_next(byte * buf);
|
||||
int index_next_same(byte * buf, const byte *key, uint keylen);
|
||||
int index_prev(byte * buf);
|
||||
int index_first(byte * buf);
|
||||
int index_last(byte * buf);
|
||||
int rnd_init(bool scan=1);
|
||||
int rnd_end();
|
||||
int rnd_next(byte *buf);
|
||||
int rnd_pos(byte * buf, byte *pos);
|
||||
void position(const byte *record);
|
||||
void info(uint);
|
||||
int extra(enum ha_extra_function operation);
|
||||
int reset(void);
|
||||
int analyze(THD* thd, HA_CHECK_OPT* check_opt);
|
||||
int check(THD* thd, HA_CHECK_OPT* check_opt);
|
||||
int repair(THD* thd, HA_CHECK_OPT* check_opt);
|
||||
int restore(THD* thd, HA_CHECK_OPT* check_opt);
|
||||
int backup(THD* thd, HA_CHECK_OPT* check_opt);
|
||||
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
|
||||
int external_lock(THD *thd, int lock_type);
|
||||
virtual longlong get_auto_increment();
|
||||
void position(byte *record);
|
||||
ha_rows records_in_range(int inx,
|
||||
const byte *start_key,uint start_key_len,
|
||||
enum ha_rkey_function start_search_flag,
|
||||
const byte *end_key,uint end_key_len,
|
||||
enum ha_rkey_function end_search_flag);
|
||||
void update_create_info(HA_CREATE_INFO *create_info);
|
||||
int create(const char *name, register TABLE *form,
|
||||
HA_CREATE_INFO *create_info);
|
||||
int delete_table(const char *name);
|
||||
int rename_table(const char* from, const char* to);
|
||||
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
||||
enum thr_lock_type lock_type);
|
||||
};
|
||||
|
||||
#define GEMOPT_FLUSH_LOG 0x00000001
|
||||
#define GEMOPT_UNBUFFERED_IO 0x00000002
|
||||
|
||||
#define GEMINI_RECOVERY_FULL 0x00000001
|
||||
#define GEMINI_RECOVERY_NONE 0x00000002
|
||||
#define GEMINI_RECOVERY_FORCE 0x00000004
|
||||
|
||||
#define GEM_OPTID_SPIN_RETRIES 1
|
||||
|
||||
extern bool gemini_skip;
|
||||
extern SHOW_COMP_OPTION have_gemini;
|
||||
extern long gemini_options;
|
||||
extern long gemini_buffer_cache;
|
||||
extern long gemini_io_threads;
|
||||
extern long gemini_log_cluster_size;
|
||||
extern long gemini_locktablesize;
|
||||
extern long gemini_lock_wait_timeout;
|
||||
extern long gemini_spin_retries;
|
||||
extern long gemini_connection_limit;
|
||||
extern char *gemini_basedir;
|
||||
extern TYPELIB gemini_recovery_typelib;
|
||||
extern ulong gemini_recovery_options;
|
||||
|
||||
bool gemini_init(void);
|
||||
bool gemini_end(void);
|
||||
bool gemini_flush_logs(void);
|
||||
int gemini_commit(THD *thd);
|
||||
int gemini_rollback(THD *thd);
|
||||
int gemini_recovery_logging(THD *thd, bool on);
|
||||
void gemini_disconnect(THD *thd);
|
||||
int gemini_rollback_to_savepoint(THD *thd);
|
||||
int gemini_parse_table_name(const char *fullname, char *dbname, char *tabname);
|
||||
int gemini_is_vst(const char *pname);
|
||||
int gemini_set_option_long(int optid, long optval);
|
||||
|
||||
const int gemini_blocksize = BLKSIZE;
|
||||
const int gemini_recbits = DEFAULT_RECBITS;
|
||||
|
||||
extern "C" void uttrace(void);
|
|
@ -35,9 +35,6 @@
|
|||
#ifdef HAVE_INNOBASE_DB
|
||||
#include "ha_innobase.h"
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
#include "ha_gemini.h"
|
||||
#endif
|
||||
#include <myisampack.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -81,10 +78,6 @@ enum db_type ha_checktype(enum db_type database_type)
|
|||
case DB_TYPE_INNODB:
|
||||
return(innodb_skip ? DB_TYPE_MYISAM : database_type);
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
case DB_TYPE_GEMINI:
|
||||
return(gemini_skip ? DB_TYPE_MYISAM : database_type);
|
||||
#endif
|
||||
#ifndef NO_HASH
|
||||
case DB_TYPE_HASH:
|
||||
#endif
|
||||
|
@ -122,10 +115,6 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
|
|||
#ifdef HAVE_INNOBASE_DB
|
||||
case DB_TYPE_INNODB:
|
||||
return new ha_innobase(table);
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
case DB_TYPE_GEMINI:
|
||||
return new ha_gemini(table);
|
||||
#endif
|
||||
case DB_TYPE_HEAP:
|
||||
return new ha_heap(table);
|
||||
|
@ -161,17 +150,6 @@ int ha_init()
|
|||
else
|
||||
have_innodb=SHOW_OPTION_DISABLED;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
if (!gemini_skip)
|
||||
{
|
||||
if (gemini_init())
|
||||
return -1;
|
||||
if (!gemini_skip) // If we couldn't use handler
|
||||
opt_using_transactions=1;
|
||||
else
|
||||
have_gemini=SHOW_OPTION_DISABLED;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -199,10 +177,6 @@ int ha_panic(enum ha_panic_function flag)
|
|||
#ifdef HAVE_INNOBASE_DB
|
||||
if (!innodb_skip)
|
||||
error|=innobase_end();
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
if (!gemini_skip)
|
||||
error|=gemini_end();
|
||||
#endif
|
||||
return error;
|
||||
} /* ha_panic */
|
||||
|
@ -214,12 +188,6 @@ void ha_close_connection(THD* thd)
|
|||
if (!innodb_skip)
|
||||
innobase_close_connection(thd);
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
if (!gemini_skip && thd->gemini.context)
|
||||
{
|
||||
gemini_disconnect(thd);
|
||||
}
|
||||
#endif /* HAVE_GEMINI_DB */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -284,20 +252,6 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
|
|||
}
|
||||
trans->innodb_active_trans=0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
/* Commit the transaction in behalf of the commit statement
|
||||
or if we're in auto-commit mode */
|
||||
if((trans == &thd->transaction.all) ||
|
||||
(!(thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))))
|
||||
{
|
||||
error=gemini_commit(thd);
|
||||
if (error)
|
||||
{
|
||||
my_error(ER_ERROR_DURING_COMMIT, MYF(0), error);
|
||||
error=1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
|
||||
sql_print_error("Error: Got error during commit; Binlog is not up to date!");
|
||||
|
@ -336,18 +290,6 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
|
|||
}
|
||||
trans->innodb_active_trans=0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
if((trans == &thd->transaction.stmt) &&
|
||||
(thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN)))
|
||||
error = gemini_rollback_to_savepoint(thd);
|
||||
else
|
||||
error=gemini_rollback(thd);
|
||||
if (error)
|
||||
{
|
||||
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error);
|
||||
error=1;
|
||||
}
|
||||
#endif
|
||||
if (trans == &thd->transaction.all)
|
||||
reinit_io_cache(&thd->transaction.trans_log,
|
||||
|
@ -359,17 +301,6 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
|
|||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
void ha_set_spin_retries(uint retries)
|
||||
{
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
if (!gemini_skip)
|
||||
{
|
||||
gemini_set_option_long(GEM_OPTID_SPIN_RETRIES, retries);
|
||||
}
|
||||
#endif /* HAVE_GEMINI_DB */
|
||||
}
|
||||
|
||||
|
||||
bool ha_flush_logs()
|
||||
{
|
||||
bool result=0;
|
||||
|
@ -751,22 +682,6 @@ int handler::rename_table(const char * from, const char * to)
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
int ha_commit_rename(THD *thd)
|
||||
{
|
||||
int error=0;
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
/* Gemini needs to commit the rename; otherwise a rollback will change
|
||||
** the table names back internally but the physical files will still
|
||||
** have the new names.
|
||||
*/
|
||||
if (ha_commit_stmt(thd))
|
||||
error= -1;
|
||||
if (ha_commit(thd))
|
||||
error= -1;
|
||||
#endif
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Tell the handler to turn on or off logging to the handler's
|
||||
recovery log
|
||||
*/
|
||||
|
@ -775,14 +690,6 @@ int ha_recovery_logging(THD *thd, bool on)
|
|||
int error=0;
|
||||
|
||||
DBUG_ENTER("ha_recovery_logging");
|
||||
#ifdef USING_TRANSACTIONS
|
||||
if (opt_using_transactions)
|
||||
{
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
error = gemini_recovery_logging(thd, on);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#define NO_HASH /* Not yet implemented */
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMINI_DB)
|
||||
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB)
|
||||
#define USING_TRANSACTIONS
|
||||
#endif
|
||||
|
||||
|
@ -134,7 +134,6 @@ enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
|
|||
typedef struct st_thd_trans {
|
||||
void *bdb_tid;
|
||||
void *innobase_tid;
|
||||
void *gemini_tid;
|
||||
bool innodb_active_trans;
|
||||
} THD_TRANS;
|
||||
|
||||
|
@ -325,17 +324,6 @@ public:
|
|||
enum thr_lock_type lock_type)=0;
|
||||
};
|
||||
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
struct st_gemini
|
||||
{
|
||||
void *context;
|
||||
unsigned long savepoint;
|
||||
bool needSavepoint;
|
||||
uint tx_isolation;
|
||||
uint lock_count;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Some extern variables used with handlers */
|
||||
|
||||
extern const char *ha_row_type[];
|
||||
|
@ -366,5 +354,4 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans);
|
|||
int ha_autocommit_or_rollback(THD *thd, int error);
|
||||
void ha_set_spin_retries(uint retries);
|
||||
bool ha_flush_logs(void);
|
||||
int ha_commit_rename(THD *thd);
|
||||
int ha_recovery_logging(THD *thd, bool on);
|
||||
|
|
|
@ -154,8 +154,6 @@ static SYMBOL symbols[] = {
|
|||
{ "FULL", SYM(FULL),0,0},
|
||||
{ "FULLTEXT", SYM(FULLTEXT_SYM),0,0},
|
||||
{ "FUNCTION", SYM(UDF_SYM),0,0},
|
||||
{ "GEMINI", SYM(GEMINI_SYM),0,0},
|
||||
{ "GEMINI_SPIN_RETRIES", SYM(GEMINI_SPIN_RETRIES),0,0},
|
||||
{ "GLOBAL", SYM(GLOBAL_SYM),0,0},
|
||||
{ "GRANT", SYM(GRANT),0,0},
|
||||
{ "GRANTS", SYM(GRANTS),0,0},
|
||||
|
|
144
sql/mysqld.cc
144
sql/mysqld.cc
|
@ -28,9 +28,6 @@
|
|||
#ifdef HAVE_INNOBASE_DB
|
||||
#include "ha_innobase.h"
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
#include "ha_gemini.h"
|
||||
#endif
|
||||
#include "ha_myisam.h"
|
||||
#include <nisam.h>
|
||||
#include <thr_alarm.h>
|
||||
|
@ -183,11 +180,6 @@ SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_YES;
|
|||
#else
|
||||
SHOW_COMP_OPTION have_berkeley_db=SHOW_OPTION_NO;
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
SHOW_COMP_OPTION have_gemini=SHOW_OPTION_YES;
|
||||
#else
|
||||
SHOW_COMP_OPTION have_gemini=SHOW_OPTION_NO;
|
||||
#endif
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
SHOW_COMP_OPTION have_innodb=SHOW_OPTION_YES;
|
||||
#else
|
||||
|
@ -334,9 +326,6 @@ enum_tx_isolation default_tx_isolation=ISO_READ_COMMITTED;
|
|||
|
||||
uint rpl_recovery_rank=0;
|
||||
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
const char *gemini_recovery_options_str="FULL";
|
||||
#endif
|
||||
my_string mysql_unix_port=NULL, mysql_tmpdir=NULL, allocated_mysql_tmpdir=NULL;
|
||||
ulong my_bind_addr; /* the address we bind to */
|
||||
DATE_FORMAT dayord;
|
||||
|
@ -1240,9 +1229,6 @@ the thread stack. Please read http://www.mysql.com/doc/L/i/Linux.html\n\n",
|
|||
#ifdef HAVE_STACKTRACE
|
||||
if(!(test_flags & TEST_NO_STACKTRACE))
|
||||
{
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
utrace();
|
||||
#endif
|
||||
print_stacktrace(thd ? (gptr) thd->thread_stack : (gptr) 0,
|
||||
thread_stack);
|
||||
}
|
||||
|
@ -2600,10 +2586,8 @@ enum options {
|
|||
OPT_INNODB_FLUSH_LOG_AT_TRX_COMMIT,
|
||||
OPT_INNODB_FLUSH_METHOD,
|
||||
OPT_SAFE_SHOW_DB,
|
||||
OPT_GEMINI_SKIP, OPT_INNODB_SKIP,
|
||||
OPT_INNODB_SKIP, OPT_SKIP_SAFEMALLOC,
|
||||
OPT_TEMP_POOL, OPT_TX_ISOLATION,
|
||||
OPT_GEMINI_FLUSH_LOG, OPT_GEMINI_RECOVER,
|
||||
OPT_GEMINI_UNBUFFERED_IO, OPT_SKIP_SAFEMALLOC,
|
||||
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
|
||||
OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL,
|
||||
OPT_SAFE_USER_CREATE, OPT_SQL_MODE,
|
||||
|
@ -2647,11 +2631,6 @@ static struct option long_options[] = {
|
|||
{"enable-pstack", no_argument, 0, (int) OPT_DO_PSTACK},
|
||||
{"exit-info", optional_argument, 0, 'T'},
|
||||
{"flush", no_argument, 0, (int) OPT_FLUSH},
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
{"gemini-flush-log-at-commit",no_argument, 0, (int) OPT_GEMINI_FLUSH_LOG},
|
||||
{"gemini-recovery", required_argument, 0, (int) OPT_GEMINI_RECOVER},
|
||||
{"gemini-unbuffered-io", no_argument, 0, (int) OPT_GEMINI_UNBUFFERED_IO},
|
||||
#endif
|
||||
/* We must always support this option to make scripts like mysqltest easier
|
||||
to do */
|
||||
{"innodb_data_file_path", required_argument, 0,
|
||||
|
@ -2746,7 +2725,6 @@ static struct option long_options[] = {
|
|||
(int) OPT_SHOW_SLAVE_AUTH_INFO},
|
||||
{"skip-bdb", no_argument, 0, (int) OPT_BDB_SKIP},
|
||||
{"skip-innodb", no_argument, 0, (int) OPT_INNODB_SKIP},
|
||||
{"skip-gemini", no_argument, 0, (int) OPT_GEMINI_SKIP},
|
||||
{"skip-concurrent-insert", no_argument, 0, (int) OPT_SKIP_CONCURRENT_INSERT},
|
||||
{"skip-delay-key-write", no_argument, 0, (int) OPT_SKIP_DELAY_KEY_WRITE},
|
||||
{"skip-grant-tables", no_argument, 0, (int) OPT_SKIP_GRANT},
|
||||
|
@ -2814,22 +2792,6 @@ CHANGEABLE_VAR changeable_vars[] = {
|
|||
HA_FT_MAXLEN, 10, HA_FT_MAXLEN, 0, 1 },
|
||||
{ "ft_max_word_len_for_sort",(long*) &ft_max_word_len_for_sort,
|
||||
20, 4, HA_FT_MAXLEN, 0, 1 },
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
{ "gemini_buffer_cache", (long*) &gemini_buffer_cache,
|
||||
128 * 8192, 16, LONG_MAX, 0, 1 },
|
||||
{ "gemini_connection_limit", (long*) &gemini_connection_limit,
|
||||
100, 10, LONG_MAX, 0, 1 },
|
||||
{ "gemini_io_threads", (long*) &gemini_io_threads,
|
||||
2, 0, 256, 0, 1 },
|
||||
{ "gemini_log_cluster_size", (long*) &gemini_log_cluster_size,
|
||||
256 * 1024, 16 * 1024, LONG_MAX, 0, 1 },
|
||||
{ "gemini_lock_table_size", (long*) &gemini_locktablesize,
|
||||
4096, 1024, LONG_MAX, 0, 1 },
|
||||
{ "gemini_lock_wait_timeout",(long*) &gemini_lock_wait_timeout,
|
||||
10, 1, LONG_MAX, 0, 1 },
|
||||
{ "gemini_spin_retries", (long*) &gemini_spin_retries,
|
||||
1, 0, LONG_MAX, 0, 1 },
|
||||
#endif
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
{"innodb_mirrored_log_groups",
|
||||
(long*) &innobase_mirrored_log_groups, 1, 1, 10, 0, 1},
|
||||
|
@ -2965,18 +2927,7 @@ struct show_var_st init_vars[]= {
|
|||
{"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG},
|
||||
{"ft_max_word_len", (char*) &ft_max_word_len, SHOW_LONG},
|
||||
{"ft_max_word_len_for_sort",(char*) &ft_max_word_len_for_sort, SHOW_LONG},
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
{"gemini_buffer_cache", (char*) &gemini_buffer_cache, SHOW_LONG},
|
||||
{"gemini_connection_limit", (char*) &gemini_connection_limit, SHOW_LONG},
|
||||
{"gemini_io_threads", (char*) &gemini_io_threads, SHOW_LONG},
|
||||
{"gemini_log_cluster_size", (char*) &gemini_log_cluster_size, SHOW_LONG},
|
||||
{"gemini_lock_table_size", (char*) &gemini_locktablesize, SHOW_LONG},
|
||||
{"gemini_lock_wait_timeout",(char*) &gemini_lock_wait_timeout, SHOW_LONG},
|
||||
{"gemini_recovery_options", (char*) &gemini_recovery_options_str, SHOW_CHAR_PTR},
|
||||
{"gemini_spin_retries", (char*) &gemini_spin_retries, SHOW_LONG},
|
||||
#endif
|
||||
{"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
|
||||
{"have_gemini", (char*) &have_gemini, SHOW_HAVE},
|
||||
{"have_innodb", (char*) &have_innodb, SHOW_HAVE},
|
||||
{"have_isam", (char*) &have_isam, SHOW_HAVE},
|
||||
{"have_raid", (char*) &have_raid, SHOW_HAVE},
|
||||
|
@ -3293,16 +3244,6 @@ static void usage(void)
|
|||
--skip-bdb Don't use berkeley db (will save memory)\n\
|
||||
");
|
||||
#endif /* HAVE_BERKELEY_DB */
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
puts("\
|
||||
--gemini-recovery=mode Set Crash Recovery operating mode\n\
|
||||
(FULL, NONE, FORCE - default FULL)\n\
|
||||
--gemini-flush-log-at-commit\n\
|
||||
Every commit forces a write to the reovery log\n\
|
||||
--gemini-unbuffered-io Use unbuffered i/o\n\
|
||||
--skip-gemini Don't use gemini (will save memory)\n\
|
||||
");
|
||||
#endif
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
puts("\
|
||||
--innodb_data_home_dir=dir The common part for Innodb table spaces\n\
|
||||
|
@ -3877,27 +3818,6 @@ static void get_options(int argc,char **argv)
|
|||
#ifdef HAVE_BERKELEY_DB
|
||||
berkeley_skip=1;
|
||||
have_berkeley_db=SHOW_OPTION_DISABLED;
|
||||
#endif
|
||||
break;
|
||||
case OPT_GEMINI_SKIP:
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
gemini_skip=1;
|
||||
have_gemini=SHOW_OPTION_DISABLED;
|
||||
break;
|
||||
case OPT_GEMINI_RECOVER:
|
||||
gemini_recovery_options_str=optarg;
|
||||
if ((gemini_recovery_options=
|
||||
find_bit_type(optarg, &gemini_recovery_typelib)) == ~(ulong) 0)
|
||||
{
|
||||
fprintf(stderr, "Unknown option to gemini-recovery: %s\n",optarg);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
case OPT_GEMINI_FLUSH_LOG:
|
||||
gemini_options |= GEMOPT_FLUSH_LOG;
|
||||
break;
|
||||
case OPT_GEMINI_UNBUFFERED_IO:
|
||||
gemini_options |= GEMOPT_UNBUFFERED_IO;
|
||||
#endif
|
||||
break;
|
||||
case OPT_INNODB_SKIP:
|
||||
|
@ -4446,68 +4366,6 @@ static int get_service_parameters()
|
|||
{
|
||||
SET_CHANGEABLE_VARVAL( "thread_concurrency" );
|
||||
}
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiLazyCommit")) == 0 )
|
||||
{
|
||||
CHECK_KEY_TYPE( REG_DWORD, szKeyValueName );
|
||||
if ( *lpdwValue )
|
||||
gemini_options |= GEMOPT_FLUSH_LOG;
|
||||
else
|
||||
gemini_options &= ~GEMOPT_FLUSH_LOG;
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiFullRecovery")) == 0 )
|
||||
{
|
||||
CHECK_KEY_TYPE( REG_DWORD, szKeyValueName );
|
||||
if ( *lpdwValue )
|
||||
gemini_options &= ~GEMOPT_NO_CRASH_PROTECTION;
|
||||
else
|
||||
gemini_options |= GEMOPT_NO_CRASH_PROTECTION;
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiNoRecovery")) == 0 )
|
||||
{
|
||||
CHECK_KEY_TYPE( REG_DWORD, szKeyValueName );
|
||||
if ( *lpdwValue )
|
||||
gemini_options |= GEMOPT_NO_CRASH_PROTECTION;
|
||||
else
|
||||
gemini_options &= ~GEMOPT_NO_CRASH_PROTECTION;
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiUnbufferedIO")) == 0 )
|
||||
{
|
||||
CHECK_KEY_TYPE( REG_DWORD, szKeyValueName );
|
||||
if ( *lpdwValue )
|
||||
gemini_options |= GEMOPT_UNBUFFERED_IO;
|
||||
else
|
||||
gemini_options &= ~GEMOPT_UNBUFFERED_IO;
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiLockTableSize")) == 0 )
|
||||
{
|
||||
SET_CHANGEABLE_VARVAL( "gemini_lock_table_size" );
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiBufferCache")) == 0 )
|
||||
{
|
||||
SET_CHANGEABLE_VARVAL( "gemini_buffer_cache" );
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiSpinRetries")) == 0 )
|
||||
{
|
||||
SET_CHANGEABLE_VARVAL( "gemini_spin_retries" );
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiIoThreads")) == 0 )
|
||||
{
|
||||
SET_CHANGEABLE_VARVAL( "gemini_io_threads" );
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiConnectionLimit")) == 0 )
|
||||
{
|
||||
SET_CHANGEABLE_VARVAL( "gemini_connection_limit" );
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiLogClusterSize")) == 0 )
|
||||
{
|
||||
SET_CHANGEABLE_VARVAL( "gemini_log_cluster_size" );
|
||||
}
|
||||
else if ( lstrcmp(szKeyValueName, TEXT("GeminiLockWaitTimeout")) == 0 )
|
||||
{
|
||||
SET_CHANGEABLE_VARVAL( "gemini_lock_wait_timeout" );
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
TCHAR szErrorMsg [ 512 ];
|
||||
|
|
|
@ -1390,11 +1390,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
|
|||
|
||||
#if defined( __WIN__) || defined(OS2)
|
||||
/* Win32 can't drop a file that is open */
|
||||
if (lock_type == TL_WRITE_ALLOW_READ
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
&& table->db_type != DB_TYPE_GEMINI
|
||||
#endif /* HAVE_GEMINI_DB */
|
||||
)
|
||||
if (lock_type == TL_WRITE_ALLOW_READ)
|
||||
{
|
||||
lock_type= TL_WRITE;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,6 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
|
|||
tmp_table=0;
|
||||
lock=locked_tables=0;
|
||||
used_tables=0;
|
||||
gemini_spin_retries=0;
|
||||
cuted_fields=sent_row_count=0L;
|
||||
start_time=(time_t) 0;
|
||||
current_linfo = 0;
|
||||
|
@ -110,9 +109,6 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
|
|||
#ifdef __WIN__
|
||||
real_id = 0;
|
||||
#endif
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
bzero((char *)&gemini, sizeof(gemini));
|
||||
#endif
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
active_vio = 0;
|
||||
pthread_mutex_init(&active_vio_lock, MY_MUTEX_INIT_FAST);
|
||||
|
|
|
@ -262,9 +262,6 @@ public:
|
|||
THD_TRANS stmt; /* Trans for current statement */
|
||||
uint bdb_lock_count;
|
||||
} transaction;
|
||||
#ifdef HAVE_GEMINI_DB
|
||||
struct st_gemini gemini;
|
||||
#endif
|
||||
Item *free_list, *handler_items;
|
||||
CONVERT *convert_set;
|
||||
Field *dupp_field;
|
||||
|
@ -280,7 +277,6 @@ public:
|
|||
max_join_size, sent_row_count, examined_row_count;
|
||||
table_map used_tables;
|
||||
ulong query_id,version, inactive_timeout,options,thread_id;
|
||||
ulong gemini_spin_retries;
|
||||
long dbug_thread_id;
|
||||
pthread_t real_id;
|
||||
uint current_tablenr,tmp_table,cond_count,col_access,query_length;
|
||||
|
@ -374,12 +370,10 @@ public:
|
|||
{
|
||||
#ifdef USING_TRANSACTIONS
|
||||
return (transaction.all.bdb_tid != 0 ||
|
||||
transaction.all.innodb_active_trans != 0 ||
|
||||
transaction.all.gemini_tid != 0);
|
||||
transaction.all.innodb_active_trans != 0);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); }
|
||||
inline gptr calloc(unsigned int size)
|
||||
|
|
|
@ -174,7 +174,6 @@ typedef struct st_lex {
|
|||
HA_CREATE_INFO create_info;
|
||||
LEX_MASTER_INFO mi; // used by CHANGE MASTER
|
||||
ulong thread_id,type;
|
||||
ulong gemini_spin_retries;
|
||||
enum_sql_command sql_command;
|
||||
enum lex_states next_state;
|
||||
enum enum_duplicates duplicates;
|
||||
|
|
|
@ -1897,11 +1897,6 @@ mysql_execute_command(void)
|
|||
TL_WRITE_LOW_PRIORITY : TL_WRITE);
|
||||
thd->default_select_limit=select_lex->select_limit;
|
||||
thd->tx_isolation=lex->tx_isolation;
|
||||
if (thd->gemini_spin_retries != lex->gemini_spin_retries)
|
||||
{
|
||||
thd->gemini_spin_retries= lex->gemini_spin_retries;
|
||||
ha_set_spin_retries(thd->gemini_spin_retries);
|
||||
}
|
||||
DBUG_PRINT("info",("options: %ld limit: %ld",
|
||||
thd->options,(long) thd->default_select_limit));
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ static TABLE_LIST *rename_tables(THD *thd, TABLE_LIST *table_list,
|
|||
|
||||
bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
|
||||
{
|
||||
bool error=1,cerror,got_all_locks=1;
|
||||
bool error=1,got_all_locks=1;
|
||||
TABLE_LIST *lock_table,*ren_table=0;
|
||||
DBUG_ENTER("mysql_rename_tables");
|
||||
|
||||
|
@ -87,12 +87,7 @@ end:
|
|||
}
|
||||
|
||||
/* Lets hope this doesn't fail as the result will be messy */
|
||||
if ((cerror=ha_commit_rename(thd)))
|
||||
{
|
||||
my_error(ER_GET_ERRNO,MYF(0),cerror);
|
||||
error= 1;
|
||||
}
|
||||
else if (!error)
|
||||
if (!error)
|
||||
{
|
||||
mysql_update_log.write(thd,thd->query,thd->query_length);
|
||||
if (mysql_bin_log.is_open())
|
||||
|
|
|
@ -1192,12 +1192,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
|||
if (mysql_rename_table(old_db_type,db,table_name,new_db,new_name))
|
||||
error= -1;
|
||||
}
|
||||
if (!error && (error=ha_commit_rename(thd)))
|
||||
{
|
||||
my_error(ER_GET_ERRNO,MYF(0),error);
|
||||
error=1;
|
||||
}
|
||||
|
||||
VOID(pthread_cond_broadcast(&COND_refresh));
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
}
|
||||
|
@ -1704,7 +1698,6 @@ end_temporary:
|
|||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
(void) ha_commit_rename(thd); // Just for safety
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
|
|
|
@ -186,8 +186,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
|
|||
%token FROM
|
||||
%token FULL
|
||||
%token FULLTEXT_SYM
|
||||
%token GEMINI_SYM
|
||||
%token GEMINI_SPIN_RETRIES
|
||||
%token GLOBAL_SYM
|
||||
%token GRANT
|
||||
%token GRANTS
|
||||
|
@ -813,7 +811,6 @@ table_types:
|
|||
| HEAP_SYM { $$= DB_TYPE_HEAP; }
|
||||
| BERKELEY_DB_SYM { $$= DB_TYPE_BERKELEY_DB; }
|
||||
| INNOBASE_SYM { $$= DB_TYPE_INNODB; }
|
||||
| GEMINI_SYM { $$= DB_TYPE_GEMINI; }
|
||||
|
||||
row_types:
|
||||
DEFAULT { $$= ROW_TYPE_DEFAULT; }
|
||||
|
@ -2868,7 +2865,6 @@ keyword:
|
|||
| FIXED_SYM {}
|
||||
| FLUSH_SYM {}
|
||||
| GRANTS {}
|
||||
| GEMINI_SYM {}
|
||||
| GLOBAL_SYM {}
|
||||
| HEAP_SYM {}
|
||||
| HANDLER_SYM {}
|
||||
|
@ -2963,7 +2959,6 @@ set:
|
|||
lex->sql_command= SQLCOM_SET_OPTION;
|
||||
lex->select->options=lex->thd->options;
|
||||
lex->select->select_limit=lex->thd->default_select_limit;
|
||||
lex->gemini_spin_retries=lex->thd->gemini_spin_retries;
|
||||
lex->tx_isolation=lex->thd->tx_isolation;
|
||||
lex->option_type=0;
|
||||
lex->option_list.empty()
|
||||
|
@ -3032,14 +3027,6 @@ option_value:
|
|||
{
|
||||
current_thd->next_insert_id=$3;
|
||||
}
|
||||
| GEMINI_SPIN_RETRIES equal ULONG_NUM
|
||||
{
|
||||
Lex->gemini_spin_retries= $3;
|
||||
}
|
||||
| GEMINI_SPIN_RETRIES equal DEFAULT
|
||||
{
|
||||
Lex->gemini_spin_retries= 1;
|
||||
}
|
||||
| CHAR_SYM SET IDENT
|
||||
{
|
||||
CONVERT *tmp;
|
||||
|
|
|
@ -148,7 +148,7 @@ Summary(pt_BR): MySQL - Medi
|
|||
Group(pt_BR): Aplicações/Banco_de_Dados
|
||||
Obsoletes: embedded
|
||||
|
||||
%description devel
|
||||
%description embedded
|
||||
This package contains the MySQL server as library.
|
||||
|
||||
%{see_base}
|
||||
|
@ -360,7 +360,7 @@ fi
|
|||
%attr(755, root, root) /usr/bin/mysqlbug
|
||||
%attr(755, root, root) /usr/bin/mysqltest
|
||||
%attr(755, root, root) /usr/bin/mysqlhotcopy
|
||||
%attr(755, root, root) /usr/bin/mysql_explain
|
||||
%attr(755, root, root) /usr/bin/mysql_explain_log
|
||||
%attr(755, root, root) /usr/bin/perror
|
||||
%attr(755, root, root) /usr/bin/replace
|
||||
%attr(755, root, root) /usr/bin/resolveip
|
||||
|
|
|
@ -21,27 +21,25 @@
|
|||
**/
|
||||
|
||||
#include <my_global.h>
|
||||
#include <my_sys.h>
|
||||
#include <m_string.h>
|
||||
#include <my_pthread.h>
|
||||
#include <mysql.h>
|
||||
#include <mysql_version.h>
|
||||
#include <m_ctype.h>
|
||||
#include <my_config.h>
|
||||
#include <my_dir.h>
|
||||
#include <hash.h>
|
||||
#include <mysqld_error.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <my_sys.h>
|
||||
#include <my_dir.h>
|
||||
#include <m_string.h>
|
||||
#include <m_ctype.h>
|
||||
#include <hash.h>
|
||||
#include <getopt.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <violite.h>
|
||||
#include <my_pthread.h>
|
||||
#include <md5.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#define MANAGER_VERSION "1.0"
|
||||
#define MANAGER_GREETING "MySQL Server Management Daemon v. 1.0"
|
||||
|
@ -1040,7 +1038,7 @@ LOG_MSG_FUNC(log_info,LOG_INFO)
|
|||
#ifndef DBUG_OFF
|
||||
LOG_MSG_FUNC(log_debug,LOG_DEBUG)
|
||||
#else
|
||||
inline void log_debug(char* __attribute__((unused)) fmt,...) {}
|
||||
inline void log_debug(const char* __attribute__((unused)) fmt,...) {}
|
||||
#endif
|
||||
|
||||
static pthread_handler_decl(process_launcher_messages,
|
||||
|
@ -1065,7 +1063,7 @@ static pthread_handler_decl(process_launcher_messages,
|
|||
char* ident=buf+1;
|
||||
int ident_len=strlen(ident);
|
||||
memcpy(&pid,ident+ident_len+1,sizeof(pid));
|
||||
log_debug("process message - ident=%s,ident_len=%d,pid=%d",ident,
|
||||
log_debug("process message - ident=%s ident_len=%d pid=%d",ident,
|
||||
ident_len,pid);
|
||||
pthread_mutex_lock(&lock_exec_hash);
|
||||
log_debug("hash has %d records",exec_hash.records);
|
||||
|
|
Loading…
Reference in a new issue