MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Øystein Grøvlen Date:October 9 2009 12:31pm
Subject:Re: bzr commit into mysql-6.0-backup branch (oystein.grovlen:2869)
Bug#39105
View as plain text  
Rafal Somla wrote:
> Hi Oystein,
> 
> The patch is good to push.

Rafal,

When I were to push this fix, I discovered that it causes a failure in
backup_engines.backup_interruption test.  The diff is (at least in the 
myisam case):

@@ -195,6 +195,9 @@
  SHOW WARNINGS;
  Level  Code    Message
  Error  <error-code>    Query execution was interrupted
+Error  <error-code>    Query execution was interrupted
+Error  <error-code>    Query execution was interrupted
+Error  <error-code>    Query execution was interrupted
  Warning        <error-code>    Operation aborted
  #
  # Examine backup logs.
@@ -410,6 +413,9 @@
  SHOW WARNINGS;
  Level  Code    Message
  Error  <error-code>    Query execution was interrupted
+Error  <error-code>    Query execution was interrupted
+Error  <error-code>    Query execution was interrupted
+Error  <error-code>    Query execution was interrupted
  Warning        <error-code>    Operation aborted
  #
  # Examine backup logs.

Do you think this is OK or should I investigate it further?
Also, a lot of backup_extra tests fail.  Is that to be expected?

--
Øystein


