Hello,

I'm encountering a serious program fault at using MySQL Win32 client library
LIBMYSQL.DLL.

I found LIBMYSQL.DLL not thread-safe. When 10 threads are launched to run
the following two blocks of C statements, very quickly a program fault
window pops up to LIBMYSQL.DLL.

    ---- block #1 -----
    EnterCriticalSection(&dcs);
    mysql_real_query(db,stmt,strlen(stmt));
    res=mysql_store_result(db);
    LeaveCriticalSection(&dcs);

    ---- block #1 ----- (in another C function)
    EnterCriticalSection(&dcs);
    row=mysql_fetch_row(res);
    nfld=mysql_num_fields(res);
    flds=mysql_fetch_fields(res);
    LeaveCriticalSection(&dcs);

But, if I merged the two blocks into one as:

    EnterCriticalSection(&dcs);
    mysql_real_query(db,stmt,strlen(stmt));
    res=mysql_store_result(db);
    row=mysql_fetch_row(res);
    nfld=mysql_num_fields(res);
    flds=mysql_fetch_fields(res);
    LeaveCriticalSection(&dcs);

then, the threads run fine for hours without any program fault pop up.

HOWEVER, the second scenario is irrelevant to my (and most multithreaded)
application where there are many nested queries of rows.

Is there any thread-safe LIBMYSQL.DLL downloadable on mysql.com?? or is
there any other solution to make SQL queries by simultaneous threads safe?

Thank You!

Best Regards,
Peter

----- Original Message -----
From: Michael Widenius <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, October 16, 2001 6:29 AM
Subject: MySQL 4.0 released


>
> Hi!
>
> MySQL 4.0.0-alpha is now available at:
> http://www.mysql.com/downloads/mysql-4.0.html
>
> You can find information about upgrading from MySQL 3.23 to 4.0 at:
> http://www.mysql.com/doc/U/p/Upgrading-from-3.23.html
>
> The MySQL 4.0 release includes a lot of new exciting features, like
> MySQL as an embedded library, InnoDB (transactions) as standard table
> type, UNION, multi table delete and much more.
>
> MySQL 4.0 is basically a 'reconstruction release' that will enable us to
> easier add new features to MySQL in the future.  The intention is to
> quickly add features list at:
>
> http://www.mysql.com/doc/T/O/TODO_MySQL_4.0.html
>
> and then start to work on the 4.1 branch while 4.0 stabilizes.
>
> Changes in release 4.0.0
> ------------------------
>
>    * Added documentation for `libmysqld', the embedded MySQL server
>      library.  Also added example programs (a `mysql' client and
>      `mysqltest' test program) which use `libmysqld'.
>
>    * Removed all Gemini hooks from MySQL.
>
>    * Removed `my_thread_init()' and `my_thread_end()' from mysql_com.h,
>      and added `mysql_thread_init()' and `mysql_thread_end()' to
>      mysql.h.
>
>    * Secure connections (with SSL).
>
>    * Unsigned `BIGINT' constants now work. `MIN()' and `MAX()' now
>      handles signed and unsigned `BIGINT' numbers correctly.
>
>    * New character set `latin_de' which provides correct German sorting.
>
>    * `TRUNCATE TABLE' and `DELETE FROM table_name' are now separate
>      functions. One bonus is that `DELETE FROM table_name' now returns
>      the number of deleted rows.
>
>    * `DROP DATABASE' now executes a `DROP TABLE' on all tables in the
>      database, which fixes a problem with InnoDB tables.
>
>    * Added support for `UNION'.
>
>    * A new `HANDLER' interface to `MyISAM' tables.
>
>    * Added support for `INSERT' on `MERGE' tables. Patch from Benjamin
>      Pflugmann.
>
>    * Changed `WEEK(#,0)' to match the calender in the USA.
>
>    * `COUNT(DISTINCT)' is about 30% faster.
>
>    * Speed up all internal list handling.
>
>    * Speed up `IS NULL()' and some other internal primitives.
>
>    * Creating full text indexes are now much faster.
>
>    * Tree-like cache to speed up bulk inserts and
>      `myisam_bulk_insert_tree_size' variable.
>
>    * Searching on packed (`CHAR'/`VARCHAR') keys are now much faster.
>
>    * Optimized queries of type: `SELECT DISTINCT * from table_name
>      ORDER by key_part1 LIMIT #'
>
>    * `SHOW CREATE TABLE' now shows all table attributes.
>
>    * `ORDER BY ... DESC' can now use keys.
>
>    * `LOAD DATA FROM MASTER' "auto-magically" sets up a slave.
>
>    * Renamed `safe_mysqld' to `mysqld_safe'.
>
>    * Added support for symbolic links to `MyISAM' tables. Symlink
>      handling is now enabled by default for Windows.
>
>    * `LOAD DATA FROM MASTER' "auto-magically" sets up a slave.
>
>    * Added `SQL_CALC_FOUND_ROWS' and `FOUND_ROWS()'. This makes it
>      possible to know how many rows a query would have returned without
>      a `LIMIT' clause.
>
>    * Changed output format of `SHOW OPEN TABLES'.
>
>    * Allow `SELECT expression LIMIT ...'.
>
>    * Added `IDENTITY' as a synonym for `AUTO_INCREMENT' (like Sybase).
>
>    * Added `ORDER BY' syntax to `UPDATE' and `DELETE'.
>
>    * `SHOW INDEXES' is now a synonym for `SHOW INDEX'.
>
>    * Added `ALTER TABLE table_name DISABLE KEYS' and `ALTER TABLE
>      table_name ENABLE KEYS' commands.
>
>    * Allow one to use `IN' instead of `FROM' in `SHOW' commands.
>
>    * Allow ANSI SQL syntax `X'hexadecimal-number''
>
>    * Cleaned up global lock handling for `FLUSH TABLES WITH READ LOCK'
>
>    * Fixed problem with `DATETIME = constant' in `WHERE' optimization.
>
>    * Added options `--master-data' and `--no-autocommit' to `mysqldump'
>      (Thanks to Brian Aker for this).
>
>    * Added script `mysql_explain_log.sh' to distribution.  (Thanks to
>      mobile.de).
>
> Regards,
> Monty
>
> ---------------------------------------------------------------------
> To request this thread, e-mail [EMAIL PROTECTED]
> To unsubscribe, e-mail the address shown in the
> List-Unsubscribe header of this message.
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to