List:Commits« Previous MessageNext Message »
From:monty Date:June 21 2006 10:25am
Subject:bk commit into 5.1 tree (monty:1.2223)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 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.2223 06/06/21 13:24:56 monty@stripped +3 -0
  Merge bk-internal.mysql.com:/home/bk/mysql-5.1
  into  mysql.com:/home/my/mysql-5.1

  sql/sql_show.cc
    1.353 06/06/21 13:24:51 monty@stripped +0 -0
    Auto merged

  sql/sql_lex.cc
    1.189 06/06/21 13:24:51 monty@stripped +0 -0
    Auto merged

  sql/ha_ndbcluster.cc
    1.330 06/06/21 13:24:51 monty@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:	monty
# Host:	narttu.mysql.fi
# Root:	/home/my/mysql-5.1/RESYNC

--- 1.188/sql/sql_lex.cc	2006-06-20 14:38:57 +03:00
+++ 1.189/sql/sql_lex.cc	2006-06-21 13:24:51 +03:00
@@ -168,7 +168,7 @@
   lex->select_lex.group_list.empty();
   lex->select_lex.order_list.empty();
   lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
-  lex->sql_command= lex->orig_sql_command= SQLCOM_END;
+  lex->sql_command= SQLCOM_END;
   lex->duplicates= DUP_ERROR;
   lex->ignore= 0;
   lex->sphead= NULL;

