Bug #42226 ALTER DATABASE returns OK even when there are errors

Submitted: 20 Jan 2009 19:14 Modified: 29 Aug 2009 6:08
Reporter: Mark Leith Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.1.30 OS:Any
Assigned to: Tatiana Azundris Nuernberg CPU Architecture:Any
Tags: alter database

[20 Jan 2009 19:14] Mark Leith
Description:
ALTER DATABASE, within mysql_alter_db(), will return OK, even if there were errors, such as writing to the binary logs, or getting global read locks etc. 

How to repeat:
N/A - Code Review

Suggested fix:
Return errors when there are errors, so that the client does not think everything went OK.
[21 Jan 2009 14:23] Mark Leith
Specifically, from mysql_alter_db() in sql/sql_db.cc:

  build_table_filename(path, sizeof(path), db, "", MY_DB_OPT_FILE, 0);
  if ((error=write_db_opt(thd, path, create_info)))
    goto exit;
...
exit:
  VOID(pthread_mutex_unlock(&LOCK_mysql_create_db));
  start_waiting_global_read_lock(thd);
exit2:
  DBUG_RETURN(error);

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.