diff options
author | unknown <hf@deer.(none)> | 2003-07-18 16:26:35 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2003-07-18 16:26:35 +0500 |
commit | d17b3e967d517ad290eec9cd0d59dd47f4887e08 (patch) | |
tree | f1de729b4db0054d2ad06f1d4e3913b941563f60 /sql-common | |
parent | bf3af8eeac3dba6af359805e82ad5c1b26d4834e (diff) | |
download | mariadb-git-d17b3e967d517ad290eec9cd0d59dd47f4887e08.tar.gz |
SCRUM
Including client code into embedded library
fixes
libmysql/libmysql.c:
We should call this way
libmysqld/lib_sql.cc:
Necessary initializations added
libmysqld/libmysqld.c:
mysql_close can't be "virtual"
mysqltest.c calls mysql_close before mysql_connect
sql-common/client.c:
We have to redo fetch_lengths to count lengths looking at '\0' in string.
It works slower, but is correct for both client and embedded libraries
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index ea0d079511f..7c0de2dba73 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -48,12 +48,14 @@ #endif #define CLI_MYSQL_REAL_CONNECT cli_mysql_real_connect +#define CLI_MYSQL_CLOSE cli_mysql_close #undef net_flush my_bool net_flush(NET *net); #else /*EMBEDDED_LIBRARY*/ #define CLI_MYSQL_REAL_CONNECT mysql_real_connect +#define CLI_MYSQL_CLOSE mysql_close #endif /*EMBEDDED_LIBRARY*/ #if !defined(MYSQL_SERVER) && (defined(__WIN__) || defined(_WIN32) || defined(_WIN64)) @@ -965,26 +967,11 @@ void mysql_read_default_options(struct st_mysql_options *options, void fetch_lengths(ulong *to, MYSQL_ROW column, uint field_count) { - ulong *prev_length; - byte *start=0; MYSQL_ROW end; - - prev_length=0; /* Keep gcc happy */ - for (end=column + field_count + 1 ; column != end ; column++, to++) - { - if (!*column) - { - *to= 0; /* Null */ - continue; - } - if (start) /* Found end of prev string */ - *prev_length= (ulong) (*column-start-1); - start= *column; - prev_length= to; - } + for (end=column + field_count; column != end ; column++, to++) + *to= *column ? strlen(*column) : 0; } - /*************************************************************************** Change field rows to field structs ***************************************************************************/ @@ -1422,14 +1409,12 @@ error: before calling mysql_real_connect ! */ -static void STDCALL cli_mysql_close(MYSQL *mysql); static my_bool STDCALL cli_mysql_read_query_result(MYSQL *mysql); static MYSQL_RES * STDCALL cli_mysql_store_result(MYSQL *mysql); static MYSQL_RES * STDCALL cli_mysql_use_result(MYSQL *mysql); static MYSQL_METHODS client_methods= { - cli_mysql_close, cli_mysql_read_query_result, cli_advanced_command, cli_mysql_store_result, @@ -2140,7 +2125,7 @@ static void mysql_close_free(MYSQL *mysql) } -static void STDCALL cli_mysql_close(MYSQL *mysql) +void STDCALL CLI_MYSQL_CLOSE(MYSQL *mysql) { DBUG_ENTER("mysql_close"); if (mysql) /* Some simple safety */ |