List:Internals« Previous MessageNext Message »
From:monty Date:May 18 2005 7:41am
Subject:bk commit into 5.0 tree (monty:1.1846)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of monty. When monty 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.1846 05/05/18 10:41:35 monty@stripped +5 -0
  Change update_auto_increment to return 1 if get_auto_increment() returned ~(ulonglong)
  This makes it easier to give an error in the handler if there was a problem generating an auto-increment value

  tests/mysql_client_test.c
    1.119 05/05/18 10:41:30 monty@stripped +2 -1
    Removed compiler warning

  sql/item_strfunc.cc
    1.225 05/05/18 10:41:30 monty@stripped +3 -3
    Fixed indentation

  sql/handler.h
    1.141 05/05/18 10:41:30 monty@stripped +1 -1
    Change update_auto_increment to return 1 if get_auto_increment() returned ~(ulonglong)
    This makes it easier to give an error in the handler if there was a problem generating an auto-increment value

  sql/handler.cc
    1.169 05/05/18 10:41:30 monty@stripped +20 -5
    Change update_auto_increment to return 1 if get_auto_increment() returned ~(ulonglong)
    This makes it easier to give an error in the handler if there was a problem generating an auto-increment value

  mysys/thr_alarm.c
    1.45 05/05/18 10:41:30 monty@stripped +1 -1
    Remove warning from valgrind

# 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:	monty
# Host:	narttu.mysql.com
# Root:	/home/my/mysql-5.0

--- 1.44/mysys/thr_alarm.c	2005-01-24 16:48:17 +02:00
+++ 1.45/mysys/thr_alarm.c	2005-05-18 10:41:30 +03:00
@@ -85,7 +85,7 @@
 #else
   {
     struct sigaction sact;
-    sact.sa_flags = 0;
+    bzero((char*) &sact, sizeof(sact));
     sact.sa_handler = thread_alarm;
     sigaction(THR_CLIENT_ALARM, &sact, (struct sigaction*) 0);
   }

--- 1.168/sql/handler.cc	2005-05-16 15:21:31 +03:00
+++ 1.169/sql/handler.cc	2005-05-18 10:41:30 +03:00
@@ -1376,7 +1376,19 @@
 
 
 /*
-  Updates columns with type NEXT_NUMBER if:
+  Update the auto_increment field if necessary
+
+  SYNOPSIS
+     update_auto_increment()
+
+  RETURN
+    0	ok
+    1 	get_auto_increment() was called and returned ~(ulonglong) 0
+    
+
+  IMPLEMENTATION
+
+    Updates columns with type NEXT_NUMBER if:
 
   - If column value is set to NULL (in which case
     auto_increment_field_not_null is 0)
@@ -1415,12 +1427,13 @@
     thd->next_insert_id is cleared after it's been used for a statement.
 */
 
-void handler::update_auto_increment()
+bool handler::update_auto_increment()
 {
   ulonglong nr;
   THD *thd= table->in_use;
   struct system_variables *variables= &thd->variables;
   bool auto_increment_field_not_null;
+  bool result= 0;
   DBUG_ENTER("handler::update_auto_increment");
 
   /*
@@ -1449,11 +1462,13 @@
       thd->next_insert_id= nr;
       DBUG_PRINT("info",("next_insert_id: %lu", (ulong) nr));
     }
-    DBUG_VOID_RETURN;
+    DBUG_RETURN(0);
   }
   if (!(nr= thd->next_insert_id))
   {
-    nr= get_auto_increment();
+    if ((nr= get_auto_increment()) == ~(ulonglong) 0)
+      result= 1;                                // Mark failure
+
     if (variables->auto_increment_increment != 1)
       nr= next_insert_id(nr-1, variables);
     /*
@@ -1493,7 +1508,7 @@
 
   /* Mark that we generated a new value */
   auto_increment_column_changed=1;
-  DBUG_VOID_RETURN;
+  DBUG_RETURN(result);
 }
 
 /*

--- 1.140/sql/handler.h	2005-05-14 18:19:54 +03:00
+++ 1.141/sql/handler.h	2005-05-18 10:41:30 +03:00
@@ -497,7 +497,7 @@
     {}
   virtual ~handler(void) { /* TODO: DBUG_ASSERT(inited == NONE); */ }
   int ha_open(const char *name, int mode, int test_if_locked);
-  void update_auto_increment();
+  bool update_auto_increment();
   virtual void print_error(int error, myf errflag);
   virtual bool get_error_message(int error, String *buf);
   uint get_dup_key(int error);

--- 1.224/sql/item_strfunc.cc	2005-05-09 19:40:16 +03:00
+++ 1.225/sql/item_strfunc.cc	2005-05-18 10:41:30 +03:00
@@ -2906,9 +2906,9 @@
   ulonglong tv=my_getsystime() + UUID_TIME_OFFSET + nanoseq;
   if (unlikely(tv < uuid_time))
     set_clock_seq_str();
-  else
-  if (unlikely(tv == uuid_time))
-  { /* special protection from low-res system clocks */
+  else if (unlikely(tv == uuid_time))
+  {
+    /* special protection from low-res system clocks */
     nanoseq++;
     tv++;
   }

--- 1.118/tests/mysql_client_test.c	2005-05-16 17:29:02 +03:00
+++ 1.119/tests/mysql_client_test.c	2005-05-18 10:41:30 +03:00
@@ -787,6 +787,7 @@
 
 /* Utility function to execute a query using prepare-execute */
 
+#ifndef EMBEDDED_LIBRARY
 static void execute_prepare_query(const char *query, ulonglong exp_count)
 {
   MYSQL_STMT *stmt;
@@ -807,7 +808,7 @@
   DIE_UNLESS(affected_rows == exp_count);
   mysql_stmt_close(stmt);
 }
-
+#endif
 
 /* Store result processing */
 
Thread
bk commit into 5.0 tree (monty:1.1846)monty18 May