~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/set_user_var.cc

[patch 109/129] Merge patch for revision 1921 from InnoDB SVN:
revno: 1921
revision-id: svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6160
parent: svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6159
committer: vasil
timestamp: Wed 2009-11-11 13:33:49 +0000
message:
  branches/zip: Merge r6152:6159 from branches/5.1:
  
  (r6158 was skipped as an equivallent change has already been merged from MySQL)
  
    ------------------------------------------------------------------------
    r6154 | calvin | 2009-11-11 02:51:17 +0200 (Wed, 11 Nov 2009) | 17 lines
    Changed paths:
       M /branches/5.1/include/os0file.h
       M /branches/5.1/os/os0file.c
    
    branches/5.1: fix bug#3139: Mysql crashes: 'windows error 995'
    after several selects on a large DB
    
    During stress environment, Windows AIO may fail with error code
    ERROR_OPERATION_ABORTED. InnoDB does not handle the error, rather
    crashes. The cause of the error is unknown, but likely due to
    faulty hardware or driver.
    
    This patch introduces a new error code OS_FILE_OPERATION_ABORTED,
    which maps to Windows ERROR_OPERATION_ABORTED (995). When the error
    is detected during AIO, the InnoDB will issue a synchronous retry
    (read/write).
    
    This patch has been extensively tested by MySQL support.
    
    Approved by: Marko
    rb://196
    ------------------------------------------------------------------------
    r6158 | vasil | 2009-11-11 14:52:14 +0200 (Wed, 11 Nov 2009) | 37 lines
    Changed paths:
       M /branches/5.1/handler/ha_innodb.cc
       M /branches/5.1/handler/ha_innodb.h
    
    branches/5.1:
    
    Merge a change from MySQL:
    (this has been reviewed by Calvin and Marko, and Calvin says Luis has
    incorporated Marko's suggestions)
    
      ------------------------------------------------------------
      revno: 3092.5.1
      committer: Luis Soares <luis.soares@sun.com>
      branch nick: mysql-5.1-bugteam
      timestamp: Thu 2009-09-24 15:52:52 +0100
      message:
        BUG#42829: binlogging enabled for all schemas regardless of
        binlog-db-db / binlog-ignore-db
              
        InnoDB will return an error if statement based replication is used
        along with transaction isolation level READ-COMMITTED (or weaker),
        even if the statement in question is filtered out according to the
        binlog-do-db rules set. In this case, an error should not be printed.
              
        This patch addresses this issue by extending the existing check in
        external_lock to take into account the filter rules before deciding to
        print an error. Furthermore, it also changes decide_logging_format to
        take into consideration whether the statement is filtered out from 
        binlog before decision is made.
      added:
        mysql-test/suite/binlog/r/binlog_stm_do_db.result
        mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
        mysql-test/suite/binlog/t/binlog_stm_do_db.test
      modified:
        sql/sql_base.cc
        sql/sql_class.cc
        storage/innobase/handler/ha_innodb.cc
        storage/innobase/handler/ha_innodb.h
        storage/innodb_plugin/handler/ha_innodb.cc
        storage/innodb_plugin/handler/ha_innodb.h
    
    ------------------------------------------------------------------------
modified:
  include/os0file.h              2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fos0file.h
  os/os0file.c                   2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Fos%2Fos0file.c
diff:
=== modified file 'include/os0file.h'

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
  {
92
92
    Table *table= (Table *) arg;
93
93
    if (result_field->getTable() == table || !table)
94
 
      result_field->getTable()->setReadSet(result_field->position());
 
94
      result_field->getTable()->setReadSet(result_field->field_index);
95
95
  }
96
96
  return 0;
97
97
}
140
140
 
