List:Maria Storage Engine« Previous MessageNext Message »
From:jani Date:May 14 2008 6:50am
Subject:bk commit into maria tree (jani:1.2643)
View as plain text  
Below is the list of changes that have just been committed into a local
maria repository of jani.  When jani does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-05-14 09:50:16+03:00, jani@stripped +8 -0
  Manual merge and some fixes.

  mysql-test/include/varchar.inc@stripped, 2008-05-14 09:50:10+03:00, jani@stripped +5 -0
    Manual merge between 5.1 and maria.
    
    Added a comment.

  mysql-test/r/maria.result@stripped, 2008-05-14 09:50:10+03:00, jani@stripped +1 -0
    Temporary fix.

  mysql-test/suite/binlog/r/binlog_unsafe.result@stripped, 2008-05-14 09:50:10+03:00, jani@stripped +0 -1
    Manual merge.

  mysql-test/suite/binlog/t/binlog_unsafe.test@stripped, 2008-05-14 09:50:10+03:00, jani@stripped +0 -1
    Manual merge.

  sql/handler.h@stripped, 2008-05-14 09:50:10+03:00, jani@stripped +1 -0
    Manual merge + fix.

  sql/item.h@stripped, 2008-05-14 09:50:10+03:00, jani@stripped +1 -0
    Manual merge + fix.

  sql/log.cc@stripped, 2008-05-14 09:50:11+03:00, jani@stripped +16 -9
    Manual merge + fix.

  sql/sql_insert.cc@stripped, 2008-05-14 09:50:11+03:00, jani@stripped +10 -8
    Manual merge + fix. A commit was done when using
    create table ... select from for transactional tables
    other than maria, when an error occurred and
    transaction should have been aborted.

diff -Nrup a/mysql-test/include/varchar.inc b/mysql-test/include/varchar.inc
--- a/mysql-test/include/varchar.inc	2007-06-25 12:51:38 +03:00
+++ b/mysql-test/include/varchar.inc	2008-05-14 09:50:10 +03:00
@@ -11,6 +11,11 @@ enable_query_log;
 # Simple basic test that endspace is saved
 #
 
+#
+# Remember to check that one doesn't get a warning or a note
+# from a char field when end spaces get removed. SQL standard!
+#
+
 create table t1 (v varchar(10), c char(10), t text);
 insert into t1 values('+ ', '+ ', '+ ');
 set @a=repeat(' ',20);
diff -Nrup a/mysql-test/r/maria.result b/mysql-test/r/maria.result
--- a/mysql-test/r/maria.result	2008-04-24 18:22:45 +03:00
+++ b/mysql-test/r/maria.result	2008-05-14 09:50:10 +03:00
@@ -983,6 +983,7 @@ set @a=repeat(' ',20);
 insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
 Warnings:
 Note	1265	Data truncated for column 'v' at row 1
+Note	1265	Data truncated for column 'c' at row 1
 select concat('*',v,'*',c,'*',t,'*') from t1;
 concat('*',v,'*',c,'*',t,'*')
 *+ *+*+ *
diff -Nrup a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result	2008-04-28 19:24:00 +03:00
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result	2008-05-14 09:50:10 +03:00
@@ -11,7 +11,6 @@ INSERT DELAYED INTO t1 VALUES (5);
 INSERT INTO t1 VALUES (@@global.sync_binlog);
 Warnings:
 Warning	1592	Statement is not safe to log in statement format.
-DROP VIEW v1;
 INSERT INTO t1 VALUES (@@session.insert_id);
 Warnings:
 Warning	1592	Statement is not safe to log in statement format.
diff -Nrup a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test	2008-04-28 19:24:00 +03:00
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test	2008-05-14 09:50:10 +03:00
@@ -59,7 +59,6 @@
 source include/have_log_bin.inc;
 source include/have_binlog_format_statement.inc;
 
-DROP VIEW v1;
 --echo ==== Setup tables ====
 
 CREATE TABLE t1 (a INT);
diff -Nrup a/sql/handler.h b/sql/handler.h
--- a/sql/handler.h	2008-04-28 16:46:36 +03:00
+++ b/sql/handler.h	2008-05-14 09:50:10 +03:00
@@ -767,6 +767,7 @@ struct THD_TRANS
   bool modified_non_trans_table;
 
   void reset() { no_2pc= FALSE; modified_non_trans_table= FALSE; }
