List:Commits« Previous MessageNext Message »
From:pekka Date:February 20 2006 12:23pm
Subject:bk commit into 5.1 tree (pekka:1.2139)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka 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
  1.2139 06/02/20 12:23:42 pekka@stripped +2 -0
  Merge pnousiainen@stripped:/home/bk/mysql-5.1-new
  into  mysql.com:/space/pekka/ndb/version/my51

  sql/ha_ndbcluster_binlog.cc
    1.21 06/02/20 12:19:34 pekka@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.cc
    1.274 06/02/20 12:19:33 pekka@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	pekka
# Host:	orca.ndb.mysql.com
# Root:	/space/pekka/ndb/version/my51/RESYNC

--- 1.273/sql/ha_ndbcluster.cc	2006-02-17 22:35:36 +01:00
+++ 1.274/sql/ha_ndbcluster.cc	2006-02-20 12:19:33 +01:00
@@ -4430,29 +4430,24 @@
         Always create an event for the table, as other mysql servers
         expect it to be there.
       */
-      if (ndbcluster_create_event(ndb, t, event_name.c_ptr(), share) < 0)
+      if (!ndbcluster_create_event(ndb, t, event_name.c_ptr(), share,
+                                   share && do_event_op /* push warning */))
       {
-        /* this is only a serious error if the binlog is on */
-	if (share && do_event_op)
-	{
-          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-                              ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
-                              "Creating event for logging table failed. "
-                              "See error log for details.");
-	}
-        break;
-      }
-      if (ndb_extra_logging)
-        sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
-                              event_name.c_ptr());
-
-      if (share && do_event_op &&
-          ndbcluster_create_event_ops(share, t, event_name.c_ptr()) < 0)
-      {
-        sql_print_error("NDB Binlog: FAILED CREATE TABLE event operations."
-                        " Event: %s", name);
-        /* a warning has been issued to the client */
+        if (ndb_extra_logging)
+          sql_print_information("NDB Binlog: CREATE TABLE Event: %s",
+                                event_name.c_ptr());
+        if (share && do_event_op &&
+            ndbcluster_create_event_ops(share, t, event_name.c_ptr()))
+        {
+          sql_print_error("NDB Binlog: FAILED CREATE TABLE event operations."
+                          " Event: %s", name);
+          /* a warning has been issued to the client */
+        }
       }
+      /*
+        warning has been issued if ndbcluster_create_event failed
+        and (share && do_event_op)
+      */
       if (share && !do_event_op)
         share->flags|= NSF_NO_BINLOG;
       ndbcluster_log_schema_op(current_thd, share,
@@ -4793,31 +4788,24 @@
     ndb_rep_event_name(&event_name, to + sizeof(share_prefix) - 1, 0);
     const NDBTAB *ndbtab= dict->getTable(new_tabname);
 
-    if (ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share) >= 0)
+    if (!ndbcluster_create_event(ndb, ndbtab, event_name.c_ptr(), share,
+                                 share && ndb_binlog_running /* push warning */))
     {
       if (ndb_extra_logging)
         sql_print_information("NDB Binlog: RENAME Event: %s",
                               event_name.c_ptr());
-      if (share && ndb_binlog_running)
+      if (share && ndb_binlog_running &&
+          ndbcluster_create_event_ops(share, ndbtab, event_name.c_ptr()))
       {
-        if (ndbcluster_create_event_ops(share, ndbtab,
-                                        event_name.c_ptr()) < 0)
-        {
-          sql_print_error("NDB Binlog: FAILED create event operations "
-                          "during RENAME. Event %s", event_name.c_ptr());
-          /* a warning has been issued to the client */
-        }
+        sql_print_error("NDB Binlog: FAILED create event operations "
+                        "during RENAME. Event %s", event_name.c_ptr());
+        /* a warning has been issued to the client */
       }
     }