--- 1.352/sql/sql_show.cc	2006-06-19 17:57:35 +03:00
+++ 1.353/sql/sql_show.cc	2006-06-21 13:24:51 +03:00
@@ -2146,7 +2146,7 @@
 void get_index_field_values(LEX *lex, INDEX_FIELD_VALUES *index_field_values)
 {
   const char *wild= lex->wild ? lex->wild->ptr() : NullS;
-  switch (lex->orig_sql_command) {
+  switch (lex->sql_command) {
   case SQLCOM_SHOW_DATABASES:
     index_field_values->db_value= wild;
     break;
@@ -2335,10 +2335,9 @@
   /*
     This part of code is for SHOW TABLES, SHOW TABLE STATUS commands.
     idx_field_vals->db_value can't be 0 (see get_index_field_values()
-    function). lex->orig_sql_command can be not equal to SQLCOM_END
-    only in case of executing of SHOW commands.
+    function).
   */
-  if (lex->orig_sql_command != SQLCOM_END)
+  if (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND)
   {
     if (!my_strcasecmp(system_charset_info, information_schema_name.str,
                        idx_field_vals->db_value))
@@ -2417,12 +2416,6 @@
   LINT_INIT(end);
   LINT_INIT(len);
 
-  /*
-    Let us set fake sql_command so views won't try to merge
-    themselves into main statement.
-  */
-  lex->sql_command= SQLCOM_SHOW_FIELDS;
-
   lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
 
   /*
@@ -2445,8 +2438,16 @@
       I_S tables will be done.
     */
     thd->temporary_tables= open_tables_state_backup.temporary_tables;
+    /*
+      Let us set fake sql_command so views won't try to merge
+      themselves into main statement. If we don't do this,
+      SELECT * from information_schema.xxxx will cause problems.
+      SQLCOM_SHOW_FIELDS is used because it satisfies 'only_view_structure()' 
+    */
+    lex->sql_command= SQLCOM_SHOW_FIELDS;
     res= open_normal_and_derived_tables(thd, show_table_list,
                                         MYSQL_LOCK_IGNORE_FLUSH);
+    lex->sql_command= save_sql_command;
     /*
       get_all_tables() returns 1 on failure and 0 on success thus
       return only these and not the result code of ::process_table()
@@ -2477,13 +2478,13 @@
 
   partial_cond= make_cond_for_info_schema(cond, tables);
   it.rewind(); /* To get access to new elements in basis list */
+
+  /*
+    Below we generate error for non existing database.
+    (to save old behaviour for SHOW TABLES FROM db)
+  */
   while ((orig_base_name= base_name= it++) ||
-	 /*
-	   generate error for non existing database.
-	   (to save old behaviour for SHOW TABLES FROM db)
-	 */
-	 ((lex->orig_sql_command == SQLCOM_SHOW_TABLES ||
-           lex->orig_sql_command == SQLCOM_SHOW_TABLE_STATUS) &&
+         ((sql_command_flags[save_sql_command] & CF_SHOW_TABLE_COMMAND) &&
 	  (base_name= select_lex->db) && !bases.elements))
   {
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -2524,7 +2525,8 @@
         {
           if (schema_table_idx == SCH_TABLE_NAMES)
           {
-            if (lex->verbose || lex->orig_sql_command == SQLCOM_END)
+            if (lex->verbose ||
+                (sql_command_flags[save_sql_command] & CF_STATUS_COMMAND) == 0)
             {
               if (with_i_schema)
               {
@@ -2568,8 +2570,10 @@
             TABLE_LIST *show_table_list= (TABLE_LIST*) sel.table_list.first;
             lex->all_selects_list= &sel;
             lex->derived_tables= 0;
+            lex->sql_command= SQLCOM_SHOW_FIELDS;
             res= open_normal_and_derived_tables(thd, show_table_list,
                                                 MYSQL_LOCK_IGNORE_FLUSH);
+            lex->sql_command= save_sql_command;
             /*
               We should use show_table_list->alias instead of 
               show_table_list->table_name because table_name
@@ -2879,7 +2883,7 @@
 
   if (res)
   {
-    if (lex->orig_sql_command != SQLCOM_SHOW_FIELDS)
+    if (lex->sql_command != SQLCOM_SHOW_FIELDS)
     {
       /*
         I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS
@@ -2930,7 +2934,7 @@
     col_access= get_column_grant(thd, &tables->grant, 
                                  base_name, file_name,
                                  field->field_name) & COL_ACLS;
-    if (lex->orig_sql_command != SQLCOM_SHOW_FIELDS  && 
+    if (lex->sql_command != SQLCOM_SHOW_FIELDS  &&
         !tables->schema_table && !col_access)
       continue;
     end= tmp;
@@ -2975,7 +2979,7 @@
       table->field[5]->set_notnull();
     }
     else if (field->unireg_check == Field::NEXT_NUMBER ||
-             lex->orig_sql_command != SQLCOM_SHOW_FIELDS ||
+             lex->sql_command != SQLCOM_SHOW_FIELDS ||
              field->maybe_null())
       table->field[5]->set_null();                // Null as default
     else
@@ -3245,16 +3249,18 @@
   get_field(thd->mem_root, proc_table->field[11], &definer);
   if (!full_access)
     full_access= !strcmp(sp_user, definer.ptr());
-  if (!full_access && check_some_routine_access(thd, sp_db.ptr(), sp_name.ptr(),
-                                                proc_table->field[2]->val_int() ==
+  if (!full_access && check_some_routine_access(thd, sp_db.ptr(),
+                                                sp_name.ptr(),
+                                                proc_table->field[2]->
+                                                val_int() ==
                                                 TYPE_ENUM_PROCEDURE))
     return 0;
 
-  if (lex->orig_sql_command == SQLCOM_SHOW_STATUS_PROC &&
+  if (lex->sql_command == SQLCOM_SHOW_STATUS_PROC &&
       proc_table->field[2]->val_int() == TYPE_ENUM_PROCEDURE ||
-      lex->orig_sql_command == SQLCOM_SHOW_STATUS_FUNC &&
+      lex->sql_command == SQLCOM_SHOW_STATUS_FUNC &&
       proc_table->field[2]->val_int() == TYPE_ENUM_FUNCTION ||
-      lex->orig_sql_command == SQLCOM_END)
+      (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)
   {
     restore_record(table, s->default_values);
     if (!wild || !wild[0] || !wild_compare(sp_name.ptr(), wild, 0))
@@ -3365,7 +3371,7 @@
   DBUG_ENTER("get_schema_stat_record");
   if (res)
   {
-    if (thd->lex->orig_sql_command != SQLCOM_SHOW_KEYS)
+    if (thd->lex->sql_command != SQLCOM_SHOW_KEYS)
     {
       /*
         I.e. we are in SELECT FROM INFORMATION_SCHEMA.STATISTICS
@@ -4156,7 +4162,7 @@
     optimized. It's guaranteed in case of SHOW EVENTS that the user
     has access.
   */
-  if (thd->lex->orig_sql_command != SQLCOM_SHOW_EVENTS &&
+  if (thd->lex->sql_command != SQLCOM_SHOW_EVENTS &&
       check_access(thd, EVENT_ACL, et.dbname.str, 0, 0, 1,
                    is_schema_db(et.dbname.str)))
     DBUG_RETURN(0);
@@ -4386,7 +4392,7 @@
     If it's SHOW EVENTS then thd->lex->select_lex.db is guaranteed not to
     be NULL. Let's do an assert anyway.
   */
-  if (thd->lex->orig_sql_command == SQLCOM_SHOW_EVENTS)
+  if (thd->lex->sql_command == SQLCOM_SHOW_EVENTS)
   {
     DBUG_ASSERT(thd->lex->select_lex.db);
     if (check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0,
@@ -4414,7 +4420,7 @@
                   will save use from doing a table scan and comparing
                   every single row's `db` with the schema which we show.
   */
-  if (thd->lex->orig_sql_command == SQLCOM_SHOW_EVENTS)
+  if (thd->lex->sql_command == SQLCOM_SHOW_EVENTS)
     ret= events_table_index_read_for_db(thd, schema_table, event_table);
   else
     ret= events_table_scan_all(thd, schema_table, event_table);
@@ -4480,7 +4486,7 @@
                          (SHOW_VAR *)all_status_vars.buffer,
                          OPT_GLOBAL,
                          (lex->option_type == OPT_GLOBAL ?
-                          &tmp: &thd->status_var), "",tables->table);
+                          &tmp: thd->initial_status_var), "",tables->table);
   pthread_mutex_unlock(&LOCK_status);
   DBUG_RETURN(res);
 }
@@ -4673,8 +4679,8 @@
     schema_table        pointer to 'schema_tables' element
 
   RETURN
-   -1	errror
-    0	success
+   1	error
+   0	success
 */
 
 int make_old_format(THD *thd, ST_SCHEMA_TABLE *schema_table)
@@ -4997,7 +5003,7 @@
       break;
 
     TABLE_LIST *table_list= tab->table->pos_in_table_list;
-    if (table_list->schema_table && thd->fill_derived_tables())
+    if (table_list->schema_table && thd->fill_information_schema_tables())
     {
       bool is_subselect= (&lex->unit != lex->current_select->master_unit() &&
                           lex->current_select->master_unit()->item);

--- 1.329/sql/ha_ndbcluster.cc	2006-06-19 13:00:31 +03:00
+++ 1.330/sql/ha_ndbcluster.cc	2006-06-21 13:24:51 +03:00
@@ -735,7 +735,7 @@
   ha_ndbcluster *ha= (ha_ndbcluster *)arg;
   int ret= get_ndb_blobs_value(ha->table, ha->m_value,
                                ha->m_blobs_buffer, ha->m_blobs_buffer_size,
-                               0);
+                               ha->m_blobs_offset);
   DBUG_RETURN(ret);
 }
 
@@ -864,6 +864,7 @@
       if (ndb_blob != NULL)
       {
         // Set callback
+	m_blobs_offset= buf - (byte*) table->record[0];
         void *arg= (void *)this;
         DBUG_RETURN(ndb_blob->setActiveHook(g_get_ndb_blobs_value, arg) != 0);
       }
@@ -5477,6 +5478,7 @@
   m_ops_pending(0),
   m_skip_auto_increment(TRUE),
   m_blobs_pending(0),
+  m_blobs_offset(0),
   m_blobs_buffer(0),
   m_blobs_buffer_size(0),
   m_dupkey((uint) -1),
@@ -10364,7 +10366,7 @@
       table->field[c++]->set_null(); // DELETED_ROWS
       table->field[c++]->set_null(); // UPDATE_COUNT
       table->field[c++]->store(lfg.getUndoFreeWords()); // FREE_EXTENTS
-      table->field[c++]->store(lfg.getUndoBufferSize()); // TOTAL_EXTENTS
+      table->field[c++]->store(uf.getSize()/4); // TOTAL_EXTENTS
       table->field[c++]->store(4); // EXTENT_SIZE
 
       table->field[c++]->store(uf.getSize()); // INITIAL_SIZE
@@ -10394,8 +10396,8 @@
 
       table->field[c++]->store("NORMAL", 6, system_charset_info);
 
-      char extra[30];
-      int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u",id);
+      char extra[100];
+      int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
       table->field[c]->store(extra, len, system_charset_info);
       schema_table_store_record(thd, table);
     }
Thread
bk commit into 5.1 tree (monty:1.2223)monty21 Jun