~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Monty Taylor
  • Date: 2010-12-24 00:04:05 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101224000405-pbeo7g3qs2s3xr7c
A stab at C++-izing InnoDB.

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
/** @file ha_innodb.cc */
83
83
 
84
84
/* Include necessary InnoDB headers */
85
 
extern "C" {
86
85
#include "univ.i"
87
86
#include "buf0lru.h"
88
87
#include "btr0sea.h"
115
114
#include "ut0mem.h"
116
115
#include "ibuf0ibuf.h"
117
116
#include "mysql_addons.h"
118
 
}
119
117
 
120
118
#include "ha_innodb.h"
121
119
#include "data_dictionary.h"
803
801
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking 
804
802
         in non-Cursor code.
805
803
@return true if session is the replication thread */
806
 
extern "C" UNIV_INTERN
 
804
UNIV_INTERN
807
805
ibool
808
806
thd_is_replication_slave_thread(
809
807
/*============================*/
877
875
DRIZZLE: Note, we didn't change this name to avoid more ifdef forking 
878
876
         in non-Cursor code.
879
877
@return true if non-transactional tables have been edited */
880
 
extern "C" UNIV_INTERN
 
878
UNIV_INTERN
881
879
ibool
882
880
thd_has_edited_nontrans_tables(
883
881
/*===========================*/
889
887
/******************************************************************//**
890
888
Returns true if the thread is executing a SELECT statement.
891
889
@return true if session is executing SELECT */
892
 
extern "C" UNIV_INTERN
 
890
UNIV_INTERN
893
891
ibool
894
892
thd_is_select(
895
893
/*==========*/
902
900
Returns true if the thread supports XA,
903
901
global value of innodb_supports_xa if session is NULL.
904
902
@return true if session has XA support */
905
 
extern "C" UNIV_INTERN
 
903
UNIV_INTERN
906
904
ibool
907
905
thd_supports_xa(
908
906
/*============*/
916
914
/******************************************************************//**
917
915
Returns the lock wait timeout for the current connection.
918
916
@return the lock wait timeout, in seconds */
919
 
extern "C" UNIV_INTERN
 
917
UNIV_INTERN
920
918
ulong
921
919
thd_lock_wait_timeout(
922
920
/*==================*/
931
929
 
932
930
/******************************************************************//**
933
931
Set the time waited for the lock for the current query. */
934
 
extern "C" UNIV_INTERN
 
932
UNIV_INTERN
935
933
void
936
934
thd_set_lock_wait_time(
937
935
/*===================*/
1023
1021
about a possible transaction rollback inside InnoDB caused by a lock wait
1024
1022
timeout or a deadlock.
1025
1023
@return MySQL error code */
1026
 
extern "C" UNIV_INTERN
 
1024
UNIV_INTERN
1027
1025
int
1028
1026
convert_error_code_to_mysql(
1029
1027
/*========================*/
1168
1166
 
1169
1167
/*************************************************************//**
1170
1168
Prints info of a Session object (== user session thread) to the given file. */
1171
 
extern "C" UNIV_INTERN
 
1169
UNIV_INTERN
1172
1170
void
1173
1171
innobase_mysql_print_thd(
1174
1172
/*=====================*/
1194
1192
 
1195
1193
/******************************************************************//**
1196
1194
Get the variable length bounds of the given character set. */
1197
 
extern "C" UNIV_INTERN
 
1195
UNIV_INTERN
1198
1196
void
1199
1197
innobase_get_cset_width(
1200
1198
/*====================*/
1221
1219
 
1222
1220
/******************************************************************//**
1223
1221
Converts an identifier to a table name. */
1224
 
extern "C" UNIV_INTERN
 
1222
UNIV_INTERN
1225
1223
void
1226
1224
innobase_convert_from_table_id(
1227
1225
/*===========================*/
1235
1233
 
1236
1234
/******************************************************************//**
1237
1235
Converts an identifier to UTF-8. */
1238
 
extern "C" UNIV_INTERN
 
1236
UNIV_INTERN
1239
1237
void
1240
1238
innobase_convert_from_id(
1241
1239
/*=====================*/
1250
1248
/******************************************************************//**
1251
1249
Compares NUL-terminated UTF-8 strings case insensitively.
1252
1250
@return 0 if a=b, <0 if a<b, >1 if a>b */
1253
 
extern "C" UNIV_INTERN
 
1251
UNIV_INTERN
1254
1252
int
1255
1253
innobase_strcasecmp(
1256
1254
/*================*/
1262
1260
 
1263
1261
/******************************************************************//**
1264
1262
Makes all characters in a NUL-terminated UTF-8 string lower case. */
1265
 
extern "C" UNIV_INTERN
 
1263
UNIV_INTERN
1266
1264
void
1267
1265
innobase_casedn_str(
1268
1266
/*================*/
1274
1272
/**********************************************************************//**
1275
1273
Determines the connection character set.
1276
1274
@return connection character set */
1277
 
extern "C" UNIV_INTERN
 
1275
UNIV_INTERN
1278
1276
const void*
1279
1277
innobase_get_charset(
1280
1278
/*=================*/
1283
1281
  return static_cast<Session*>(mysql_session)->charset();
1284
1282
}
1285
1283
 
1286
 
extern "C" UNIV_INTERN
 
1284
UNIV_INTERN
1287
1285
bool
1288
1286
innobase_isspace(
1289
1287
  const void *cs,
1303
1301
/**********************************************************************//**
1304
1302
Determines the current SQL statement.
1305
1303
@return        SQL statement string */
1306
 
extern "C" UNIV_INTERN
 
1304
UNIV_INTERN
1307
1305
const char*
1308
1306
innobase_get_stmt(
1309
1307
/*==============*/
1317
1315
/*******************************************************************//**
1318
1316
Map an OS error to an errno value. The OS error number is stored in
1319
1317
_doserrno and the mapped value is stored in errno) */
1320
 
extern "C"
1321
1318
void __cdecl
1322
1319
_dosmaperr(
1323
1320
  unsigned long); /*!< in: OS error value */
1325
1322
/*********************************************************************//**
1326
1323
Creates a temporary file.
1327
1324
@return temporary file descriptor, or < 0 on error */
1328
 
extern "C" UNIV_INTERN
 
1325
UNIV_INTERN
1329
1326
int
1330
1327
innobase_mysql_tmpfile(void)
1331
1328
/*========================*/
1405
1402
/*********************************************************************//**
1406
1403
Creates a temporary file.
1407
1404
@return temporary file descriptor, or < 0 on error */
1408
 
extern "C" UNIV_INTERN
 
1405
UNIV_INTERN
1409
1406
int
1410
1407
innobase_mysql_tmpfile(void)
1411
1408
/*========================*/
1444
1441
number of bytes that were written to "buf" is returned (including the
1445
1442
terminating NUL).
1446
1443
@return number of bytes that were written */
1447
 
extern "C" UNIV_INTERN
 
1444
UNIV_INTERN
1448
1445
ulint
1449
1446
innobase_raw_format(
1450
1447
/*================*/
1564
1561
/*********************************************************************//**
1565
1562
Allocates an InnoDB transaction for a MySQL Cursor object.
1566
1563
@return InnoDB transaction handle */
1567
 
extern "C" UNIV_INTERN
 
1564
UNIV_INTERN
1568
1565
trx_t*
1569
1566
innobase_trx_allocate(
1570
1567
/*==================*/
1745
1742
Convert a table or index name to the MySQL system_charset_info (UTF-8)
1746
1743
and quote it if needed.
1747
1744
@return pointer to the end of buf */
1748
 
extern "C" UNIV_INTERN
 
1745
UNIV_INTERN
1749
1746
char*
1750
1747
innobase_convert_name(
1751
1748
/*==================*/
1801
1798
/**********************************************************************//**
1802
1799
Determines if the currently running transaction has been interrupted.
1803
1800
@return TRUE if interrupted */
1804
 
extern "C" UNIV_INTERN
 
1801
UNIV_INTERN
1805
1802
ibool
1806
1803
trx_is_interrupted(
1807
1804
/*===============*/
1813
1810
/**********************************************************************//**
1814
1811
Determines if the currently running transaction is in strict mode.
1815
1812
@return TRUE if strict */
1816
 
extern "C" UNIV_INTERN
 
1813
UNIV_INTERN
1817
1814
ibool
1818
1815
trx_is_strict(
1819
1816
/*==========*/
3718
3715
of this function is in rem0cmp.c in InnoDB source code! If you change this
3719
3716
function, remember to update the prototype there!
3720
3717
@return 1, 0, -1, if a is greater, equal, less than b, respectively */
3721
 
extern "C" UNIV_INTERN
3722
 
int
 
3718
UNIV_INTERN int
3723
3719
innobase_mysql_cmp(
3724
3720
/*===============*/
3725
3721
  int   mysql_type, /*!< in: MySQL type */
3801
3797
the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1
3802
3798
VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'.
3803
3799
@return DATA_BINARY, DATA_VARCHAR, ... */
3804
 
extern "C" UNIV_INTERN
 
3800
UNIV_INTERN
3805
3801
ulint
3806
3802
get_innobase_type_from_mysql_type(
3807
3803
/*==============================*/
8895
8891
finds charset information and returns length of prefix_len characters in the
8896
8892
index field in bytes.
8897
8893
@return number of bytes occupied by the first n characters */
8898
 
extern "C" UNIV_INTERN
 
8894
UNIV_INTERN
8899
8895
ulint
8900
8896
innobase_get_at_most_n_mbchars(
8901
8897
/*===========================*/
9431
9427
This function checks each index name for a table against reserved
9432
9428
system default primary index name 'GEN_CLUST_INDEX'. If a name matches,
9433
9429
this function pushes an warning message to the client, and returns true. */
9434
 
extern "C" UNIV_INTERN
 
9430
UNIV_INTERN
9435
9431
bool
9436
9432
innobase_index_name_is_reserved(
9437
9433
/*============================*/