Commit fc75a836 authored by unknown's avatar unknown

Merge mysql.com:/home/jonas/src/mysql-5.0

into mysql.com:/home/jonas/src/mysql-5.0-ndb


mysql-test/mysql-test-run.sh:
  Auto merged
ndb/src/kernel/vm/FastScheduler.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
parents 488fb181 8da1c3e0
......@@ -1181,26 +1181,15 @@ sasha@mysql.sashanet.com|build-tags|20011125054855|05181|7afb7e785b80f97
sasha@mysql.sashanet.com|build-tags|20011201050944|25384|b6f6fff142121618
sasha@mysql.sashanet.com|libmysql_r/acconfig.h|20001128060846|51084|65f1202b3b5c345f
sasha@mysql.sashanet.com|mysql-test/README.gcov|20001012045950|28177|5a6da067a30780ce
sasha@mysql.sashanet.com|mysql-test/README.gcov|20001214012355|41825|2de7575ca81155e5
sasha@mysql.sashanet.com|mysql-test/README|20001010001022|12739|108667adaeabe3f5
sasha@mysql.sashanet.com|mysql-test/r/3.23/alt000001.result|20001122072330|24729|393103dbf15f35c9
sasha@mysql.sashanet.com|mysql-test/r/3.23/ins000001.result|20001018175743|49824|f45c599efdf8352b
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.a.result|20001118063528|39426|2987b17db06808c3
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.b.result|20001118063528|44057|62e1fa91167cacc3
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000002.result|20001118063528|46039|109f5ceed1e0d64
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000003.result|20001118063528|48148|68d6ee00beaa011
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.a.result|20001118063528|50132|3415f066cb91c460
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.b.result|20001118063528|52094|352b35351551485
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000005.result|20001118063528|54071|a50962bc2340ab9a
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000006.result|20001118063528|56081|5653051e8ce6b4aa
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000007.result|20001121063807|21606|e0c3b6134e0884da
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000008.result|20001121063807|23636|c5cfee19ca5a7da9
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000009.result|20001121063807|25633|ed8042446ab97926
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000010.result|20001122072330|29430|3228109b8965b0f8
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000011.result|20001125024912|48851|c29dce30aa97f265
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.result|20001126062901|05938|35d6596da7b90fc5
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.status.result|20001126062901|09395|bbbd650b5beea32f
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.result|20001202171150|03876|ac5024e6cf6daac6
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.status.result|20001202171150|06069|6bee190c298cc9fd
sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000003.result|20001011230020|64653|d7b657b1e3a286a7
sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000100.res|20001205131218|23520|84ed46856cb3a69f
......@@ -1209,7 +1198,6 @@ sasha@mysql.sashanet.com|mysql-test/r/binlog-backup-restore.result|2001042423392
sasha@mysql.sashanet.com|mysql-test/r/df_crash.result|20010406010433|59989|4a3dbee64843953d
sasha@mysql.sashanet.com|mysql-test/r/identity.result|20010910233028|16331|e41453a364242503
sasha@mysql.sashanet.com|mysql-test/r/mrg000002.result|20001212152450|11492|745be0854aaaaf5e
sasha@mysql.sashanet.com|mysql-test/r/slave-running.result|20001208141122|24303|f73e49462cf59e1f
sasha@mysql.sashanet.com|mysql-test/r/slave-stopped.result|20001208141122|28916|25c134b1a4f1993a
sasha@mysql.sashanet.com|mysql-test/std_data/m.MRG|20001212152450|17736|3f5632c37af00f18
sasha@mysql.sashanet.com|mysql-test/std_data/m.frm|20001212152450|13897|e351dfe0b6824c0c
......
......@@ -109,6 +109,12 @@ sub add_copyright
$line_copyright= "! ";
$end_copyright= "";
}
elsif ($ARGV =~ /\.sql$/)
{
$start_copyright="-- ";
$line_copyright= "-- ";
$end_copyright= "";
}
elsif ($ARGV =~ /\.asm$/)
{
$start_copyright="; ";
......
......@@ -739,11 +739,11 @@ Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
}}}
Package=<4>
{{{
Begin Project Dependency
{{{ Begin Project Dependency
Project_Dep_Name libmysql
End Project Dependency
Begin Project Dependency
......@@ -756,6 +756,19 @@ Package=<4>
###############################################################################
Project: "mysql_client_test"=.\tests\mysql_client_test.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4>
Package=<5>
......@@ -763,15 +776,18 @@ Package=<5>
}}}
Package=<4>
{{{
Begin Project Dependency
{{{ Begin Project Dependency
Project_Dep_Name mysqltest
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysqladmin
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysql_client_test
End Project Dependency
}}}
###############################################################################
Global:
......
# Microsoft Developer Studio Project File - Name="mysql_client_test" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=mysql_client_test - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mysql_client_test.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mysql_client_test.mak" CFG="mysql_client_test - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mysql_client_test - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "mysql_client_test - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mysql_client_test - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir ".\Debug"
# PROP BASE Intermediate_Dir ".\Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ".\Debug"
# PROP Intermediate_Dir ".\Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
# ADD BASE MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32
# ADD MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
!ELSEIF "$(CFG)" == "mysql_client_test - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir ".\Release"
# PROP BASE Intermediate_Dir ".\Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD BASE MTL /nologo /tlb".\Release\client_test.tlb" /win32
# ADD MTL /nologo /tlb".\Release\client_test.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console
!ENDIF
# Begin Target
# Name "mysql_client_test - Win32 Debug"
# Name "mysql_client_test - Win32 Release"
# Begin Source File
SOURCE=tests\mysql_client_test.c
# End Source File
# End Target
# End Project
......@@ -2379,6 +2379,8 @@ void usage()
#include <help_end.h>
#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
......
......@@ -3,6 +3,8 @@ dnl Define zlib paths to point at bundled zlib
AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [
ZLIB_INCLUDES="-I\$(top_srcdir)/zlib"
ZLIB_LIBS="\$(top_builddir)/zlib/libz.la"
dnl Omit -L$pkglibdir as it's always in the list of mysql_config deps.
ZLIB_DEPS="-lz"
zlib_dir="zlib"
AC_SUBST([zlib_dir])
mysql_cv_compress="yes"
......@@ -44,8 +46,13 @@ dnl $prefix/lib. If zlib headers or binaries weren't found at $prefix, the
dnl macro bails out with error.
dnl
dnl If the library was found, this function #defines HAVE_COMPRESS
dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include) and
dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz).
dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include),
dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz) and ZLIB_DEPS which is
dnl used in mysql_config and is always the same as ZLIB_LIBS except to
dnl when we use the bundled zlib. In the latter case ZLIB_LIBS points to the
dnl build dir ($top_builddir/zlib), while mysql_config must point to the
dnl installation dir ($pkglibdir), so ZLIB_DEPS is set to point to
dnl $pkglibdir.
AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [
AC_MSG_CHECKING([for zlib compression library])
......@@ -94,7 +101,11 @@ case $SYSTEM_TYPE in
;;
esac
if test "$mysql_cv_compress" = "yes"; then
if test "x$ZLIB_DEPS" = "x"; then
ZLIB_DEPS="$ZLIB_LIBS"
fi
AC_SUBST([ZLIB_LIBS])
AC_SUBST([ZLIB_DEPS])
AC_SUBST([ZLIB_INCLUDES])
AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support])
fi
......
......@@ -47,7 +47,7 @@ dist-hook:
$(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/t/*.test $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(srcdir)/r/*.require $(distdir)/r
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
......@@ -65,7 +65,7 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
......
......@@ -96,6 +96,8 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db,User),"
"KEY User (User))"
"engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Database privileges';\n");
if (test)
......@@ -126,10 +128,12 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY Host (Host,Db))"
"comment='Host privileges;"
" Merged with database privileges';\n");
"engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Host privileges; Merged with database privileges';\n");
}
if (test_sys_file(mdata,"mysql/user.frm"))
{
#ifdef __WIN__
......@@ -184,7 +188,10 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
"max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
"PRIMARY KEY Host (Host,User)"
") comment='Users and global privileges';\n");
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Users and global privileges';\n");
if (test)
{
......@@ -238,7 +245,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"dl char(128) DEFAULT '' NOT NULL,"
"type enum ('function','aggregate') NOT NULL,"
"PRIMARY KEY (name)"
") comment='User defined functions';\n");
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='User defined functions';\n");
}
if (test_sys_file(mdata,"mysql/tables_priv.frm"))
......@@ -258,7 +267,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
" DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name),"
"KEY Grantor (Grantor)"
") comment='Table privileges';\n");
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Table privileges';\n");
}
if (test_sys_file(mdata,"mysql/columns_priv.frm"))
......@@ -274,7 +285,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Column_priv set('Select','Insert','Update','References')"
" DEFAULT '' NOT NULL,"
"PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
") comment='Column privileges';\n");
") engine=MyISAM "
"CHARACTER SET utf8 COLLATE utf8_bin "
"comment='Column privileges';\n");
}
if (test_sys_file(mdata,"mysql/help_topic.frm"))
......@@ -289,7 +302,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"url varchar(128) not null,"
"primary key (help_topic_id),"
"unique index (name)"
") comment='help topics';\n");
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help topics';\n");
}
if (test_sys_file(mdata,"mysql/help_category.frm"))
......@@ -302,7 +317,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"url varchar(128) not null,"
"primary key (help_category_id),"
"unique index (name)"
") comment='help categories';\n");
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help categories';\n");
}
if (test_sys_file(mdata,"mysql/help_keyword.frm"))
......@@ -313,7 +330,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"name varchar(64) not null,"
"primary key (help_keyword_id),"
"unique index (name)"
") comment='help keywords';\n");
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='help keywords';\n");
}
if (test_sys_file(mdata,"mysql/help_relation.frm"))
......@@ -323,7 +342,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"help_topic_id int unsigned not null references help_topic,"
"help_keyword_id int unsigned not null references help_keyword,"
"primary key (help_keyword_id, help_topic_id)"
") comment='keyword-topic relation';\n");
") engine=MyISAM "
"CHARACTER SET utf8 "
"comment='keyword-topic relation';\n");
}
if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
......@@ -333,7 +354,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Name char(64) NOT NULL,"
"Time_zone_id int unsigned NOT NULL,"
"PRIMARY KEY Name (Name)"
") DEFAULT CHARACTER SET latin1 "
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone names';\n");
if (test)
......@@ -341,7 +362,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
fprintf(out,
"INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
"('MET', 1), ('UTC', 2), ('Universal', 2), "
"('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n");
"('Europe/Moscow',3), ('leap/Europe/Moscow',4),"
"('Japan', 5);\n");
}
}
......@@ -353,13 +376,13 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Time_zone_id int unsigned NOT NULL auto_increment,"
"Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
"PRIMARY KEY TzId (Time_zone_id)"
") DEFAULT CHARACTER SET latin1 "
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zones';\n");
if (test)
{
fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n");
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n");
}
}
......@@ -371,7 +394,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Transition_time bigint signed NOT NULL,"
"Transition_type_id int unsigned NOT NULL,"
"PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
") DEFAULT CHARACTER SET latin1 "
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone transitions';\n");
if (test)
......@@ -576,7 +599,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
",(4, 2045689222, 8) ,(4, 2058390022, 9)"
",(4, 2077138822, 8) ,(4, 2090444422, 9)"
",(4, 2108588422, 8) ,(4, 2121894022, 9)"
",(4, 2140038022, 8);\n");
",(4, 2140038022, 8), (5, -1009875600, 1);\n");
}
}
......@@ -590,7 +615,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
"Abbreviation char(8) DEFAULT '' NOT NULL,"
"PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
") DEFAULT CHARACTER SET latin1 "
") engine=MyISAM CHARACTER SET utf8 "
"comment='Time zone transition types';\n");
if (test)
......@@ -612,7 +637,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n");
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')"
",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n");
}
}
......@@ -623,7 +650,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
"Transition_time bigint signed NOT NULL,"
"Correction int signed NOT NULL,"
"PRIMARY KEY TranTime (Transition_time)"
") DEFAULT CHARACTER SET latin1 "
") engine=MyISAM CHARACTER SET utf8 "
"comment='Leap seconds information for time zones';\n");
if (test)
......
......@@ -800,9 +800,12 @@ int removef(const char *format, ...)
#ifndef STRUCT_DIRENT_HAS_D_TYPE
struct stat st;
if (lstat(entry->d_name, &st) == -1)
/* create long name */
snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
if (lstat(temp, &st) == -1)
{
return 1;
return 1; /* Error couldn't lstat file */
}
if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0))
......
......@@ -441,7 +441,7 @@ while test $# -gt 0; do
STRACE_CLIENT=1
;;
--debug)
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \
EXTRA_MASTER_MYSQLD_TRACE=" \
--debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
--debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace"
......@@ -1149,6 +1149,10 @@ start_master()
this_master_myport=$MASTER_MYPORT
NOT_FIRST_MASTER_EXTRA_OPTS=""
fi
if [ -n "$EXTRA_MASTER_MYSQLD_TRACE" ]
then
CURR_MASTER_MYSQLD_TRACE="$EXTRA_MASTER_MYSQLD_TRACE$1"
fi
if [ -z "$DO_BENCH" ]
then
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \
......@@ -1172,7 +1176,7 @@ start_master()
$MASTER_40_ARGS \
$SMALL_SERVER \
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
$NOT_FIRST_MASTER_EXTRA_OPTS"
$NOT_FIRST_MASTER_EXTRA_OPTS $CURR_MASTER_MYSQLD_TRACE"
else
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \
--server-id=$id --rpl-recovery-rank=1 \
......
This diff is collapsed.
......@@ -655,9 +655,9 @@ insert into t1 (a,b) values (1,2),(1,3),(2,5);
select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1;
a r2 r1
1 1.0 2
select a, rand()*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1;
select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2;
a r2 r1
1 1 2
1 2 2
select a,sum(b) from t1 where a=1 group by c;
a sum(b)
1 5
......
......@@ -355,3 +355,13 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ref a a 44 const,const 6 Using where
1 SIMPLE t1 ref heap_idx heap_idx 22 const 7 Using where
drop table t1, t2, t3;
create temporary table t1 ( a int, index (a) ) engine=memory;
insert into t1 values (1),(2),(3),(4),(5);
select a from t1 where a in (1,3);
a
1
3
explain select a from t1 where a in (1,3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 2 Using where
drop table t1;
......@@ -2666,7 +2666,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 127
......@@ -2717,7 +2716,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 -128
......
......@@ -2649,7 +2649,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 127
......@@ -2700,7 +2699,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 -128
......
......@@ -2650,7 +2650,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 127
......@@ -2701,7 +2700,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 -128
......
......@@ -2586,7 +2586,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 127
......@@ -2637,7 +2636,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 -128
......@@ -5597,7 +5595,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 127
......@@ -5648,7 +5645,6 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1
Warning 1264 Out of range value adjusted for column 'c5' at row 1
Warning 1264 Out of range value adjusted for column 'c6' at row 1
Warning 1264 Out of range value adjusted for column 'c7' at row 1
Note 1265 Data truncated for column 'c12' at row 1
Warning 1264 Out of range value adjusted for column 'c12' at row 1
execute my_select ;
c1 -128
......
......@@ -1433,7 +1433,7 @@ Note 1003 (select `test`.`t1`.`s1` AS `s1` from `test`.`t1`)
s1
tttt
drop table t1;
create table t1 (s1 char(5) not null, index s1(s1));
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
insert into t2 values ('a1'),('a2');
......@@ -1459,25 +1459,25 @@ a2 1
a3 1
explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 5 NULL 3 Using index
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
Warnings:
Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1`
explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 5 NULL 3 Using index
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
Warnings:
Note 1003 select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1`
explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 5 NULL 3 Using index
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index
Warnings:
Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1`
explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL s1 5 NULL 3 Using index
1 PRIMARY t1 index NULL s1 6 NULL 3 Using index
2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where
Warnings:
Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1`
......@@ -2133,34 +2133,6 @@ SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1
c
Oceania
drop table t1;
CREATE TABLE t1 ( f1 BIGINT );
INSERT INTO t1 SET f1= NULL;
INSERT INTO t1 SET f1= 1;
CREATE TABLE t2 ( f1 BIGINT );
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT f1 FROM t2 );
f1
NULL
1
INSERT INTO t2 VALUES (1), (2);
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 );
f1
NULL
1
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2
UNION
SELECT f1 FROM t2 WHERE f1 > 3);
f1
NULL
1
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000);
f1
NULL
1
drop table t1,t2;
create table t1 (a1 int);
create table t2 (b1 int);
select * from t1 where a2 > any(select b1 from t2);
......
......@@ -113,8 +113,8 @@ select @a:=0;
select @a, @a:=@a+count(*), count(*), @a from t1 group by i;
@a @a:=@a+count(*) count(*) @a
0 1 1 0
0 3 2 0
0 6 3 0
0 2 2 0
0 3 3 0
select @a:=0;
@a:=0
0
......
......@@ -480,7 +480,8 @@ drop table t1;
create table t1 (a integer, b integer, c integer);
insert into t1 (a,b) values (1,2),(1,3),(2,5);
select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1;
select a, rand()*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1;
# rand(100)*10 will be < 2 only for the first row (of 6)
select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2;
select a,sum(b) from t1 where a=1 group by c;
select a*sum(b) from t1 where a=1 group by c;
select sum(a)*sum(b) from t1 where a=1 group by c;
......
......@@ -251,3 +251,9 @@ explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a
drop table t1, t2, t3;
# Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table
create temporary table t1 ( a int, index (a) ) engine=memory;
insert into t1 values (1),(2),(3),(4),(5);
select a from t1 where a in (1,3);
explain select a from t1 where a in (1,3);
drop table t1;
......@@ -329,7 +329,7 @@ prepare stmt4 from ' show engine bdb logs ';
execute stmt4;
--enable_result_log
prepare stmt4 from ' show full processlist ';
--replace_column 1 number 6 time
--replace_column 1 number 6 time 3 localhost
execute stmt4;
prepare stmt4 from ' show grants for user ';
--error 1295
......
......@@ -894,7 +894,7 @@ drop table t1;
#
# IN optimisation test results
#
create table t1 (s1 char(5) not null, index s1(s1));
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
insert into t2 values ('a1'),('a2');
......@@ -1392,34 +1392,6 @@ INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','M
SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200);
drop table t1;
#
# Test cases for bug #7351:
# quantified predicate with subquery returning empty result set
#
CREATE TABLE t1 ( f1 BIGINT );
INSERT INTO t1 SET f1= NULL;
INSERT INTO t1 SET f1= 1;
CREATE TABLE t2 ( f1 BIGINT );
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT f1 FROM t2 );
INSERT INTO t2 VALUES (1), (2);
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 );
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2
UNION
SELECT f1 FROM t2 WHERE f1 > 3);
SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000);
drop table t1,t2;
#
# Test for BUG#7885: Server crash when 'any' subselect compared to
# non-existant field.
......
......@@ -45,7 +45,7 @@ int my_rename(const char *from, const char *to, myf MyFlags)
}
#endif
#if defined(HAVE_RENAME)
#ifdef __WIN__
#if defined(__WIN__) || defined(__NETWARE__)
/*
On windows we can't rename over an existing file:
Remove any conflicting files:
......
......@@ -32,7 +32,8 @@ testTransactions \
testDeadlock \
test_event ndbapi_slow_select testReadPerf testLcp \
testPartitioning \
testBitfield
testBitfield \
DbCreate DbAsyncGenerator
#flexTimedAsynch
#testBlobs
......@@ -73,6 +74,8 @@ testReadPerf_SOURCES = testReadPerf.cpp
testLcp_SOURCES = testLcp.cpp
testPartitioning_SOURCES = testPartitioning.cpp
testBitfield_SOURCES = testBitfield.cpp
DbCreate_SOURCES= bench/mainPopulate.cpp bench/dbPopulate.cpp bench/userInterface.cpp
DbAsyncGenerator_SOURCES= bench/mainAsyncGenerator.cpp bench/asyncGenerator.cpp bench/ndb_async2.cpp
INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel
......
This diff is collapsed.
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef DBGENERATOR_H
#define DBGENERATOR_H
/***************************************************************
* I N C L U D E D F I L E S *
***************************************************************/
#include "testData.h"
#include "userInterface.h"
/***************************************************************
* M A C R O S *
***************************************************************/
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
/***************************************************************
* D A T A S T R U C T U R E S *
***************************************************************/
/***************************************************************
* P U B L I C F U N C T I O N S *
***************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
extern void asyncGenerator(ThreadData *d, int parallellism,
int millisSendPoll,
int minEventSendPoll,
int forceSendPoll);
#ifdef __cplusplus
}
#endif
/***************************************************************
* E X T E R N A L D A T A *
***************************************************************/
#endif /* DBGENERATOR_H */
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/***************************************************************
* I N C L U D E D F I L E S *
***************************************************************/
#include <ndb_global.h>
#include "userInterface.h"
#include "dbPopulate.h"
#include <NdbOut.hpp>
#include <random.h>
/***************************************************************
* L O C A L C O N S T A N T S *
***************************************************************/
/***************************************************************
* L O C A L D A T A S T R U C T U R E S *
***************************************************************/
/***************************************************************
* L O C A L F U N C T I O N S *
***************************************************************/
static void getRandomSubscriberData(int subscriberNo,
SubscriberNumber number,
SubscriberName name);
static void populate(char *title,
int count,
void (*func)(UserHandle*,int),
UserHandle *uh);
static void populateServers(UserHandle *uh, int count);
static void populateSubscribers(UserHandle *uh, int count);
static void populateGroups(UserHandle *uh, int count);
/***************************************************************
* L O C A L D A T A *
***************************************************************/
static SequenceValues permissionsDefinition[] = {
{90, 1},
{10, 0},
{0, 0}
};
/***************************************************************
* P U B L I C D A T A *
***************************************************************/
/***************************************************************
****************************************************************
* L O C A L F U N C T I O N S C O D E S E C T I O N *
****************************************************************
***************************************************************/
static void getRandomSubscriberData(int subscriberNo,
SubscriberNumber number,
SubscriberName name)
{
char sbuf[SUBSCRIBER_NUMBER_LENGTH + 1];
sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_LENGTH, subscriberNo);
memcpy(number, sbuf, SUBSCRIBER_NUMBER_LENGTH);
memset(name, myRandom48(26)+'A', SUBSCRIBER_NAME_LENGTH);
}
static void populate(char *title,
int count,
void (*func)(UserHandle*, int),
UserHandle *uh)
{
ndbout_c("Populating %d '%s' ... ",count, title);
/* fflush(stdout); */
func(uh,count);
ndbout_c("done");
}
static void populateServers(UserHandle *uh, int count)
{
int i, j;
int len;
char tmp[80];
int suffix_length = 1;
ServerName serverName;
SubscriberSuffix suffix;
int commitCount = 0;
for(i = 0; i < SUBSCRIBER_NUMBER_SUFFIX_LENGTH; i++)
suffix_length *= 10;
for(i = 0; i < count; i++) {
sprintf(tmp, "-Server %d-", i);
len = strlen(tmp);
for(j = 0; j < SERVER_NAME_LENGTH; j++){
serverName[j] = tmp[j % len];
}
/* serverName[j] = 0; not null-terminated */
for(j = 0; j < suffix_length; j++){
char sbuf[SUBSCRIBER_NUMBER_SUFFIX_LENGTH + 1];
sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, j);
memcpy(suffix, sbuf, SUBSCRIBER_NUMBER_SUFFIX_LENGTH);
userDbInsertServer(uh, i, suffix, serverName);
commitCount ++;
if((commitCount % OP_PER_TRANS) == 0)
userDbCommit(uh);
}
}
if((commitCount % OP_PER_TRANS) != 0)
userDbCommit(uh);
}
static void populateSubscribers(UserHandle *uh, int count)
{
SubscriberNumber number;
SubscriberName name;
int i, j, k;
int res;
SequenceValues values[NO_OF_GROUPS+1];
RandomSequence seq;
for(i = 0; i < NO_OF_GROUPS; i++) {
values[i].length = 1;
values[i].value = i;
}
values[i].length = 0;
values[i].value = 0;
if( initSequence(&seq, values) != 0 ) {
ndbout_c("could not set the sequence of random groups");
exit(0);
}
#define RETRIES 25
for(i = 0; i < count; i+= OP_PER_TRANS) {
for(j = 0; j<RETRIES; j++){
for(k = 0; k<OP_PER_TRANS && i+k < count; k++){
getRandomSubscriberData(i+k, number, name);
userDbInsertSubscriber(uh, number, getNextRandom(&seq), name);
}
res = userDbCommit(uh);
if(res == 0)
break;
if(res != 1){
ndbout_c("Terminating");
exit(0);
}
}
if(j == RETRIES){
ndbout_c("Terminating");
exit(0);
}
}
}
static void populateGroups(UserHandle *uh, int count)
{
int i;
int j;
int len;
RandomSequence seq;
Permission allow[NO_OF_GROUPS];
ServerBit serverBit;
GroupName groupName;
char tmp[80];
int commitCount = 0;
if( initSequence(&seq, permissionsDefinition) != 0 ) {
ndbout_c("could not set the sequence of random permissions");
exit(0);
}
for(i = 0; i < NO_OF_GROUPS; i++)
allow[i] = 0;
for(i = 0; i < NO_OF_SERVERS; i++) {
serverBit = 1 << i;
for(j = 0; j < NO_OF_GROUPS; j++ ) {
if( getNextRandom(&seq) )
allow[j] |= serverBit;
}
}
for(i = 0; i < NO_OF_GROUPS; i++) {
sprintf(tmp, "-Group %d-", i);
len = strlen(tmp);
for(j = 0; j < GROUP_NAME_LENGTH; j++) {
groupName[j] = tmp[j % len];
}
/* groupName[j] = 0; not null-terminated */
userDbInsertGroup(uh,
i,
groupName,
allow[i],
allow[i],
allow[i]);
commitCount ++;
if((commitCount % OP_PER_TRANS) == 0)
userDbCommit(uh);
}
if((commitCount % OP_PER_TRANS) != 0)
userDbCommit(uh);
}
/***************************************************************
****************************************************************
* P U B L I C F U N C T I O N S C O D E S E C T I O N *
****************************************************************
***************************************************************/
void dbPopulate(UserHandle *uh)
{
populate("servers", NO_OF_SERVERS, populateServers, uh);
populate("subscribers", NO_OF_SUBSCRIBERS, populateSubscribers, uh);
populate("groups", NO_OF_GROUPS, populateGroups, uh);
}
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef DBPOPULATE_H
#define DBPOPULATE_H
/***************************************************************
* I N C L U D E D F I L E S *
***************************************************************/
#include "userInterface.h"
/***************************************************************
* M A C R O S *
***************************************************************/
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
/***************************************************************
* D A T A S T R U C T U R E S *
***************************************************************/
/***************************************************************
* P U B L I C F U N C T I O N S *
***************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
extern void dbPopulate(UserHandle *uh);
#ifdef __cplusplus
}
#endif
/***************************************************************
* E X T E R N A L D A T A *
***************************************************************/
#endif /* DBPOPULATE_H */
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef MACROS_H
#define MACROS_H
#include <ndb_global.h>
#include <NdbOut.hpp>
#define ERROR(x) {ndbout_c((x));}
#define ERROR1(x,y) {ndbout_c((x), (y));}
#define ERROR2(x,y,z) {ndbout_c((x), (y), (z));}
#define ERROR3(x,y,z,u) {ndbout_c((x), (y), (z), (u));}
#define ERROR4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));}
#define INIT_RANDOM(x) srand48((x))
#define UI_RANDOM(x) ((unsigned int)(lrand48()%(x)))
#define ASSERT(cond, message) \
{ if(!(cond)) { ERROR(message); exit(-1); }}
#ifdef DEBUG_ON
#define DEBUG(x) {ndbout_c((x));}
#define DEBUG1(x,y) {ndbout_c((x), (y));}
#define DEBUG2(x,y,z) {ndbout_c((x), (y), (z));}
#define DEBUG3(x,y,z,u) {ndbout_c((x), (y), (z), (u));}
#define DEBUG4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));}
#define DEBUG5(x,y,z,u,w, v) {ndbout_c((x), (y), (z), (u), (w), (v));}
#else
#define DEBUG(x)
#define DEBUG1(x,y)
#define DEBUG2(x,y,z)
#define DEBUG3(x,y,z,u)
#define DEBUG4(x,y,z,u,w)
#define DEBUG5(x,y,z,u,w, v)
#endif
#endif
This diff is collapsed.
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <ndb_opts.h>
#include "userInterface.h"
#include "dbPopulate.h"
#include <NdbMain.h>
#include <NdbOut.hpp>
#include <random.h>
#ifdef __cplusplus
extern "C" {
#endif
int useTableLogging;
int useIndexTables;
#ifdef __cplusplus
}
#endif
static void usage()
{
}
static
void usage(const char *prog)
{
ndbout_c(
"Usage: %s [-l]\n"
" -l Use logging and checkpointing on tables\n",
" -i Use index tables\n",
prog);
exit(1);
}
NDB_STD_OPTS_VARS;
NDB_COMMAND(DbCreate, "DbCreate", "DbCreate", "DbCreate", 16384)
{
int i;
UserHandle *uh;
useTableLogging = useIndexTables = 0;
NDB_INIT(argv[0]);
for(i = 1; i<argc; i++){
if(strcmp(argv[i], "-l") == 0){
useTableLogging = 1;
} else if(strcmp(argv[i], "-i") == 0){
useIndexTables = 1;
} else {
usage(argv[0]);
return 0;
}
}
ndbout_c("Using %s tables and %s key storage",
useTableLogging ? "logging" : "temporary",
useIndexTables ? "index" : "normal");
myRandom48Init(0x3e6f);
uh = userDbConnect(1, "TEST_DB");
dbPopulate(uh);
userDbDisconnect(uh);
return(0);
}
This diff is collapsed.
This diff is collapsed.
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NDB_ERROR_H
#define NDB_ERROR_H
#include <ndb_global.h>
#include <NdbOut.hpp>
#include "userInterface.h"
#include <NdbError.hpp>
#include <NdbApi.hpp>
#define error_handler(x,y, z) { \
ndbout << x << " " << y << endl; \
exit(-1); }
#define CHECK_MINUS_ONE(x, y, z) if(x == -1) \
error_handler(y,(z->getNdbError()), 0)
inline
void
CHECK_ALLOWED_ERROR(const char * str,
const ThreadData * td,
const struct NdbError & error){
char buf[100];
snprintf(buf, sizeof(buf), "subscriber = %.*s ",
SUBSCRIBER_NUMBER_LENGTH,
td->transactionData.number);
ndbout << str << " " << error << endl
<< buf;
showTime();
switch(error.classification) {
case NdbError::TimeoutExpired:
case NdbError::OverloadError:
case NdbError::TemporaryResourceError:
case NdbError::NodeRecoveryError:
break;
default:
if(error.status != NdbError::TemporaryError)
exit(-1);
}
}
inline
void
CHECK_NULL(void * null,
const char * str,
const ThreadData * td,
const struct NdbError & err){
if(null == 0){
CHECK_ALLOWED_ERROR(str, td, err);
exit(-1);
}
}
inline
void
CHECK_NULL(void * null, const char* msg, NdbConnection* obj)
{
if(null == 0)
{
error_handler(msg, obj->getNdbError(), 0);
}
}
#endif
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NDB_SCHEMA_H
#define NDB_SCHEMA_H
#include "testDefinitions.h"
#define SUBSCRIBER_TABLE "SUBSCRIBER"
#define SUBSCRIBER_NUMBER "NUMBER"
#define SUBSCRIBER_LOCATION "LOCATION"
#define SUBSCRIBER_NAME "NAME"
#define SUBSCRIBER_GROUP "GROUP_ID"
#define SUBSCRIBER_SESSIONS "SESSIONS"
#define SUBSCRIBER_CHANGED_BY "CHANGED_BY"
#define SUBSCRIBER_CHANGED_TIME "CHANGED_TIME"
#define SERVER_TABLE "SERVER"
#define SERVER_ID "SERVER_ID"
#define SERVER_SUBSCRIBER_SUFFIX "SUFFIX"
#define SERVER_NAME "NAME"
#define SERVER_READS "NO_OF_READ"
#define SERVER_INSERTS "NO_OF_INSERT"
#define SERVER_DELETES "NO_OF_DELETE"
#define GROUP_TABLE "GROUP"
#define GROUP_ID "GROUP_ID"
#define GROUP_NAME "GROUP_NAME"
#define GROUP_ALLOW_READ "ALLOW_READ"
#define GROUP_ALLOW_INSERT "ALLOW_INSERT"
#define GROUP_ALLOW_DELETE "ALLOW_DELETE"
#define SESSION_TABLE "SESSION"
#define SESSION_SERVER "SERVER_ID"
#define SESSION_SUBSCRIBER "NUMBER"
#define SESSION_DATA "DATA"
/** Numbers */
#define IND_SUBSCRIBER_NUMBER (unsigned)0
#define IND_SUBSCRIBER_NAME (unsigned)1
#define IND_SUBSCRIBER_GROUP (unsigned)2
#define IND_SUBSCRIBER_LOCATION (unsigned)3
#define IND_SUBSCRIBER_SESSIONS (unsigned)4
#define IND_SUBSCRIBER_CHANGED_BY (unsigned)5
#define IND_SUBSCRIBER_CHANGED_TIME (unsigned)6
#define IND_SERVER_SUBSCRIBER_SUFFIX (unsigned)0
#define IND_SERVER_ID (unsigned)1
#define IND_SERVER_NAME (unsigned)2
#define IND_SERVER_READS (unsigned)3
#define IND_SERVER_INSERTS (unsigned)4
#define IND_SERVER_DELETES (unsigned)5
#define IND_GROUP_ID (unsigned)0
#define IND_GROUP_NAME (unsigned)1
#define IND_GROUP_ALLOW_READ (unsigned)2
#define IND_GROUP_ALLOW_INSERT (unsigned)3
#define IND_GROUP_ALLOW_DELETE (unsigned)4
#define IND_SESSION_SUBSCRIBER (unsigned)0
#define IND_SESSION_SERVER (unsigned)1
#define IND_SESSION_DATA (unsigned)2
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef TESTDATA_H
#define TESTDATA_H
/***************************************************************
* I N C L U D E D F I L E S *
***************************************************************/
#include <NdbTick.h>
#include <NdbThread.h>
#include <NDBT_Stats.hpp>
#include <random.h>
#include "testDefinitions.h"
/***************************************************************
* M A C R O S *
***************************************************************/
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
#define NUM_TRANSACTION_TYPES 5
#define SESSION_LIST_LENGTH 1000
/***************************************************************
* D A T A S T R U C T U R E S *
***************************************************************/
typedef struct {
SubscriberNumber subscriberNumber;
ServerId serverId;
} SessionElement;
typedef struct {
SessionElement list[SESSION_LIST_LENGTH];
unsigned int readIndex;
unsigned int writeIndex;
unsigned int numberInList;
} SessionList;
typedef struct {
unsigned int count;
unsigned int branchExecuted;
unsigned int rollbackExecuted;
/**
* Latency measures
*/
NDB_TICKS startTime;
NDBT_Stats latency;
unsigned int latencyCounter;
inline void startLatency(){
if((latencyCounter & 127) == 127)
startTime = NdbTick_CurrentMillisecond();
}
inline void stopLatency(){
if((latencyCounter & 127) == 127){
const NDB_TICKS tmp = NdbTick_CurrentMillisecond() - startTime;
latency.addObservation(tmp);
}
latencyCounter++;
}
} TransactionDefinition;
typedef struct {
RandomSequence transactionSequence;
RandomSequence rollbackSequenceT4;
RandomSequence rollbackSequenceT5;
TransactionDefinition transactions[NUM_TRANSACTION_TYPES];
unsigned int totalTransactions;
double outerLoopTime;
double outerTps;
SessionList activeSessions;
} GeneratorStatistics;
typedef enum{
Runnable,
Running
} RunState ;
typedef struct {
SubscriberNumber number;
SubscriberSuffix suffix;
SubscriberName name;
Location location;
ChangedBy changed_by;
ChangedTime changed_time;
ServerId server_id;
ServerBit server_bit;
SessionDetails session_details;
GroupId group_id;
ActiveSessions sessions;
Permission permission;
unsigned int do_rollback;
unsigned int branchExecuted;
unsigned int sessionElement;
} TransactionData ;
typedef struct {
struct NdbThread* pThread;
unsigned long randomSeed;
unsigned long changedTime;
unsigned int warmUpSeconds;
unsigned int testSeconds;
unsigned int coolDownSeconds;
GeneratorStatistics generator;
/**
* For async execution
*/
RunState runState;
double startTime;
TransactionData transactionData;
struct Ndb * pNDB;
} ThreadData;
/***************************************************************
* P U B L I C F U N C T I O N S *
***************************************************************/
/***************************************************************
* E X T E R N A L D A T A *
***************************************************************/
#endif /* TESTDATA_H */
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef TESTDEFINITIONS_H
#define TESTDEFINITIONS_H
/***************************************************************/
/* I N C L U D E D F I L E S */
/***************************************************************/
#include <ndb_types.h>
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
#define OP_PER_TRANS 200
#define NO_OF_SUBSCRIBERS 500000
#define NO_OF_GROUPS 100
#define NO_OF_SERVERS 20
#define SUBSCRIBER_NUMBER_LENGTH 12
#define SUBSCRIBER_NUMBER_SUFFIX_LENGTH 2
#define SUBSCRIBER_NAME_LENGTH 32
#define CHANGED_BY_LENGTH 32
#define CHANGED_TIME_LENGTH 32
#define SESSION_DETAILS_LENGTH 2000
#define SERVER_NAME_LENGTH 32
#define GROUP_NAME_LENGTH 32
/***************************************************************
* D A T A S T R U C T U R E S *
***************************************************************/
#define PADDING 4
typedef char SubscriberNumber[SUBSCRIBER_NUMBER_LENGTH];
typedef char SubscriberSuffix[SUBSCRIBER_NUMBER_SUFFIX_LENGTH + 2];
typedef char SubscriberName[SUBSCRIBER_NAME_LENGTH];
typedef char ServerName[SERVER_NAME_LENGTH];
typedef char GroupName[GROUP_NAME_LENGTH];
typedef char ChangedBy[CHANGED_BY_LENGTH];
typedef char ChangedTime[CHANGED_TIME_LENGTH];
typedef char SessionDetails[SESSION_DETAILS_LENGTH];
typedef Uint32 ServerId;
typedef Uint32 ServerBit;
typedef Uint32 GroupId;
typedef Uint32 Location;
typedef Uint32 Permission;
typedef Uint32 Counter;
typedef Uint32 ActiveSessions;
typedef unsigned int BranchExecuted;
typedef unsigned int DoRollback;
/***************************************************************
* P U B L I C F U N C T I O N S *
***************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
/***************************************************************
* E X T E R N A L D A T A *
***************************************************************/
#endif /* TESTDEFINITIONS_H */
This diff is collapsed.
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef DBINTERFACE_H
#define DBINTERFACE_H
/***************************************************************/
/* I N C L U D E D F I L E S */
/***************************************************************/
#include "testDefinitions.h"
#include "testData.h"
/***************************************************************
* M A C R O S *
***************************************************************/
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
/*-----------------------*/
/* Default Database Name */
/*-----------------------*/
#define DEFAULTDB "TestDbClient"
/***************************************************************
* D A T A S T R U C T U R E S *
***************************************************************/
/***************************************************************
* P U B L I C F U N C T I O N S *
***************************************************************/
typedef struct Ndb Ndb;
#ifdef __cplusplus
extern "C" {
#endif
extern void showTime();
extern double userGetTime(void);
extern Ndb *asyncDbConnect(int parallellism);
extern void asyncDbDisconnect(Ndb* pNDB);
extern void start_T1(Ndb * uh, ThreadData * data, int async);
extern void start_T2(Ndb * uh, ThreadData * data, int async);
extern void start_T3(Ndb * uh, ThreadData * data, int async);
extern void start_T4(Ndb * uh, ThreadData * data, int async);
extern void start_T5(Ndb * uh, ThreadData * data, int async);
extern void complete_T1(ThreadData * data);
extern void complete_T2(ThreadData * data);
extern void complete_T3(ThreadData * data);
extern void complete_T4(ThreadData * data);
extern void complete_T5(ThreadData * data);
#ifdef __cplusplus
}
#endif
/***************************************************************/
/* I N C L U D E D F I L E S */
/***************************************************************/
#include "testDefinitions.h"
/***************************************************************
* M A C R O S *
***************************************************************/
/***************************************************************/
/* C O N S T A N T S */
/***************************************************************/
/*-----------------------*/
/* Default Database Name */
/*-----------------------*/
#define DEFAULTDB "TestDbClient"
/***************************************************************
* D A T A S T R U C T U R E S *
***************************************************************/
typedef struct {
struct Ndb_cluster_connection* pNCC;
struct Ndb * pNDB;
struct NdbConnection * pCurrTrans;
} UserHandle;
/***************************************************************
* P U B L I C F U N C T I O N S *
***************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
extern double userGetTimeSync(void);
extern void userCheckpoint(UserHandle *uh);
extern UserHandle *userDbConnect(uint32 createDb, char *dbName);
extern void userDbDisconnect(UserHandle *uh);
extern int userDbInsertServer(UserHandle *uh,
ServerId serverId,
SubscriberSuffix suffix,
ServerName name);
extern int userDbInsertSubscriber(UserHandle *uh,
SubscriberNumber number,
uint32 groupId,
SubscriberName name);
extern int userDbInsertGroup(UserHandle *uh,
GroupId groupId,
GroupName name,
Permission allowRead,
Permission allowInsert,
Permission allowDelete);
extern int userDbCommit(UserHandle *uh);
extern int userDbRollback(UserHandle *uh);
#ifdef __cplusplus
}
#endif
/***************************************************************
* E X T E R N A L D A T A *
***************************************************************/
#endif /* DBINTERFACE_H */
......@@ -192,7 +192,7 @@ void install_db(char *datadir)
char error[PATH_MAX];
// input file
snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir);
snprintf(input, PATH_MAX, "%s/bin/test_db.sql", base_dir);
snprintf(output, PATH_MAX, "%s/install.out", datadir);
snprintf(error, PATH_MAX, "%s/install.err", datadir);
......@@ -1160,7 +1160,8 @@ void setup(char *file)
setenv("MASTER_MYPORT", "9306", 1);
setenv("SLAVE_MYPORT", "9307", 1);
setenv("MYSQL_TCP_PORT", "3306", 1);
snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port);
setenv("MYSQL_CLIENT_TEST",file_path,1);
}
/******************************************************************************
......
......@@ -493,6 +493,24 @@ sub print_insert_header
}
}
print <<EOF;
-- Copyright (C) 2000-2005 MySQL AB
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
EOF
print "delete from help_topic;\n";
print "delete from help_category;\n";
print "delete from help_keyword;\n";
......
This diff is collapsed.
......@@ -290,7 +290,11 @@ public:
int cuted_increment);
void set_datetime_warning(const uint level, const uint code,
double nr, timestamp_type ts_type);
int check_overflow(int op_result);
inline bool check_overflow(int op_result)
{
return (op_result == E_DEC_OVERFLOW);
}
int warn_if_overflow(int op_result);
virtual field_cast_enum field_cast_type()= 0;
bool field_cast_compatible(field_cast_enum type);
/* maximum possible display length */
......
......@@ -60,7 +60,6 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
{
/* Initialize variables for the opened table */
set_keys_for_scanning();
if (table->s->tmp_table == NO_TMP_TABLE)
update_key_stats();
}
return (file ? 0 : 1);
......@@ -104,6 +103,8 @@ void ha_heap::update_key_stats()
for (uint i= 0; i < table->s->keys; i++)
{
KEY *key=table->key_info+i;
if (!key->rec_per_key)
continue;
if (key->algorithm != HA_KEY_ALG_BTREE)
{
ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
......@@ -124,8 +125,8 @@ int ha_heap::write_row(byte * buf)
if (table->next_number_field && buf == table->record[0])
update_auto_increment();
res= heap_write(file,buf);
if (!res && table->s->tmp_table == NO_TMP_TABLE &&
++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records)
if (!res && (++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
file->s->records))
update_key_stats();
return res;
}
......@@ -137,8 +138,8 @@ int ha_heap::update_row(const byte * old_data, byte * new_data)
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
res= heap_update(file,old_data,new_data);
if (!res && table->s->tmp_table == NO_TMP_TABLE &&
++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records)
if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
file->s->records)
update_key_stats();
return res;
}
......
......@@ -2363,11 +2363,10 @@ void ha_ndbcluster::print_results()
String val(buf_val, sizeof(buf_val), &my_charset_bin);
for (uint f=0; f<table->s->fields;f++)
{
// Use DBUG_PRINT since DBUG_FILE cannot be filtered out
/* Use DBUG_PRINT since DBUG_FILE cannot be filtered out */
char buf[2000];
Field *field;
void* ptr;
const NDBCOL *col= NULL;
NdbValue value;
NdbBlob *ndb_blob;
......@@ -2380,8 +2379,6 @@ void ha_ndbcluster::print_results()
}
ptr= field->ptr;
DBUG_DUMP("field->ptr", (char*)ptr, field->pack_length());
col= tab->getColumn(f);
if (! (field->flags & BLOB_FLAG))
{
......@@ -2409,7 +2406,7 @@ void ha_ndbcluster::print_results()
}
print_value:
DBUG_PRINT("value", ("%u,%s: %s", f, col->getName(), buf));
DBUG_PRINT("value", ("%u,%s: %s", f, field->field_name, buf));
}
#endif
DBUG_VOID_RETURN;
......
This diff is collapsed.
......@@ -334,6 +334,9 @@ public:
virtual void update_used_tables() {}
virtual void split_sum_func(THD *thd, Item **ref_pointer_array,
List<Item> &fields) {}
/* Called for items that really have to be split */
void split_sum_func2(THD *thd, Item **ref_pointer_array, List<Item> &fields,
Item **ref);
virtual bool get_date(TIME *ltime,uint fuzzydate);
virtual bool get_time(TIME *ltime);
virtual bool get_date_result(TIME *ltime,uint fuzzydate)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1027,6 +1027,7 @@ public:
bool charset_is_system_charset, charset_is_collation_connection;
bool slow_command;
bool no_trans_update, abort_on_warning;
bool got_warning; /* Set on call to push_warning() */
longlong row_count_func; /* For the ROW_COUNT() function */
sp_rcontext *spcont; // SP runtime context
sp_cache *sp_proc_cache;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment