Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/jonas/src/mysql-5.0
This commit is contained in:
joreland@mysql.com 2004-12-31 06:14:18 +01:00
commit dd32940b50
508 changed files with 12900 additions and 31332 deletions

View file

@ -104,6 +104,7 @@ PENDING/*
TAGS
ac_available_languages_fragment
aclocal.m4
analyse.test
autom4te-2.53.cache/*
autom4te-2.53.cache/output.0
autom4te-2.53.cache/requests
@ -260,6 +261,7 @@ client/mf_iocache.c
client/mf_iocache.cc
client/mysql
client/mysqladmin
client/mysqladmin.c
client/mysqlbinlog
client/mysqlcheck
client/mysqldump
@ -300,14 +302,17 @@ depcomp
emacs.h
extra/charset2html
extra/comp_err
extra/created_include_files
extra/my_print_defaults
extra/mysql_install
extra/mysql_tzinfo_to_sql
extra/mysql_waitpid
extra/mysqld_error.h
extra/perror
extra/replace
extra/resolve_stack_dump
extra/resolveip
extra/sql_state.h
extra/tztime.cc
fcns.c
fcns.h
@ -538,6 +543,7 @@ myisam/test2.MYD
myisam/test2.MYI
mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-4.0.2-alpha.tar.gz
mysql-4.1.8-win-src.zip
mysql-5.0.2-alpha.tar.gz
mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-test/gmon.out
@ -983,6 +989,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
extra/mysqld_error.h
extra/sql_state.h
extra/created_include_files

View file

@ -2,6 +2,7 @@ Administrador@light.
Administrator@co3064164-a.
Administrator@co3064164-a.rochd1.qld.optushome.com.au
Administrator@fred.
Administrator@w2k.
Greg@greg-laptop.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
@ -43,6 +44,7 @@ dlenev@jabberwock.localdomain
dlenev@mysql.com
ejonore@mc03.ndb.mysql.com
georg@beethoven.local
georg@beethoven.site
gerberb@ou800.zenez.com
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
@ -108,6 +110,7 @@ magnus@neptunus.(none)
magnus@shellback.(none)
marko@hundin.mysql.fi
mats@mysql.com
matt@booty.(none)
matt@mysql.com
matthias@three.local.lan
miguel@hegel.(none)
@ -163,6 +166,7 @@ papa@gbichot.local
patg@krsna.patg.net
patg@patrick-galbraiths-computer.local
paul@central.snake.net
paul@frost.snake.net
paul@ice.local
paul@ice.snake.net
paul@kite-hub.kitebird.com

View file

@ -10,8 +10,8 @@ use Sys::Hostname;
$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;
GetOptions(
"bdb",
@ -25,6 +25,7 @@ GetOptions(
"delete",
"distribution=s",
"enable-shared",
"embedded-test",
"fast-benchmark",
"help|Information",
"innodb",
@ -40,6 +41,7 @@ GetOptions(
"one-error",
"perl-files=s",
"perl-options=s",
"ps-test",
"raid",
"readline",
"stage=i",
@ -55,6 +57,8 @@ GetOptions(
"version-suffix=s",
"with-archive",
"with-cluster",
"with-csv",
"with-example",
"with-debug",
"with-low-memory",
"with-other-libc=s",
@ -274,8 +278,11 @@ if ($opt_stage <= 1)
$opt_config_options.= " --with-libedit";
}
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
$opt_embedded_test= 0 if ($opt_without_embedded);
$opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive);
$opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
$opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv);
$opt_config_options.= " --with-example-storage-engine" if ($opt_with_example);
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
@ -376,13 +383,29 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
{
my $flags= "";
my $force= "";
$flags.= " --with-ndbcluster" if ($opt_with_cluster);
$flags.= " --force" if (!$opt_one_error);
log_timestamp();
info("Running test suite");
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
safe_cd("${test_dir}/mysql-test");
check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
if ($opt_ps_test)
{
log_timestamp();
info("Running test suite using prepared statements");
check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
}
if ($opt_embedded_test)
{
log_timestamp();
info("Running embedded server test suite");
# Embedded server and NDB don't jive
$flags=~ s/ --with-ndbcluster//;
check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
}
# 'mysql-test-run' writes its own final message for log evaluation.
}
@ -528,6 +551,9 @@ Delete the distribution file.
--distribution=<distribution_file>
Name of the MySQL source distribution file.
--embedded-test
Run the test suite against the embedded server
--enable-shared
Compile with shared libraries
@ -576,6 +602,9 @@ Compile and install the given perl modules.
--perl-options=<options>
Build Perl modules with the additional options
--ps-test
Run an additional test run, using prepared statements
--raid
Compile with RAID support
@ -612,11 +641,17 @@ If user is empty then no mail is sent.
Set name suffix (e.g. 'com' or '-max') for a distribution
--with archive
Enable the Archive storage Engine
Enable the Archive storage engine
--with cluster
Compile and test with NDB Cluster enabled
--with-csv
Enable the CSV storage engine
--with-example
Enable the Example storage engine
--with-debug
Build binaries with debug information (implies "--no-strip")

View file

@ -100,7 +100,7 @@ tags:
# Test installation
test:
cd mysql-test ; ./mysql-test-run
cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol
# Don't update the files from bitkeeper
%::SCCS/s.%

View file

@ -42,8 +42,8 @@ RSC=rc.exe
# 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 "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "_DEBUG"
@ -52,8 +52,8 @@ 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 mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# 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:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ELSEIF "$(CFG)" == "mysqltest - Win32 classic"
@ -77,8 +77,8 @@ 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 mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# 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 /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ELSEIF "$(CFG)" == "mysqltest - Win32 Release"
@ -102,8 +102,8 @@ 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 mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# 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 /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ENDIF

View file

@ -2,7 +2,7 @@
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=mysql_test_run_new - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
@ -17,8 +17,8 @@ CFG=mysql_test_run_new - Win32 Debug
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@ -33,51 +33,51 @@ RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# 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 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_test_run.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_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE MTL /nologo /win32
# ADD MTL /nologo /win32
# 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_test_run_new.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_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.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 Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows
# 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 Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows
# 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:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.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 Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console
!ELSEIF "$(CFG)" == "mysql_test_run_new - 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 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 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 /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 /Fo".\release/" /Fd".\release/" /c /GX
# ADD BASE MTL /nologo /win32
# ADD MTL /nologo /win32
# 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/mysql_test_run_new.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/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.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 Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows
# 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 Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows
# 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:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
# 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:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
!ENDIF
@ -87,19 +87,19 @@ LINK32=link.exe
# Name "mysql_test_run_new - Win32 Release"
# Begin Source File
SOURCE=my_create_tables.c
SOURCE=.\my_create_tables.c
# End Source File
# Begin Source File
SOURCE=my_manage.c
SOURCE=.\my_manage.c
# End Source File
# Begin Source File
SOURCE=my_manage.h
SOURCE=.\my_manage.h
# End Source File
# Begin Source File
SOURCE=mysql_test_run_new.c
SOURCE=.\mysql_test_run_new.c
# End Source File
# End Target
# End Project

View file

@ -824,11 +824,20 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libmysql
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysys
End Project Dependency
Begin Project Dependency
Project_Dep_Name regex
End Project Dependency
}}}
###############################################################################
Project: "mysql_test_run_new"=.\mysql-test\mysql_test_run_new.dsp - Package Owner=<4>
Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4>
Package=<5>
{{{
@ -836,6 +845,12 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name mysqltest
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysqladmin
End Project Dependency
}}}
###############################################################################

View file

@ -1,102 +0,0 @@
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : MySqlManager
========================================================================
AppWizard has created this MySqlManager application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your MySqlManager application.
MySqlManager.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CMySqlManagerApp application class.
MySqlManager.cpp
This is the main application source file that contains the application
class CMySqlManagerApp.
MySqlManager.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Developer Studio.
res\MySqlManager.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file MySqlManager.rc.
res\MySqlManager.rc2
This file contains resources that are not edited by Microsoft
Developer Studio. You should place all resources not
editable by the resource editor in this file.
MySqlManager.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
/////////////////////////////////////////////////////////////////////////////
For the main frame window:
MainFrm.h, MainFrm.cpp
These files contain the frame class CMainFrame, which is derived from
CMDIFrameWnd and controls all MDI frame features.
res\Toolbar.bmp
This bitmap file is used to create tiled images for the toolbar.
The initial toolbar and status bar are constructed in the
CMainFrame class. Edit this toolbar bitmap along with the
array in MainFrm.cpp to add more toolbar buttons.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one document type and one view:
MySqlManagerDoc.h, MySqlManagerDoc.cpp - the document
These files contain your CMySqlManagerDoc class. Edit these files to
add your special document data and to implement file saving and loading
(via CMySqlManagerDoc::Serialize).
MySqlManagerView.h, MySqlManagerView.cpp - the view of the document
These files contain your CMySqlManagerView class.
CMySqlManagerView objects are used to view CMySqlManagerDoc objects.
res\MySqlManagerDoc.ico
This is an icon file, which is used as the icon for MDI child windows
for the CMySqlManagerDoc class. This icon is included by the main
resource file MySqlManager.rc.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named MySqlManager.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Developer Studio reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC40XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC40DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,13 +0,0 @@
//
// MYSQLMANAGER.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,65 +0,0 @@
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "ChildFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CMDIChildWnd::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers

View file

@ -1,52 +0,0 @@
// ChildFrm.h : interface of the CChildFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHILDFRM_H__826CB2F0_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_CHILDFRM_H__826CB2F0_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CChildFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CChildFrame)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHILDFRM_H__826CB2F0_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,134 +0,0 @@
#ifndef _CRESOURCE_H
#define _CRESOURCE_H
/////////////////////////////////////////////////////////////////////////////
#define MYSQL_PORT_AS_STRING "3306" /* Can't use # in preprocessor because of bugs in VC++ 5.0 */
class CResource
{
public:
enum eRESOURCETYPE
{
eNone
, eServer
, eDatabase
, eTable
, eField
, eProcesslist
, eProcesslistItem
};
virtual LPCTSTR GetDisplayName() { return ""; }
virtual LPCTSTR GetHostName() { return LOCAL_HOST; }
virtual LPCTSTR GetUserName() { return "root"; }
virtual LPCTSTR GetPassword() { return ""; }
virtual LPCTSTR GetPortName() { return MYSQL_PORT_AS_STRING; }
virtual int GetPortNumber() { return MYSQL_PORT; }
virtual eRESOURCETYPE GetType() { return eNone; }
};
/////////////////////////////////////////////////////////////////////////////
class CResourceServer : public CResource
{
public:
CResourceServer(LPCTSTR pszName = "",LPCTSTR pszHost = LOCAL_HOST ,LPCTSTR pszUser = "root", LPCTSTR pszPassword = "", LPCTSTR pszPort = MYSQL_PORT_AS_STRING)
: m_strName(pszName)
, m_strHost(pszHost)
, m_strUser(pszUser)
, m_strPassword(pszPassword)
, m_strPort(pszPort)
{
}
virtual LPCTSTR GetDisplayName() { return m_strName; }
virtual LPCTSTR GetHostName() { return m_strHost; }
virtual LPCTSTR GetUserName() { return m_strUser; }
virtual LPCTSTR GetPassword() { return m_strPassword; }
virtual eRESOURCETYPE GetType() { return eServer; }
virtual LPCTSTR GetPortName() { return m_strPort; }
virtual int GetPortNumber() { return atoi(m_strPort); }
CString m_strName;
CString m_strHost;
CString m_strUser;
CString m_strPassword;
CString m_strPort;
CStringArray m_rgFields;
};
/////////////////////////////////////////////////////////////////////////////
class CResourceDatabase : public CResource
{
public:
CResourceDatabase(LPCTSTR pszName = "")
: m_strName(pszName)
{
}
virtual LPCTSTR GetDisplayName() { return m_strName; }
virtual eRESOURCETYPE GetType() { return eDatabase; }
CString m_strName;
CStringArray m_rgFields;
};
/////////////////////////////////////////////////////////////////////////////
class CResourceTable : public CResource
{
public:
CResourceTable(LPCTSTR pszName = "")
: m_strName(pszName)
{
}
virtual LPCTSTR GetDisplayName() { return m_strName; }
virtual eRESOURCETYPE GetType() { return eTable; }
CString m_strName;
CStringArray m_rgFields;
};
/////////////////////////////////////////////////////////////////////////////
class CResourceField : public CResource
{
public:
CResourceField(LPCTSTR pszName = "")
: m_strName(pszName)
{
}
virtual LPCTSTR GetDisplayName() { return m_strName; }
virtual eRESOURCETYPE GetType() { return eField; }
CString m_strName;
CStringArray m_rgFields;
};
/////////////////////////////////////////////////////////////////////////////
class CResourceProcesslist : public CResource
{
public:
CResourceProcesslist(LPCTSTR pszName = "Processlist")
: m_strName(pszName)
{
}
virtual LPCTSTR GetDisplayName() { return m_strName; }
virtual eRESOURCETYPE GetType() { return eProcesslist; }
CString m_strName;
CStringArray m_rgFields;
};
/////////////////////////////////////////////////////////////////////////////
class CResourceProcesslistItem : public CResourceProcesslist
{
public:
CResourceProcesslistItem(LPCTSTR pszName = "ProcesslistItem")
: CResourceProcesslist(pszName)
{
}
virtual eRESOURCETYPE GetType() { return eProcesslistItem; }
};
#endif

View file

@ -1,137 +0,0 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "MainFrm.h"
CMainFrame* CMainFrame::g_pMainFrame = NULL;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.Create(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips or a resizeable toolbar
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CMDIFrameWnd::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
int CMainFrame::StatusMsg ( LPCSTR fmt, ... )
{
char buf [2048];
va_list args;
va_start(args, fmt);
int ret = vsprintf(buf, fmt, args);
if ( this != NULL )
{
static char g_StatusMsg_Buffer_TT [ 2048 ];
memcpy ( g_StatusMsg_Buffer_TT, buf, sizeof(g_StatusMsg_Buffer_TT) );
m_wndStatusBar.SetPaneText ( 0, buf );
m_wndStatusBar.UpdateWindow ();
}
va_end(args);
return ( ret );
}
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
g_pMainFrame = this;
return CMDIFrameWnd::OnCreateClient(lpcs, pContext);
}

View file

@ -1,69 +0,0 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__826CB2EE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_MAINFRM_H__826CB2EE_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
int StatusMsg ( LPCSTR fmt, ... );
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
static CMainFrame* g_pMainFrame;
};
#define MainFrame ( CMainFrame::g_pMainFrame ? CMainFrame::g_pMainFrame : (CMainFrame*) AfxGetMainWnd() -> GetTopLevelFrame() )
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__826CB2EE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,168 +0,0 @@
// MySqlManager.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#include "MySqlManagerDoc.h"
#include "MySqlManagerView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerApp
BEGIN_MESSAGE_MAP(CMySqlManagerApp, CWinApp)
//{{AFX_MSG_MAP(CMySqlManagerApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerApp construction
CMySqlManagerApp::CMySqlManagerApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMySqlManagerApp object
CMySqlManagerApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerApp initialization
BOOL CMySqlManagerApp::InitInstance()
{
WSADATA WsaData;
if (SOCKET_ERROR == WSAStartup (0x0101, &WsaData))
{
AfxMessageBox("WSAStartup Failed\n");
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MYSQLMTYPE,
RUNTIME_CLASS(CMySqlManagerDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CMySqlManagerView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum {IDD = IDD_ABOUTBOX};
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CMySqlManagerApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerApp commands

View file

@ -1,277 +0,0 @@
# Microsoft Developer Studio Project File - Name="MySqlManager" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=MySqlManager - 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 "MySqlManager.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 "MySqlManager.mak" CFG="MySqlManager - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "MySqlManager - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "MySqlManager - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "MySqlManager - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /WX /Fr /YX /Yc /Yu
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"../client_release/MySqlManager.exe"
# SUBTRACT LINK32 /nodefaultlib
!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /GR /GX /Z7 /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /Fr /YX /Yc /Yu
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /o "NUL" /win32
# SUBTRACT MTL /mktyplib203
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "MySqlManager - Win32 Release"
# Name "MySqlManager - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\ChildFrm.cpp
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-extra.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-latin1.c"
# End Source File
# Begin Source File
SOURCE="..\strings\ctype-mb.c"
# End Source File
# Begin Source File
SOURCE=..\strings\is_prefix.c
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=..\mysys\my_sleep.c
# End Source File
# Begin Source File
SOURCE=..\strings\my_vsnprintf.c
# End Source File
# Begin Source File
SOURCE=.\MySqlManager.cpp
# End Source File
# Begin Source File
SOURCE=.\MySqlManager.rc
# End Source File
# Begin Source File
SOURCE=.\MySqlManagerDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\MySqlManagerView.cpp
# End Source File
# Begin Source File
SOURCE=.\RegisterServer.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\ToolSql.cpp
# End Source File
# Begin Source File
SOURCE=.\ToolSqlQuery.cpp
# End Source File
# Begin Source File
SOURCE=.\ToolSqlResults.cpp
# End Source File
# Begin Source File
SOURCE=.\ToolSqlStatus.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\ChildFrm.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\MySqlManager.h
# End Source File
# Begin Source File
SOURCE=.\MySqlManagerDoc.h
# End Source File
# Begin Source File
SOURCE=.\MySqlManagerView.h
# End Source File
# Begin Source File
SOURCE=.\RegisterServer.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\ToolSqlQuery.h
# End Source File
# Begin Source File
SOURCE=.\ToolSqlResults.h
# End Source File
# Begin Source File
SOURCE=.\ToolSqlStatus.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\bitmap1.bmp
# End Source File
# Begin Source File
SOURCE=.\res\bitmap3.bmp
# End Source File
# Begin Source File
SOURCE=.\res\bmp00001.bmp
# End Source File
# Begin Source File
SOURCE=.\res\bmp00002.bmp
# End Source File
# Begin Source File
SOURCE=.\res\database.bmp
# End Source File
# Begin Source File
SOURCE=.\res\fontd.bmp
# End Source File
# Begin Source File
SOURCE=.\res\fontu.bmp
# End Source File
# Begin Source File
SOURCE=.\res\MySqlManager.ico
# End Source File
# Begin Source File
SOURCE=.\res\MySqlManager.rc2
# End Source File
# Begin Source File
SOURCE=.\res\MySqlManagerDoc.ico
# End Source File
# Begin Source File
SOURCE=.\res\query_ex.bmp
# End Source File
# Begin Source File
SOURCE=.\res\Toolbar.bmp
# End Source File
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project

View file

@ -1,50 +0,0 @@
// MySqlManager.h : main header file for the MYSQLMANAGER application
//
#if !defined(AFX_MYSQLMANAGER_H__826CB2EA_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_MYSQLMANAGER_H__826CB2EA_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerApp:
// See MySqlManager.cpp for the implementation of this class
//
class CMySqlManagerApp : public CWinApp
{
public:
CMySqlManagerApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMySqlManagerApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CMySqlManagerApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MYSQLMANAGER_H__826CB2EA_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,327 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on MySqlManager.dsp
!IF "$(CFG)" == ""
CFG=MySqlManager - Win32 Debug
!MESSAGE No configuration specified. Defaulting to MySqlManager - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "MySqlManager - Win32 Release" && "$(CFG)" != "MySqlManager - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!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 "MySqlManager.mak" CFG="MySqlManager - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "MySqlManager - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "MySqlManager - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "MySqlManager - Win32 Release"
OUTDIR=.\release
INTDIR=.\release
# Begin Custom Macros
OutDir=.\release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "..\client_release\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
!ELSE
ALL : "mysqlclient - Win32 Release" "..\client_release\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"mysqlclient - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\ChildFrm.obj"
-@erase "$(INTDIR)\MainFrm.obj"
-@erase "$(INTDIR)\MySqlManager.obj"
-@erase "$(INTDIR)\MySqlManager.pch"
-@erase "$(INTDIR)\MySqlManager.res"
-@erase "$(INTDIR)\MySqlManagerDoc.obj"
-@erase "$(INTDIR)\MySqlManagerView.obj"
-@erase "$(INTDIR)\RegisterServer.obj"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\ToolSql.obj"
-@erase "$(INTDIR)\ToolSqlQuery.obj"
-@erase "$(INTDIR)\ToolSqlResults.obj"
-@erase "$(INTDIR)\ToolSqlStatus.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "..\client_release\MySqlManager.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /G6 /MT /W3 /GX /O1 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\MySqlManager.res" /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\MySqlManager.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=/nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\MySqlManager.pdb" /machine:I386 /out:"../client_release/MySqlManager.exe"
LINK32_OBJS= \
"$(INTDIR)\ChildFrm.obj" \
"$(INTDIR)\MainFrm.obj" \
"$(INTDIR)\MySqlManager.obj" \
"$(INTDIR)\MySqlManagerDoc.obj" \
"$(INTDIR)\MySqlManagerView.obj" \
"$(INTDIR)\RegisterServer.obj" \
"$(INTDIR)\StdAfx.obj" \
"$(INTDIR)\ToolSql.obj" \
"$(INTDIR)\ToolSqlQuery.obj" \
"$(INTDIR)\ToolSqlResults.obj" \
"$(INTDIR)\ToolSqlStatus.obj" \
"$(INTDIR)\MySqlManager.res" \
"..\lib_release\mysqlclient.lib"
"..\client_release\MySqlManager.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
OUTDIR=.\debug
INTDIR=.\debug
# Begin Custom Macros
OutDir=.\debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "..\client_debug\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
!ELSE
ALL : "mysqlclient - Win32 Debug" "..\client_debug\MySqlManager.exe" "$(OUTDIR)\MySqlManager.pch"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"mysqlclient - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\ChildFrm.obj"
-@erase "$(INTDIR)\MainFrm.obj"
-@erase "$(INTDIR)\MySqlManager.obj"
-@erase "$(INTDIR)\MySqlManager.pch"
-@erase "$(INTDIR)\MySqlManager.res"
-@erase "$(INTDIR)\MySqlManagerDoc.obj"
-@erase "$(INTDIR)\MySqlManagerView.obj"
-@erase "$(INTDIR)\RegisterServer.obj"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\ToolSql.obj"
-@erase "$(INTDIR)\ToolSqlQuery.obj"
-@erase "$(INTDIR)\ToolSqlResults.obj"
-@erase "$(INTDIR)\ToolSqlStatus.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\MySqlManager.pdb"
-@erase "..\client_debug\MySqlManager.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
MTL_PROJ=/nologo /D "_DEBUG" /o "NUL" /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\MySqlManager.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\MySqlManager.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\MySqlManager.pdb" /debug /machine:I386 /out:"../client_debug/MySqlManager.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
LINK32_OBJS= \
"$(INTDIR)\ChildFrm.obj" \
"$(INTDIR)\MainFrm.obj" \
"$(INTDIR)\MySqlManager.obj" \
"$(INTDIR)\MySqlManagerDoc.obj" \
"$(INTDIR)\MySqlManagerView.obj" \
"$(INTDIR)\RegisterServer.obj" \
"$(INTDIR)\StdAfx.obj" \
"$(INTDIR)\ToolSql.obj" \
"$(INTDIR)\ToolSqlQuery.obj" \
"$(INTDIR)\ToolSqlResults.obj" \
"$(INTDIR)\ToolSqlStatus.obj" \
"$(INTDIR)\MySqlManager.res" \
"..\lib_debug\mysqlclient.lib"
"..\client_debug\MySqlManager.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("MySqlManager.dep")
!INCLUDE "MySqlManager.dep"
!ELSE
!MESSAGE Warning: cannot find "MySqlManager.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "MySqlManager - Win32 Release" || "$(CFG)" == "MySqlManager - Win32 Debug"
SOURCE=.\ChildFrm.cpp
"$(INTDIR)\ChildFrm.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\MainFrm.cpp
"$(INTDIR)\MainFrm.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\MySqlManager.cpp
"$(INTDIR)\MySqlManager.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\MySqlManager.rc
"$(INTDIR)\MySqlManager.res" : $(SOURCE) "$(INTDIR)"
$(RSC) $(RSC_PROJ) $(SOURCE)
SOURCE=.\MySqlManagerDoc.cpp
"$(INTDIR)\MySqlManagerDoc.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\MySqlManagerView.cpp
"$(INTDIR)\MySqlManagerView.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\RegisterServer.cpp
"$(INTDIR)\RegisterServer.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\StdAfx.cpp
!IF "$(CFG)" == "MySqlManager - Win32 Release"
CPP_SWITCHES=/nologo /G6 /MT /W3 /GX /O1 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /Fp"$(INTDIR)\MySqlManager.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\MySqlManager.pch" : $(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
CPP_SWITCHES=/nologo /G6 /MTd /W3 /Gm /GX /ZI /Od /I "../include" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\MySqlManager.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\MySqlManager.pch" : $(SOURCE) "$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ENDIF
SOURCE=.\ToolSql.cpp
"$(INTDIR)\ToolSql.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\ToolSqlQuery.cpp
"$(INTDIR)\ToolSqlQuery.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\ToolSqlResults.cpp
"$(INTDIR)\ToolSqlResults.obj" : $(SOURCE) "$(INTDIR)"
SOURCE=.\ToolSqlStatus.cpp
"$(INTDIR)\ToolSqlStatus.obj" : $(SOURCE) "$(INTDIR)"
!IF "$(CFG)" == "MySqlManager - Win32 Release"
"mysqlclient - Win32 Release" :
cd "\MYSQL-3.23\client"
$(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Release"
cd "..\mysqlmanager"
"mysqlclient - Win32 ReleaseCLEAN" :
cd "\MYSQL-3.23\client"
$(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Release" RECURSE=1 CLEAN
cd "..\mysqlmanager"
!ELSEIF "$(CFG)" == "MySqlManager - Win32 Debug"
"mysqlclient - Win32 Debug" :
cd "\MYSQL-3.23\client"
$(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Debug"
cd "..\mysqlmanager"
"mysqlclient - Win32 DebugCLEAN" :
cd "\MYSQL-3.23\client"
$(MAKE) /$(MAKEFLAGS) /F ".\mysqlclient.mak" CFG="mysqlclient - Win32 Debug" RECURSE=1 CLEAN
cd "..\mysqlmanager"
!ENDIF
!ENDIF

View file

@ -1,572 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""res\\MySqlManager.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""afxprint.rc"" // printing/print preview resources\r\n"
"#endif\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\MySqlManager.ico"
IDR_MYSQLMTYPE ICON DISCARDABLE "res\\MySqlManagerDoc.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
IDB_BITMAP1 BITMAP DISCARDABLE "res\\bitmap3.bmp"
IDB_QUERY_EXECU BITMAP FIXED IMPURE "res\\query_ex.bmp"
IDB_QUERY_EXECD BITMAP FIXED IMPURE "res\\bmp00001.bmp"
IDB_FONTU BITMAP FIXED IMPURE "res\\fontu.bmp"
IDB_FONTD BITMAP FIXED IMPURE "res\\fontd.bmp"
IDB_DATABASESU BITMAP FIXED IMPURE "res\\database.bmp"
IDB_DATABASESD BITMAP FIXED IMPURE "res\\bmp00002.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON ID_FILE_SAVE
SEPARATOR
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
SEPARATOR
BUTTON ID_FILE_PRINT
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM SEPARATOR
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Help"
BEGIN
MENUITEM "&About MySqlManager...", ID_APP_ABOUT
END
END
IDR_MYSQLMTYPE MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Close", ID_FILE_CLOSE
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
MENUITEM "Save &As...", ID_FILE_SAVE_AS
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&Tools"
BEGIN
MENUITEM "SQL &Query", IDM_SQL_TOOL_QUERY
MENUITEM "Register Server", IDM_TOOLS_REGISTER_SERVER
MENUITEM "Server Properties", IDM_TOOLS_SERVER_PROPERTIES
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Window"
BEGIN
MENUITEM "&New Window", ID_WINDOW_NEW
MENUITEM "&Cascade", ID_WINDOW_CASCADE
MENUITEM "&Tile", ID_WINDOW_TILE_HORZ
MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE
END
POPUP "&Help"
BEGIN
MENUITEM "&About MySqlManager...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
"D", IDM_QUERY_DATABASES, VIRTKEY, ALT, NOINVERT
"E", IDM_QUERY_EXEC, VIRTKEY, CONTROL, NOINVERT
"N", ID_FILE_NEW, VIRTKEY, CONTROL, NOINVERT
"O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
"P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT
"S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
VK_F6, ID_NEXT_PANE, VIRTKEY, NOINVERT
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT, NOINVERT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
"X", ID_EDIT_CUT, VIRTKEY, CONTROL, NOINVERT
"X", IDM_QUERY_EXEC, VIRTKEY, ALT, NOINVERT
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 234, 72
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About MySqlManager"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "MySqlManager Version 1.0.2",IDC_STATIC,37,10,119,8,
SS_NOPREFIX
LTEXT "By James Pereira (jpereira@iafrica.com)",IDC_STATIC,37,
49,146,9
DEFPUSHBUTTON "OK",IDOK,195,7,32,14,WS_GROUP
LTEXT "This file is public domain and comes with NO WARRANTY of any kind",
IDC_STATIC,38,25,136,18,SS_SUNKEN
END
IDD_TOOL_SQL DIALOGEX 0, 0, 452, 246
STYLE DS_3DLOOK | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION |
WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_CLIENTEDGE
CAPTION "mySQL Query Tool"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
PUSHBUTTON "OK",IDOK,369,10,12,14,NOT WS_VISIBLE
DEFPUSHBUTTON "Close",IDCANCEL,391,10,50,14
CONTROL "Tab1",IDC_TAB1,"SysTabControl32",0x0,11,26,434,213
CONTROL "IDB_QUERY_EXEC",IDC_QUERY_PB,"Button",BS_OWNERDRAW |
WS_TABSTOP,106,10,12,14
CONTROL "IDB_FONT",IDC_FONT_PB,"Button",BS_OWNERDRAW |
WS_TABSTOP,123,10,12,14
COMBOBOX IDC_SERVER_CB,12,9,85,128,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
CONTROL "IDB_DATABASES",IDC_DATABASES_PB,"Button",BS_OWNERDRAW |
WS_TABSTOP,142,10,12,14
DEFPUSHBUTTON "&Start",IDC_START_PB,315,10,23,14
DEFPUSHBUTTON "S&top",IDC_STOP_PB,343,10,23,14
EDITTEXT IDC_TIMER_SECS,287,10,22,14,ES_AUTOHSCROLL
LTEXT "Interval (s)",IDC_STATIC,249,11,34,8
CONTROL "Clear",IDC_CLEAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
215,11,29,10
END
IDD_TOOL_SQL_QUERY DIALOG DISCARDABLE 0, 0, 452, 247
STYLE WS_CHILD | WS_BORDER
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT,11,11,434,229,ES_MULTILINE | ES_AUTOVSCROLL |
ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL
END
IDD_TOOL_SQL_RESULTS DIALOG DISCARDABLE 0, 0, 452, 247
STYLE WS_CHILD | WS_BORDER
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT,11,11,434,229,ES_MULTILINE | ES_AUTOVSCROLL |
ES_AUTOHSCROLL | WS_VSCROLL
END
IDD_REGISTER_SERVER DIALOG FIXED IMPURE 0, 0, 281, 199
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Register Server"
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "",-1,5,0,270,195
LTEXT "&Server:",-1,12,14,25,8
COMBOBOX ID_SERVER_CB,46,12,159,60,CBS_DROPDOWN | CBS_AUTOHSCROLL |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "&Host",-1,12,33,25,8
COMBOBOX ID_HOST_CB,46,31,159,60,CBS_DROPDOWN | CBS_AUTOHSCROLL |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "&Port",-1,12,53,25,8
COMBOBOX ID_PORT_CB,46,50,159,60,CBS_DROPDOWN | CBS_AUTOHSCROLL |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Login Information",-1,12,82,194,76
CONTROL "Use S&tandard Security",ID_USE_STANDARD_CK,"Button",
BS_AUTORADIOBUTTON | WS_GROUP,19,107,94,11
CONTROL "Use Tr&usted Connection",ID_USE_TRUSTED_CK,"Button",
BS_AUTORADIOBUTTON,19,94,99,11
LTEXT "&Login ID:",1060,37,124,35,8
EDITTEXT ID_USER,77,122,120,12,ES_AUTOHSCROLL | WS_GROUP
LTEXT "&Password:",1061,37,140,35,8
EDITTEXT ID_PASSWORD,77,138,120,12,ES_PASSWORD | ES_AUTOHSCROLL
LTEXT "S&erver Group:",-1,12,164,24,25
CONTROL "&Display Server Status in Server Manager",
ID_DISPLAY_SERVER_STATUS_CK,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,44,168,152,10
DEFPUSHBUTTON "&Register",IDOK,214,11,53,14
PUSHBUTTON "Re&move",ID_REMOVE_PB,214,27,53,14
PUSHBUTTON "&Close",IDCANCEL,214,43,53,14
PUSHBUTTON "&Help",ID_HELP,214,59,53,14
PUSHBUTTON "Ser&vers...",ID_SERVERS_PB,214,92,53,14
PUSHBUTTON "&Groups...",ID_GROUPS_PB,214,108,53,14
END
IDD_TOOL_SQL_STATUS DIALOG DISCARDABLE 0, 0, 452, 247
STYLE WS_CHILD | WS_BORDER
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT,11,11,434,229,ES_MULTILINE | ES_AUTOVSCROLL |
ES_AUTOHSCROLL | WS_VSCROLL
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,2
PRODUCTVERSION 1,0,0,2
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "MySqlManager MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 2\0"
VALUE "InternalName", "MySqlManager\0"
VALUE "LegalCopyright", "Copyright (C) 1998\0"
VALUE "OriginalFilename", "MySqlManager.EXE\0"
VALUE "ProductName", "MySqlManager Application\0"
VALUE "ProductVersion", "1, 0, 0, 2\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 6
RIGHTMARGIN, 227
TOPMARGIN, 7
BOTTOMMARGIN, 65
END
IDD_TOOL_SQL, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 445
TOPMARGIN, 7
BOTTOMMARGIN, 239
END
IDD_TOOL_SQL_QUERY, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 445
TOPMARGIN, 7
BOTTOMMARGIN, 240
END
IDD_TOOL_SQL_RESULTS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 445
TOPMARGIN, 7
BOTTOMMARGIN, 240
END
IDD_TOOL_SQL_STATUS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 445
TOPMARGIN, 7
BOTTOMMARGIN, 240
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "MySqlManager"
IDR_MYSQLMTYPE "\nMySqlM\nMySqlM\n\n\nMySqlManager.Document\nMySqlM Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "MySqlManager"
AFX_IDS_IDLEMESSAGE "Ready"
IDS_QUERY_DATABASES "Query Database(s)"
IDS_REFRESH "Refresh"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "CAP"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "SCRL"
ID_INDICATOR_OVR "OVR"
ID_INDICATOR_REC "REC"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW "Create a new document\nNew"
ID_FILE_OPEN "Open an existing document\nOpen"
ID_FILE_CLOSE "Close the active document\nClose"
ID_FILE_SAVE "Save the active document\nSave"
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
ID_FILE_PRINT "Print the active document\nPrint"
ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "Open this document"
ID_FILE_MRU_FILE2 "Open this document"
ID_FILE_MRU_FILE3 "Open this document"
ID_FILE_MRU_FILE4 "Open this document"
ID_FILE_MRU_FILE5 "Open this document"
ID_FILE_MRU_FILE6 "Open this document"
ID_FILE_MRU_FILE7 "Open this document"
ID_FILE_MRU_FILE8 "Open this document"
ID_FILE_MRU_FILE9 "Open this document"
ID_FILE_MRU_FILE10 "Open this document"
ID_FILE_MRU_FILE11 "Open this document"
ID_FILE_MRU_FILE12 "Open this document"
ID_FILE_MRU_FILE13 "Open this document"
ID_FILE_MRU_FILE14 "Open this document"
ID_FILE_MRU_FILE15 "Open this document"
ID_FILE_MRU_FILE16 "Open this document"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_NEW "Open another window for the active document\nNew Window"
ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons"
ID_WINDOW_CASCADE "Arrange windows so they overlap\nCascade Windows"
ID_WINDOW_TILE_HORZ "Arrange windows as non-overlapping tiles\nTile Windows"
ID_WINDOW_TILE_VERT "Arrange windows as non-overlapping tiles\nTile Windows"
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "Erase the selection\nErase"
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
ID_EDIT_FIND "Find the specified text\nFind"
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
ID_EDIT_UNDO "Undo the last action\nUndo"
ID_EDIT_REDO "Redo the previously undone action\nRedo"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "Change the window size"
AFX_IDS_SCMOVE "Change the window position"
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "Restore the window to normal size"
AFX_IDS_SCTASKLIST "Activate Task List"
AFX_IDS_MDICHILD "Activate this window"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
IDC_QUERY_PB "Execute Query"
IDS_QUERY_EXEC "Execute Query"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif
#include "res\MySqlManager.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#include "afxprint.rc" // printing/print preview resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -1,84 +0,0 @@
// MySqlManagerDoc.cpp : implementation of the CMySqlManagerDoc class
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "MySqlManagerDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerDoc
IMPLEMENT_DYNCREATE(CMySqlManagerDoc, CDocument)
BEGIN_MESSAGE_MAP(CMySqlManagerDoc, CDocument)
//{{AFX_MSG_MAP(CMySqlManagerDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerDoc construction/destruction
CMySqlManagerDoc::CMySqlManagerDoc()
{
// TODO: add one-time construction code here
}
CMySqlManagerDoc::~CMySqlManagerDoc()
{
}
BOOL CMySqlManagerDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerDoc serialization
void CMySqlManagerDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerDoc diagnostics
#ifdef _DEBUG
void CMySqlManagerDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMySqlManagerDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMySqlManagerDoc commands

View file

@ -1,57 +0,0 @@
// MySqlManagerDoc.h : interface of the CMySqlManagerDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MYSQLMANAGERDOC_H__826CB2F2_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_MYSQLMANAGERDOC_H__826CB2F2_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CMySqlManagerDoc : public CDocument
{
protected: // create from serialization only
CMySqlManagerDoc();
DECLARE_DYNCREATE(CMySqlManagerDoc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMySqlManagerDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMySqlManagerDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CMySqlManagerDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MYSQLMANAGERDOC_H__826CB2F2_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,854 +0,0 @@
// MySqlManagerView.cpp : implementation of the CMySqlManagerView class
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "MySqlManagerDoc.h"
#include "MySqlManagerView.h"
#include "mainfrm.h"
#include "ToolSql.h"
#include "RegisterServer.h"
class XStatus
{
public:
XStatus ( LPCSTR fmt, ... )
{
char buf [2048];
va_list args;
va_start(args, fmt);
int ret = vsprintf(buf, fmt, args);
MainFrame->StatusMsg ( "%s", buf );
va_end(args);
}
~XStatus()
{
MainFrame->StatusMsg ( " ");
}
private:
XStatus();
};
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE(CMySqlManagerView, CTreeView)
BEGIN_MESSAGE_MAP(CMySqlManagerView, CTreeView)
//{{AFX_MSG_MAP(CMySqlManagerView)
ON_NOTIFY_REFLECT(NM_DBLCLK, OnDblclk)
ON_COMMAND(IDM_SQL_TOOL_QUERY, OnSqlToolQuery)
ON_COMMAND(IDM_REFRESH, OnRefresh)
ON_COMMAND(IDM_TOOLS_SERVER_PROPERTIES,OnServerProperties)
ON_COMMAND(IDM_TOOLS_REGISTER_SERVER, OnRegisterServer)
ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CTreeView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CTreeView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CTreeView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
CMySqlManagerView::CMySqlManagerView()
: m_pTree(0)
, m_pImages(0)
, m_pbmBmp(0)
, m_pTool(0)
{
}
/////////////////////////////////////////////////////////////////////////////
CMySqlManagerView::~CMySqlManagerView()
{
if ( m_pbmBmp ) delete m_pbmBmp;
if ( m_pImages ) delete m_pImages;
if ( m_pTool )
{
m_pTool->DestroyWindow();
delete m_pTool;
}
}
/////////////////////////////////////////////////////////////////////////////
BOOL CMySqlManagerView::PreCreateWindow(CREATESTRUCT& cs)
{
return CTreeView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnDraw(CDC* pDC)
{
CMySqlManagerDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
}
/////////////////////////////////////////////////////////////////////////////
BOOL CMySqlManagerView::OnPreparePrinting(CPrintInfo* pInfo)
{
return DoPreparePrinting(pInfo);
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
}
/////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
void CMySqlManagerView::AssertValid() const
{
CTreeView::AssertValid();
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
/////////////////////////////////////////////////////////////////////////////
CMySqlManagerDoc* CMySqlManagerView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMySqlManagerDoc)));
return (CMySqlManagerDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnInitialUpdate()
{
CTreeView::OnInitialUpdate();
m_pTree = & GetTreeCtrl();
m_pImages = new CImageList;
m_pImages->Create( 16, 16, FALSE, 0, 10 );
m_pbmBmp = new CBitmap;
m_pbmBmp->LoadBitmap( IDB_BITMAP1 );
m_pImages->Add( m_pbmBmp, (COLORREF)0 );
m_pTree->SetImageList( m_pImages, TVSIL_NORMAL );
HTREEITEM h = AddResource ( TVI_ROOT, new CResourceServer ( "MySQL", "localhost", "root", "" ) );
// AddResource ( h, new CResourceProcesslist () );
h = AddResource ( TVI_ROOT, new CResourceServer ( "Test", "localhost", "test", "" ) );
// AddResource ( h, new CResourceProcesslist () );
m_pTree->ModifyStyle(0, TVS_HASLINES|TVS_HASBUTTONS);
}
/////////////////////////////////////////////////////////////////////////////
HTREEITEM CMySqlManagerView::AddResource ( HTREEITEM hParent, CResource* pRes, HTREEITEM hLastItem )
{
TV_INSERTSTRUCT ItemStruct;
memset( &ItemStruct, 0, sizeof(ItemStruct) );
ItemStruct.hParent = hParent;
ItemStruct.hInsertAfter = hLastItem;
ItemStruct.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_SELECTEDIMAGE | TVIF_IMAGE;
ItemStruct.item.hItem = 0;
ItemStruct.item.state = 0;
ItemStruct.item.stateMask = 0;
ItemStruct.item.pszText = (LPSTR) pRes->GetDisplayName();
ItemStruct.item.cchTextMax = (int) strlen( ItemStruct.item.pszText );
ItemStruct.item.iImage = 2;
ItemStruct.item.iSelectedImage = 3;
ItemStruct.item.cChildren = 0;
ItemStruct.item.lParam = (long) pRes;
hLastItem = m_pTree->InsertItem( &ItemStruct );
return hLastItem;
}
//int InsertNetResources( LPNETRESOURCE lpNetResource, CTreeCtrl *pTreeCtrl, HTREEITEM hParent, int *pnCount )
//{
//
// DWORD Erc;
// NETRESOURCE *pNetRes;
// HANDLE hEnum;
//
// if( !pTreeCtrl ) return -1;
// if( pnCount ) *pnCount = 0;
// Erc = WNetOpenEnum(
// RESOURCE_GLOBALNET,//DWORD dwScope, // scope of enumeration
// RESOURCETYPE_ANY,//DWORD dwType, // resource types to list
// 0,//DWORD dwUsage, // resource usage to list
// lpNetResource,//LPNETRESOURCE lpNetResource, // pointer to resource structure
// &hEnum//LPHANDLE lphEnum // pointer to enumeration handle buffer
// );
// if( Erc )
// {
// ShowError( Erc );
// return Erc;
// }
//
//
// DWORD dwBufferSize = 1024;
// pNetRes = (NETRESOURCE *)malloc( dwBufferSize );
//
// while( TRUE )
// {
// DWORD dwCount = 0xFFFFFFFF;
// Erc = WNetEnumResource(
// hEnum,//HANDLE hEnum, // handle to enumeration
// &dwCount,//LPDWORD lpcCount, // pointer to entries to list
// pNetRes,//LPVOID lpBuffer, // pointer to buffer for results
// &dwBufferSize//LPDWORD lpBufferSize // pointer to buffer size variable
// );
// if( Erc == ERROR_NO_MORE_ITEMS ) return 0;
// if( Erc )
// {
// free( pNetRes );
// pNetRes = (NETRESOURCE *)malloc( dwBufferSize );
// Erc = WNetEnumResource(
// hEnum,//HANDLE hEnum, // handle to enumeration
// &dwCount,//LPDWORD lpcCount, // pointer to entries to list
// pNetRes,//LPVOID lpBuffer, // pointer to buffer for results
// &dwBufferSize//LPDWORD lpBufferSize // pointer to buffer size variable
// );
// }
// if( Erc ){ ShowError( Erc ); return Erc; }
//
// TV_INSERTSTRUCT ItemStruct;
// HTREEITEM hLastItem = TVI_FIRST;
// DWORD i;
//
// if( pnCount ) *pnCount += dwCount;
// for( i=0; i<dwCount; i++ )
// {
// memset( &ItemStruct, 0, sizeof(ItemStruct) );
// ItemStruct.hParent = hParent;
// ItemStruct.hInsertAfter = hLastItem;
// ItemStruct.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_SELECTEDIMAGE | TVIF_IMAGE;
// ItemStruct.item.hItem = 0;
// ItemStruct.item.state = 0;
// ItemStruct.item.stateMask = 0;
// ItemStruct.item.pszText = pNetRes[i].lpRemoteName;
// ItemStruct.item.cchTextMax = strlen( ItemStruct.item.pszText );
// ItemStruct.item.iImage = 2;
// ItemStruct.item.iSelectedImage = 3;
// ItemStruct.item.cChildren = 0;
// ItemStruct.item.lParam = (long) (new CNetResource( &pNetRes[i] ));
//
// hLastItem = pTreeCtrl->InsertItem( &ItemStruct );
// }
// }//end while()
//
// WNetCloseEnum( hEnum );
// free( pNetRes );
// return Erc;
//}
/////////////////////////////////////////////////////////////////////////////
static void print_top(MYSQL_RES *result)
{
uint length;
MYSQL_FIELD *field;
mysql_field_seek(result,0);
while ((field = mysql_fetch_field(result)))
{
if ((length= (uint) strlen(field->name)) > field->max_length)
field->max_length=length;
else
length=field->max_length;
}
}
/////////////////////////////////////////////////////////////////////////////
static void print_header(MYSQL_RES *result,CStringArray& rg)
{
MYSQL_FIELD *field;
print_top(result);
mysql_field_seek(result,0);
while ((field = mysql_fetch_field(result)))
{
// printf(" %-*s|",field->max_length+1,field->name);
rg.Add(field->name);
}
print_top(result);
}
/////////////////////////////////////////////////////////////////////////////
static void print_row(MYSQL_RES *result,MYSQL_ROW row,CStringArray& rg)
{
uint i,length;
MYSQL_FIELD *field;
mysql_field_seek(result,0);
for (i=0 ; i < mysql_num_fields(result); i++)
{
field = mysql_fetch_field(result);
length=field->max_length;
rg.Add(row[i] ? (char*) row[i] : "");
// printf(" %-*s|",length+1,row[i] ? (char*) row[i] : "");
}
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::ProcessResultSet ( HTREEITEM hItem, LPVOID r, CResource* pResource )
{
MYSQL_RES* result = (MYSQL_RES *) r;
MYSQL_ROW row;
switch (pResource->GetType())
{
case CResource::eProcesslist:
{
CResourceProcesslist* p = (CResourceProcesslist*) pResource;
CResourceProcesslistItem* pi = new CResourceProcesslistItem ();
CString strText;
print_header(result,p->m_rgFields);
for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
{
strText += p->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
AddResource ( hItem, pi );
for (int index=0;(row=mysql_fetch_row(result));index++)
{
pi = new CResourceProcesslistItem ();
print_row(result,row,pi->m_rgFields);
strText.Empty();
for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
{
strText += pi->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
AddResource ( hItem, pi );
}
print_top(result);
break;
}
case CResource::eServer:
{
CResourceServer* p = (CResourceServer*) pResource;
CResourceDatabase* pi = new CResourceDatabase ();
CString strText;
/* print_header(result,p->m_rgFields); */
for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
{
strText += p->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
/* AddResource ( hItem, pi ); */
for (int index=0;(row=mysql_fetch_row(result));index++)
{
pi = new CResourceDatabase ();
print_row(result,row,pi->m_rgFields);
strText.Empty();
for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
{
strText += pi->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
AddResource ( hItem, pi );
}
print_top(result);
break;
}
case CResource::eDatabase:
{
CResourceDatabase* p = (CResourceDatabase*) pResource;
CResourceTable* pi = new CResourceTable ();
CString strText;
/* print_header(result,p->m_rgFields); */
for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
{
strText += p->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
/* AddResource ( hItem, pi ); */
for (int index=0;(row=mysql_fetch_row(result));index++)
{
pi = new CResourceTable ();
print_row(result,row,pi->m_rgFields);
strText.Empty();
for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
{
strText += pi->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
AddResource ( hItem, pi );
}
print_top(result);
break;
}
case CResource::eTable:
{
CResourceTable* p = (CResourceTable*) pResource;
CResourceField* pi = new CResourceField ();
CString strText;
/* print_header(result,p->m_rgFields); */
for (int i = 0; i<p->m_rgFields.GetSize(); i++ )
{
strText += p->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
/* AddResource ( hItem, pi ); */
for (int index=0;(row=mysql_fetch_row(result));index++)
{
pi = new CResourceField ();
print_row(result,row,pi->m_rgFields);
strText.Empty();
for (int i = 0; i<pi->m_rgFields.GetSize(); i++ )
{
strText += pi->m_rgFields[i];
strText += " ";
}
pi->m_strName = strText;
AddResource ( hItem, pi );
}
print_top(result);
break;
}
}
}
/////////////////////////////////////////////////////////////////////////////
CResource* CMySqlManagerView::GetSelectedResource(HTREEITEM* phItemRet)
{
CResource* pResource = NULL;
HTREEITEM hItem = m_pTree->GetSelectedItem();
if ( hItem )
{
TV_ITEM item;
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hItem;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
if ( item.lParam )
{
pResource = (CResource*) item.lParam;
}
}
if (phItemRet)
{
*phItemRet = hItem;
}
return pResource;
}
/////////////////////////////////////////////////////////////////////////////
CResourceServer* CMySqlManagerView::GetServerResource(HTREEITEM hItem)
{
TV_ITEM item;
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hItem;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
if ( !item.lParam ) return NULL;
CResource* pResource = (CResource*) item.lParam;
switch (pResource->GetType())
{
case CResource::eServer:
{
return (CResourceServer*) pResource;
}
case CResource::eDatabase:
{
HTREEITEM hParent = m_pTree->GetParentItem(hItem);
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hParent;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
if ( !item.lParam ) return NULL;
return (CResourceServer*) item.lParam;
}
case CResource::eTable:
{
HTREEITEM hParent = m_pTree->GetParentItem(m_pTree->GetParentItem(hItem));
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hParent;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
if ( !item.lParam ) return NULL;
return (CResourceServer*) item.lParam;
}
}
return NULL;
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
{
HTREEITEM hItem;
hItem = m_pTree->GetSelectedItem();
*pResult = 0;
if ( !hItem ) return;
TV_ITEM item;
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hItem;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
if ( ! item.lParam ) return;
if ( item.cChildren ) return; //if has got children expand only
CWaitCursor x;
CResource* pResource = (CResource*) item.lParam;
MYSQL mysql;
MYSQL_RES *result;
switch (pResource->GetType())
{
case CResource::eProcesslist:
{
XStatus x ( "Connecting to server %s on host %s..."
, (LPCTSTR) pResource->GetDisplayName()
, (LPCTSTR) pResource->GetHostName()
);
mysql_init(&mysql);
if (!mysql_real_connect(&mysql,pResource->GetHostName(), pResource->GetUserName(),pResource->GetPassword(),0,pResource->GetPortNumber(), NullS,0))
{
PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
return;
}
mysql.reconnect= 1;
if (!(result=mysql_list_processes(&mysql)))
{
return;
}
ProcessResultSet ( hItem, result, pResource );
mysql_free_result(result);
mysql_close(&mysql);
break;
}
case CResource::eServer:
{
MainFrame->StatusMsg ( "Connecting to server %s on host %s..."
, (LPCTSTR) pResource->GetDisplayName()
, (LPCTSTR) pResource->GetHostName()
);
mysql_init(&mysql);
if (!mysql_real_connect(&mysql,pResource->GetHostName(), pResource->GetUserName(),pResource->GetPassword(),0,pResource->GetPortNumber(), NullS,0))
{
PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
MainFrame->StatusMsg ( "Error: Connecting to server %s... (%s)"
, (LPCTSTR) pResource->GetDisplayName()
, mysql_error(&mysql)
);
return;
}
mysql.reconnect= 1;
if (!(result=mysql_list_dbs(&mysql,0)))
{
}
ProcessResultSet ( hItem, result, pResource );
mysql_free_result(result);
mysql_close(&mysql);
MainFrame->StatusMsg ( " " );
break;
}
case CResource::eDatabase:
{
CResourceServer* pServer = GetServerResource(hItem);
if (!pServer) return;
MainFrame->StatusMsg ( "Connecting to server %s on host %s..."
, (LPCTSTR) pServer->GetDisplayName()
, (LPCTSTR) pServer->GetHostName()
);
mysql_init(&mysql);
if (!mysql_real_connect(&mysql,pServer->GetHostName(), pServer->GetUserName(),pServer->GetPassword(),0,pServer->GetPortNumber(), NullS,0))
{
PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
MainFrame->StatusMsg ( "Error: Connecting to server %s... (%s)"
, (LPCTSTR) pServer->GetDisplayName()
, mysql_error(&mysql)
);
return;
}
mysql.reconnect= 1;
CResourceDatabase* pRes = (CResourceDatabase*) pResource;
CString strDB = pResource->GetDisplayName();
strDB.TrimRight();
if (mysql_select_db(&mysql,strDB))
{
MainFrame->StatusMsg ( "Error: Selecting database %s... (%s)"
, (LPCTSTR) strDB
, mysql_error(&mysql)
);
return;
}
if (!(result=mysql_list_tables(&mysql,0)))
{
}
ProcessResultSet ( hItem, result, pRes );
mysql_free_result(result);
mysql_close(&mysql);
MainFrame->StatusMsg ( " " );
break;
}
case CResource::eTable:
{
CResourceServer* pServer = GetServerResource(hItem);
if (!pServer) return;
MainFrame->StatusMsg ( "Connecting to server %s on host %s..."
, (LPCTSTR) pServer->GetDisplayName()
, (LPCTSTR) pServer->GetHostName()
);
mysql_init(&mysql);
if (!mysql_real_connect(&mysql,pServer->GetHostName(), pServer->GetUserName(),pServer->GetPassword(),0,pServer->GetPortNumber(), NullS,0))
{
PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
MainFrame->StatusMsg ( "Error: Connecting to server %s... (%s)"
, (LPCTSTR) pServer->GetDisplayName()
, mysql_error(&mysql)
);
return;
}
mysql.reconnect= 1;
HTREEITEM hParent = m_pTree->GetParentItem(hItem);
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hParent;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
if ( item.lParam )
{
CResourceDatabase* pResDatabase = (CResourceDatabase*) item.lParam;
CResourceTable* pRes = (CResourceTable*) pResource;
CString strDB = pResDatabase->GetDisplayName();
CString strTable = pResource->GetDisplayName();
strDB.TrimRight();
strTable.TrimRight();
if (mysql_select_db(&mysql,strDB))
{
return;
}
CString str; str.Format("show fields from %s",(LPCTSTR)strTable);
if ( mysql_query(&mysql,str)==0 )
{
MYSQL_RES *result;
if ((result=mysql_store_result(&mysql)))
{
ProcessResultSet ( hItem, result, pRes );
mysql_free_result(result);
}
}
}
mysql_close(&mysql);
break;
}
}
// InsertNetResources( (LPNETRESOURCE)pTvItem->lParam,
// &m_TreeCtrl,
// hItem,
// &pTvItem->cChildren );
// pTvItem->mask = TVIF_CHILDREN;
// m_TreeCtrl.SetItem( pTvItem );
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnRefresh()
{
HTREEITEM hItem = NULL;
CResource* pResource = GetSelectedResource(&hItem);
if (pResource&&hItem)
{
switch (pResource->GetType())
{
case CResource::eTable:
{
TV_ITEM item;
MYSQL mysql;
// MYSQL_RES *result;
HTREEITEM hParent = m_pTree->GetParentItem(hItem);
HTREEITEM hChild = m_pTree->GetChildItem(hItem);
while (hChild)
{
HTREEITEM h = m_pTree->GetNextSiblingItem(hChild);
BOOL b = m_pTree->DeleteItem(hChild);
hChild = h;
}
mysql_init(&mysql);
if (!mysql_real_connect(&mysql,pResource->GetHostName(), pResource->GetUserName(),pResource->GetPassword(),0,pResource->GetPortNumber(), NullS,0))
{
return;
}
mysql.reconnect= 1;
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hParent;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
if ( item.lParam )
{
CResourceDatabase* pResDatabase = (CResourceDatabase*) item.lParam;
CResourceTable* pRes = (CResourceTable*) pResource;
CString strDB = pResDatabase->GetDisplayName();
CString strTable = pResource->GetDisplayName();
strDB.TrimRight();
strTable.TrimRight();
if (mysql_select_db(&mysql,strDB))
{
return;
}
CString str; str.Format("show fields from %s",(LPCTSTR)strTable);
if ( mysql_query(&mysql,str)==0 )
{
MYSQL_RES *result;
if ((result=mysql_store_result(&mysql)))
{
ProcessResultSet ( hItem, result, pRes );
mysql_free_result(result);
}
}
}
mysql_close(&mysql);
break;
}
}
}
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnRegisterServer()
{
CRegisterServer dlg;
if (dlg.DoModal()!=IDOK) return;
AddResource (
TVI_ROOT,
new CResourceServer ( dlg.m_strServer, dlg.m_strHost, dlg.m_strUser, dlg.m_strPassword, dlg.m_strPort )
);
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnServerProperties()
{
HTREEITEM hItem;
CResource* pRes = GetSelectedResource(&hItem);
if (!pRes) return;
if (pRes->GetType()!=CResource::eServer) return;
CResourceServer* pResource = (CResourceServer*)pRes;
CRegisterServer dlg;
dlg.m_strHost = pResource->GetHostName();
dlg.m_strUser = pResource->GetUserName();
dlg.m_strPassword = pResource->GetPassword();
dlg.m_strPort = pResource->GetPortName();
if (dlg.DoModal()!=IDOK) return;
pResource->m_strHost = dlg.m_strHost ;
pResource->m_strUser = dlg.m_strUser ;
pResource->m_strPassword = dlg.m_strPassword;
pResource->m_strPort = dlg.m_strPort ;
TV_ITEM item;
memset( &item, 0, sizeof(TV_ITEM) );
item.hItem = hItem;
item.mask = TVIF_TEXT | TVIF_HANDLE | TVIF_CHILDREN | TVIF_PARAM ;
m_pTree->GetItem( &item );
}
/////////////////////////////////////////////////////////////////////////////
void CMySqlManagerView::OnSqlToolQuery()
{
HTREEITEM hItem;
CResource* pResource = GetSelectedResource(&hItem);
if (!pResource) return;
CResourceServer* pServer = GetServerResource(hItem);
if (!pServer) return; /* Avoid bug when selecting field */
m_pTool = new CToolSql ( AfxGetMainWnd(), pServer, pResource );
if ( ! m_pTool->Create(IDD_TOOL_SQL,this) )
{
delete m_pTool;
m_pTool = 0;
PostMessage(WM_COMMAND,IDM_TOOLS_SERVER_PROPERTIES);
}
else
{
m_pTool->ShowWindow(SW_SHOW);
}
}
/////////////////////////////////////////////////////////////////////////////
BOOL CMySqlManagerView::PreTranslateMessage(MSG* pMsg)
{
if (m_pTool && m_pTool->PreTranslateMessage(pMsg))
return TRUE;
return CTreeView::PreTranslateMessage(pMsg);
}
void CMySqlManagerView::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
{
POINT pt;
GetCursorPos ( & pt );
CMenu menu;
menu.CreatePopupMenu ();
menu.AppendMenu ( MF_ENABLED , IDM_SQL_TOOL_QUERY, "SQL Query" );
menu.AppendMenu ( MF_ENABLED , IDM_REFRESH, "Refresh active item(s)" );
menu.AppendMenu ( MF_ENABLED , IDM_TOOLS_REGISTER_SERVER, "Register server" );
menu.AppendMenu ( MF_ENABLED , IDM_TOOLS_SERVER_PROPERTIES, "Properties" );
menu.TrackPopupMenu ( TPM_LEFTALIGN | TPM_RIGHTBUTTON , pt.x, pt.y, CWnd::GetParent(), NULL );
*pResult = 0;
}

View file

@ -1,89 +0,0 @@
// MySqlManagerView.h : interface of the CMySqlManagerView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MYSQLMANAGERVIEW_H__826CB2F4_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_MYSQLMANAGERVIEW_H__826CB2F4_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <afxcview.h>
#include "cresource.h"
class CToolSql;
class CMySqlManagerView : public CTreeView
{
protected: // create from serialization only
CMySqlManagerView();
DECLARE_DYNCREATE(CMySqlManagerView)
// Attributes
public:
CMySqlManagerDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMySqlManagerView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
CResource* GetSelectedResource(HTREEITEM* phItemRet=NULL);
CResourceServer* GetServerResource(HTREEITEM hItem);
HTREEITEM AddResource ( HTREEITEM hParent, CResource* pRes, HTREEITEM hLastItem = TVI_FIRST ) ;
void ProcessResultSet ( HTREEITEM hItem, LPVOID result, CResource* pResource );
public:
virtual ~CMySqlManagerView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
CTreeCtrl* m_pTree;
CImageList* m_pImages;
CBitmap* m_pbmBmp;
CToolSql* m_pTool;
// Generated message map functions
protected:
//{{AFX_MSG(CMySqlManagerView)
afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSqlToolQuery();
afx_msg void OnRefresh();
afx_msg void OnRegisterServer();
afx_msg void OnServerProperties();
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in MySqlManagerView.cpp
inline CMySqlManagerDoc* CMySqlManagerView::GetDocument()
{ return (CMySqlManagerDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MYSQLMANAGERVIEW_H__826CB2F4_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,51 +0,0 @@
// RegisterServer.cpp : implementation file
//
#include "stdafx.h"
#include "mysqlmanager.h"
#include "RegisterServer.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRegisterServer dialog
CRegisterServer::CRegisterServer(CWnd* pParent /*=NULL*/)
: CDialog(CRegisterServer::IDD, pParent)
, m_strServer("servername")
, m_strHost("localhost")
, m_strUser("root")
, m_strPassword("")
{
//{{AFX_DATA_INIT(CRegisterServer)
m_strPort = _T("3306");
//}}AFX_DATA_INIT
}
void CRegisterServer::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRegisterServer)
DDX_CBString(pDX, ID_SERVER_CB, m_strServer);
DDX_CBString(pDX, ID_HOST_CB, m_strHost);
DDX_Text(pDX, ID_USER, m_strUser);
DDX_Text(pDX, ID_PASSWORD, m_strPassword);
DDX_CBString(pDX, ID_PORT_CB, m_strPort);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRegisterServer, CDialog)
//{{AFX_MSG_MAP(CRegisterServer)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRegisterServer message handlers

View file

@ -1,50 +0,0 @@
#if !defined(AFX_REGISTERSERVER_H__826CB2FF_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_REGISTERSERVER_H__826CB2FF_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// RegisterServer.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CRegisterServer dialog
class CRegisterServer : public CDialog
{
// Construction
public:
CRegisterServer(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CRegisterServer)
enum { IDD = IDD_REGISTER_SERVER };
CString m_strServer;
CString m_strHost;
CString m_strUser;
CString m_strPassword;
CString m_strPort;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CRegisterServer)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CRegisterServer)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_REGISTERSERVER_H__826CB2FF_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,55 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by MySqlManager.rc
//
#define IDC_START_PB 3
#define IDC_STOP_PB 4
#define ID_SERVERS_PB 7
#define IDD_ABOUTBOX 100
#define IDM_QUERY_EXEC 101
#define IDM_QUERY_DATABASES 102
#define IDM_REFRESH 103
#define IDD_REGISTER_SERVER 114
#define IDR_MAINFRAME 128
#define IDR_MYSQLMTYPE 129
#define IDD_TOOL_SQL 132
#define IDB_BITMAP1 133
#define IDD_TOOL_SQL_QUERY 134
#define IDD_TOOL_SQL_RESULTS 135
#define IDD_TOOL_SQL_STATUS 136
#define IDC_TAB1 1000
#define IDC_EDIT 1001
#define IDC_QUERY_PB 1002
#define IDC_FONT_PB 1003
#define IDS_QUERY_EXEC 1003
#define ID_SERVER_CB 1003
#define ID_USER 1004
#define IDC_SERVER_CB 1004
#define IDC_DATABASES_PB 1005
#define ID_PASSWORD 1005
#define ID_HOST_CB 1006
#define IDC_TIMER_SECS 1006
#define ID_PORT_CB 1007
#define IDC_CLEAR 1007
#define ID_GROUPS_PB 1012
#define ID_REMOVE_PB 1017
#define ID_DISPLAY_SERVER_STATUS_CK 1057
#define ID_USE_STANDARD_CK 1058
#define ID_USE_TRUSTED_CK 1059
#define IDM_SQL_TOOL_QUERY 32771
#define IDM_TOOLS_REGISTER_SERVER 32772
#define IDM_TOOLS_SERVER_PROPERTIES 32773
#define IDS_QUERY_DATABASES 57346
#define IDS_REFRESH 57347
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 136
#define _APS_NEXT_COMMAND_VALUE 32775
#define _APS_NEXT_CONTROL_VALUE 1008
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif

View file

@ -1,5 +0,0 @@
// stdafx.cpp : source file that includes just the standard includes
// MySqlManager.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View file

@ -1,28 +0,0 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__826CB2EC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_STDAFX_H__826CB2EC_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxsock.h>
#include "mysql.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__826CB2EC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,687 +0,0 @@
// ToolSql.cpp : implementation file
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "ToolSql.h"
#define WINDOW_COORDS 0
#define CLIENT_COORDS 1
#define MY_TIMER_ID 0x1234
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
CToolSql::CToolSql(CWnd* pParent,CResource* pServer,CResource* pResource)
: CDialog(CToolSql::IDD, pParent)
, m_pQuery(0)
, m_pResults(0)
, m_pStatus(0)
, m_pServer(pServer)
, m_pResource(pResource)
, m_ui_timer(0)
{
//{{AFX_DATA_INIT(CToolSql)
m_nIntervalTimerSeconds = 10;
m_bClear = FALSE;
//}}AFX_DATA_INIT
memset ( & m_lf, 0,sizeof(m_lf) );
}
/////////////////////////////////////////////////////////////////////////////
CToolSql::~CToolSql()
{
if (m_ui_timer)
{
KillTimer(MY_TIMER_ID);
}
if (m_pdb)
{
mysql_close(m_pdb);
}
if (m_pQuery)
{
m_pQuery->DestroyWindow();
delete m_pQuery;
}
if (m_pResults)
{
m_pResults->DestroyWindow();
delete m_pResults;
}
if (m_pStatus)
{
m_pStatus->DestroyWindow();
delete m_pStatus;
}
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CToolSql)
DDX_Control(pDX, IDC_STOP_PB, m_ctl_Stop);
DDX_Control(pDX, IDC_START_PB, m_ctl_Start);
DDX_Control(pDX, IDC_SERVER_CB, m_ctl_Server);
DDX_Control(pDX, IDC_TAB1, m_tabs);
DDX_Text(pDX, IDC_TIMER_SECS, m_nIntervalTimerSeconds);
DDV_MinMaxInt(pDX, m_nIntervalTimerSeconds, 1, 120);
DDX_Check(pDX, IDC_CLEAR, m_bClear);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CToolSql, CDialog)
//{{AFX_MSG_MAP(CToolSql)
ON_BN_CLICKED(IDC_QUERY_PB, OnQueryPb)
ON_BN_CLICKED(IDC_DATABASES_PB, OnQueryDatabases)
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
ON_BN_CLICKED(IDC_FONT_PB, OnFontPb)
ON_WM_SIZE()
ON_BN_CLICKED(IDC_START_PB, OnStartPb)
ON_BN_CLICKED(IDC_STOP_PB, OnStopPb)
ON_WM_TIMER()
ON_WM_DESTROY()
ON_BN_CLICKED(IDC_CLEAR, OnClear)
ON_COMMAND(IDM_QUERY_EXEC, OnQueryPb)
ON_COMMAND(IDM_QUERY_DATABASES, OnQueryDatabases)
ON_EN_CHANGE(IDC_TIMER_SECS, OnChangeTimerSecs)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
BOOL CToolSql::OnInitDialog()
{
CDialog::OnInitDialog();
m_ctl_Start . EnableWindow(TRUE);
m_ctl_Stop . EnableWindow(FALSE);
CString strTitle;
strTitle.Format ("mySql Query to %s on %s",m_pServer->GetDisplayName(),m_pServer->GetHostName());
m_ctl_Server.AddString ( m_pServer->GetDisplayName() );
m_ctl_Server.SetCurSel (0);
SetWindowText(strTitle);
CWaitCursor x;
m_btn_QueryExec.AutoLoad ( IDC_QUERY_PB, this );
m_btn_QueryDatabases.AutoLoad ( IDC_DATABASES_PB, this );
m_btn_Font.AutoLoad ( IDC_FONT_PB, this );
m_tabs.GetWindowRect ( m_rectTab[WINDOW_COORDS] );
GetWindowRect ( m_rectDlg[WINDOW_COORDS] );
m_tabs.GetClientRect ( m_rectTab[CLIENT_COORDS] );
GetClientRect ( m_rectDlg[CLIENT_COORDS] );
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strText;
strText.LoadString(IDS_QUERY_EXEC);
if (!strText.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_QUERY_EXEC, strText);
}
strText.LoadString(IDS_QUERY_DATABASES);
if (!strText.IsEmpty())
{
pSysMenu->AppendMenu(MF_STRING, IDM_QUERY_DATABASES, strText);
}
}
m_pdb = new MYSQL;
CString strQuery ( "Query" );
CString strResults ( "Results" );
CString strStatus ( "Status" );
TC_ITEM tc1 = { TCIF_TEXT, 0,0, (LPSTR)(LPCTSTR)strQuery, strQuery.GetLength(), 0,0};
TC_ITEM tc2 = { TCIF_TEXT, 0,0, (LPSTR)(LPCTSTR)strResults, strResults.GetLength(), 0,0};
TC_ITEM tc3 = { TCIF_TEXT, 0,0, (LPSTR)(LPCTSTR)strStatus, strStatus.GetLength(), 0,0};
m_tabs.InsertItem ( 0,&tc1 );
m_tabs.InsertItem ( 1,&tc2 );
m_tabs.InsertItem ( 2,&tc3 );
m_pQuery = new CToolSqlQuery ( NULL );
m_pResults = new CToolSqlResults ( NULL );
m_pStatus = new CToolSqlStatus ( NULL );
try
{
// OpenDatabase();
//
// m_pSelection->SetDatabase ( & m_db );
// m_pScript->SetDatabase ( & m_db );
// m_pLog->SetDatabase ( & m_db );
m_pQuery -> Create ( (LPCTSTR)IDD_TOOL_SQL_QUERY, &m_tabs );
m_pResults -> Create ( (LPCTSTR)IDD_TOOL_SQL_RESULTS, &m_tabs );
m_pStatus -> Create ( (LPCTSTR)IDD_TOOL_SQL_STATUS, &m_tabs );
ActivateTab ( 0 );
m_pQuery -> SetWindowPos(NULL,20,24,0,0,SWP_NOZORDER|SWP_NOSIZE);
m_pResults -> SetWindowPos(NULL,20,24,0,0,SWP_NOZORDER|SWP_NOSIZE);
m_pStatus -> SetWindowPos(NULL,20,24,0,0,SWP_NOZORDER|SWP_NOSIZE);
DoOnSize( SIZE_RESTORED, m_rectDlg[CLIENT_COORDS].Width(), m_rectDlg[CLIENT_COORDS].Height() );
}
catch (...)
{
}
mysql_init(m_pdb);
if (!mysql_real_connect(m_pdb,m_pServer->GetHostName(), m_pServer->GetUserName(),m_pServer->GetPassword(),0,m_pServer->GetPortNumber(), NullS,0))
{
// my_printf_error(0,"connect to server at '%s' failed; error: '%s'",
// MYF(ME_BELL), pResource->GetHostName(), mysql_error(&mysql));
CString strText;
strText.Format ( "connect to server at '%s' failed; error: '%s'", m_pServer->GetHostName(), mysql_error(m_pdb));
AfxMessageBox(strText);
EndDialog(IDCANCEL);
return FALSE;
}
if ( m_pResource && m_pResource->GetType() == CResource::eDatabase )
{
CString strDB = m_pResource->GetDisplayName();
strDB.TrimRight();
if (mysql_select_db(m_pdb,strDB))
{
}
}
return FALSE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::ActivateTab ( int tab )
{
switch (tab)
{
case 0: ;
m_pResults-> ShowWindow(SW_HIDE);
m_pStatus-> ShowWindow(SW_HIDE);
m_pQuery-> ShowWindow(SW_SHOW);
m_pQuery->m_ctl_edit.SetFocus();
break;
case 1: ;
m_pQuery-> ShowWindow(SW_HIDE);
m_pStatus-> ShowWindow(SW_HIDE);
m_pResults-> ShowWindow(SW_SHOW);
m_pResults->m_ctl_edit.SetFocus();
break;
case 2: ;
m_pResults-> ShowWindow(SW_HIDE);
m_pQuery-> ShowWindow(SW_HIDE);
m_pStatus-> ShowWindow(SW_SHOW);
m_pStatus->m_ctl_edit.SetFocus();
break;
default:
break;
}
}
/////////////////////////////////////////////////////////////////////////////
void CalculateFontSize ( CEdit& ed, CSize& sizeRet )
{
CDC* pdc = ed.GetDC();
int nAveWidth , nAveHeight;
int i ;
CSize size ;
static BOOL bFirstTime = TRUE;
static char rgchAlphabet [54] ;
if ( bFirstTime )
{
bFirstTime = false;
for ( i = 0 ; i <= 25 ; i++)
{
rgchAlphabet[i] = (char)(i+(int)'a') ;
rgchAlphabet[i+26] = (char)(i+(int)'A') ;
}
rgchAlphabet[52] = 0x20;
rgchAlphabet[53] = 0x20;
}
CFont* pf = ed.GetFont();
LOGFONT lf;
pf->GetLogFont(&lf);
pdc->SelectObject (pf);
GetTextExtentPoint32 ( pdc->m_hDC, (LPSTR) rgchAlphabet, 54, & size ) ;
nAveWidth = size.cx / 54 ;
if ( size.cx % 54 )
{
nAveWidth++;
}
nAveHeight = size.cy; //6 * size.cy / 4;
sizeRet.cx = nAveWidth;
sizeRet.cy = nAveHeight; // tm.tmHeight;
ed.ReleaseDC(pdc);
}
///////////////////////////////////////////////////////////////////////////////
int ProcessYieldMessage ()
{
CWinApp* pApp = AfxGetApp();
if ( pApp )
{
MSG msgx;
while (::PeekMessage(&msgx, NULL, NULL, NULL, PM_NOREMOVE))
try
{
if (!pApp->PumpMessage())
{
// ExitProcess(1);
}
}
catch (...)
{
}
}
return 0;
}
/////////////////////////////////////////////////////////////////////////////
void print_table_data(MYSQL_RES *result,CString& str,CEdit& ed,LOGFONT& lf)
{
MYSQL_ROW cur;
uint length;
MYSQL_FIELD* field;
bool* num_flag;
my_ulonglong nRows = mysql_num_rows(result);
uint nFields = mysql_num_fields(result);
int* rgi = new int [nFields];
memset ( rgi, 0, nFields*sizeof(int) );
num_flag=(bool*) my_alloca(sizeof(bool)*nFields);
ed.SetLimitText(65535*16);
CSize sizeFont;
CalculateFontSize ( ed, sizeFont );
uint index = 0;
rgi[index++]=0;
CString separator("");
mysql_field_seek(result,0);
for (uint off=0; (field = mysql_fetch_field(result)) ; off++)
{
uint length= (uint) strlen(field->name);
length=max(length,field->max_length);
if (length < 4 && !IS_NOT_NULL(field->flags))
length=4; // Room for "NULL"
field->max_length=length+1;
int n=length+2;
for (uint i=lstrlen(field->name); i-- > 0 ; ) separator+="-";
if ( index!= nFields )
{
int o = rgi[index-1];
rgi[index++]=o+((n+1)*sizeFont.cx)/2;
}
separator+='\t';
str += field->name;
str += "\t";
num_flag[off]= IS_NUM(field->type);
}
separator += "\r\n";
str += "\r\n";
str += separator;
ed.SetSel(-1,-1);
ed.ReplaceSel(str);
if ( 1 || nRows > 100 )
{
while ((cur = mysql_fetch_row(result)))
{
ProcessYieldMessage ();
mysql_field_seek(result,0);
str.Empty();
ed.SetSel(-1,-1);
for (uint off=0 ; off < mysql_num_fields(result); off++)
{
field = mysql_fetch_field(result);
length=field->max_length;
CString strText;
strText.Format ("%s", cur[off] ? (char*) cur[off] : "NULL");
str += strText;
str += "\t";
}
str += "\r\n";
ed.SetSel(-1,-1);
ed.ReplaceSel(str);
}
}
else
{
while ((cur = mysql_fetch_row(result)))
{
mysql_field_seek(result,0);
for (uint off=0 ; off < mysql_num_fields(result); off++)
{
field = mysql_fetch_field(result);
length=field->max_length;
CString strText;
strText.Format ("%s", cur[off] ? (char*) cur[off] : "NULL");
str += strText;
str += "\t";
}
str += "\r\n";
}
}
my_afree((gptr) num_flag);
str += "\r\n";
ed.SetTabStops(nFields,rgi);
delete [] rgi;
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnQueryPb()
{
CWaitCursor x;
// mysql_select_db(m_pdb,"mysql");
if ( m_pResource && m_pResource->GetType() == CResource::eDatabase )
{
CString strDB = m_pResource->GetDisplayName();
strDB.TrimRight();
if (mysql_select_db(m_pdb,strDB))
{
}
}
m_pQuery->UpdateData();
m_pResults->m_edit.Empty();
CString str = m_pQuery->m_edit;
if ( mysql_real_query(m_pdb,str,str.GetLength())==0 )
{
MYSQL_RES *result;
if ((result=mysql_store_result(m_pdb)))
{
my_ulonglong nRows = mysql_num_rows(result);
m_pResults->UpdateData(FALSE);
m_tabs.SetCurSel(1);
ActivateTab ( 1 );
print_table_data(result,m_pResults->m_edit,m_pResults->m_ctl_edit,m_lf);
// m_pResults->UpdateData(FALSE);
m_pResults->m_ctl_edit.SetSel(-1,-1);
CString strText;
strText.Format ( "\r\n(%d row(s) affected)\r\n", nRows );
m_pResults->m_ctl_edit.ReplaceSel(strText);
mysql_free_result(result);
}
else
{
m_pResults->m_edit = mysql_error(m_pdb);
m_pResults->UpdateData(FALSE);
}
}
else
{
m_pResults->m_edit = mysql_error(m_pdb);
m_pResults->UpdateData(FALSE);
}
m_tabs.SetCurSel(1);
ActivateTab ( 1 );
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnQueryDatabases()
{
CWaitCursor x;
MYSQL_RES *result;
m_pResults->m_edit.Empty();
if ((result=mysql_list_dbs(m_pdb,0)))
{
my_ulonglong nRows = mysql_num_rows(result);
print_table_data(result,m_pResults->m_edit,m_pResults->m_ctl_edit,m_lf);
//m_pResults->UpdateData(FALSE);
mysql_free_result(result);
}
else
{
m_pResults->m_edit = mysql_error(m_pdb);
m_pResults->UpdateData(FALSE);
}
m_tabs.SetCurSel(1);
ActivateTab ( 1 );
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
ActivateTab ( m_tabs.GetCurSel() );
*pResult = 0;
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnFontPb()
{
CFontDialog FontDlg ( & m_lf );
if ( FontDlg.DoModal ( ) == IDOK )
{
if (m_font.GetSafeHandle())
m_font.DeleteObject();
m_lf = *FontDlg.m_cf.lpLogFont;
m_font.CreateFontIndirect(FontDlg.m_cf.lpLogFont);
m_pQuery->SetFont(&m_font);
m_pResults->SetFont(&m_font);
m_pStatus->SetFont(&m_font);
}
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::DoOnSize(UINT nType, int cx, int cy)
{
int nx = cx - ( m_rectDlg[CLIENT_COORDS].Width ( ) - m_rectTab[CLIENT_COORDS].Width ( ) );
int ny = cy - ( m_rectDlg[CLIENT_COORDS].Height ( ) - m_rectTab[CLIENT_COORDS].Height ( ) );
if (IsWindow(m_tabs.GetSafeHwnd()))
{
m_tabs.SetWindowPos ( NULL
, 0
, 0
, nx
, ny
, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW );
if (m_pResults&&IsWindow(m_pResults->GetSafeHwnd()))
m_pResults -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE );
if (m_pQuery&&IsWindow(m_pQuery->GetSafeHwnd()))
m_pQuery -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE );
if (m_pStatus&&IsWindow(m_pStatus->GetSafeHwnd()))
m_pStatus -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE );
// switch ( m_tabs.GetCurSel() )
// {
// case 0:
// {
// if (m_pResults&&IsWindow(m_pResults->GetSafeHwnd()))
// m_pResults -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_HIDEWINDOW );
// if (m_pQuery&&IsWindow(m_pQuery->GetSafeHwnd()))
// m_pQuery -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW );
// break;
// }
// case 1:
// {
// if (m_pQuery&&IsWindow(m_pQuery->GetSafeHwnd()))
// m_pQuery -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_HIDEWINDOW );
// if (m_pResults&&IsWindow(m_pResults->GetSafeHwnd()))
// m_pResults -> SetWindowPos(NULL,20,24,nx-40,ny-48,SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW );
// break;
// }
// }
}
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
DoOnSize ( nType, cx, cy );
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnOK()
{
CDialog::OnOK();
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnCancel()
{
CDialog::OnCancel();
}
/////////////////////////////////////////////////////////////////////////////
BOOL CToolSql::PreTranslateMessage(MSG* pMsg)
{
return CDialog::PreTranslateMessage(pMsg);
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::DoProcessListQuery()
{
MYSQL_RES *result;
if (result=mysql_list_processes(m_pdb))
{
if (m_bClear)
{
m_pStatus->m_edit.Empty();
m_pStatus->UpdateData(FALSE);
}
print_table_data(result,m_pStatus->m_edit,m_pStatus->m_ctl_edit,m_lf);
mysql_free_result(result);
}
else
{
// my_printf_error(0,"process list failed; error: '%s'",MYF(ME_BELL),mysql_error(mysql));
}
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnStartPb()
{
UpdateData();
if (m_ui_timer) return;
if (m_nIntervalTimerSeconds<1) return;
ActivateTab ( 2 );
m_ui_timer = SetTimer( MY_TIMER_ID, m_nIntervalTimerSeconds*1000, NULL );
m_ctl_Start . EnableWindow(FALSE);
m_ctl_Stop . EnableWindow(TRUE);
DoProcessListQuery();
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnStopPb()
{
UpdateData();
if (m_ui_timer)
{
KillTimer(MY_TIMER_ID);
m_ui_timer = 0;
}
m_ctl_Start . EnableWindow(TRUE);
m_ctl_Stop . EnableWindow(FALSE);
}
/////////////////////////////////////////////////////////////////////////////
void CToolSql::OnTimer(UINT nIDEvent)
{
DoProcessListQuery();
CDialog::OnTimer(nIDEvent);
}
void CToolSql::OnDestroy()
{
if (m_ui_timer)
{
KillTimer(MY_TIMER_ID);
m_ui_timer = 0;
}
CDialog::OnDestroy();
}
void CToolSql::OnClear()
{
UpdateData();
}
void CToolSql::OnChangeTimerSecs()
{
UpdateData();
}

View file

@ -1,102 +0,0 @@
#if !defined(AFX_ToolSql_H__826CB2FC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_ToolSql_H__826CB2FC_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "ToolSqlQuery.h"
#include "ToolSqlResults.h"
#include "ToolSqlStatus.h"
#include "cresource.h"
#include <my_global.h>
#include "my_sys.h"
#include "mysql.h"
/////////////////////////////////////////////////////////////////////////////
// CToolSql dialog
class CToolSql : public CDialog
{
// Construction
public:
CToolSql(CWnd* pParent = NULL,CResource* pServer=NULL,CResource* pResource=NULL);
~CToolSql();
// Dialog Data
//{{AFX_DATA(CToolSql)
enum { IDD = IDD_TOOL_SQL };
CButton m_ctl_Stop;
CButton m_ctl_Start;
CComboBox m_ctl_Server;
CTabCtrl m_tabs;
int m_nIntervalTimerSeconds;
BOOL m_bClear;
//}}AFX_DATA
CBitmapButton m_btn_QueryExec;
CBitmapButton m_btn_Font;
CBitmapButton m_btn_QueryDatabases;
#ifdef _WIN64
__int64 m_ui_timer;
#else
UINT m_ui_timer;
#endif
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CToolSql)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
void ActivateTab ( int tab );
void DoProcessListQuery();
CToolSqlQuery* m_pQuery;
CToolSqlResults* m_pResults;
CToolSqlStatus* m_pStatus;
CResource* m_pServer;
CResource* m_pResource;
MYSQL* m_pdb;
CFont m_font;
LOGFONT m_lf;
CRect m_rectTab[2];
CRect m_rectDlg[2];
protected:
// Generated message map functions
//{{AFX_MSG(CToolSql)
virtual BOOL OnInitDialog();
afx_msg void OnQueryPb();
afx_msg void OnQueryDatabases();
afx_msg void OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnFontPb();
afx_msg void OnSize(UINT nType, int cx, int cy);
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnStartPb();
afx_msg void OnStopPb();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDestroy();
afx_msg void OnClear();
afx_msg void OnChangeTimerSecs();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void DoOnSize(UINT nType, int cx, int cy) ;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ToolSql_H__826CB2FC_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,110 +0,0 @@
// ToolSqlQuery.cpp : implementation file
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "ToolSqlQuery.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
CToolSqlQuery::CToolSqlQuery(CWnd* pParent /*=NULL*/)
: CDialog(CToolSqlQuery::IDD, pParent)
{
//{{AFX_DATA_INIT(CToolSqlQuery)
m_edit = _T("");
//}}AFX_DATA_INIT
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlQuery::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CToolSqlQuery)
DDX_Control(pDX, IDC_EDIT, m_ctl_edit);
DDX_Text(pDX, IDC_EDIT, m_edit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CToolSqlQuery, CDialog)
//{{AFX_MSG_MAP(CToolSqlQuery)
ON_WM_SIZE()
ON_WM_CLOSE()
ON_COMMAND(IDM_QUERY_EXEC, OnQueryPb)
ON_COMMAND(IDM_QUERY_DATABASES, OnQueryDatabases)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
void CToolSqlQuery::SetFont(CFont* pFont, BOOL bRedraw)
{
m_ctl_edit.SetFont(pFont,bRedraw);
m_ctl_edit.Invalidate();
m_ctl_edit.UpdateWindow();
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlQuery::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if (IsWindow(m_ctl_edit.GetSafeHwnd()))
m_ctl_edit.SetWindowPos(NULL,20,24,cx-40,cy-48,SWP_NOZORDER | SWP_NOMOVE);
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlQuery::OnCancel()
{
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlQuery::OnClose()
{
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlQuery::OnQueryPb()
{
GetParent()->GetParent()->PostMessage(WM_COMMAND,IDM_QUERY_EXEC);
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlQuery::OnQueryDatabases()
{
GetParent()->GetParent()->PostMessage(WM_COMMAND,IDM_QUERY_DATABASES);
}
/////////////////////////////////////////////////////////////////////////////
BOOL CToolSqlQuery::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST)
{
if (::TranslateAccelerator(m_hWnd, m_hAccel, pMsg))
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
/////////////////////////////////////////////////////////////////////////////
BOOL CToolSqlQuery::OnInitDialog()
{
CDialog::OnInitDialog();
m_hAccel = ::LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE ( IDR_MAINFRAME ));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

View file

@ -1,60 +0,0 @@
#if !defined(AFX_TOOLSQLQUERY_H__826CB2FD_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_TOOLSQLQUERY_H__826CB2FD_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ToolSqlQuery.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CToolSqlQuery dialog
class CToolSqlQuery : public CDialog
{
// Construction
public:
CToolSqlQuery(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CToolSqlQuery)
enum { IDD = IDD_TOOL_SQL_QUERY };
CEdit m_ctl_edit;
CString m_edit;
//}}AFX_DATA
HACCEL m_hAccel;
void SetFont(CFont* pFont, BOOL bRedraw = TRUE);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CToolSqlQuery)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CToolSqlQuery)
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnCancel();
afx_msg void OnClose();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
afx_msg void OnQueryPb();
afx_msg void OnQueryDatabases();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TOOLSQLQUERY_H__826CB2FD_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,73 +0,0 @@
// ToolSqlResults.cpp : implementation file
//
#include "stdafx.h"
#include "MySqlManager.h"
#include "ToolSqlResults.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
CToolSqlResults::CToolSqlResults(CWnd* pParent /*=NULL*/)
: CDialog(CToolSqlResults::IDD, pParent)
{
//{{AFX_DATA_INIT(CToolSqlResults)
m_edit = _T("");
//}}AFX_DATA_INIT
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlResults::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CToolSqlResults)
DDX_Control(pDX, IDC_EDIT, m_ctl_edit);
DDX_Text(pDX, IDC_EDIT, m_edit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CToolSqlResults, CDialog)
//{{AFX_MSG_MAP(CToolSqlResults)
ON_WM_SIZE()
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
void CToolSqlResults::SetFont(CFont* pFont, BOOL bRedraw)
{
m_ctl_edit.SetFont(pFont,bRedraw);
m_ctl_edit.Invalidate();
m_ctl_edit.UpdateWindow();
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlResults::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if (IsWindow(m_ctl_edit.GetSafeHwnd()))
m_ctl_edit.SetWindowPos(NULL,20,24,cx-40,cy-48,SWP_NOZORDER | SWP_NOMOVE);
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlResults::OnCancel()
{
}
/////////////////////////////////////////////////////////////////////////////
void CToolSqlResults::OnClose()
{
}

View file

@ -1,53 +0,0 @@
#if !defined(AFX_TOOLSQLRESULTS_H__826CB2FE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)
#define AFX_TOOLSQLRESULTS_H__826CB2FE_8B6D_11D1_AEC1_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ToolSqlResults.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CToolSqlResults dialog
class CToolSqlResults : public CDialog
{
// Construction
public:
CToolSqlResults(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CToolSqlResults)
enum { IDD = IDD_TOOL_SQL_RESULTS };
CEdit m_ctl_edit;
CString m_edit;
//}}AFX_DATA
void SetFont(CFont* pFont, BOOL bRedraw = TRUE);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CToolSqlResults)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CToolSqlResults)
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnCancel();
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TOOLSQLRESULTS_H__826CB2FE_8B6D_11D1_AEC1_00600806E071__INCLUDED_)

View file

@ -1,50 +0,0 @@
// ToolSqlStatus.cpp : implementation file
//
#include "stdafx.h"
#include "mysqlmanager.h"
#include "ToolSqlStatus.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CToolSqlStatus dialog
CToolSqlStatus::CToolSqlStatus(CWnd* pParent /*=NULL*/)
: CDialog(CToolSqlStatus::IDD, pParent)
{
//{{AFX_DATA_INIT(CToolSqlStatus)
m_edit = _T("");
//}}AFX_DATA_INIT
}
void CToolSqlStatus::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CToolSqlStatus)
DDX_Control(pDX, IDC_EDIT, m_ctl_edit);
DDX_Text(pDX, IDC_EDIT, m_edit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CToolSqlStatus, CDialog)
//{{AFX_MSG_MAP(CToolSqlStatus)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CToolSqlStatus message handlers
void CToolSqlStatus::OnDestroy()
{
CDialog::OnDestroy();
}

View file

@ -1,47 +0,0 @@
#if !defined(AFX_TOOLSQLSTATUS_H__40C861B4_9E5A_11D1_AED0_00600806E071__INCLUDED_)
#define AFX_TOOLSQLSTATUS_H__40C861B4_9E5A_11D1_AED0_00600806E071__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ToolSqlStatus.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CToolSqlStatus dialog
class CToolSqlStatus : public CDialog
{
// Construction
public:
CToolSqlStatus(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CToolSqlStatus)
enum { IDD = IDD_TOOL_SQL_STATUS };
CEdit m_ctl_edit;
CString m_edit;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CToolSqlStatus)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CToolSqlStatus)
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TOOLSQLSTATUS_H__40C861B4_9E5A_11D1_AED0_00600806E071__INCLUDED_)

View file

@ -924,76 +924,139 @@ SOURCE=.\message.mc
!IF "$(CFG)" == "mysqld - Win32 Release"
# Begin Custom Build
InputPath=.\message.mc
BuildCmds= \
mc message.mc
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 Debug"
# Begin Custom Build
InputPath=.\message.mc
BuildCmds= \
mc message.mc
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 nt"
# Begin Custom Build - Compiling messages
InputDir=.
# Begin Custom Build
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
mc message.mc
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 Max nt"
# Begin Custom Build - Compiling messages
InputDir=.
# Begin Custom Build
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
mc message.mc
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
# Begin Custom Build
InputPath=.\message.mc
BuildCmds= \
mc message.mc
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 classic"
# Begin Custom Build
InputPath=.\message.mc
BuildCmds= \
mc message.mc
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 pro"
# Begin Custom Build
InputPath=.\message.mc
BuildCmds= \
mc message.mc
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 classic nt"
# Begin Custom Build - Compiling messages
InputDir=.
# Begin Custom Build
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
mc message.mc
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "mysqld - Win32 pro nt"
# Begin Custom Build - Compiling messages
InputDir=.
# Begin Custom Build
InputPath=.\message.mc
InputName=message
BuildCmds= \
mc.exe "$(InputDir)\$(InputName).mc"
mc message.mc
"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File

View file

@ -21,6 +21,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
$(openssl_includes) -I$(top_srcdir)/extra
LIBS = @CLIENT_LIBS@
DEPLIB= ../libmysql/libmysqlclient.la
REGEXLIB= ../regex/libregex.a
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB)
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen
@ -37,8 +38,8 @@ mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c
mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(REGEXLIB) $(DEPLIB)
mysqltest_LDADD = $(REGEXLIB) $(LDADD)
mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c
mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqlmanagerc_SOURCES = mysqlmanagerc.c

View file

@ -1677,7 +1677,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (num_fields == 2)
{
put_info("Many help items for your request exist.", INFO_INFO);
put_info("To make a more specific request, please type 'help <item>',\nwhere item is one of the following", INFO_INFO);
put_info("To make a more specific request, please type 'help <item>',\nwhere <item> is one of the following", INFO_INFO);
num_name= 0;
num_cat= 1;
last_char= '_';
@ -1685,7 +1685,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
else if ((cur= mysql_fetch_row(result)))
{
tee_fprintf(PAGER, "You asked for help about help category: \"%s\"\n", cur[0]);
put_info("For more information, type 'help <item>', where item is one of the following", INFO_INFO);
put_info("For more information, type 'help <item>', where <item> is one of the following", INFO_INFO);
num_name= 1;
num_cat= 2;
print_help_item(&cur,1,2,&last_char);

View file

@ -160,7 +160,7 @@ static struct my_option my_long_options[] =
(gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compact", OPT_COMPACT,
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-lock-tables",
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks",
(gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag,
@ -1848,8 +1848,6 @@ static void dumpTable(uint numFields, char *table)
err:
if (query != query_buf)
my_free(query, MYF(MY_ALLOW_ZERO_PTR));
if (order_by)
my_free(order_by, MYF(0));
safe_exit(error);
return;
} /* dumpTable */
@ -1967,7 +1965,7 @@ static int init_dumping(char *database)
sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s",
qdatabase);
if (mysql_query_with_error_report(sock, &dbinfo, qbuf))
if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock)))
{
/* Old server version, dump generic CREATE DATABASE */
fprintf(md_result_file,
@ -2029,6 +2027,8 @@ static int dump_all_tables_in_db(char *database)
numrows = getTableStructure(table, database);
if (!dFlag && numrows > 0)
dumpTable(numrows,table);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
}
if (opt_xml)
{
@ -2130,6 +2130,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
numrows = getTableStructure(table_names[i], db);
if (!dFlag && numrows > 0)
dumpTable(numrows, table_names[i]);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
}
if (was_views)
{

View file

@ -227,7 +227,7 @@ typedef struct
int alloced;
} VAR;
#ifdef __NETWARE__
#if defined(__NETWARE__) || defined(__WIN__)
/*
Netware doesn't proved environment variable substitution that is done
by the shell in unix environments. We do this in the following function:
@ -4609,6 +4609,9 @@ static char *subst_env_var(const char *str)
*/
#undef popen /* Remove wrapper */
#ifdef __WIN__
#define popen _popen /* redefine for windows */
#endif
FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
{

View file

@ -287,7 +287,7 @@ case $default_charset in
;;
latin1)
default_charset_default_collation="latin1_swedish_ci"
default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci"
default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci"
;;
latin2)
default_charset_default_collation="latin2_general_ci"

View file

@ -749,7 +749,8 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h)
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
sys/resource.h sys/param.h)
#--------------------------------------------------------------------
# Check for system libraries. Adds the library to $LIBS
@ -1919,7 +1920,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \
realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl \
sighold sigset sigthreadmask \
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
@ -2648,15 +2651,26 @@ then
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)"
if test "$with_debug" = "yes"
if test "$have_ndb_debug" = "default"
then
have_ndb_debug=$with_debug
fi
if test "$have_ndb_debug" = "yes"
then
# Medium debug.
NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
elif test "$with_debug" = "full"
elif test "$have_ndb_debug" = "full"
then
NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
else
NDB_DEFS="-DNDEBUG"
# no extra ndb debug but still do asserts if debug version
if test "$with_debug" = "yes" -o "$with_debug" = "full"
then
NDB_DEFS=""
else
NDB_DEFS="-DNDEBUG"
fi
fi
AC_SUBST([NDB_DEFS])
@ -2676,10 +2690,19 @@ fi
AC_SUBST([ndb_port_base])
ndb_transporter_opt_objs=""
if test X"$have_ndb_shm" = Xyes
if test "$ac_cv_func_shmget" = "yes" &&
test "$ac_cv_func_shmat" = "yes" &&
test "$ac_cv_func_shmdt" = "yes" &&
test "$ac_cv_func_shmctl" = "yes"
then
ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
[Including Ndb Cluster DB shared memory transporter])
AC_MSG_RESULT([Including ndb shared memory transporter])
ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
else
AC_MSG_RESULT([Not including ndb shared memory transporter])
fi
if test X"$have_ndb_sci" = Xyes
then
ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo"
@ -2742,6 +2765,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
ndb/test/ndbapi/bank/Makefile dnl
ndb/test/tools/Makefile dnl
ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl
ndb/include/ndb_version.h ndb/include/ndb_global.h dnl
)
fi

View file

@ -51,6 +51,7 @@
#include <my_global.h>
#include <m_string.h>
#include <my_pthread.h>
static char *my_name;
static int verbose;
@ -246,7 +247,7 @@ char *m_name;
modules[n_items].m_stkuse = 0;
DBUG_RETURN (n_items++);
}
while (cmp = strcmp (m_name,modules[ind].name)) {
while ((cmp = strcmp (m_name,modules[ind].name))) {
if (cmp < 0) { /* In left subtree */
if (s_table[ind].lchild == MAXPROCS) {
/* Add as left child */
@ -392,7 +393,7 @@ FILE *inf;
}
break;
default:
fprintf (stderr, "unknown record type '%s'\n", buf[0]);
fprintf (stderr, "unknown record type '%c'\n", buf[0]);
break;
}
next_line:;
@ -450,10 +451,11 @@ FILE *outf;
unsigned long int sum_calls, sum_time;
{
DBUG_ENTER ("out_trailer");
if (verbose) {
fprintf (outf, "======\t==========\t===========\t==========\t========\n");
fprintf (outf, "%6d\t%10.2f\t%11d\t%10.2f\t\t%-15s\n",
sum_calls, 100.0, sum_time, 100.0, "Totals");
if (verbose)
{
fprintf(outf, "======\t==========\t===========\t==========\t========\n");
fprintf(outf, "%6ld\t%10.2f\t%11ld\t%10.2f\t\t%-15s\n",
sum_calls, 100.0, sum_time, 100.0, "Totals");
}
DBUG_VOID_RETURN;
}
@ -488,16 +490,16 @@ unsigned long int *called, *timed;
import = (unsigned int) (per_time * per_calls);
if (verbose) {
fprintf (outf, "%6d\t%10.2f\t%11d\t%10.2f %10d\t%-15s\n",
fprintf (outf, "%6d\t%10.2f\t%11ld\t%10.2f %10d\t%-15s\n",
calls, per_calls, time, per_time, import, name);
} else {
ms_per_call = time;
ms_per_call /= calls;
ftime = time;
ftime /= 1000;
fprintf (outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8u %-s\n",
per_time, ftime, calls, ms_per_call, per_calls, import,
stkuse, name);
fprintf(outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\n",
per_time, ftime, calls, ms_per_call, per_calls, import,
stkuse, name);
}
*called = calls;
*timed = time;

View file

@ -94,6 +94,7 @@ extern const char *client_errors[]; /* Error messages */
#define CR_SECURE_AUTH 2049
#define CR_FETCH_CANCELED 2050
#define CR_NO_DATA 2051
#define CR_ERROR_LAST /*Copy last error nr:*/ 2051
#define CR_NO_STMT_METADATA 2052
#define CR_ERROR_LAST /*Copy last error nr:*/ 2052
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */

View file

@ -311,7 +311,8 @@ enum ha_base_keytype {
#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
#define HA_ERR_LAST 157 /*Copy last error nr.*/
#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */
#define HA_ERR_LAST 158 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)

View file

@ -25,17 +25,17 @@
typedef struct st_HA_KEYSEG /* Key-portion */
{
CHARSET_INFO *charset;
uint32 start; /* Start of key in record */
uint32 null_pos; /* position to NULL indicator */
uint16 bit_pos; /* Position to bit part */
uint16 flag;
uint16 length; /* Keylength */
uint8 type; /* Type of key (for sort) */
uint8 language;
uint8 null_bit; /* bitmask to test for NULL */
uint8 bit_start,bit_end; /* if bit field */
uint16 flag;
uint16 length; /* Keylength */
uint32 start; /* Start of key in record */
uint32 null_pos; /* position to NULL indicator */
CHARSET_INFO *charset;
uint8 bit_length; /* Length of bit part */
uint16 bit_pos; /* Position to bit part */
uint8 bit_length; /* Length of bit part */
} HA_KEYSEG;
#define get_key_length(length,key) \

View file

@ -107,12 +107,13 @@ typedef struct st_mi_create_info
} MI_CREATE_INFO;
struct st_myisam_info; /* For referense */
struct st_mi_isam_share;
typedef struct st_myisam_info MI_INFO;
struct st_mi_s_param;
typedef struct st_mi_keydef /* Key definition with open & info */
{
struct st_mi_isam_share *share; /* Pointer to base (set in mi_open) */
uint16 keysegs; /* Number of key-segment */
uint16 flag; /* NOSAME, PACK_USED */

View file

@ -32,9 +32,6 @@ C_MODE_END
#endif
#if defined(USE_RAID)
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
#endif
#include "my_dir.h"
/* Trap all occurences of my_...() in source and use our wrapper around this function */
@ -92,6 +89,10 @@ extern "C" {
#ifdef __cplusplus
}
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
#endif
class RaidName {
public:
RaidName(const char *FileName);

View file

@ -2391,6 +2391,8 @@ dict_scan_id(
ulint len = 0;
const char* s;
char* d;
ulint id_len;
byte* b;
*id = NULL;
@ -2452,6 +2454,28 @@ dict_scan_id(
*id = s;
}
if (heap && !quote) {
/* EMS MySQL Manager sometimes adds characters 0xA0 (in
latin1, a 'non-breakable space') to the end of a table name.
But isspace(0xA0) is not true, which confuses our foreign key
parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
and 0xA0 are at the end of the string.
TODO: we should lex the string using thd->charset_info, and
my_isspace(). Only after that, convert id names to UTF-8. */
b = (byte*)(*id);
id_len = strlen(b);
if (id_len >= 3 && b[id_len - 1] == 0xA0
&& b[id_len - 2] == 0xC2) {
/* Strip the 2 last bytes */
b[id_len - 2] = '\0';
}
}
return(ptr);
}
@ -2506,7 +2530,7 @@ dict_scan_col(
}
/*************************************************************************
Scans the referenced table name from an SQL string. */
Scans a table name from an SQL string. */
static
const char*
dict_scan_table_name(
@ -2517,7 +2541,7 @@ dict_scan_table_name(
const char* name, /* in: foreign key table name */
ibool* success,/* out: TRUE if ok name found */
mem_heap_t* heap, /* in: heap where to allocate the id */
const char** ref_name)/* out,own: the referenced table name;
const char** ref_name)/* out,own: the table name;
NULL if no name was scannable */
{
const char* database_name = NULL;
@ -3689,6 +3713,29 @@ dict_tree_find_index_for_tuple(
return(index);
}
/***********************************************************************
Checks if a table which is a mixed cluster member owns a record. */
ibool
dict_is_mixed_table_rec(
/*====================*/
/* out: TRUE if the record belongs to this
table */
dict_table_t* table, /* in: table in a mixed cluster */
rec_t* rec) /* in: user record in the clustered index */
{
byte* mix_id_field;
ulint len;
ut_ad(!table->comp);
mix_id_field = rec_get_nth_field_old(rec,
table->mix_len, &len);
return(len == table->mix_id_len
&& !ut_memcmp(table->mix_id_buf, mix_id_field, len));
}
/**************************************************************************
Checks that a tuple has n_fields_cmp value in a sensible range, so that
no comparison can occur with the page number field in a node pointer. */

View file

@ -8,6 +8,7 @@ Created 4/24/1996 Heikki Tuuri
*******************************************************/
#include "dict0load.h"
#include "mysql_version.h"
#ifdef UNIV_NONINL
#include "dict0load.ic"
@ -766,6 +767,22 @@ dict_load_table(
return(NULL);
}
#if MYSQL_VERSION_ID < 50003
/* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the
"compact format" flag. */
field = rec_get_nth_field(rec, 7, &len);
if (mach_read_from_1(field) & 0x80) {
btr_pcur_close(&pcur);
mtr_commit(&mtr);
mem_heap_free(heap);
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: table %s is in the new compact format\n"
"InnoDB: of MySQL 5.0.3 or later\n", name);
return(NULL);
}
#endif /* MYSQL_VERSION_ID < 50300 */
ut_a(0 == ut_strcmp("SPACE",
dict_field_get_col(
dict_index_get_nth_field(sys_index, 9))->name));

View file

@ -614,9 +614,9 @@ fil_try_to_close_file_in_LRU(
fputs("InnoDB: cannot close file ", stderr);
ut_print_filename(stderr, node->name);
fprintf(stderr,
", because mod_count %lld != fl_count %lld\n",
node->modification_counter,
node->flush_counter);
", because mod_count %ld != fl_count %ld\n",
(long) node->modification_counter,
(long) node->flush_counter);
}
node = UT_LIST_GET_PREV(LRU, node);

View file

@ -1140,7 +1140,8 @@ void
ibuf_dummy_index_add_col(
/*====================*/
dict_index_t* index, /* in: dummy index */
dtype_t* type) /* in: the data type of the column */
dtype_t* type, /* in: the data type of the column */
ulint len) /* in: length of the column */
{
ulint i = index->table->n_def;
dict_mem_table_add_col(index->table, "DUMMY",
@ -1149,7 +1150,7 @@ ibuf_dummy_index_add_col(
dtype_get_len(type),
dtype_get_prec(type));
dict_index_add_col(index,
dict_table_get_nth_col(index->table, i), 0, 0);
dict_table_get_nth_col(index->table, i), 0, len);
}
/************************************************************************
Deallocates a dummy index for inserting a record to a non-clustered index.
@ -1259,7 +1260,7 @@ ibuf_build_entry_from_ibuf_rec(
dfield_get_type(field),
types + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE);
ibuf_dummy_index_add_col(index, dfield_get_type(field));
ibuf_dummy_index_add_col(index, dfield_get_type(field), len);
}
*pindex = index;

View file

@ -657,19 +657,6 @@ dict_index_copy_types(
dtuple_t* tuple, /* in: data tuple */
dict_index_t* index, /* in: index */
ulint n_fields); /* in: number of field types to copy */
/************************************************************************
Gets the value of a system column in a clustered index record. The clustered
index must contain the system column: if the index is unique, row id is
not contained there! */
UNIV_INLINE
dulint
dict_index_rec_get_sys_col(
/*=======================*/
/* out: system column value */
dict_index_t* index, /* in: clustered index describing the record */
const ulint* offsets,/* in: offsets returned by rec_get_offsets() */
ulint type, /* in: column type: DATA_ROLL_PTR, ... */
rec_t* rec); /* in: record */
/*************************************************************************
Gets the index tree where the index is stored. */
UNIV_INLINE
@ -731,7 +718,7 @@ dict_tree_find_index_for_tuple(
dtuple_t* tuple); /* in: tuple for which to find index */
/***********************************************************************
Checks if a table which is a mixed cluster member owns a record. */
UNIV_INLINE
ibool
dict_is_mixed_table_rec(
/*====================*/

View file

@ -9,7 +9,6 @@ Created 1/8/1996 Heikki Tuuri
#include "dict0load.h"
#include "trx0undo.h"
#include "trx0sys.h"
#include "rem0rec.h"
/*************************************************************************
Gets the column data type. */
@ -312,51 +311,6 @@ dict_index_get_sys_col_pos(
dict_table_get_sys_col_no(index->table, type)));
}
/************************************************************************
Gets the value of a system column in a clustered index record. The clustered
index must contain the system column: if the index is unique, row id is
not contained there! */
UNIV_INLINE
dulint
dict_index_rec_get_sys_col(
/*=======================*/
/* out: system column value */
dict_index_t* index, /* in: clustered index describing the record */
const ulint* offsets,/* in: offsets returned by rec_get_offsets() */
ulint type, /* in: column type: DATA_ROLL_PTR, ... */
rec_t* rec) /* in: record */
{
ulint pos;
byte* field;
ulint len;
ut_ad(index);
ut_ad(index->type & DICT_CLUSTERED);
ut_ad(rec_offs_validate(rec, index, offsets));
pos = dict_index_get_sys_col_pos(index, type);
ut_ad(pos != ULINT_UNDEFINED);
field = rec_get_nth_field(rec, offsets, pos, &len);
if (type == DATA_ROLL_PTR) {
ut_ad(len == 7);
return(trx_read_roll_ptr(field));
} else if (type == DATA_TRX_ID) {
return(trx_read_trx_id(field));
} else if (type == DATA_MIX_ID) {
return(mach_dulint_read_compressed(field));
} else {
ut_a(type == DATA_ROW_ID);
return(mach_read_from_6(field));
}
}
/*************************************************************************
Gets the index tree where the index is stored. */
UNIV_INLINE
@ -664,31 +618,3 @@ dict_table_get_index(
return(index);
}
/***********************************************************************
Checks if a table which is a mixed cluster member owns a record. */
UNIV_INLINE
ibool
dict_is_mixed_table_rec(
/*====================*/
/* out: TRUE if the record belongs to this
table */
dict_table_t* table, /* in: table in a mixed cluster */
rec_t* rec) /* in: user record in the clustered index */
{
byte* mix_id_field;
ulint len;
ut_ad(!table->comp);
mix_id_field = rec_get_nth_field_old(rec,
table->mix_len, &len);
if ((len != table->mix_id_len)
|| (0 != ut_memcmp(table->mix_id_buf, mix_id_field, len))) {
return(FALSE);
}
return(TRUE);
}

View file

@ -880,7 +880,6 @@ rec_get_nth_field(
length = rec_offs_base(offsets)[1 + n];
if (length & REC_OFFS_SQL_NULL) {
field = NULL;
length = UNIV_SQL_NULL;
} else {
length &= REC_OFFS_MASK;
@ -1185,6 +1184,7 @@ rec_set_nth_field(
byte* data2;
ulint len2;
ut_ad(rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (len == UNIV_SQL_NULL) {
@ -1195,14 +1195,15 @@ rec_set_nth_field(
}
data2 = rec_get_nth_field(rec, offsets, n, &len2);
ut_ad(len2 == len);
ut_memcpy(data2, data, len);
if (len2 == UNIV_SQL_NULL) {
ut_ad(!rec_offs_comp(offsets));
rec_set_nth_field_null_bit(rec, n, FALSE);
ut_ad(len == rec_get_nth_field_size(rec, n));
} else {
ut_ad(len2 == len);
}
ut_memcpy(data2, data, len);
}
/**************************************************************

View file

@ -398,10 +398,19 @@ os_file_lock(
lk.l_start = lk.l_len = 0;
if (fcntl(fd, F_SETLK, &lk) == -1) {
fprintf(stderr,
"InnoDB: Unable to lock %s, error: %d", name, errno);
"InnoDB: Unable to lock %s, error: %d\n", name, errno);
if (errno == EAGAIN || errno == EACCES) {
fprintf(stderr,
"InnoDB: Check that you do not already have another mysqld process\n"
"InnoDB: using the same InnoDB data or log files.\n");
}
close(fd);
return(-1);
}
return(0);
}
#endif /* USE_FILE_LOCK */
@ -1672,7 +1681,7 @@ os_file_set_size(
}
/* Print about progress for each 100 MB written */
if ((offset + n_bytes) / (ib_longlong)(100 * 1024 * 1024)
if ((ib_longlong) (offset + n_bytes) / (ib_longlong)(100 * 1024 * 1024)
!= offset / (ib_longlong)(100 * 1024 * 1024)) {
fprintf(stderr, " %lu00",

View file

@ -103,7 +103,7 @@ page_dir_find_owner_slot(
(ulong) buf_frame_get_page_no(page));
if (comp) {
fputs("(compact record)\n", stderr);
fputs("(compact record)", stderr);
} else {
rec_print_old(stderr, original_rec);
}
@ -113,7 +113,11 @@ page_dir_find_owner_slot(
fputs(
"InnoDB: Cannot find the dir slot for record ",
stderr);
rec_print(stderr, rec, NULL);
if (comp) {
fputs("(compact record)", stderr);
} else {
rec_print_old(stderr, rec);
}
fputs("\n"
"InnoDB: on that page!\n", stderr);

View file

@ -137,16 +137,18 @@ rec_validate_old(
rec_t* rec); /* in: physical record */
/**********************************************************
The following function determines the offsets to each field
in the record. The offsets are written to an array of
ulint[n+2], with [0] being the number of fields (n), [1] being the
extra size (if REC_OFFS_COMPACT is set, the record is in the new
format), and [2]..[n+1] being the offsets past the end of
fields 0..n, or to the beginning of fields 1..n+1. When the
high-order bit of the offset at [n+1] is set (REC_OFFS_SQL_NULL),
the field n is NULL. When the second high-order bit of the offset
at [n+1] is set (REC_OFFS_EXTERNAL), the field n is being stored
externally. */
The following function determines the offsets to each field in the
record. The offsets are written to a previously allocated array of
ulint, where rec_offs_n_fields(offsets) has been initialized to the
number of fields in the record. The rest of the array will be
initialized by this function. rec_offs_base(offsets)[0] will be set
to the extra size (if REC_OFFS_COMPACT is set, the record is in the
new format), and rec_offs_base(offsets)[1..n_fields] will be set to
offsets past the end of fields 0..n_fields, or to the beginning of
fields 1..n_fields+1. When the high-order bit of the offset at [i+1]
is set (REC_OFFS_SQL_NULL), the field i is NULL. When the second
high-order bit of the offset at [i+1] is set (REC_OFFS_EXTERNAL), the
field i is being stored externally. */
static
void
rec_init_offsets(
@ -154,8 +156,8 @@ rec_init_offsets(
/* out: the offsets */
rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets)/* in:/out: ulint[n+2];
n=rec_offs_n_fields(offsets) */
ulint* offsets)/* in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */
{
ulint n_fields = rec_offs_n_fields(offsets);
ulint i = 0;

View file

@ -1531,8 +1531,8 @@ row_upd_clust_rec(
rec_t* rec;
mtr_start(mtr);
rec = btr_cur_get_rec(btr_cur);
ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
rec = btr_cur_get_rec(btr_cur);
err = btr_store_big_rec_extern_fields(index, rec,
rec_get_offsets(rec, index, offsets_,
ULINT_UNDEFINED, &heap),

View file

@ -1573,7 +1573,6 @@ srv_printf_innodb_monitor(
srv_last_monitor_time = time(NULL);
rewind(file);
fputs("\n=====================================\n", file);
ut_print_timestamp(file);

View file

@ -485,10 +485,15 @@ trx_undo_page_report_modify(
ptr += 1;
/* Store the values of the system columns */
trx_id = dict_index_rec_get_sys_col(index, offsets,
DATA_TRX_ID, rec);
roll_ptr = dict_index_rec_get_sys_col(index, offsets,
DATA_ROLL_PTR, rec);
field = rec_get_nth_field(rec, offsets,
dict_index_get_sys_col_pos(index, DATA_TRX_ID), &len);
ut_ad(len == DATA_TRX_ID_LEN);
trx_id = trx_read_trx_id(field);
field = rec_get_nth_field(rec, offsets,
dict_index_get_sys_col_pos(index, DATA_ROLL_PTR), &len);
ut_ad(len == DATA_ROLL_PTR_LEN);
roll_ptr = trx_read_roll_ptr(field);
len = mach_dulint_write_compressed(ptr, trx_id);
ptr += len;

View file

@ -78,7 +78,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch"
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
""
};
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
@ -137,7 +139,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch"
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
""
};
#else /* ENGLISH */
@ -194,7 +198,9 @@ const char *client_errors[]=
"Invalid connection handle",
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
"Row retrieval was canceled by mysql_stmt_close() call",
"Attempt to read column without prior row fetch"
"Attempt to read column without prior row fetch",
"Prepared statement contains no metadata",
""
};
#endif

View file

@ -158,7 +158,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
(void) signal(SIGPIPE, SIG_IGN);
#endif
#ifdef EMBEDDED_LIBRARY
result= init_embedded_server(argc, argv, groups);
if (argc > -1)
result= init_embedded_server(argc, argv, groups);
#endif
}
#ifdef THREAD
@ -2166,12 +2167,12 @@ static void update_stmt_fields(MYSQL_STMT *stmt)
DESCRIPTION
This function should be used after mysql_stmt_execute().
You can safely check that prepared statement has a result set by calling
mysql_stmt_num_fields(): if number of fields is not zero, you can call
mysql_stmt_field_count(): if number of fields is not zero, you can call
this function to get fields metadata.
Next steps you may want to make:
- find out number of columns in result set by calling
mysql_num_fields(res) (the same value is returned by
mysql_stmt_num_fields)
mysql_stmt_field_count())
- fetch metadata for any column with mysql_fetch_field,
mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek.
- free returned MYSQL_RES structure with mysql_free_result.
@ -3876,8 +3877,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */
case MYSQL_TYPE_LONG:
{
long value= sint4korr(*row);
longlong data= field_is_unsigned ? (longlong) (unsigned long) value :
int32 value= sint4korr(*row);
longlong data= field_is_unsigned ? (longlong) (uint32) value :
(longlong) value;
fetch_long_with_conversion(param, field, data, 0);
*row+= 4;
@ -4335,11 +4336,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
if (!bind_count)
{
if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
{
set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
}
DBUG_RETURN(0);
int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ?
CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA;
set_stmt_error(stmt, errorcode, unknown_sqlstate);
DBUG_RETURN(1);
}
/*
@ -4624,7 +4624,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data)
row+= (stmt->field_count+9)/8; /* skip null bits */
bit= 4; /* first 2 bits are reserved */
/* Go throw all fields and calculate metadata */
/* Go through all fields and calculate metadata */
for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ;
bind < end ;
bind++, field++)
@ -4759,6 +4759,12 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
for (; tmp && row; --row, tmp= tmp->next)
;
stmt->data_cursor= tmp;
if (!row && tmp)
{
/* Rewind the counter */
stmt->read_row_func= stmt_read_row_buffered;
stmt->state= MYSQL_STMT_EXECUTE_DONE;
}
DBUG_VOID_RETURN;
}

View file

@ -591,6 +591,32 @@ err:
C_MODE_END
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
uint32 dummy32;
uint dummy_err;
char *result;
/* 'tocs' is set 0 when client issues SET character_set_results=NULL */
if (tocs && String::needs_conversion(0, fromcs, tocs, &dummy32))
{
uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1;
result= (char *)alloc_root(root, new_len);
length= copy_and_convert(result, new_len,
tocs, from, length, fromcs, &dummy_err);
}
else
{
result= (char *)alloc_root(root, length + 1);
memcpy(result, from, length);
}
result[length]= 0;
return result;
}
bool Protocol::send_fields(List<Item> *list, uint flags)
{
List_iterator_fast<Item> it(*list);
@ -598,6 +624,8 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
MYSQL_FIELD *client_field;
MYSQL *mysql= thd->mysql;
MEM_ROOT *field_alloc;
CHARSET_INFO *thd_cs= thd->variables.character_set_results;
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("send_fields");
@ -616,12 +644,29 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
Send_field server_field;
item->make_field(&server_field);
client_field->db= strdup_root(field_alloc, server_field.db_name);
client_field->table= strdup_root(field_alloc, server_field.table_name);
client_field->name= strdup_root(field_alloc, server_field.col_name);
client_field->org_table= strdup_root(field_alloc, server_field.org_table_name);
client_field->org_name= strdup_root(field_alloc, server_field.org_col_name);
client_field->length= server_field.length;
client_field->db= dup_str_aux(field_alloc, server_field.db_name,
strlen(server_field.db_name), cs, thd_cs);
client_field->table= dup_str_aux(field_alloc, server_field.table_name,
strlen(server_field.table_name), cs, thd_cs);
client_field->name= dup_str_aux(field_alloc, server_field.col_name,
strlen(server_field.col_name), cs, thd_cs);
client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name,
strlen(server_field.org_table_name), cs, thd_cs);
client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name,
strlen(server_field.org_col_name), cs, thd_cs);
if (item->collation.collation == &my_charset_bin || thd_cs == NULL)
{
/* No conversion */
client_field->charsetnr= server_field.charsetnr;
client_field->length= server_field.length;
}
else
{
/* With conversion */
client_field->charsetnr= thd_cs->number;
uint char_len= server_field.length / item->collation.collation->mbmaxlen;
client_field->length= char_len * thd_cs->mbmaxlen;
}
client_field->type= server_field.type;
client_field->flags= server_field.flags;
client_field->decimals= server_field.decimals;
@ -630,9 +675,8 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
client_field->name_length= strlen(client_field->name);
client_field->org_name_length= strlen(client_field->org_name);
client_field->org_table_length= strlen(client_field->org_table);
client_field->charsetnr= server_field.charsetnr;
client_field->catalog= strdup_root(field_alloc, "def");
client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs);
client_field->catalog_length= 3;
if (INTERNAL_NUM_FIELD(client_field))
@ -710,6 +754,7 @@ bool Protocol_prep::write()
}
cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS));
memcpy(cur->data, packet->ptr()+1, packet->length()-1);
cur->length= packet->length(); /* To allow us to do sanity checks */
*data->prev_ptr= cur;
data->prev_ptr= &cur->next;
@ -804,21 +849,3 @@ bool Protocol::net_store_data(const char *from, uint length)
return false;
}
#if 0
/* The same as Protocol::net_store_data but does the converstion
*/
bool Protocol::convert_str(const char *from, uint length)
{
if (!(*next_field=alloc_root(alloc, length + 1)))
return true;
convert->store_dest(*next_field, from, length);
(*next_field)[length]= 0;
if (next_mysql_field->max_length < length)
next_mysql_field->max_length=length;
++next_field;
++next_mysql_field;
return false;
}
#endif

View file

@ -1,3 +0,0 @@
.deps
Makefile
Makefile.in

View file

@ -1,25 +0,0 @@
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
pkglib_LIBRARIES = libmerge.a
noinst_HEADERS = mrg_def.h
libmerge_a_SOURCES = mrg_open.c mrg_extra.c mrg_info.c mrg_locking.c \
mrg_rrnd.c mrg_update.c mrg_delete.c mrg_rsame.c \
mrg_panic.c mrg_close.c mrg_create.c mrg_static.c
# Don't update the files from bitkeeper
%::SCCS/s.%

View file

@ -1,3 +0,0 @@
ccc -I./../include -I../include -DDBUG_OFF -fast -O3 -c _locking.c close.c create.c delete.c extra.c info.c open.c panic.c rrnd.c rsame.c static.c update.c
rm libmerge.a
ar -cr libmerge.a _locking.o

View file

@ -1,40 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* close a isam-database */
#include "mrg_def.h"
int mrg_close(register MRG_INFO *info)
{
int error=0,new_error;
MRG_TABLE *file;
DBUG_ENTER("mrg_close");
for (file=info->open_tables ; file != info->end_table ; file++)
if ((new_error=nisam_close(file->table)))
error=new_error;
pthread_mutex_lock(&THR_LOCK_open);
mrg_open_list=list_delete(mrg_open_list,&info->open_list);
pthread_mutex_unlock(&THR_LOCK_open);
my_free((gptr) info,MYF(0));
if (error)
{
my_errno=error;
DBUG_RETURN(-1);
}
DBUG_RETURN(0);
}

View file

@ -1,61 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Create a MERGE-file */
#include "mrg_def.h"
/* create file named 'name' and save filenames in it
table_names should be NULL or a vector of string-pointers with
a NULL-pointer last
*/
int mrg_create(const char *name, const char**table_names)
{
int save_errno;
uint errpos;
File file;
char buff[FN_REFLEN],*end;
DBUG_ENTER("mrg_create");
errpos=0;
if ((file = my_create(fn_format(buff,name,"",MRG_NAME_EXT,4),0,
O_RDWR | O_TRUNC,MYF(MY_WME))) < 0)
goto err;
errpos=1;
if (table_names)
for ( ; *table_names ; table_names++)
{
strmov(buff,*table_names);
fn_same(buff,name,4);
*(end=strend(buff))='\n';
if (my_write(file,*table_names,(uint) (end-buff+1),
MYF(MY_WME | MY_NABP)))
goto err;
}
if (my_close(file,MYF(0)))
goto err;
DBUG_RETURN(0);
err:
save_errno=my_errno;
switch (errpos) {
case 1:
VOID(my_close(file,MYF(0)));
}
my_errno=save_errno; /* Return right errocode */
DBUG_RETURN(-1);
} /* mrg_create */

View file

@ -1,29 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Delete last read record */
#include "mrg_def.h"
int mrg_delete(MRG_INFO *info,const byte *record)
{
if (!info->current_table)
{
my_errno=HA_ERR_NO_ACTIVE_RECORD;
return(-1);
}
return nisam_delete(info->current_table->table,record);
}

View file

@ -1,46 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
Extra functions we want to do with a database
- All flags, exept record-cache-flags, are set in all used databases
record-cache-flags are set in mrg_rrnd when we are changing database.
*/
#include "mrg_def.h"
int mrg_extra(
MRG_INFO *info,
enum ha_extra_function function)
{
MRG_TABLE *file;
if (function == HA_EXTRA_CACHE)
info->cache_in_use=1;
else
{
if (function == HA_EXTRA_NO_CACHE || function == HA_EXTRA_RESET)
info->cache_in_use=0;
if (function == HA_EXTRA_RESET || function == HA_EXTRA_RESET_STATE)
{
info->current_table=0;
info->last_used_table=info->open_tables;
}
for (file=info->open_tables ; file != info->end_table ; file++)
nisam_extra(file->table,function);
}
return 0;
}

View file

@ -1,60 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mrg_def.h"
ulong mrg_position(MRG_INFO *info)
{
MRG_TABLE *current_table;
if (!(current_table = info->current_table) &&
info->open_tables != info->end_table)
current_table = info->open_tables;
return (current_table ?
(ulong) (current_table->table->lastpos +
current_table->file_offset) :
~(ulong) 0);
}
/* If flag != 0 one only gets pos of last record */
int mrg_info(MRG_INFO *info,register MERGE_INFO *x,int flag)
{
MRG_TABLE *current_table;
DBUG_ENTER("mrg_info");
if (!(current_table = info->current_table) &&
info->open_tables != info->end_table)
current_table = info->open_tables;
x->recpos = info->current_table ?
info->current_table->table->lastpos + info->current_table->file_offset :
(ulong) -1L;
if (flag != HA_STATUS_POS)
{
x->records = info->records;
x->deleted = info->del;
x->data_file_length = info->data_file_length;
x->reclength = info->reclength;
if (current_table)
x->errkey = current_table->table->errkey;
else
{ /* No tables in MRG */
x->errkey=0;
}
x->options = info->options;
}
DBUG_RETURN(0);
}

View file

@ -1,150 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* open a MERGE-database */
#include "mrg_def.h"
#include <stddef.h>
#include <errno.h>
#ifdef VMS
#include "static.c"
#endif
/* open a MERGE-database.
if handle_locking is 0 then exit with error if some database is locked
if handle_locking is 1 then wait if database is locked
*/
MRG_INFO *mrg_open(
const char *name,
int mode,
int handle_locking)
{
int save_errno,i,errpos;
uint files,dir_length,length, options;
ulonglong file_offset;
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
MRG_INFO info,*m_info;
File fd;
IO_CACHE file;
N_INFO *isam,*last_isam;
DBUG_ENTER("mrg_open");
LINT_INIT(last_isam);
isam=0;
errpos=files=0;
bzero((gptr) &info,sizeof(info));
bzero((char*) &file,sizeof(file));
if ((fd=my_open(fn_format(name_buff,name,"",MRG_NAME_EXT,4),
O_RDONLY | O_SHARE,MYF(0))) < 0 ||
init_io_cache(&file, fd, IO_SIZE, READ_CACHE, 0, 0,
MYF(MY_WME | MY_NABP)))
goto err;
errpos=1;
dir_length=dirname_part(name_buff,name);
info.reclength=0;
while ((length=my_b_gets(&file,buff,FN_REFLEN-1)))
{
if ((end=buff+length)[-1] == '\n')
end[-1]='\0';
if (buff[0] && buff[0] != '#') /* Skip empty lines and comments */
{
last_isam=isam;
if (!test_if_hard_path(buff))
{
VOID(strmake(name_buff+dir_length,buff,
sizeof(name_buff)-1-dir_length));
VOID(cleanup_dirname(buff,name_buff));
}
if (!(isam=nisam_open(buff,mode,test(handle_locking))))
goto err;
files++;
}
last_isam=isam;
if (info.reclength && info.reclength != isam->s->base.reclength)
{
my_errno=HA_ERR_WRONG_IN_RECORD;
goto err;
}
info.reclength=isam->s->base.reclength;
}
if (!(m_info= (MRG_INFO*) my_malloc(sizeof(MRG_INFO)+files*sizeof(MRG_TABLE),
MYF(MY_WME))))
goto err;
*m_info=info;
m_info->open_tables=(MRG_TABLE *) (m_info+1);
m_info->tables=files;
options= (uint) ~0;
for (i=files ; i-- > 0 ; )
{
m_info->open_tables[i].table=isam;
m_info->options|=isam->s->base.options;
options&=isam->s->base.options;
m_info->records+=isam->s->state.records;
m_info->del+=isam->s->state.del;
m_info->data_file_length=isam->s->state.data_file_length;
if (i)
isam=(N_INFO*) (isam->open_list.next->data);
}
/* Don't force readonly if not all tables are readonly */
if (! (options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA)))
m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
/* Fix fileinfo for easyer debugging (actually set by rrnd) */
file_offset=0;
for (i=0 ; (uint) i < files ; i++)
{
m_info->open_tables[i].file_offset=(my_off_t) file_offset;
file_offset+=m_info->open_tables[i].table->s->state.data_file_length;
}
if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
{
my_errno=HA_ERR_RECORD_FILE_FULL;
my_free((char*) m_info,MYF(0));
goto err;
}
m_info->end_table=m_info->open_tables+files;
m_info->last_used_table=m_info->open_tables;
VOID(my_close(fd,MYF(0)));
end_io_cache(&file);
m_info->open_list.data=(void*) m_info;
pthread_mutex_lock(&THR_LOCK_open);
mrg_open_list=list_add(mrg_open_list,&m_info->open_list);
pthread_mutex_unlock(&THR_LOCK_open);
DBUG_RETURN(m_info);
err:
save_errno=my_errno;
switch (errpos) {
case 1:
VOID(my_close(fd,MYF(0)));
end_io_cache(&file);
for (i=files ; i-- > 0 ; )
{
isam=last_isam;
if (i)
last_isam=(N_INFO*) (isam->open_list.next->data);
nisam_close(isam);
}
}
my_errno=save_errno;
DBUG_RETURN (NULL);
}

View file

@ -1,47 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mrg_def.h"
/* if flag == HA_PANIC_CLOSE then all misam files are closed */
/* if flag == HA_PANIC_WRITE then all misam files are unlocked and
all changed data in single user misam is written to file */
/* if flag == HA_PANIC_READ then all misam files that was locked when
nisam_panic(HA_PANIC_WRITE) was done is locked. A ni_readinfo() is
done for all single user files to get changes in database */
int mrg_panic(
enum ha_panic_function flag)
{
int error=0;
LIST *list_element,*next_open;
MRG_INFO *info;
DBUG_ENTER("mrg_panic");
for (list_element=mrg_open_list ; list_element ; list_element=next_open)
{
next_open=list_element->next; /* Save if close */
info=(MRG_INFO*) list_element->data;
if (flag == HA_PANIC_CLOSE && mrg_close(info))
error=my_errno;
}
if (mrg_open_list && flag != HA_PANIC_CLOSE)
DBUG_RETURN(nisam_panic(flag));
if (!error) DBUG_RETURN(0);
my_errno=error;
DBUG_RETURN(-1);
}

View file

@ -1,110 +0,0 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
Read a record with random-access. The position to the record must
get by mrg_info(). The next record can be read with pos= -1 */
#include "mrg_def.h"
static MRG_TABLE *find_table(MRG_TABLE *start,MRG_TABLE *end,mrg_off_t pos);
/*
If filepos == -1, read next
Returns same as nisam_rrnd:
0 = Ok.
1 = Record deleted.
-1 = EOF (or something, errno should be HA_ERR_END_OF_FILE)
*/
int mrg_rrnd(MRG_INFO *info,byte *buf,mrg_off_t filepos)
{
int error;
N_INFO *isam_info;
if (filepos == ~(mrg_off_t) 0) /* Can't use HA_POS_ERROR */
{
if (!info->current_table)
{
if (info->open_tables == info->end_table)
{ /* No tables */
my_errno=HA_ERR_END_OF_FILE;
return -1;
}
isam_info=(info->current_table=info->open_tables)->table;
if (info->cache_in_use)
nisam_extra(isam_info,HA_EXTRA_CACHE);
filepos=isam_info->s->pack.header_length;
isam_info->lastinx= (uint) -1; /* Can't forward or backward */
}
else
{
isam_info=info->current_table->table;
filepos= isam_info->nextpos;
}
for (;;)
{
isam_info->update&= HA_STATE_CHANGED;
if ((error=(*isam_info->s->read_rnd)(isam_info,(byte*) buf,
filepos,1)) >= 0 ||
my_errno != HA_ERR_END_OF_FILE)
return (error);
if (info->cache_in_use)
nisam_extra(info->current_table->table,HA_EXTRA_NO_CACHE);
if (info->current_table+1 == info->end_table)
return(-1);
info->current_table++;
info->last_used_table=info->current_table;
if (info->cache_in_use)
nisam_extra(info->current_table->table,HA_EXTRA_CACHE);
info->current_table->file_offset=
info->current_table[-1].file_offset+
info->current_table[-1].table->s->state.data_file_length;
isam_info=info->current_table->table;
filepos=isam_info->s->pack.header_length;
isam_info->lastinx= (uint) -1;
}
}
info->current_table=find_table(info->open_tables,
info->end_table-1,filepos);
isam_info=info->current_table->table;
isam_info->update&= HA_STATE_CHANGED;
return ((*isam_info->s->read_rnd)(isam_info,(byte*) buf,
(ulong) (filepos -
info->current_table->file_offset),
0));
}
/* Find which table to use according to file-pos */
static MRG_TABLE *find_table(MRG_TABLE *start,MRG_TABLE *end,mrg_off_t pos)
{
MRG_TABLE *mid;
while (start != end)
{
mid=start+((uint) (end-start)+1)/2;
if (mid->file_offset > pos)
end=mid-1;
else
start=mid;
}
return start;
}

View file

@ -155,7 +155,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root,
sizeof(FTB_WORD) +
(param.trunc ? MI_MAX_KEY_BUFF :
w.len+extra));
w.len*ftb->charset->mbmaxlen+extra));
ftbw->len=w.len+1;
ftbw->flags=0;
ftbw->off=0;
@ -211,6 +211,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
uint off, extra=HA_FT_WLEN+info->s->base.rec_reflength;
byte *lastkey_buf=ftbw->word+ftbw->off;
LINT_INIT(off);
if (ftbw->flags & FTB_FLAG_TRUNC)
lastkey_buf+=ftbw->len;

View file

@ -25,23 +25,25 @@ char ft_boolean_syntax[]="+ -><()~*:\"\"&|";
const HA_KEYSEG ft_keysegs[FT_SEGS]={
{
HA_KEYTYPE_VARTEXT2, /* type */
63, /* language (will be overwritten) */
0, 2, 0, /* null_bit, bit_start, bit_end */
HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */
HA_FT_MAXBYTELEN, /* length */
HA_FT_WLEN, /* start */
0, /* null_pos */
NULL /* charset */
},
{
/*
Note, this (and the last HA_KEYTYPE_END) segment should NOT
be packed in any way, otherwise w_search() won't be able to
update key entry 'in vivo'
*/
HA_FT_WTYPE, 63, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, 0, 0, NULL
}
0, /* charset */
HA_FT_WLEN, /* start */
0, /* null_pos */
0, /* Bit pos */
HA_VAR_LENGTH_PART | HA_PACK_KEY, /* flag */
HA_FT_MAXBYTELEN, /* length */
HA_KEYTYPE_VARTEXT2, /* type */
63, /* language (will be overwritten) */
0, /* null_bit */
2, 0, 0 /* bit_start, bit_end, bit_length */
},
{
/*
Note, this (and the last HA_KEYTYPE_END) segment should NOT
be packed in any way, otherwise w_search() won't be able to
update key entry 'in vivo'
*/
0, 0, 0, 0, HA_NO_SORT, HA_FT_WLEN, HA_FT_WTYPE, 63, 0, 0, 0, 0
}
};
const struct _ft_vft _ft_vft_nlq = {

View file

@ -26,6 +26,7 @@
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include "rt_index.h"
#ifndef USE_RAID
#define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G)
@ -1466,6 +1467,12 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff,
if (_mi_ft_add(info,i,(char*) key,buff,filepos))
goto err;
}
else if (info->s->keyinfo[i].flag & HA_SPATIAL)
{
uint key_length=_mi_make_key(info,i,key,buff,filepos);
if (rtree_insert(info, i, key, key_length))
goto err;
}
else
{
uint key_length=_mi_make_key(info,i,key,buff,filepos);
@ -3988,7 +3995,8 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
key->seg->charset->mbmaxlen;
key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN;
}
return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
return (key->flag & HA_SPATIAL) ||
(key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
((ulonglong) rows * key_maxlength >
(ulonglong) myisam_max_temp_length));
}

View file

@ -46,10 +46,10 @@ int mi_delete(MI_INFO *info,const byte *record)
/* Test if record is in datafile */
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_usage",
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
DBUG_RETURN(my_errno= HA_ERR_CRASHED););
DBUG_EXECUTE_IF("my_error_test_undefined_error",
mi_print_error(info, INT_MAX);
mi_print_error(info->s, INT_MAX);
DBUG_RETURN(my_errno= INT_MAX););
if (!(info->update & HA_STATE_AKTIV))
{
@ -116,7 +116,7 @@ err:
myisam_log_command(MI_LOG_DELETE,info,(byte*) lastpos, sizeof(lastpos),0);
if (save_errno != HA_ERR_RECORD_CHANGED)
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* mark table crashed */
}
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
@ -125,7 +125,7 @@ err:
my_errno=save_errno;
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
}
@ -154,7 +154,7 @@ static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo,
if ((old_root=*root) == HA_OFFSET_ERROR)
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
DBUG_RETURN(my_errno=HA_ERR_CRASHED);
}
if (!(root_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
@ -266,9 +266,12 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_off_t root;
uchar *kpos=keypos;
if (!(tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&kpos,lastkey))
&& (my_errno == HA_ERR_CRASHED))
mi_print_error(info, HA_ERR_CRASHED);
if (!(tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&kpos,lastkey)))
{
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno= HA_ERR_CRASHED;
DBUG_RETURN(-1);
}
root=_mi_dpos(info,nod_flag,kpos);
if (subkeys == -1)
{
@ -317,7 +320,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (!nod_flag)
{
DBUG_PRINT("error",("Didn't find key"));
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED; /* This should newer happend */
goto err;
}
@ -329,15 +332,10 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{ /* Found key */
uint tmp;
length=mi_getint(anc_buff);
tmp=remove_key(keyinfo,nod_flag,keypos,lastkey,anc_buff+length,
&next_block);
if (tmp == 0)
{
if (my_errno == HA_ERR_CRASHED)
mi_print_error(info, HA_ERR_CRASHED);
DBUG_PRINT("exit",("Return: %d",0));
DBUG_RETURN(0);
}
if (!(tmp= remove_key(keyinfo,nod_flag,keypos,lastkey,anc_buff+length,
&next_block)))
goto err;
length-= tmp;
mi_putint(anc_buff,length,nod_flag);
@ -386,6 +384,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
my_afree((byte*) leaf_buff);
DBUG_PRINT("exit",("Return: %d",ret_value));
DBUG_RETURN(ret_value);
err:
my_afree((byte*) leaf_buff);
DBUG_PRINT("exit",("Error: %d",my_errno));
@ -491,8 +490,6 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
(info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH :
(uint) keyinfo->underflow_block_length));
err:
if (my_errno == HA_ERR_CRASHED)
mi_print_error(info, HA_ERR_CRASHED);
DBUG_RETURN(-1);
} /* del */
@ -579,14 +576,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
/* remove key from anc_buff */
s_length=remove_key(keyinfo,key_reflength,keypos,anc_key,
anc_buff+anc_length,(my_off_t *) 0);
if (!s_length)
{
if (my_errno == HA_ERR_CRASHED)
mi_print_error(info, HA_ERR_CRASHED);
if (!(s_length=remove_key(keyinfo,key_reflength,keypos,anc_key,
anc_buff+anc_length,(my_off_t *) 0)))
goto err;
}
anc_length-=s_length;
mi_putint(anc_buff,anc_length,key_reflength);
@ -692,14 +685,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
mi_putint(buff,buff_length,nod_flag);
/* remove key from anc_buff */
s_length=remove_key(keyinfo,key_reflength,keypos,anc_key,
anc_buff+anc_length,(my_off_t *) 0);
if (!s_length)
{
if (my_errno == HA_ERR_CRASHED)
mi_print_error(info, HA_ERR_CRASHED);
if (!(s_length= remove_key(keyinfo,key_reflength,keypos,anc_key,
anc_buff+anc_length,(my_off_t *) 0)))
goto err;
}
anc_length-=s_length;
mi_putint(anc_buff,anc_length,key_reflength);
@ -759,9 +748,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (_mi_write_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff))
goto err;
DBUG_RETURN(anc_length <= (uint) keyinfo->block_length/2);
err:
if (my_errno == HA_ERR_CRASHED)
mi_print_error(info, HA_ERR_CRASHED);
DBUG_RETURN(-1);
} /* underflow */
@ -798,6 +786,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
/* Calculate length of key */
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,lastkey))
DBUG_RETURN(0); /* Error */
if (next_block && nod_flag)
*next_block= _mi_kpos(nod_flag,keypos);
s_length=(int) (keypos-start);

View file

@ -187,7 +187,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
if ((error=flush_io_cache(&info->rec_cache)))
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Fatal error found */
}
}
@ -288,7 +288,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
{
error=my_errno;
share->changed=1;
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Fatal error found */
}
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
@ -343,7 +343,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (error)
{
share->changed=1;
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Fatal error found */
}
}

View file

@ -477,7 +477,7 @@ int _mi_read_key_record(MI_INFO *info, my_off_t filepos, byte *buf)
{ /* Read only key */
if (_mi_put_key_in_record(info,(uint) info->lastinx,buf))
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
return -1;
}

View file

@ -79,7 +79,7 @@ int mi_assign_to_key_cache(MI_INFO *info,
if (flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE))
{
error= my_errno;
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Mark that table must be checked */
}

View file

@ -66,7 +66,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
share->kfile,FLUSH_KEEP))
{
error=my_errno;
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info); /* Mark that table must be checked */
}
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
@ -74,7 +74,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
if (end_io_cache(&info->rec_cache))
{
error=my_errno;
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
}
@ -101,7 +101,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
share->not_flushed=1;
if (error)
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
}
@ -290,7 +290,7 @@ void mi_update_status(void* param)
{
if (end_io_cache(&info->rec_cache))
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
mi_mark_crashed(info);
}
info->opt_flag&= ~WRITE_CACHE_USED;