+  THD_TRANS() {}                        /* Remove gcc warning */
 };
 
 
diff -Nrup a/sql/item.h b/sql/item.h
--- a/sql/item.h	2008-04-28 16:46:36 +03:00
+++ b/sql/item.h	2008-05-14 09:50:10 +03:00
@@ -1028,6 +1028,7 @@ public:
     if (orig_name)
       name= orig_name;
   }
+  Item_basic_constant() {}                      /* Remove gcc warning */
 };
 
 
diff -Nrup a/sql/log.cc b/sql/log.cc
--- a/sql/log.cc	2008-04-28 16:46:36 +03:00
+++ b/sql/log.cc	2008-05-14 09:50:11 +03:00
@@ -1535,16 +1535,23 @@ static int binlog_commit(handlerton *hto
               YESNO(in_transaction),
               YESNO(thd->transaction.all.modified_non_trans_table),
               YESNO(thd->transaction.stmt.modified_non_trans_table)));
-  if (in_transaction &&
-      (all ||
-       (!trx_data->at_least_one_stmt &&
-        thd->transaction.stmt.modified_non_trans_table)) ||
-      !in_transaction && !all)
+  if (thd->options & OPTION_BIN_LOG)
   {
-    Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
-    qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
-    int error= binlog_end_trans(thd, trx_data, &qev, all);
-    DBUG_RETURN(error);
+    if (in_transaction &&
+        (all ||
+         (!trx_data->at_least_one_stmt &&
+          thd->transaction.stmt.modified_non_trans_table)) ||
+        !in_transaction && !all)
+    {
+      Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE);
+      qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE)
+      int error= binlog_end_trans(thd, trx_data, &qev, all);
+      DBUG_RETURN(error);
+    }
+  }
+  else
+  {
+    trx_data->reset();
   }
   DBUG_RETURN(0);
 }
diff -Nrup a/sql/sql_insert.cc b/sql/sql_insert.cc
--- a/sql/sql_insert.cc	2008-04-28 19:24:01 +03:00
+++ b/sql/sql_insert.cc	2008-05-14 09:50:11 +03:00
@@ -3533,15 +3533,17 @@ select_create::prepare(List<Item> &value
      engines to do logging of insertions (optimization). We don't do it for
      temporary tables (yet) as re-enabling causes an undesirable commit.
    */
-  if (((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0) &&
-      ha_enable_transaction(thd, FALSE))
-    DBUG_RETURN(-1);
 
   if (!(table= create_table_from_items(thd, create_info, create_table,
                                        alter_info, &values,
                                        &extra_lock, hook_ptr)))
     DBUG_RETURN(-1);				// abort() deletes table
 
+  if (((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0) &&
+      !create_info->table_existed &&
+      ha_enable_transaction(thd, FALSE))
+    DBUG_RETURN(-1);
+
   if (extra_lock)
   {
     DBUG_ASSERT(m_plock == NULL);
@@ -3682,7 +3684,8 @@ bool select_create::send_eof()
     abort();
   else
   {
-    if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0)
+    if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 &&
+        !create_info->table_existed)
       ha_enable_transaction(thd, TRUE);
     /*
       Do an implicit commit at end of statement for non-temporary
@@ -3712,9 +3715,6 @@ void select_create::abort()
 {
   DBUG_ENTER("select_create::abort");
 
-  if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0)
-    ha_enable_transaction(thd, TRUE);
-
   /*
     In select_insert::abort() we roll back the statement, including
     truncating the transaction cache of the binary log. To do this, we
@@ -3731,10 +3731,12 @@ void select_create::abort()
     log state.
   */
   tmp_disable_binlog(thd);
+  if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 &&
+      !create_info->table_existed)
+    ha_enable_transaction(thd, TRUE);
   select_insert::abort();
   thd->transaction.stmt.modified_non_trans_table= FALSE;
   reenable_binlog(thd);
-
 
   if (m_plock)
   {
Thread
bk commit into maria tree (jani:1.2643)jani14 May
  • Re: bk commit into maria tree (jani:1.2643)Guilhem Bichot16 May
    • Re: bk commit into maria tree (jani:1.2643)Jani Tolonen19 May
      • Re: bk commit into maria tree (jani:1.2643)Guilhem Bichot19 May
        • Re: bk commit into maria tree (jani:1.2643)Guilhem Bichot26 May
          • Re: bk commit into maria tree (jani:1.2643)Jani Tolonen26 May