Loading Docs/internals.texi +18 −20 Original line number Diff line number Diff line Loading @@ -183,23 +183,27 @@ and then we read the rows in the sorted order into a row buffer We are using @uref{http://www.bitkeeper.com/, BitKeeper} for source management. @item You should use the @strong{MySQL} 3.23 or 4.0 source for all developments. You should use the @strong{MySQL} 4.0 source for all developments. @item If you have any questions about the @strong{MySQL} source, you can post these to @email{developers@@mysql.com} and we will answer them. Note that we will shortly change the name of this list to @email{internals@@mysql.com}, to more accurately reflect what should be posted to this list. to @email{dev-public@@mysql.com} and we will answer them. Please remember to not use this internal email list in public! @item Try to write code in a lot of black boxes that can be reused or at least have a clean interface. Try to write code in a lot of black boxes that can be reused or use at least a clean, easy to change interface. @item Reuse code; There is already a lot of algorithms in MySQL for list handling, queues, dynamic and hashed arrays, sorting, etc. that can be reused. @item Use the @code{my_*} functions like @code{my_read()}/@code{my_write()}/ @code{my_malloc()} that you can find in the @code{mysys} library instead of the direct system calls; This will make your code easier to debug and more portable. @item Try to always write optimized code, so that you don't have to go back and rewrite it a couple of months later. It's better to Loading @@ -222,7 +226,11 @@ Do not check the same pointer for @code{NULL} more than once. @item Use long function and variable names in English; This makes your code easier to read. Use the 'varible_name' style instead of 'VariableName'. easier to read. @item Use my_var as opposed to myVar or MyVar (@samp{_} rather than dancing SHIFT to seperate words in identifiers). @item Think assembly - make it easier for the compiler to optimize your code. Loading @@ -232,14 +240,8 @@ Comment your code when you do something that someone else may think is not ''trivial''. @item Use the @code{my_*} functions like @code{my_read()}/@code{my_write()}/ @code{my_malloc()} that you can find in the @code{mysys} library instead of the direct system calls; This will make your code easier to debug and more portable. @item Use @code{libstring} functions instead of standard libc string functions whenever possible. Use @code{libstring} functions (in the strings directory) instead of standard libc string functions whenever possible. @item Avoid using @code{malloc()} (its REAL slow); For memory allocations Loading @@ -253,10 +255,6 @@ it. This way we can easily provide you with feedback and also easily discuss it thoroughly if some other developer thinks there is better way to do the same thing! @item Use my_var as opposed to myVar or MyVar (@samp{_} rather than dancing SHIFT to seperate words in identifiers). @item Class names start with a capital letter. Loading Docs/manual.texi +29 −18 Original line number Diff line number Diff line Loading @@ -9592,8 +9592,8 @@ version 4.0; @item The old C API functions @code{mysql_drop_db}, @code{mysql_create_db} and @code{mysql_connect} are not supported anymore, unless one compiles MySQL with @code{USE_OLD_FUNCTIONS}. Instead of doing this, one should change the client to use the new 4.0 API. MySQL with @code{CFLAGS=-DUSE_OLD_FUNCTIONS}. Instead of doing this, one should change the client to use the new 4.0 API. @item In the @code{MYSQL_FIELD} structure, @code{length} and @code{max_length} has changed from @code{unsigned int} to @code{unsigned long}. This should not Loading @@ -9616,6 +9616,10 @@ Format of @code{SHOW OPEN TABLE} has changed. @item Multithreaded clients should use @code{mysql_thread_init()} and @code{mysql_thread_end()}. @xref{Threaded clients}. @item If you want to recompile the perl DBD-MySQL module, you must get Msql-Mysql-modules version 1.2218 or newer, because the older DBD modules used the deprecated @code{drop_db()} call. @end itemize @node Upgrading-from-3.22, Upgrading-from-3.21, Upgrading-from-3.23, Upgrade Loading Loading @@ -9660,6 +9664,10 @@ option @code{--no-named-commands (-g)}. This option can be disabled with some cases, for example in SQL scripts that use named commands without a semicolon! Long format commands still work from the first line. @item Date functions that work on part of dates (like @code{MONTH()}) will now return 0 for @code{0000-00-00} dates. (MySQL 3.22 returned @code{NULL}). @item If you are using the @code{german} character sort order, you must repair all your tables with @code{isamchk -r}, as we have made some changes in Loading Loading @@ -10368,6 +10376,8 @@ You can avoid using @file{libg++.a} by running @code{configure} like this: shell> CXX=gcc ./configure @end example If you are running gcc 3.0 and above, you can't use the above trick with CXX=gcc, but you have to install libstd++. @node Linux-SPARC, Linux-Alpha, Linux-x86, Linux @subsubsection Linux SPARC Notes Loading Loading @@ -10950,6 +10960,10 @@ Because Windows doesn't allow you to drop files that are open, you first must flush all @code{MERGE} tables (with @code{FLUSH TABLES}) or drop the @code{MERGE} table before dropping the table. We will fix this at the same time we introduce @code{VIEW}s. @item @code{DATA DIRECTORY} and @code{INDEX DIRECTORY} directives in @code{CREATE TABLE} is ignored on windows, because windows doesn't support symbolic links. @end table Here are some open issues for anyone who might want to help us with the Windows Loading Loading @@ -11184,7 +11198,7 @@ When using the @code{--with-libwrap} configure option, you must also include the libraries that @file{libwrap.a} needs: @example --with-libwrap="/opt/NUtcpwrapper-7.6/lib/libwrap.a -lnsl -lsocket --with-libwrap="/opt/NUtcpwrapper-7.6/ -lnsl -lsocket @end example If you have problems with configure trying to link with @code{-lz} and Loading Loading @@ -35648,15 +35662,6 @@ If you use @code{ALTER TABLE} on a @code{MyISAM} table, all non-unique indexes are created in a separate batch (like in @code{REPAIR}). This should make @code{ALTER TABLE} much faster when you have many indexes. @item Since @strong{MySQL 4.0} this can be activated explicitly. @code{ALTER TABLE ... DISABLE KEYS} makes MySQL to stop updating non-unique indexes for @code{MyISAM} table. @code{ALTER TABLE ... ENABLE KEYS} then should be used to recreate missing indexes. As MySQL does it with special algorithm which is much faster then inserting keys one by one, disabling keys could give a considerable speedup on bulk inserts. @item @findex mysql_info() With the C API function @code{mysql_info()}, you can find out how many Loading Loading @@ -39091,7 +39096,14 @@ they roll back the corresponding SQL statement. @itemize @bullet @item @code{SHOW TABLE STATUS} does not give accurate statistics @item @strong{WARNING:} Do @strong{NOT} convert MySQL system tables from MyISAM TO InnoDB tables! This is not supported; If you do this MySQL will not restart until you restore the old system tables from a backup or re-generate them with the mysql_install_db script. @item @code{SHOW TABLE STATUS} does not give accurate statistics on InnoDB tables, except for the physical size reserved by the table. The row count is only a rough estimate used in SQL optimization. Loading Loading @@ -47349,7 +47361,7 @@ chapter or for the proper operation of the programs listed herein. Perl @code{Data-Dumper} module. Useful with @code{DBI}/@code{DBD} support for older Perl installations. @item @uref{http://www.mysql.com/Downloads/Contrib/DBI-1.15.tar.gz, DBI-1.15.tar.gz} @item @uref{http://www.mysql.com/Downloads/Contrib/DBI-1.18.tar.gz, DBI-1.18.tar.gz} Perl @code{DBI} module. @item @uref{http://www.mysql.com/Downloads/Contrib/KAMXbase1.2.tar.gz,KAMXbase1.2.tar.gz} Loading @@ -47358,7 +47370,7 @@ module written by Pratap Pereira @email{pereira@@ee.eng.ohio-state.edu}, extended by Kevin A. McGrail @email{kmcgrail@@digital1.peregrinehw.com}. This converter can handle MEMO fields. @item @uref{http://www.mysql.com/Downloads/Contrib/Msql-Mysql-modules-1.2216.tar.gz, Msql-Mysql-modules-1.2216.tar.gz} @item @uref{http://www.mysql.com/Downloads/Contrib/Msql-Mysql-modules-1.2218.tar.gz, Msql-Mysql-modules-1.2218.tar.gz} Perl @code{DBD} module to access mSQL and MySQL databases. @item @uref{http://www.mysql.com/Downloads/Contrib/Data-ShowTable-3.3.tar.gz, Data-ShowTable-3.3.tar.gz} Loading Loading @@ -47440,9 +47452,6 @@ A C++ database independent library that supports MySQL. @cindex Delphi @item Delphi @itemize @bullet @item @uref{http://www.mysql.com/Downloads/Contrib/delphi-interface.gz, delphi-interface.gz} Delphi interface to @code{libmysql.dll}, by Blestan Tabakov, @email{root@@tdg.bis.bg}. @item @uref{http://www.mysql.com/Downloads/Contrib/DelphiMySQL2.zip, DelphiMySQL2.zip} Delphi interface to @code{libmysql.dll}, by @email{bsilva@@umesd.k12.or.us}. Loading Loading @@ -48656,6 +48665,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item Ignore @code{DATA DIRECTORY} and @code{INDEX DIRECTORY} directives on windows. @item Added boolean fulltext search code. It should be considered early alpha. @item Extended @code{MODIFY} and @code{CHANGE} in @code{ALTER TABLE} to accept acinclude.m4 +2 −2 Original line number Diff line number Diff line Loading @@ -652,7 +652,7 @@ if test -r /proc/cpuinfo ; then cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` fi if test "$cpu_vendor" = "AuthenticAMD"; then if test $cpu_family>=6; then if test $cpu_family -ge 6; then cpu_set="athlon pentiumpro k5 pentium i486 i386"; elif test $cpu_family=5; then cpu_set="k5 pentium i486 i386"; Loading @@ -662,7 +662,7 @@ if test "$cpu_vendor" = "AuthenticAMD"; then cpu_set="i386" fi elif test "$cpu_vendor" = "GenuineIntel"; then if test $cpu_family>=6; then if test $cpu_family -ge 6; then cpu_set="pentiumpro pentium i486 i386"; elif test $cpu_family=5; then cpu_set="pentium i486 i386"; Loading configure.in +1 −1 Original line number Diff line number Diff line Loading @@ -1769,7 +1769,7 @@ then fi AC_SUBST(tools_dirs) MYSQL_CHECK_CPU #MYSQL_CHECK_CPU MYSQL_CHECK_MYSQLFS MYSQL_CHECK_VIO MYSQL_CHECK_OPENSSL Loading include/mysql.h +5 −5 Original line number Diff line number Diff line Loading @@ -253,15 +253,15 @@ typedef struct st_mysql_manager /* Set up and bring down the server; to ensure that applications will * work when linked against either the standard client library or the * embedded server library, these functions should be called. */ int mysql_server_init(int argc, char **argv, char **groups); void mysql_server_end(void); int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); /* Set up and bring down a thread; these function should be called * for each thread in an application which opens at least one MySQL * connection. All uses of the connection(s) should be between these * function calls. */ my_bool mysql_thread_init(void); void mysql_thread_end(void); my_bool STDCALL mysql_thread_init(void); void STDCALL mysql_thread_end(void); /* Functions to get information from the MYSQL and MYSQL_RES structures */ /* Should definitely be used if one uses shared libraries */ Loading Loading @@ -414,8 +414,8 @@ MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) #define HAVE_MYSQL_REAL_CONNECT #endif #define HAVE_MYSQL_REAL_CONNECT /* The following functions are mainly exported because of mysqlbinlog; Loading Loading
Docs/internals.texi +18 −20 Original line number Diff line number Diff line Loading @@ -183,23 +183,27 @@ and then we read the rows in the sorted order into a row buffer We are using @uref{http://www.bitkeeper.com/, BitKeeper} for source management. @item You should use the @strong{MySQL} 3.23 or 4.0 source for all developments. You should use the @strong{MySQL} 4.0 source for all developments. @item If you have any questions about the @strong{MySQL} source, you can post these to @email{developers@@mysql.com} and we will answer them. Note that we will shortly change the name of this list to @email{internals@@mysql.com}, to more accurately reflect what should be posted to this list. to @email{dev-public@@mysql.com} and we will answer them. Please remember to not use this internal email list in public! @item Try to write code in a lot of black boxes that can be reused or at least have a clean interface. Try to write code in a lot of black boxes that can be reused or use at least a clean, easy to change interface. @item Reuse code; There is already a lot of algorithms in MySQL for list handling, queues, dynamic and hashed arrays, sorting, etc. that can be reused. @item Use the @code{my_*} functions like @code{my_read()}/@code{my_write()}/ @code{my_malloc()} that you can find in the @code{mysys} library instead of the direct system calls; This will make your code easier to debug and more portable. @item Try to always write optimized code, so that you don't have to go back and rewrite it a couple of months later. It's better to Loading @@ -222,7 +226,11 @@ Do not check the same pointer for @code{NULL} more than once. @item Use long function and variable names in English; This makes your code easier to read. Use the 'varible_name' style instead of 'VariableName'. easier to read. @item Use my_var as opposed to myVar or MyVar (@samp{_} rather than dancing SHIFT to seperate words in identifiers). @item Think assembly - make it easier for the compiler to optimize your code. Loading @@ -232,14 +240,8 @@ Comment your code when you do something that someone else may think is not ''trivial''. @item Use the @code{my_*} functions like @code{my_read()}/@code{my_write()}/ @code{my_malloc()} that you can find in the @code{mysys} library instead of the direct system calls; This will make your code easier to debug and more portable. @item Use @code{libstring} functions instead of standard libc string functions whenever possible. Use @code{libstring} functions (in the strings directory) instead of standard libc string functions whenever possible. @item Avoid using @code{malloc()} (its REAL slow); For memory allocations Loading @@ -253,10 +255,6 @@ it. This way we can easily provide you with feedback and also easily discuss it thoroughly if some other developer thinks there is better way to do the same thing! @item Use my_var as opposed to myVar or MyVar (@samp{_} rather than dancing SHIFT to seperate words in identifiers). @item Class names start with a capital letter. Loading
Docs/manual.texi +29 −18 Original line number Diff line number Diff line Loading @@ -9592,8 +9592,8 @@ version 4.0; @item The old C API functions @code{mysql_drop_db}, @code{mysql_create_db} and @code{mysql_connect} are not supported anymore, unless one compiles MySQL with @code{USE_OLD_FUNCTIONS}. Instead of doing this, one should change the client to use the new 4.0 API. MySQL with @code{CFLAGS=-DUSE_OLD_FUNCTIONS}. Instead of doing this, one should change the client to use the new 4.0 API. @item In the @code{MYSQL_FIELD} structure, @code{length} and @code{max_length} has changed from @code{unsigned int} to @code{unsigned long}. This should not Loading @@ -9616,6 +9616,10 @@ Format of @code{SHOW OPEN TABLE} has changed. @item Multithreaded clients should use @code{mysql_thread_init()} and @code{mysql_thread_end()}. @xref{Threaded clients}. @item If you want to recompile the perl DBD-MySQL module, you must get Msql-Mysql-modules version 1.2218 or newer, because the older DBD modules used the deprecated @code{drop_db()} call. @end itemize @node Upgrading-from-3.22, Upgrading-from-3.21, Upgrading-from-3.23, Upgrade Loading Loading @@ -9660,6 +9664,10 @@ option @code{--no-named-commands (-g)}. This option can be disabled with some cases, for example in SQL scripts that use named commands without a semicolon! Long format commands still work from the first line. @item Date functions that work on part of dates (like @code{MONTH()}) will now return 0 for @code{0000-00-00} dates. (MySQL 3.22 returned @code{NULL}). @item If you are using the @code{german} character sort order, you must repair all your tables with @code{isamchk -r}, as we have made some changes in Loading Loading @@ -10368,6 +10376,8 @@ You can avoid using @file{libg++.a} by running @code{configure} like this: shell> CXX=gcc ./configure @end example If you are running gcc 3.0 and above, you can't use the above trick with CXX=gcc, but you have to install libstd++. @node Linux-SPARC, Linux-Alpha, Linux-x86, Linux @subsubsection Linux SPARC Notes Loading Loading @@ -10950,6 +10960,10 @@ Because Windows doesn't allow you to drop files that are open, you first must flush all @code{MERGE} tables (with @code{FLUSH TABLES}) or drop the @code{MERGE} table before dropping the table. We will fix this at the same time we introduce @code{VIEW}s. @item @code{DATA DIRECTORY} and @code{INDEX DIRECTORY} directives in @code{CREATE TABLE} is ignored on windows, because windows doesn't support symbolic links. @end table Here are some open issues for anyone who might want to help us with the Windows Loading Loading @@ -11184,7 +11198,7 @@ When using the @code{--with-libwrap} configure option, you must also include the libraries that @file{libwrap.a} needs: @example --with-libwrap="/opt/NUtcpwrapper-7.6/lib/libwrap.a -lnsl -lsocket --with-libwrap="/opt/NUtcpwrapper-7.6/ -lnsl -lsocket @end example If you have problems with configure trying to link with @code{-lz} and Loading Loading @@ -35648,15 +35662,6 @@ If you use @code{ALTER TABLE} on a @code{MyISAM} table, all non-unique indexes are created in a separate batch (like in @code{REPAIR}). This should make @code{ALTER TABLE} much faster when you have many indexes. @item Since @strong{MySQL 4.0} this can be activated explicitly. @code{ALTER TABLE ... DISABLE KEYS} makes MySQL to stop updating non-unique indexes for @code{MyISAM} table. @code{ALTER TABLE ... ENABLE KEYS} then should be used to recreate missing indexes. As MySQL does it with special algorithm which is much faster then inserting keys one by one, disabling keys could give a considerable speedup on bulk inserts. @item @findex mysql_info() With the C API function @code{mysql_info()}, you can find out how many Loading Loading @@ -39091,7 +39096,14 @@ they roll back the corresponding SQL statement. @itemize @bullet @item @code{SHOW TABLE STATUS} does not give accurate statistics @item @strong{WARNING:} Do @strong{NOT} convert MySQL system tables from MyISAM TO InnoDB tables! This is not supported; If you do this MySQL will not restart until you restore the old system tables from a backup or re-generate them with the mysql_install_db script. @item @code{SHOW TABLE STATUS} does not give accurate statistics on InnoDB tables, except for the physical size reserved by the table. The row count is only a rough estimate used in SQL optimization. Loading Loading @@ -47349,7 +47361,7 @@ chapter or for the proper operation of the programs listed herein. Perl @code{Data-Dumper} module. Useful with @code{DBI}/@code{DBD} support for older Perl installations. @item @uref{http://www.mysql.com/Downloads/Contrib/DBI-1.15.tar.gz, DBI-1.15.tar.gz} @item @uref{http://www.mysql.com/Downloads/Contrib/DBI-1.18.tar.gz, DBI-1.18.tar.gz} Perl @code{DBI} module. @item @uref{http://www.mysql.com/Downloads/Contrib/KAMXbase1.2.tar.gz,KAMXbase1.2.tar.gz} Loading @@ -47358,7 +47370,7 @@ module written by Pratap Pereira @email{pereira@@ee.eng.ohio-state.edu}, extended by Kevin A. McGrail @email{kmcgrail@@digital1.peregrinehw.com}. This converter can handle MEMO fields. @item @uref{http://www.mysql.com/Downloads/Contrib/Msql-Mysql-modules-1.2216.tar.gz, Msql-Mysql-modules-1.2216.tar.gz} @item @uref{http://www.mysql.com/Downloads/Contrib/Msql-Mysql-modules-1.2218.tar.gz, Msql-Mysql-modules-1.2218.tar.gz} Perl @code{DBD} module to access mSQL and MySQL databases. @item @uref{http://www.mysql.com/Downloads/Contrib/Data-ShowTable-3.3.tar.gz, Data-ShowTable-3.3.tar.gz} Loading Loading @@ -47440,9 +47452,6 @@ A C++ database independent library that supports MySQL. @cindex Delphi @item Delphi @itemize @bullet @item @uref{http://www.mysql.com/Downloads/Contrib/delphi-interface.gz, delphi-interface.gz} Delphi interface to @code{libmysql.dll}, by Blestan Tabakov, @email{root@@tdg.bis.bg}. @item @uref{http://www.mysql.com/Downloads/Contrib/DelphiMySQL2.zip, DelphiMySQL2.zip} Delphi interface to @code{libmysql.dll}, by @email{bsilva@@umesd.k12.or.us}. Loading Loading @@ -48656,6 +48665,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item Ignore @code{DATA DIRECTORY} and @code{INDEX DIRECTORY} directives on windows. @item Added boolean fulltext search code. It should be considered early alpha. @item Extended @code{MODIFY} and @code{CHANGE} in @code{ALTER TABLE} to accept
acinclude.m4 +2 −2 Original line number Diff line number Diff line Loading @@ -652,7 +652,7 @@ if test -r /proc/cpuinfo ; then cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` fi if test "$cpu_vendor" = "AuthenticAMD"; then if test $cpu_family>=6; then if test $cpu_family -ge 6; then cpu_set="athlon pentiumpro k5 pentium i486 i386"; elif test $cpu_family=5; then cpu_set="k5 pentium i486 i386"; Loading @@ -662,7 +662,7 @@ if test "$cpu_vendor" = "AuthenticAMD"; then cpu_set="i386" fi elif test "$cpu_vendor" = "GenuineIntel"; then if test $cpu_family>=6; then if test $cpu_family -ge 6; then cpu_set="pentiumpro pentium i486 i386"; elif test $cpu_family=5; then cpu_set="pentium i486 i386"; Loading
configure.in +1 −1 Original line number Diff line number Diff line Loading @@ -1769,7 +1769,7 @@ then fi AC_SUBST(tools_dirs) MYSQL_CHECK_CPU #MYSQL_CHECK_CPU MYSQL_CHECK_MYSQLFS MYSQL_CHECK_VIO MYSQL_CHECK_OPENSSL Loading
include/mysql.h +5 −5 Original line number Diff line number Diff line Loading @@ -253,15 +253,15 @@ typedef struct st_mysql_manager /* Set up and bring down the server; to ensure that applications will * work when linked against either the standard client library or the * embedded server library, these functions should be called. */ int mysql_server_init(int argc, char **argv, char **groups); void mysql_server_end(void); int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); /* Set up and bring down a thread; these function should be called * for each thread in an application which opens at least one MySQL * connection. All uses of the connection(s) should be between these * function calls. */ my_bool mysql_thread_init(void); void mysql_thread_end(void); my_bool STDCALL mysql_thread_init(void); void STDCALL mysql_thread_end(void); /* Functions to get information from the MYSQL and MYSQL_RES structures */ /* Should definitely be used if one uses shared libraries */ Loading Loading @@ -414,8 +414,8 @@ MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) #define HAVE_MYSQL_REAL_CONNECT #endif #define HAVE_MYSQL_REAL_CONNECT /* The following functions are mainly exported because of mysqlbinlog; Loading