View file

@ -309,6 +309,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
HA_KEYSEG *pos=share->keyparts;
for (i=0 ; i < keys ; i++)
{
share->keyinfo[i].share= share;
disk_pos=mi_keydef_read(disk_pos, &share->keyinfo[i]);
disk_pos_assert(disk_pos + share->keyinfo[i].keysegs * HA_KEYSEG_SIZE,
end_pos);
@ -1057,17 +1058,19 @@ int mi_keyseg_write(File file, const HA_KEYSEG *keyseg)
{
uchar buff[HA_KEYSEG_SIZE];
uchar *ptr=buff;
ulong pos;
*ptr++ =keyseg->type;
*ptr++ =keyseg->language;
*ptr++ =keyseg->null_bit;
*ptr++ =keyseg->bit_start;
*ptr++ =keyseg->bit_end;
*ptr++= keyseg->type;
*ptr++= keyseg->language;
*ptr++= keyseg->null_bit;
*ptr++= keyseg->bit_start;
*ptr++= keyseg->bit_end;
*ptr++= keyseg->bit_length;
mi_int2store(ptr,keyseg->flag); ptr+=2;
mi_int2store(ptr,keyseg->length); ptr+=2;
mi_int4store(ptr,keyseg->start); ptr+=4;
mi_int4store(ptr, keyseg->null_bit ? keyseg->null_pos : keyseg->bit_pos);
pos= keyseg->null_bit ? keyseg->null_pos : keyseg->bit_pos;
mi_int4store(ptr, pos);
ptr+=4;
return my_write(file,(char*) buff, (uint) (ptr-buff), MYF(MY_NABP));
@ -1234,7 +1237,7 @@ int mi_enable_indexes(MI_INFO *info)
if (share->state.state.data_file_length ||
(share->state.state.key_file_length != share->base.keystart))
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
error= HA_ERR_CRASHED;
}
else

View file

@ -40,7 +40,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo,
{
DBUG_PRINT("error",("Got errno: %d from key_cache_read",my_errno));
info->last_keypage=HA_OFFSET_ERROR;
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0);
}
@ -52,7 +52,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo,
(ulong) page, page_size));
DBUG_DUMP("page", (char*) tmp, keyinfo->block_length);
info->last_keypage = HA_OFFSET_ERROR;
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno = HA_ERR_CRASHED;
tmp = 0;
}