141
141
  switch (cached_result_type) {
142
142
  case REAL_RESULT:
143
 
    {
144
 
      save_result.vreal= use_result_field ? result_field->val_real() :
145
 
        args[0]->val_real();
146
 
      break;
147
 
    }
 
143
  {
 
144
    save_result.vreal= use_result_field ? result_field->val_real() :
 
145
                        args[0]->val_real();
 
146
    break;
 
147
  }
148
148
  case INT_RESULT:
149
 
    {
150
 
      save_result.vint= use_result_field ? result_field->val_int() :
151
 
        args[0]->val_int();
152
 
      unsigned_flag= use_result_field ? ((Field_num*)result_field)->unsigned_flag:
153
 
        args[0]->unsigned_flag;
154
 
      break;
155
 
    }
 
149
  {
 
150
    save_result.vint= use_result_field ? result_field->val_int() :
 
151
                       args[0]->val_int();
 
152
    unsigned_flag= use_result_field ? ((Field_num*)result_field)->unsigned_flag:
 
153
                    args[0]->unsigned_flag;
 
154
    break;
 
155
  }
156
156
  case STRING_RESULT:
157
 
    {
158
 
      save_result.vstr= use_result_field ? result_field->val_str_internal(&value) :
159
 
        args[0]->val_str(&value);
160
 
      break;
161
 
    }
 
157
  {
 
158
    save_result.vstr= use_result_field ? result_field->val_str(&value) :
 
159
                       args[0]->val_str(&value);
 
160
    break;
 
161
  }
162
162
  case DECIMAL_RESULT:
163
 
    {
164
 
      save_result.vdec= use_result_field ?
165
 
        result_field->val_decimal(&decimal_buff) :
166
 
        args[0]->val_decimal(&decimal_buff);
167
 
      break;
168
 
    }
 
163
  {
 
164
    save_result.vdec= use_result_field ?
 
165
                       result_field->val_decimal(&decimal_buff) :
 
166
                       args[0]->val_decimal(&decimal_buff);
 
167
    break;
 
168
  }
169
169
  case ROW_RESULT:
 
170
  default:
170
171
    // This case should never be chosen
171
172
    assert(0);
172
173
    break;
173
174
  }
174
 
 
175
 
  return false;
 
175
  return(false);
176
176
}
177
177
 
178
178
/**
197
197
 
198
198
  switch (cached_result_type) {
199
199
  case REAL_RESULT:
200
 
    {
201
 
      res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
202
 
                       REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
203
 
      break;
204
 
    }
205
 
 
 
200
  {
 
201
    res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
 
202
                     REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
 
203
    break;
 
204
  }
206
205
  case INT_RESULT:
207
 
    {
208
 
      res= update_hash((void*) &save_result.vint, sizeof(save_result.vint),
209
 
                       INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT,
210
 
                       unsigned_flag);
211
 
      break;
212
 
    }
213
 
 
 
206
  {
 
207
    res= update_hash((void*) &save_result.vint, sizeof(save_result.vint),
 
208
                     INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT,
 
209
                     unsigned_flag);
 
210
    break;
 
211
  }
214
212
  case STRING_RESULT:
215
 
    {
216
 
      if (!save_result.vstr)                                      // Null value
217
 
        res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin,
218
 
                         DERIVATION_IMPLICIT, 0);
219
 
      else
220
 
        res= update_hash((void*) save_result.vstr->ptr(),
221
 
                         save_result.vstr->length(), STRING_RESULT,
222
 
                         save_result.vstr->charset(),
223
 
                         DERIVATION_IMPLICIT, 0);
224
 
      break;
225
 
    }
226
 
 
 
213
  {
 
214
    if (!save_result.vstr)                                      // Null value
 
215
      res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin,
 
216
                       DERIVATION_IMPLICIT, 0);
 
217
    else
 
218
      res= update_hash((void*) save_result.vstr->ptr(),
 
219
                       save_result.vstr->length(), STRING_RESULT,
 
220
                       save_result.vstr->charset(),
 
221
                       DERIVATION_IMPLICIT, 0);
 
222
    break;
 
223
  }
227
224
  case DECIMAL_RESULT:
228
 
    {
229
 
      if (!save_result.vdec)                                      // Null value
230
 
        res= update_hash((void*) 0, 0, DECIMAL_RESULT, &my_charset_bin,
231
 
                         DERIVATION_IMPLICIT, 0);
232
 
      else
233
 
        res= update_hash((void*) save_result.vdec,
234
 
                         sizeof(my_decimal), DECIMAL_RESULT,
235
 
                         &my_charset_bin, DERIVATION_IMPLICIT, 0);
236
 
      break;
237
 
    }
238
 
 
 
225
  {
 
226
    if (!save_result.vdec)                                      // Null value
 
227
      res= update_hash((void*) 0, 0, DECIMAL_RESULT, &my_charset_bin,
 
228
                       DERIVATION_IMPLICIT, 0);
 
229
    else
 
230
      res= update_hash((void*) save_result.vdec,
 
231
                       sizeof(my_decimal), DECIMAL_RESULT,
 
232
                       &my_charset_bin, DERIVATION_IMPLICIT, 0);
 
233
    break;
 
234
  }
239
235
  case ROW_RESULT:
 
236
  default:
240
237
    // This case should never be chosen
241
238
    assert(0);
242
239
    break;
243
240
  }
244
 
 
245
241
  return(res);
246
242
}
247
243