MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:antony Date:March 25 2007 3:13am
Subject:bk commit into 5.1 tree (acurtis:1.2491) BUG#27036
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of antony. When antony 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-03-24 20:13:13-07:00, acurtis@stripped +2 -0
  Bug#27036
    "show create table <federated> crashes server"
    Buffer allocated for string was inadequate in the case where table name length
    is longer than the connection name length.
    This bug fix is obsoleted by the patch for Bug 26257

  mysql-test/t/federated_server.test@stripped, 2007-03-24 20:13:05-07:00, acurtis@stripped +51 -0
    Bug 27036 "show create table <federated> crashes server"
    
    New test

  storage/federated/ha_federated.cc@stripped, 2007-03-24 20:13:05-07:00, acurtis@stripped +5 -5
    Bug 27036 "show create table <federated> crashes server"
    
    Buffer allocated for string was inadequate in the case where table name length
    is longer than the connection name length.
    This bug fix is obsoleted by the patch for Bug 26257

# 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:	acurtis
# Host:	ltamd64.xiphis.org
# Root:	/home/antony/work2/p1-bug27036.2

--- 1.97/storage/federated/ha_federated.cc	2007-03-24 20:13:26 -07:00
+++ 1.98/storage/federated/ha_federated.cc	2007-03-24 20:13:26 -07:00
@@ -1457,21 +1457,21 @@
     query.length(query.length() - sizeof_trailing_comma);
 
     query.append(STRING_WITH_LEN(" FROM `"));
+    tmp_share.table_name_length= strlen(tmp_share.table_name);
+    /* TODO: share->table_name to LEX_STRING object */
+    query.append(tmp_share.table_name, tmp_share.table_name_length);
+    query.append(STRING_WITH_LEN("`"));
 
     if (!(share= (FEDERATED_SHARE *)
           my_multi_malloc(MYF(MY_WME),
                           &share, sizeof(*share),
                           &select_query,
-                          query.length()+table->s->connect_string.length+1,
+                          query.length()+1,
                           NullS)))
       goto error;
 
     memcpy(share, &tmp_share, sizeof(tmp_share));
 
-    share->table_name_length= strlen(share->table_name);
-    /* TODO: share->table_name to LEX_STRING object */
-    query.append(share->table_name, share->table_name_length);
-    query.append(STRING_WITH_LEN("`"));
     share->select_query= select_query;
     strmov(share->select_query, query.ptr());
     share->use_count= 0;

--- 1.4/mysql-test/t/federated_server.test	2007-03-24 20:13:26 -07:00
+++ 1.5/mysql-test/t/federated_server.test	2007-03-24 20:13:26 -07:00
@@ -107,4 +107,55 @@
 drop database first_db;
 drop database second_db;
 
+#  BUG 27036
+connection slave;
+drop database if exists aaaaaaa;
+create database aaaaaaa;
+use aaaaaaa;
+CREATE TABLE `bbbbbbbbbbbbbbbbbbbbbb` (
+`year` smallint(6) NOT NULL,
+`month` tinyint(2) unsigned NOT NULL,
+`week` tinyint(2) unsigned NOT NULL,
+`day` tinyint(2) unsigned NOT NULL,
+`hour` tinyint(2) unsigned NOT NULL,
+`min` tinyint(2) unsigned NOT NULL,
+`count` int(10) unsigned NOT NULL DEFAULT '0',
+`timestamp` datetime NOT NULL,
+UNIQUE KEY `min` (`year`,`month`,`day`,`hour`,`min`),
+KEY `timestamp` (`timestamp`)
+);
+
+connection master;
+
+drop database if exists aaaaaaa;
+create database aaaaaaa;
+use aaaaaaa;
+
+eval create server aaaaaaa foreign data wrapper mysql options
+  (HOST '127.0.0.1',
+  DATABASE 'aaaaaaa',
+  USER 'root',
+  PASSWORD '',
+  PORT $SLAVE_MYPORT,
+  SOCKET '',
+  OWNER 'root');
+
+CREATE TABLE `bbbbbbbbbbbbbbbbbbbbbb` (
+`year` smallint(6) NOT NULL,
+`month` tinyint(2) unsigned NOT NULL,
+`week` tinyint(2) unsigned NOT NULL,
+`day` tinyint(2) unsigned NOT NULL,
+`hour` tinyint(2) unsigned NOT NULL,
+`min` tinyint(2) unsigned NOT NULL,
+`count` int(10) unsigned NOT NULL DEFAULT '0',
+`timestamp` datetime NOT NULL,
+UNIQUE KEY `min` (`year`,`month`,`day`,`hour`,`min`),
+KEY `timestamp` (`timestamp`)
+) ENGINE="FEDERATED" CONNECTION="aaaaaaa";
+
+show create table aaaaaaa.bbbbbbbbbbbbbbbbbbbbbb;
+
+drop database aaaaaaa;
+
+
 source include/federated_cleanup.inc;
Thread
bk commit into 5.1 tree (acurtis:1.2491) BUG#27036antony25 Mar