List:Internals« Previous MessageNext Message »
From:sanja Date:June 15 2005 12:22am
Subject:bk commit into 5.0 tree (bell:1.1938) BUG#11111
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of bell. When bell 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.1938 05/06/15 01:22:28 bell@stripped +3 -0
  fix of BUG#11111 fix

  tests/mysql_client_test.c
    1.124 05/06/15 01:22:24 bell@stripped +23 -9
    check results abd delete views 

  sql/sql_select.cc
    1.335 05/06/15 01:22:24 bell@stripped +1 -1
    real_type is virtual

  sql/item.h
    1.138 05/06/15 01:22:24 bell@stripped +3 -6
    revrited as recursive

# 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:	bell
# Host:	sanja.is.com.ua
# Root:	/home/bell/mysql/bk/work-bug3-5.0

--- 1.137/sql/item.h	Wed Jun 15 00:57:17 2005
+++ 1.138/sql/item.h	Wed Jun 15 01:22:24 2005
@@ -1352,12 +1352,9 @@
   {
     (*ref)->save_in_field(result_field, no_conversions);
   }
-  Item *real_item() {
-    Item *item= this;
-    do
-      item= *((Item_ref *)item)->ref;
-    while (item->type() == Item::REF_ITEM);
-    return item;
+  Item *real_item()
+  {
+    return (*ref)->real_item();
   }
   bool walk(Item_processor processor, byte *arg)
   { return (*ref)->walk(processor, arg); }

--- 1.334/sql/sql_select.cc	Wed Jun 15 00:57:06 2005
+++ 1.335/sql/sql_select.cc	Wed Jun 15 01:22:24 2005
@@ -7958,7 +7958,7 @@
                                        convert_blob_length);
   }
   case Item::REF_ITEM:
-    if ( ((Item_ref*)item)->real_item()->type() == Item::FIELD_ITEM)
+    if ( item->real_item()->type() == Item::FIELD_ITEM)
     {
       Item_field *field= (Item_field*) *((Item_ref*)item)->ref;
       Field *new_field= create_tmp_field_from_field(thd, 

--- 1.123/tests/mysql_client_test.c	Wed Jun 15 00:56:51 2005
+++ 1.124/tests/mysql_client_test.c	Wed Jun 15 01:22:24 2005
@@ -13156,14 +13156,24 @@
   char		buf[2][20];
   long		len[2];
   int i;
+  int rc;
   const char * query = "SELECT DISTINCT f1,ff2 FROM v1";
+  myheader("test_bug11111");
 
-  mysql_query(mysql, "drop table if exists t1, t2, v1");
-  mysql_query(mysql, "create table t1 (f1 int, f2 int)");
-  mysql_query(mysql, "create table t2 (ff1 int, ff2 int)");
-  mysql_query(mysql, "create view v1 as select * from t1, t2 where f1=ff1");
-  mysql_query(mysql, "insert into t1 values (1,1), (2,2), (3,3)");
-  mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)");
+  rc= mysql_query(mysql, "drop table if exists t1, t2, v1");
+  myquery(rc);
+  rc= mysql_query(mysql, "drop view if exists t1, t2, v1");
+  myquery(rc);
+  rc= mysql_query(mysql, "create table t1 (f1 int, f2 int)");
+  myquery(rc);
+  rc= mysql_query(mysql, "create table t2 (ff1 int, ff2 int)");
+  myquery(rc);
+  rc= mysql_query(mysql, "create view v1 as select * from t1, t2 where f1=ff1");
+  myquery(rc);
+  rc= mysql_query(mysql, "insert into t1 values (1,1), (2,2), (3,3)");
+  myquery(rc);
+  rc= mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)");
+  myquery(rc);
 
   stmt = mysql_stmt_init(mysql);
 
@@ -13176,15 +13186,19 @@
     bind[i].buffer= (gptr *)&buf[i];
     bind[i].buffer_length= 20;
     bind[i].length= &len[i];
-  } 
+  }
 
   if (mysql_stmt_bind_result(stmt, bind))
     printf("Error: %s\n", mysql_stmt_error(stmt));
 
   mysql_stmt_fetch(stmt);
-  DIE_UNLESS(!strcmp(buf[1],"1"));	
+  printf("return: %s", buf[1]);
+  DIE_UNLESS(!strcmp(buf[1],"1"));
   mysql_stmt_close(stmt);
-  mysql_query(mysql, "drop table t1, t2, v1");
+  rc= mysql_query(mysql, "drop view v1");
+  myquery(rc);
+  rc= mysql_query(mysql, "drop table t1, t2");
+  myquery(rc);
 }
 
 /*
Thread
bk commit into 5.0 tree (bell:1.1938) BUG#11111sanja15 Jun