List:Internals« Previous MessageNext Message »
From:Lenz Grimmer Date:July 27 2006 11:46am
Subject:Re: Bug fix for multi-table UPDATE IGNORE
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Paul,

I have not seen a reply to your message, hence I will try to provide my
2 cents here...

On Wed, 19 Jul 2006, Paul McCullagh wrote:

> I found a bug that can cause an engine to crash when executing a statement of
> the form:
> 
> UPDATE IGNORE t1, t2 ...;
> 
> The problem is, extra(HA_EXTRA_IGNORE_DUP_KEY) is not called in this case to
> inform the engine to ignore the duplicate key errors.
> 
> I have included a bug fix for the version I am using below. As far as I can
> tell, the code must also be added to mysql_multi_update_prepare() in version
> 5.1.

Thanks a lot! Would it possible to provide a diff against the last 5.1 snapshot?
That makes it easier to apply. And for bug fixes like that it may make sense to
open a bug report and attach the patch to the report. Sometimes stuff can fall
through the cracks on a mailing list...

Thank you for your help! It's appreciated.

Bye,
  LenZ

> ------ MySQL 4.1.16 ----- file: sql_update.cc ----- line: 687 ------
> 
> int mysql_multi_update(THD *thd,
> 		       TABLE_LIST *table_list,
> 		       List<Item> *fields,
> 		       List<Item> *values,
> 		       COND *conds,
> 		       ulong options,
> 		       enum enum_duplicates handle_duplicates, bool ignore,
> 		       SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex)
> {
>   int res;
>   TABLE_LIST *tl;
>   TABLE_LIST *update_list= (TABLE_LIST*) 
> thd->lex->select_lex.table_list.first;
>   List<Item> total_list;
>   multi_update *result;
>   DBUG_ENTER("mysql_multi_update");
> 
>   /* Setup timestamp handling */
>   for (tl= update_list; tl; tl= tl->next)
>   {
>     TABLE *table= tl->table;
>     /* Only set timestamp column if this is not modified */
>     if (table->timestamp_field &&
>         table->timestamp_field->query_id == thd->query_id)
>       table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
> 
>     /* We only need SELECT privilege for columns in the values list */
>     table->grant.want_privilege= (SELECT_ACL & ~table->grant.privilege);
> 
>     	/* PMC: engines may have to ignore duplicate key errors */
>     if (ignore)
>       table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
>   }
> 
> 
> 

Bye,
	LenZ
- -- 
 Lenz Grimmer <lenz@stripped>
 Community Relations Manager, EMEA
 MySQL GmbH, http://www.mysql.de/, Hamburg, Germany
 Visit the MySQL Forge at http://forge.mysql.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFEyKeHSVDhKrJykfIRAhW7AJ9k/NXzMeX8DVx5Q+Rbqubksdv4TgCfdLDJ
mkp9va9PjsrDlVwPIosen9w=
=ItVp
-----END PGP SIGNATURE-----
Thread
mysql architectureGirish Maskeri Rama2 Jun
  • Re: mysql architectureJim Winstead2 Jun
RE: mysql architectureGirish Maskeri Rama5 Jun
  • RE: mysql architecturePetr Chardin5 Jun
    • Bug fix for multi-table UPDATE IGNOREPaul McCullagh19 Jul
      • Re: Bug fix for multi-table UPDATE IGNORELenz Grimmer27 Jul
        • Re: Bug fix for multi-table UPDATE IGNOREPaul McCullagh1 Aug