-    else
-    {
-      sql_print_error("NDB Binlog: FAILED create event during RENAME. "
-                      "Event: %s", event_name.c_ptr());
-      push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-                          ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
-                          "Creating event for logging table failed. "
-                          "See error log for details.");
-    }
+    /*
+      warning has been issued if ndbcluster_create_event failed
+      and (share && ndb_binlog_running)
+    */
     if (!is_old_table_tmpfile)
       ndbcluster_log_schema_op(current_thd, share,
                                current_thd->query, current_thd->query_length,

--- 1.20/sql/ha_ndbcluster_binlog.cc	2006-02-20 12:05:37 +01:00
+++ 1.21/sql/ha_ndbcluster_binlog.cc	2006-02-20 12:19:34 +01:00
@@ -1858,8 +1858,7 @@
     /*
       create the event operations for receiving logging events
     */
-    if (ndbcluster_create_event_ops(share, ndbtab,
-                                    event_name.c_ptr()) < 0)
+    if (ndbcluster_create_event_ops(share, ndbtab, event_name.c_ptr()))
     {
       sql_print_error("NDB Binlog:"
                       "FAILED CREATE (DISCOVER) EVENT OPERATIONS Event: %s",
@@ -1874,7 +1873,8 @@
 
 int
 ndbcluster_create_event(Ndb *ndb, const NDBTAB *ndbtab,
-                        const char *event_name, NDB_SHARE *share)
+                        const char *event_name, NDB_SHARE *share,
+                        int push_warning)
 {
   DBUG_ENTER("ndbcluster_create_event");
   DBUG_PRINT("info", ("table=%s version=%d event=%s share=%s",
@@ -1901,8 +1901,14 @@
     if (share->flags & NSF_BLOB_FLAG)
     {
       sql_print_error("NDB Binlog: logging of table %s "
-                      "with no PK and blob attributes is not supported",
+                      "with BLOB attribute and no PK is not supported",
                       share->key);
+      if (push_warning)
+        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                            ER_ILLEGAL_HA_CREATE_OPTION, ER(ER_ILLEGAL_HA_CREATE_OPTION),
+                            ndbcluster_hton.name,
+                            "Binlog of table with BLOB attribute and no PK");
+        
       share->flags|= NSF_NO_BINLOG;
       DBUG_RETURN(-1);
     }
@@ -1935,17 +1941,16 @@
 
   if (dict->createEvent(my_event)) // Add event to database
   {
-#ifdef NDB_BINLOG_EXTRA_WARNINGS
-    /*
-      failed, print a warning
-    */
-    push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-                        ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
-                        dict->getNdbError().code,
-                        dict->getNdbError().message, "NDB");
-#endif
     if (dict->getNdbError().classification != NdbError::SchemaObjectExists)
     {
+      /*
+        failed, print a warning
+      */
+      if (push_warning)
+        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                            ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
+                            dict->getNdbError().code,
+                            dict->getNdbError().message, "NDB");
       sql_print_error("NDB Binlog: Unable to create event in database. "
                       "Event: %s  Error Code: %d  Message: %s", event_name,
                       dict->getNdbError().code, dict->getNdbError().message);
@@ -1957,6 +1962,11 @@
     */
     if (dict->dropEvent(my_event.getName()))
     {
+      if (push_warning)
+        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                            ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
+                            dict->getNdbError().code,
+                            dict->getNdbError().message, "NDB");
       sql_print_error("NDB Binlog: Unable to create event in database. "
                       " Attempt to correct with drop failed. "
                       "Event: %s Error Code: %d Message: %s",
@@ -1971,6 +1981,11 @@
     */
     if (dict->createEvent(my_event))
     {
+      if (push_warning)
+        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                            ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
+                            dict->getNdbError().code,
+                            dict->getNdbError().message, "NDB");
       sql_print_error("NDB Binlog: Unable to create event in database. "
                       " Attempt to correct with drop ok, but create failed. "
                       "Event: %s Error Code: %d Message: %s",
Thread
bk commit into 5.1 tree (pekka:1.2139)pekka20 Feb