From d3741dea326bafc4fb2b34bfd5bcfd9a88508009 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Thu, 14 Mar 2002 14:32:36 +0200 Subject: [PATCH 1/5] manual.texi: Fix an error in the manual: also BDB and InnoDB tables can have indexes on columns which can have NULLs --- Docs/manual.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index e98a74212fc..7b2a3acf241 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -34904,7 +34904,7 @@ table using @code{SHOW INDEX FROM tbl_name}. @item @cindex @code{NULL} values, and indexes @cindex indexes, and @code{NULL} values -Only the @code{MyISAM} table type supports indexes on columns that can have +Only the @code{MyISAM}, @code{InnoDB}, and @code{BDB} table types support indexes on columns that can have @code{NULL} values. In other cases you must declare such columns @code{NOT NULL} or an error results. From e7a3b85a8fee673bbbd398ab4ab6780c1e224546 Mon Sep 17 00:00:00 2001 From: "paul@teton.kitebird.com" <> Date: Thu, 14 Mar 2002 12:14:43 -0600 Subject: [PATCH 2/5] manual.texi remove apparently-errant half-phrase --- Docs/manual.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 6a289f54bf2..e9138d99e80 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -26724,7 +26724,7 @@ following circumstances: When the cache is full and a thread tries to open a table that is not in the cache. @item -When the cache contains more than @code{table_cache} entires and +When the cache contains more than @code{table_cache} entries and a thread is no longer using a table. @item When someone executes @code{mysqladmin refresh} or @@ -51786,7 +51786,7 @@ Added @code{--default-table-type} option to @code{mysqld}. @cindex changes, version 3.22 The 3.22 version has faster and safer connect code than version 3.21, as well -as a lot of new nice enhancements. The reason for not including these changes +as a lot of new nice enhancements. As there aren't really any major changes, upgrading from 3.21 to 3.22 should be very easy and painless. @xref{Upgrading-from-3.21}. From de8a1e2525d39af0d86dc9ebb131661b6b0626d6 Mon Sep 17 00:00:00 2001 From: "paul@teton.kitebird.com" <> Date: Thu, 14 Mar 2002 12:35:01 -0600 Subject: [PATCH 3/5] manual.texi clarify ambiguous "it" in mysql_escape_string() manual.texi description manual.texi add missing mysql_server_end() prototype manual.texi add missing mysql_thread_end() prototype manual.texi add missing mysql_thread_init() prototype manual.texi add missing my_init() prototype --- Docs/manual.texi | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index e9138d99e80..73972fb275e 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -41862,12 +41862,11 @@ None. You should use @code{mysql_real_escape_string()} instead! -This is identical to @code{mysql_real_escape_string()} except that it -takes the connection as the first -argument. @code{mysql_real_escape_string()} will escape the string -according to the current character set while -@code{mysql_escape_string()} does not respect the current charset -setting. +This function is identical to @code{mysql_real_escape_string()} except +that @code{mysql_real_escape_string()} takes a connection handler as +its first argument and escapes the string according to the current +character set. @code{mysql_escape_string()} does not take a connection +argument and does not respect the current charset setting. @node mysql_fetch_field, mysql_fetch_fields, mysql_escape_string, C API functions @@ -43486,6 +43485,8 @@ threaded client. @xref{Threaded clients}. @findex @code{my_init()} +@code{void my_init(void)} + @subsubheading Description This function needs to be called once in the program before calling any @@ -43498,13 +43499,15 @@ This is automatically called by @code{mysql_init()}, @subsubheading Return Values -none. +None. @node mysql_thread_init, mysql_thread_end, my_init, C Thread functions @subsubsection @code{mysql_thread_init()} @findex @code{mysql_thread_init()} +@code{my_bool mysql_thread_init(void)} + @subsubheading Description This function needs to be called for each created thread to initialise @@ -43514,13 +43517,15 @@ This is automatically called by @code{my_init()} and @code{mysql_connect()}. @subsubheading Return Values -none. +None. @node mysql_thread_end, , mysql_thread_init, C Thread functions @subsubsection @code{mysql_thread_end()} @findex @code{mysql_thread_end()} +@code{void mysql_thread_end(void)} + @subsubheading Description This function needs to be called before calling @code{pthread_exit()} to @@ -43531,7 +43536,7 @@ library. It must be called explicitly to avoid a memory leak. @subsubheading Return Values -none. +None. @node C Embedded Server func, C API problems, C Thread functions, C @subsection C Embedded Server Function Descriptions @@ -43617,6 +43622,8 @@ int main(void) @{ @findex @code{mysql_server_end()} +@code{void mysql_server_end(void)} + @subsubheading Description This function @strong{must} be called once in the program after @@ -43624,7 +43631,7 @@ all other MySQL functions. It shuts down the embedded server. @subsubheading Return Values -none. +None. @node C API problems, Building clients, C Embedded Server func, C @subsection Common questions and problems when using the C API From bbab880f095b141bd1837c77162c2c804bc06073 Mon Sep 17 00:00:00 2001 From: "paul@teton.kitebird.com" <> Date: Thu, 14 Mar 2002 17:59:32 -0600 Subject: [PATCH 4/5] manual.texi - make mysql_debug() argument match prototype in mysql.h. manual.texi - make mysql_data_seek() second argument match manual.texi prototype in mysql.h. manual.texi - fix missing @xref parens in function names. manual.texi - mysql_change_user(), mysql_character_set_name() manual.texi were out of order in C API section. --- Docs/manual.texi | 160 +++++++++++++++++++++++------------------------ 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 2579fee6a53..82912a093ea 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -15139,7 +15139,7 @@ There are two separte fixes for this: If one doesn't configure with @code{--enable-local-infile} then @code{LOAD DATA LOCAL} will be disabled by all clients, unless one calls @code{mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0)} in the client. -@xref{mysql_options, , @code{mysql_options}}. +@xref{mysql_options, , @code{mysql_options()}}. One can enable this command in the @code{mysql} command line client by specify the option @code{--local-infile[=1]} and disable it with @@ -40276,7 +40276,7 @@ is used. If you specify the option @code{Read options from C:\my.cnf}, the groups @code{client} and @code{odbc} will be read from the @file{C:\my.cnf} file. You can use all options that are usable by @code{mysql_options()}. -@xref{mysql_options, , @code{mysql_options}}. +@xref{mysql_options, , @code{mysql_options()}}. @node MyODBC connect parameters, ODBC Problems, ODBC administrator, ODBC @@ -41008,6 +41008,12 @@ greater detail in the next section. Returns the number of rows changed/deleted/inserted by the last @code{UPDATE}, @code{DELETE}, or @code{INSERT} query. +@item @strong{mysql_change_user()} @tab +Changes user and database on an open connection. + +@item @strong{mysql_character_set_name()} @tab +Returns the name of the default character set for the connection. + @item @strong{mysql_close()} @tab Closes a server connection. @@ -41015,12 +41021,6 @@ Closes a server connection. Connects to a MySQL server. This function is deprecated; use @code{mysql_real_connect()} instead. -@item @strong{mysql_change_user()} @tab -Changes user and database on an open connection. - -@item @strong{mysql_character_set_name()} @tab -Returns the name of the default character set for the connection. - @item @strong{mysql_create_db()} @tab Creates a database. This function is deprecated; use the SQL command @code{CREATE DATABASE} instead. @@ -41049,10 +41049,6 @@ Returns the error number for the most recently invoked MySQL function. @item @strong{mysql_error()} @tab Returns the error message for the most recently invoked MySQL function. -@item @strong{mysql_real_escape_string()} @tab -Escapes special characters in a string for use in a SQL statement, taking -into account the current charset of the connection. - @item @strong{mysql_escape_string()} @tab Escapes special characters in a string for use in a SQL statement. @@ -41140,6 +41136,10 @@ Executes a SQL query specified as a null-terminated string. @item @strong{mysql_real_connect()} @tab Connects to a MySQL server. +@item @strong{mysql_real_escape_string()} @tab +Escapes special characters in a string for use in a SQL statement, taking +into account the current charset of the connection. + @item @strong{mysql_real_query()} @tab Executes a SQL query specified as a counted string. @@ -41280,10 +41280,10 @@ when an error occurred and what it was. @menu * mysql_affected_rows:: @code{mysql_affected_rows()} -* mysql_close:: @code{mysql_close()} -* mysql_connect:: @code{mysql_connect()} * mysql_change_user:: @code{mysql_change_user()} * mysql_character_set_name:: @code{mysql_character_set_name()} +* mysql_close:: @code{mysql_close()} +* mysql_connect:: @code{mysql_connect()} * mysql_create_db:: @code{mysql_create_db()} * mysql_data_seek:: @code{mysql_data_seek()} * mysql_debug:: @code{mysql_debug()} @@ -41363,7 +41363,7 @@ A string representation of the error may be obtained by calling @code{mysql_error()}. -@node mysql_affected_rows, mysql_close, C API functions, C API functions +@node mysql_affected_rows, mysql_change_user, C API functions, C API functions @subsubsection @code{mysql_affected_rows()} @findex @code{mysql_affected_rows()} @@ -41410,63 +41410,7 @@ old row. This is because in this case one row was inserted and then the duplicate was deleted. -@node mysql_close, mysql_connect, mysql_affected_rows, C API functions -@subsubsection @code{mysql_close()} - -@findex @code{mysql_close()} - -@code{void mysql_close(MYSQL *mysql)} - -@subsubheading Description -Closes a previously opened connection. @code{mysql_close()} also deallocates -the connection handle pointed to by @code{mysql} if the handle was allocated -automatically by @code{mysql_init()} or @code{mysql_connect()}. - -@subsubheading Return Values - -None. - -@subsubheading Errors - -None. - - -@node mysql_connect, mysql_change_user, mysql_close, C API functions -@subsubsection @code{mysql_connect()} - -@findex @code{mysql_connect()} - -@code{MYSQL *mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd)} - -@subsubheading Description - -This function is deprecated. It is preferable to use -@code{mysql_real_connect()} instead. - -@code{mysql_connect()} attempts to establish a connection to a MySQL -database engine running on @code{host}. @code{mysql_connect()} must complete -successfully before you can execute any of the other API functions, with the -exception of @code{mysql_get_client_info()}. - -The meanings of the parameters are the same as for the corresponding -parameters for @code{mysql_real_connect()} with the difference that the -connection parameter may be @code{NULL}. In this case the C API -allocates memory for the connection structure automatically and frees it -when you call @code{mysql_close()}. The disadvantage of this approach is -that you can't retrieve an error message if the connection fails. (To -get error information from @code{mysql_errno()} or @code{mysql_error()}, -you must provide a valid @code{MYSQL} pointer.) - -@subsubheading Return Values - -Same as for @code{mysql_real_connect()}. - -@subsubheading Errors - -Same as for @code{mysql_real_connect()}. - - -@node mysql_change_user, mysql_character_set_name, mysql_connect, C API functions +@node mysql_change_user, mysql_character_set_name, mysql_affected_rows, C API functions @subsubsection @code{mysql_change_user()} @findex @code{mysql_change_user()} @@ -41530,7 +41474,7 @@ if (mysql_change_user(&mysql, "user", "password", "new_database")) @end example -@node mysql_character_set_name, mysql_create_db, mysql_change_user, C API functions +@node mysql_character_set_name, mysql_close, mysql_change_user, C API functions @subsubsection @code{mysql_character_set_name()} @findex @code{mysql_character_set_name()} @@ -41549,7 +41493,63 @@ The default character set None. -@node mysql_create_db, mysql_data_seek, mysql_character_set_name, C API functions +@node mysql_close, mysql_connect, mysql_character_set_name, C API functions +@subsubsection @code{mysql_close()} + +@findex @code{mysql_close()} + +@code{void mysql_close(MYSQL *mysql)} + +@subsubheading Description +Closes a previously opened connection. @code{mysql_close()} also deallocates +the connection handle pointed to by @code{mysql} if the handle was allocated +automatically by @code{mysql_init()} or @code{mysql_connect()}. + +@subsubheading Return Values + +None. + +@subsubheading Errors + +None. + + +@node mysql_connect, mysql_create_db, mysql_close, C API functions +@subsubsection @code{mysql_connect()} + +@findex @code{mysql_connect()} + +@code{MYSQL *mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd)} + +@subsubheading Description + +This function is deprecated. It is preferable to use +@code{mysql_real_connect()} instead. + +@code{mysql_connect()} attempts to establish a connection to a MySQL +database engine running on @code{host}. @code{mysql_connect()} must complete +successfully before you can execute any of the other API functions, with the +exception of @code{mysql_get_client_info()}. + +The meanings of the parameters are the same as for the corresponding +parameters for @code{mysql_real_connect()} with the difference that the +connection parameter may be @code{NULL}. In this case the C API +allocates memory for the connection structure automatically and frees it +when you call @code{mysql_close()}. The disadvantage of this approach is +that you can't retrieve an error message if the connection fails. (To +get error information from @code{mysql_errno()} or @code{mysql_error()}, +you must provide a valid @code{MYSQL} pointer.) + +@subsubheading Return Values + +Same as for @code{mysql_real_connect()}. + +@subsubheading Errors + +Same as for @code{mysql_real_connect()}. + + +@node mysql_create_db, mysql_data_seek, mysql_connect, C API functions @subsubsection @code{mysql_create_db()} @findex @code{mysql_create_db()} @@ -41599,7 +41599,7 @@ if(mysql_create_db(&mysql, "my_database")) @findex @code{mysql_data_seek()} -@code{void mysql_data_seek(MYSQL_RES *result, unsigned long long offset)} +@code{void mysql_data_seek(MYSQL_RES *result, my_ulonglong long offset)} @subsubheading Description Seeks to an arbitrary row in a query result set. This requires that the @@ -41623,7 +41623,7 @@ None. @findex @code{mysql_debug()} -@code{void mysql_debug(char *debug)} +@code{void mysql_debug(const char *debug)} @subsubheading Description Does a @code{DBUG_PUSH} with the given string. @code{mysql_debug()} uses the @@ -42851,7 +42851,7 @@ query string.) If you want to know if the query should return a result set or not, you can use @code{mysql_field_count()} to check for this. -@xref{mysql_field_count, , @code{mysql_field_count}}. +@xref{mysql_field_count, , @code{mysql_field_count()}}. @subsubheading Return Values @@ -42897,7 +42897,7 @@ The first parameter should be the address of an existing @code{MYSQL} structure. Before calling @code{mysql_real_connect()} you must call @code{mysql_init()} to initialise the @code{MYSQL} structure. You can change a lot of connect options with the @code{mysql_options()} -call. @xref{mysql_options}. +call. @xref{mysql_options, @code{mysql_options()}}. @item The value of @code{host} may be either a hostname or an IP address. If @@ -43112,7 +43112,7 @@ the query string. If you want to know if the query should return a result set or not, you can use @code{mysql_field_count()} to check for this. -@xref{mysql_field_count, @code{mysql_field_count}}. +@xref{mysql_field_count, @code{mysql_field_count()}}. @subsubheading Return Values @@ -43334,7 +43334,7 @@ checking if @code{mysql_store_result()} returns 0 (more about this later one). If you want to know if the query should return a result set or not, you can use @code{mysql_field_count()} to check for this. -@xref{mysql_field_count, @code{mysql_field_count}}. +@xref{mysql_field_count, @code{mysql_field_count()}}. @code{mysql_store_result()} reads the entire result of a query to the client, allocates a @code{MYSQL_RES} structure, and places the result into this From 7eaedb2f148583dbe3f1f8286e58990b969a1359 Mon Sep 17 00:00:00 2001 From: "arjen@fred.bitbike.com" <> Date: Fri, 15 Mar 2002 10:35:14 +1000 Subject: [PATCH 5/5] Typo fixup (from Colin Faber). --- .bzrignore | 1 + Docs/manual.texi | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.bzrignore b/.bzrignore index aabb7bddd3a..9ba7f037a1b 100644 --- a/.bzrignore +++ b/.bzrignore @@ -462,3 +462,4 @@ Docs/mysql.xml mysql-test/r/rpl000001.eval Docs/safe-mysql.xml mysys/test_vsnprintf +Docs/manual.de.log diff --git a/Docs/manual.texi b/Docs/manual.texi index 2579fee6a53..5a2889126cf 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -35950,8 +35950,8 @@ mysql> INSERT INTO articles VALUES -> (0,'1001 MySQL Trick','1. Never run mysqld as root. 2. ...'), -> (0,'MySQL vs. YourSQL', 'In the following database comparison ...'), -> (0,'MySQL Security', 'When configured properly, MySQL ...'); -Query OK, 5 rows affected (0.00 sec) -Records: 5 Duplicates: 0 Warnings: 0 +Query OK, 6 rows affected (0.00 sec) +Records: 6 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM articles -> WHERE MATCH (title,body) AGAINST ('database'); @@ -35992,7 +35992,7 @@ mysql> SELECT id,MATCH title,body AGAINST ('Tutorial') FROM articles; | 5 | 0 | | 6 | 0 | +----+-----------------------------------------+ -5 rows in set (0.00 sec) +6 rows in set (0.00 sec) @end example This example shows how to retrieve the relevances. As neither @code{WHERE}