23
23
Handler-calling-functions
26
#include <drizzled/server_includes.h>
27
#include <libdrizzleclient/libdrizzle.h>
28
#include <mysys/hash.h>
29
#include <drizzled/error.h>
30
#include <drizzled/gettext.h>
31
#include <drizzled/data_home.h>
32
#include <drizzled/probes.h>
33
#include <drizzled/sql_parse.h>
34
#include <drizzled/cost_vect.h>
26
#include "drizzled/server_includes.h"
27
#include "libdrizzleclient/libdrizzle.h"
28
#include "mysys/hash.h"
29
#include "drizzled/error.h"
30
#include "drizzled/gettext.h"
31
#include "drizzled/data_home.h"
32
#include "drizzled/probes.h"
33
#include "drizzled/sql_parse.h"
34
#include "drizzled/cost_vect.h"
36
#include <drizzled/session.h>
37
#include <drizzled/sql_base.h>
38
#include <drizzled/replicator.h>
39
#include <drizzled/lock.h>
40
#include <drizzled/item/int.h>
41
#include <drizzled/item/empty_string.h>
42
#include <drizzled/unireg.h> // for mysql_frm_type
43
#include <drizzled/serialize/table.pb.h>
36
#include "drizzled/session.h"
37
#include "drizzled/sql_base.h"
38
#include "drizzled/replicator.h"
39
#include "drizzled/lock.h"
40
#include "drizzled/item/int.h"
41
#include "drizzled/item/empty_string.h"
42
#include "drizzled/unireg.h" // for mysql_frm_type
43
#include "drizzled/field/timestamp.h"
44
#include "drizzled/serialize/table.pb.h"
45
46
#if defined(CMATH_NAMESPACE)
46
47
using namespace CMATH_NAMESPACE;
2108
2109
/* Table is opened and defined at this point */
2109
key_unpack(&str,table,(uint) key_nr);
2110
uint32_t max_length=DRIZZLE_ERRMSG_SIZE-(uint) strlen(msg);
2110
key_unpack(&str,table,(uint32_t) key_nr);
2111
uint32_t max_length=DRIZZLE_ERRMSG_SIZE-(uint32_t) strlen(msg);
2111
2112
if (str.length() >= max_length)
2113
2114
str.length(max_length-4);
2170
2171
char key[MAX_KEY_LENGTH];
2171
2172
String str(key,sizeof(key),system_charset_info);
2172
2173
/* Table is opened and defined at this point */
2173
key_unpack(&str,table,(uint) key_nr);
2174
key_unpack(&str,table,(uint32_t) key_nr);
2174
2175
max_length= (DRIZZLE_ERRMSG_SIZE-
2175
(uint) strlen(ER(ER_FOREIGN_DUPLICATE_KEY)));
2176
(uint32_t) strlen(ER(ER_FOREIGN_DUPLICATE_KEY)));
2176
2177
if (str.length() >= max_length)
2178
2179
str.length(max_length-4);
2370
2371
uint32_t handler::get_dup_key(int error)
2372
table->file->errkey = (uint) -1;
2373
table->file->errkey = (uint32_t) -1;
2373
2374
if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOREIGN_DUPLICATE_KEY ||
2374
2375
error == HA_ERR_FOUND_DUPP_UNIQUE ||
2375
2376
error == HA_ERR_DROP_INDEX_FK)
2850
2851
init_tmp_table_share(session, &share, db, 0, table_name, path);
2851
2852
if (open_table_def(session, &share, 0) ||
2852
open_table_from_share(session, &share, "", 0, (uint) READ_ALL, 0, &table,
2853
open_table_from_share(session, &share, "", 0, (uint32_t) READ_ALL, 0, &table,
2898
2899
pthread_mutex_lock(&LOCK_global_system_variables);
2899
2900
uint32_t tmp_buff_size= (uint32_t) key_cache->param_buff_size;
2900
uint32_t tmp_block_size= (uint) key_cache->param_block_size;
2901
uint32_t tmp_block_size= (uint32_t) key_cache->param_block_size;
2901
2902
uint32_t division_limit= key_cache->param_division_limit;
2902
2903
uint32_t age_threshold= key_cache->param_age_threshold;
2903
2904
pthread_mutex_unlock(&LOCK_global_system_variables);
3173
3174
cost->avg_io_cost= 1; /* assume random seeks */
3174
3175
if ((*flags & HA_MRR_INDEX_ONLY) && total_rows > 2)
3175
cost->io_count= index_only_read_time(keyno, (uint)total_rows);
3176
cost->io_count= index_only_read_time(keyno, (uint32_t)total_rows);
3177
3178
cost->io_count= read_time(keyno, n_ranges, total_rows);
3178
3179
cost->cpu_cost= (double) total_rows / TIME_FOR_COMPARE + 0.01;
3779
3780
return true; /* Buffer has not enough space for even 1 rowid */
3781
3782
/* Number of iterations we'll make with full buffer */
3782
n_full_steps= (uint)floor(rows2double(rows) / max_buff_entries);
3783
n_full_steps= (uint32_t)floor(rows2double(rows) / max_buff_entries);
3785
3786
Get numbers of rows we'll be processing in
4280
4281
DRIZZLE_INSERT_ROW_START();
4284
* If we have a timestamp column, update it to the current time
4286
* @TODO Technically, the below two lines can be take even further out of the
4287
* handler interface and into the fill_record() method.
4289
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
4290
table->timestamp_field->set_time();
4282
4292
mark_trx_read_write();
4284
4294
if (unlikely(error= write_row(buf)))