> 
> Rafal
> 
> Oystein Grovlen wrote:
>> #At file:///export/home/tmp/oysteing/mysql/mysql-6.0-backup-39105/ 
>> based on revid:charles.bell@stripped
>>
>>  2869 Oystein Grovlen    2009-09-15
>>       Bug#39105 Assertion in sql_class.cc when backing up invalid 
>> merge table
>>         (Updated to head of backup branch)
>>                   Assertion no longer happens after new version of 
>> object service API
>>       was introduced, but error message could be improved so users are
>>       informed about what is actually wrong.  (That base tables are
>>       missing.)
>>                   More information is made available by having the 
>> service interface
>>       copy its warnings to the THD error stack.  Main error message is 
>> still
>>       the same, but more information is now found on the error stack.
>>      @ mysql-test/suite/backup/r/backup_nodata_driver.result
>>         Updated result file
>>      @ mysql-test/suite/backup/t/backup_nodata_driver.test
>>         Add test case for Bug#39105
>>      @ sql/si_objects.cc
>>         More information about errors are made available by having the 
>> service interface
>>         copy its warnings to the THD error stack.  Main error message 
>> is still the same,         but more information is now found on the 
>> error stack.
>>
>>     modified:
>>       mysql-test/suite/backup/r/backup_nodata_driver.result
>>       mysql-test/suite/backup/t/backup_nodata_driver.test
>>       sql/si_objects.cc
>> === modified file 'mysql-test/suite/backup/r/backup_nodata_driver.result'
>>
>> === modified file 'mysql-test/suite/backup/r/backup_nodata_driver.result'
>> --- a/mysql-test/suite/backup/r/backup_nodata_driver.result    
>> 2009-07-09 06:48:18 +0000
>> +++ b/mysql-test/suite/backup/r/backup_nodata_driver.result    
>> 2009-09-15 14:39:59 +0000
>> @@ -308,6 +308,25 @@
>>  SELECT * FROM bup_nodata.e1;
>>  Period    Vapor_period
>>  #
>> +# Test backup of MERGE table whose base tables do not exist. (Bug#39105)
>> +#
>> +USE test;
>> +DROP DATABASE bup_nodata;
>> +CREATE DATABASE bup_nodata;
>> +# Create MERGE table where underlying tables t1, t2, does not exist.
>> +CREATE TABLE bup_nodata.total(A INT NOT NULL AUTO_INCREMENT, MESSAGE 
>> CHAR(20), +INDEX(A))
>> +ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
>> +# Try to back up table.  Should get error.
>> +BACKUP DATABASE bup_nodata TO 'bup_notables.bak';
>> +ERROR HY000: Failed to obtain metadata for table `bup_nodata`.`total`
>> +SHOW WARNINGS;
>> +Level    Code    Message
>> +Error    #    Table 'test.t1' doesn't exist
>> +Error    #    Unable to open underlying table which is differently 
>> defined or of non-MyISAM type or doesn't exist
>> +Error    #    Failed to obtain metadata for table `bup_nodata`.`total`
>> +Warning    #    Operation aborted
>> +#
>>  # Check that restore fails if the backup image contains
>>  # a table in a storage engine that is not available (BUG#39379).
>>  #
>>
>> === modified file 'mysql-test/suite/backup/t/backup_nodata_driver.test'
>> --- a/mysql-test/suite/backup/t/backup_nodata_driver.test    
>> 2009-07-09 06:48:18 +0000
>> +++ b/mysql-test/suite/backup/t/backup_nodata_driver.test    
>> 2009-09-15 14:39:59 +0000
>> @@ -240,6 +240,27 @@
>>  SELECT * FROM bup_nodata.e1;
>>  
>>  --echo #
>> +--echo # Test backup of MERGE table whose base tables do not exist. 
>> (Bug#39105)
>> +--echo #
>> +
>> +# At on point in time the server would crash in the following test
>> +# if a USE statement was included.
>> +USE test;
>> +DROP DATABASE bup_nodata;
>> +CREATE DATABASE bup_nodata;
>> +
>> +--echo # Create MERGE table where underlying tables t1, t2, does not 
>> exist.
>> +CREATE TABLE bup_nodata.total(A INT NOT NULL AUTO_INCREMENT, MESSAGE 
>> CHAR(20), +                              INDEX(A))
>> +  ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;
>> +
>> +--echo # Try to back up table.  Should get error.
>> +--error ER_BACKUP_GET_META_TABLE
>> +BACKUP DATABASE bup_nodata TO 'bup_notables.bak';
>> +--replace_column 2 #
>> +SHOW WARNINGS;
>> +
>> +--echo #
>>  --echo # Check that restore fails if the backup image contains
>>  --echo # a table in a storage engine that is not available (BUG#39379).
>>  --echo #
>> @@ -261,5 +282,3 @@
>>  
>>  remove_file $MYSQLD_BACKUPDIR/bup_data.bak;
>>  remove_file $MYSQLD_BACKUPDIR/bup_nodata.bak;
>> -
>> -
>>
>> === modified file 'sql/si_objects.cc'
>> --- a/sql/si_objects.cc    2009-09-10 13:46:13 +0000
>> +++ b/sql/si_objects.cc    2009-09-15 14:39:59 +0000
>> @@ -187,7 +187,8 @@
>>  
>>    @param[in]  thd         Thread context.
>>    @param[in]  query       SQL query to be executed.
>> -  @param[out] ed_result   A place to store result and warnings.
>> +  @param[in]  get_warnings    If true, update THD with warnings. +  
>> @param[out] ed_connection   A place to store result and warnings.
>>  
>>    @return Error status.
>>      @retval TRUE on error.
>> @@ -196,7 +197,7 @@
>>  
>>  bool
>>  run_service_interface_sql(THD *thd, Ed_connection *ed_connection,
>> -                          const LEX_STRING *query)
>> +                          const LEX_STRING *query, bool get_warnings)
>>  {
>>    Si_session_context session_context;
>>  
>> @@ -210,6 +211,11 @@
>>  
>>    bool rc= ed_connection->execute_direct(*query);
>>  
>> +  if (get_warnings) {
>> +    /* Push warnings on the THD error stack. */
>> +    thd->warning_info->append_warnings(thd, 
>> ed_connection->get_warn_list());
>> +  }
>> +
>>    session_context.restore_si_ctx(thd);
>>  
>>    DBUG_RETURN(rc);
>> @@ -1266,7 +1272,7 @@
>>    Ed_result_set *ed_result_set;
>>    Iterator *it;
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, query))
>> +  if (run_service_interface_sql(thd, &ed_connection, query, TRUE))
>>      /* Query failed with an error */
>>      return NULL;
>>    else if(ed_connection.get_warn_count())
>> @@ -1740,7 +1746,8 @@
>>      s_stream <<
>>        "SHOW CREATE DATABASE `" << get_name() << "`";
>>  
>> -    if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()) ||
>> +    if (run_service_interface_sql(thd, &ed_connection, 
>> +                  s_stream.lex_string(), TRUE) ||
>>          ed_connection.get_warn_count())
>>      {
>>        /*
>> @@ -1890,7 +1897,8 @@
>>    s_stream <<
>>      "SHOW CREATE TABLE `" << &m_db_name << "`.`" <<
> &m_id << "`";
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()) ||
>> +  if (run_service_interface_sql(thd, &ed_connection, +                
>> s_stream.lex_string(), TRUE) ||
>>        ed_connection.get_warn_count())
>>    {
>>      /*
>> @@ -1945,7 +1953,8 @@
>>      "SHOW CREATE VIEW `" << view->get_db_name() << "`."
>>      "`" << view->get_name() << "`";
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()) ||
>> +  if (run_service_interface_sql(thd, &ed_connection, +                
>> s_stream.lex_string(), TRUE) ||
>>        ed_connection.get_warn_count())
>>    {
>>      /*
>> @@ -2055,7 +2064,8 @@
>>      "SHOW CREATE " << get_type_name() <<
>>      " `" << &m_db_name << "`.`" << &m_id <<
> "`";
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()))
>> +  if (run_service_interface_sql(thd, &ed_connection, +                
>> s_stream.lex_string(), TRUE))
>>      /* Query failed with an error */
>>      DBUG_RETURN(TRUE);
>>    else if(ed_connection.get_warn_count())
>> @@ -2451,8 +2461,8 @@
>>  
>>    // Execute SELECT.
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()) ||
>> -      ed_connection.get_warn_count())
>> +  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string(), +                TRUE) || 
>> ed_connection.get_warn_count())
>>      return NULL;
>>  
>>    // Fetch result.
>> @@ -2528,7 +2538,8 @@
>>      "WHERE LCASE(schema_name) != 'mysql' AND " <<
>>      "LCASE(schema_name) != 'information_schema'";
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()))
>> +  if (run_service_interface_sql(thd, &ed_connection,
>> +                s_stream.lex_string(), TRUE))
>>      /* Query failed with an error */
>>      return NULL;
>>    else if(ed_connection.get_warn_count())
>> @@ -2584,7 +2595,8 @@
>>      "FROM INFORMATION_SCHEMA.EVENTS "
>>      "WHERE event_schema = '" << db_name << "'";
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()))
>> +  if (run_service_interface_sql(thd, &ed_connection, +                
>> s_stream.lex_string(), TRUE))
>>      /* Query failed with an error */
>>      return NULL;
>>    else if(ed_connection.get_warn_count())
>> @@ -2925,7 +2937,9 @@
>>    s_stream << "SHOW CREATE DATABASE `" << db_name << "`";
>>  
>>    Ed_connection ed_connection(thd);
>> -  rc= run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string());
>> +  rc= run_service_interface_sql(thd, +                &ed_connection, 
>> s_stream.lex_string(), +                FALSE);
>>  
>>    /* We're not interested in warnings/errors here. */
>>  
>> @@ -2950,7 +2964,8 @@
>>      "WHERE grantee = \"" << grant_obj->get_user_name() << "\"";
>>  
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()) ||
>> +  if (run_service_interface_sql(thd, &ed_connection, +                
>> s_stream.lex_string(), TRUE) ||
>>        ed_connection.get_warn_count())
>>    {
>>      /* Should be no warnings. */
>> @@ -2993,7 +3008,8 @@
>>      "t1.tablespace_name = '" << ts_name << "'";
>>  
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()) ||
>> +  if (run_service_interface_sql(thd, &ed_connection, +                
>> s_stream.lex_string(), TRUE) ||
>>        ed_connection.get_warn_count())
>>    {
>>      /* Should be no warnings. */
>> @@ -3061,7 +3077,8 @@
>>      "t3.table_name = '" << table_name << "'";
>>  
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, 
>> s_stream.lex_string()) ||
>> +  if (run_service_interface_sql(thd, &ed_connection, +                
>> s_stream.lex_string(), TRUE) ||
>>        ed_connection.get_warn_count())
>>    {
>>      /* Should be no warnings. */
>> @@ -3419,7 +3436,7 @@
>>                                  "FROM INFORMATION_SCHEMA.PROCESSLIST"
>>                                  "WHERE LCASE(command) = LCASE('Binlog 
>> Dump')");
>>  
>> -  if (run_service_interface_sql(thd, &ed_connection, &sql_text) ||
>> +  if (run_service_interface_sql(thd, &ed_connection, &sql_text, TRUE)
> ||
>>        ed_connection.get_warn_count())
>>    {
>>      /* Should be no warnings. */
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>


-- 
Øystein Grøvlen, Senior Staff Engineer
Sun Microsystems, Database Group
Trondheim, Norway
Thread
bzr commit into mysql-6.0-backup branch (oystein.grovlen:2869) Bug#39105Oystein Grovlen15 Sep
  • Re: bzr commit into mysql-6.0-backup branch (oystein.grovlen:2869)Bug#39105Rafal Somla16 Sep
    • Re: bzr commit into mysql-6.0-backup branch (oystein.grovlen:2869)Bug#39105Øystein Grøvlen9 Oct