Commit 23f80a6f authored by marko's avatar marko

branches/zip: Merge 1862:1894 from trunk, except 1866.

parent 20008e0e
...@@ -15,18 +15,16 @@ ...@@ -15,18 +15,16 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB) ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -D_LIB)
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
include ${CMAKE_SOURCE_DIR}/storage/innobase/include
handler ${CMAKE_SOURCE_DIR}/storage/innobase/handler
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
data/data0data.c data/data0type.c data/data0data.c data/data0type.c
dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c
...@@ -57,3 +55,7 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c ...@@ -57,3 +55,7 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c
usr/usr0sess.c usr/usr0sess.c
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c) ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ut/ut0vec.c ut/ut0list.c ut/ut0wqueue.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(innobase ${INNOBASE_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
...@@ -378,6 +378,8 @@ dict_table_autoinc_initialize( ...@@ -378,6 +378,8 @@ dict_table_autoinc_initialize(
dict_table_t* table, /* in/out: table */ dict_table_t* table, /* in/out: table */
ib_longlong value) /* in: next value to assign to a row */ ib_longlong value) /* in: next value to assign to a row */
{ {
ut_ad(mutex_own(&table->autoinc_mutex));
table->autoinc_inited = TRUE; table->autoinc_inited = TRUE;
table->autoinc = value; table->autoinc = value;
} }
...@@ -394,6 +396,8 @@ dict_table_autoinc_read( ...@@ -394,6 +396,8 @@ dict_table_autoinc_read(
{ {
ib_longlong value; ib_longlong value;
ut_ad(mutex_own(&table->autoinc_mutex));
if (!table->autoinc_inited) { if (!table->autoinc_inited) {
value = 0; value = 0;
......
...@@ -174,7 +174,7 @@ dict_mem_table_add_col( ...@@ -174,7 +174,7 @@ dict_mem_table_add_col(
col = dict_table_get_nth_col(table, i); col = dict_table_get_nth_col(table, i);
col->ind = i; col->ind = (unsigned int) i;
col->ord_part = 0; col->ord_part = 0;
col->mtype = (unsigned int) mtype; col->mtype = (unsigned int) mtype;
......
...@@ -5852,7 +5852,7 @@ ha_innobase::info( ...@@ -5852,7 +5852,7 @@ ha_innobase::info(
table->key_info[i].rec_per_key[j]= table->key_info[i].rec_per_key[j]=
rec_per_key >= ~(ulong) 0 ? ~(ulong) 0 : rec_per_key >= ~(ulong) 0 ? ~(ulong) 0 :
rec_per_key; (ulong) rec_per_key;
} }
index = dict_table_get_next_index(index); index = dict_table_get_next_index(index);
...@@ -7318,7 +7318,7 @@ ha_innobase::innobase_get_auto_increment( ...@@ -7318,7 +7318,7 @@ ha_innobase::innobase_get_auto_increment(
/*=====================================*/ /*=====================================*/
ulonglong* value) /* out: autoinc value */ ulonglong* value) /* out: autoinc value */
{ {
ulint error; ulong error;
*value = 0; *value = 0;
...@@ -7428,7 +7428,7 @@ ha_innobase::get_auto_increment( ...@@ -7428,7 +7428,7 @@ ha_innobase::get_auto_increment(
/* Called for the first time ? */ /* Called for the first time ? */
if (trx->n_autoinc_rows == 0) { if (trx->n_autoinc_rows == 0) {
trx->n_autoinc_rows = nb_desired_values; trx->n_autoinc_rows = (ulint) nb_desired_values;
/* It's possible for nb_desired_values to be 0: /* It's possible for nb_desired_values to be 0:
e.g., INSERT INTO T1(C) SELECT C FROM T2; */ e.g., INSERT INTO T1(C) SELECT C FROM T2; */
......
...@@ -3020,7 +3020,9 @@ next_rec: ...@@ -3020,7 +3020,9 @@ next_rec:
/* MySQL calls ha_innobase::reset_auto_increment() which does /* MySQL calls ha_innobase::reset_auto_increment() which does
the same thing. */ the same thing. */
dict_table_autoinc_lock(table);
dict_table_autoinc_initialize(table, 0); dict_table_autoinc_initialize(table, 0);
dict_table_autoinc_unlock(table);
dict_update_statistics(table); dict_update_statistics(table);
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
......
...@@ -537,15 +537,12 @@ ut_snprintf( ...@@ -537,15 +537,12 @@ ut_snprintf(
va_start(ap2, fmt); va_start(ap2, fmt);
res = _vscprintf(fmt, ap1); res = _vscprintf(fmt, ap1);
ut_a(res != -1);
if (res == -1) {
return(-1);
}
if (size > 0) { if (size > 0) {
_vsnprintf(str, size, fmt, ap2); _vsnprintf(str, size, fmt, ap2);
if ((size_t)res >= size) { if ((size_t) res >= size) {
str[size - 1] = '\0'; str[size - 1] = '\0';
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment