List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:July 17 2007 3:51pm
Subject:bk commit into 5.0 tree (sergefp:1.2525)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of psergey. When psergey 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, 2007-07-17 19:51:50+04:00, sergefp@stripped +3 -0
  [pb problem]: ha_heap->clone() fails on windows because of mess with
  '/' and '\' in path delimiters:
  - Fix this by creating new handler with exactly the same path line as
    was passed to ha_create/ha_open.

  sql/ha_heap.cc@stripped, 2007-07-17 19:51:46+04:00, sergefp@stripped +20 -0
    [pb problem]: ha_heap->clone() fails on windows because of mess with
    '/' and '\' in path delimiters:
    - Fix this by creating new handler with exactly the same path line as
      was passed to ha_create/ha_open.

  sql/ha_heap.h@stripped, 2007-07-17 19:51:46+04:00, sergefp@stripped +1 -0
    [pb problem]: ha_heap->clone() fails on windows because of mess with
    '/' and '\' in path delimiters:
    - Fix this by creating new handler with exactly the same path line as
      was passed to ha_create/ha_open.

  sql/opt_range.cc@stripped, 2007-07-17 19:51:46+04:00, sergefp@stripped +8 -0
    Set thd->net.report_error on handler::clone() failure

diff -Nrup a/sql/ha_heap.cc b/sql/ha_heap.cc
--- a/sql/ha_heap.cc	2007-03-27 12:50:41 +04:00
+++ b/sql/ha_heap.cc	2007-07-17 19:51:46 +04:00
@@ -115,6 +115,26 @@ int ha_heap::close(void)
 
 
 /*
+  Create a copy of this table
+
+  DESCRIPTION
+    Do same as default implementation but use file->s->name instead of 
+    table->s->path. This is needed by Windows where the clone() call sees
+    '/'-delimited path in table->s->path, while ha_peap::open() was called 
+    with '\'-delimited path.
+*/
+
+handler *ha_heap::clone(MEM_ROOT *mem_root)
+{
+  handler *new_handler= get_new_handler(table, mem_root, table->s->db_type);
+  if (new_handler && !new_handler->ha_open(file->s->name, table->db_stat,
+                                           HA_OPEN_IGNORE_IF_LOCKED))
+    return new_handler;
+  return NULL;
+}
+
+
+/*
   Compute which keys to use for scanning
 
   SYNOPSIS
diff -Nrup a/sql/ha_heap.h b/sql/ha_heap.h
--- a/sql/ha_heap.h	2007-07-13 19:13:36 +04:00
+++ b/sql/ha_heap.h	2007-07-17 19:51:46 +04:00
@@ -32,6 +32,7 @@ class ha_heap: public handler
 public:
   ha_heap(TABLE *table);
   ~ha_heap() {}
+  handler *clone(MEM_ROOT *mem_root);
   const char *table_type() const
   {
     return (table->in_use->variables.sql_mode & MODE_MYSQL323) ?
diff -Nrup a/sql/opt_range.cc b/sql/opt_range.cc
--- a/sql/opt_range.cc	2007-07-13 19:13:37 +04:00
+++ b/sql/opt_range.cc	2007-07-17 19:51:46 +04:00
@@ -1131,6 +1131,14 @@ int QUICK_RANGE_SELECT::init_ror_merged_
   THD *thd= current_thd;
   if (!(file= head->file->clone(thd->mem_root)))
   {
+    /* 
+      Manually set the error flag. Note: there seems to be quite a few
+      places where a failure could cause the server to "hang" the client by
+      sending no response to a query. ATM those are not real errors because 
+      the storage engine calls in question happen to never fail with the 
+      existing storage engines. 
+    */
+    thd->net.report_error= 1;
     /* Caller will free the memory */
     goto failure;
   }
Thread
bk commit into 5.0 tree (sergefp:1.2525)Sergey Petrunia17 Jul