View file

@ -213,7 +213,8 @@ err:
/* Get keynummer of current key and max number of keys in nod */
static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, uchar *keypos, uint *ret_max_key)
static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uchar *keypos, uint *ret_max_key)
{
uint nod_flag,keynr,max_key;
uchar t_buff[MI_MAX_KEY_BUFF],*end;
@ -222,7 +223,7 @@ static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, u
nod_flag=mi_test_if_nod(page);
page+=2+nod_flag;
if (!(keyinfo->flag & (HA_VAR_LENGTH_KEY| HA_BINARY_PACK_KEY)))
if (!(keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
{
*ret_max_key= (uint) (end-page)/(keyinfo->keylength+nod_flag);
return (uint) (keypos-page)/(keyinfo->keylength+nod_flag);
@ -233,11 +234,7 @@ static uint _mi_keynr(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, u
while (page < end)
{
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&page,t_buff))
{
if (my_errno == HA_ERR_CRASHED)
mi_print_error(info, HA_ERR_CRASHED);
return 0; /* Error */
}
max_key++;
if (page == keypos)
keynr=max_key;

View file

@ -78,7 +78,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
case HA_KEY_ALG_RTREE:
if (rtree_find_first(info,inx,key_buff,use_key_length,nextflag) < 0)
{
mi_print_error(info, HA_ERR_CRASHED);
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
goto err;
}

View file

@ -92,6 +92,10 @@ int mi_rnext_same(MI_INFO *info, byte *buf)
if (my_errno == HA_ERR_KEY_NOT_FOUND)
my_errno=HA_ERR_END_OF_FILE;
}
else if (!buf)
{
DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0);
}
else if (!(*info->read_record)(info,info->lastpos,buf))
{
info->update|= HA_STATE_AKTIV; /* Record is read */

Some files were not shown because too many files have changed in this diff Show more