Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
54e36baf
Commit
54e36baf
authored
May 22, 2001
by
tim@threads.polyesthetic.msg
Browse files
Options
Browse Files
Download
Plain Diff
Merge work.mysql.com:/home/bk/mysql
into threads.polyesthetic.msg:/usr/local/src/my/3
parents
a37b9715
2f990484
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
653 additions
and
364 deletions
+653
-364
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+3
-0
Docs/manual.texi
Docs/manual.texi
+378
-317
configure.in
configure.in
+5
-5
innobase/dict/dict0dict.c
innobase/dict/dict0dict.c
+67
-0
innobase/dict/dict0mem.c
innobase/dict/dict0mem.c
+5
-0
innobase/ibuf/ibuf0ibuf.c
innobase/ibuf/ibuf0ibuf.c
+23
-7
innobase/include/dict0dict.h
innobase/include/dict0dict.h
+26
-0
innobase/include/dict0mem.h
innobase/include/dict0mem.h
+10
-0
innobase/include/os0file.h
innobase/include/os0file.h
+13
-5
innobase/include/sync0sync.h
innobase/include/sync0sync.h
+1
-0
innobase/include/univ.i
innobase/include/univ.i
+6
-0
innobase/log/log0log.c
innobase/log/log0log.c
+2
-1
innobase/os/os0file.c
innobase/os/os0file.c
+37
-7
innobase/srv/srv0start.c
innobase/srv/srv0start.c
+25
-4
innobase/sync/sync0sync.c
innobase/sync/sync0sync.c
+2
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+1
-0
mysys/default.c
mysys/default.c
+1
-1
mysys/mf_keycache.c
mysys/mf_keycache.c
+2
-2
sql/ha_innobase.cc
sql/ha_innobase.cc
+36
-2
sql/mysqld.cc
sql/mysqld.cc
+7
-10
sql/violite.c
sql/violite.c
+3
-3
No files found.
BitKeeper/etc/logging_ok
View file @
54e36baf
mwagner@evoq.mwagner.org
mwagner@evoq.mwagner.org
tim@threads.polyesthetic.msg
tim@threads.polyesthetic.msg
tim@work.mysql.com
tim@work.mysql.com
heikki@donna.mysql.fi
paul@central.snake.net
monty@donna.mysql.fi
Docs/manual.texi
View file @
54e36baf
This diff is collapsed.
Click to expand it.
configure.in
View file @
54e36baf
...
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
...
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT
(
sql/mysqld.cc
)
AC_INIT
(
sql/mysqld.cc
)
AC_CANONICAL_SYSTEM
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# The Docs Makefile.am parses this line!
AM_INIT_AUTOMAKE
(
mysql, 3.23.3
8
)
AM_INIT_AUTOMAKE
(
mysql, 3.23.3
9
)
AM_CONFIG_HEADER
(
config.h
)
AM_CONFIG_HEADER
(
config.h
)
PROTOCOL_VERSION
=
10
PROTOCOL_VERSION
=
10
...
@@ -751,8 +751,8 @@ case $SYSTEM_TYPE in
...
@@ -751,8 +751,8 @@ case $SYSTEM_TYPE in
;;
;;
*
hpux10.20
*
)
*
hpux10.20
*
)
echo
"Enabling snprintf workaround for hpux 10.20"
echo
"Enabling snprintf workaround for hpux 10.20"
CFLAGS
=
"
$CFLAGS
-DHAVE_BROKEN_SNPRINTF"
CFLAGS
=
"
$CFLAGS
-DHAVE_BROKEN_SNPRINTF
-DSIGNALS_DONT_BREAK_READ
"
CXXFLAGS
=
"
$CXXFLAGS
-DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG"
CXXFLAGS
=
"
$CXXFLAGS
-DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG
-DSIGNALS_DONT_BREAK_READ
"
;;
;;
*
hpux11.
*
)
*
hpux11.
*
)
echo
"Enabling pread/pwrite workaround for hpux 11"
echo
"Enabling pread/pwrite workaround for hpux 11"
...
@@ -806,8 +806,8 @@ case $SYSTEM_TYPE in
...
@@ -806,8 +806,8 @@ case $SYSTEM_TYPE in
;;
;;
*
aix4.3
*
)
*
aix4.3
*
)
echo
"Adding defines for AIX"
echo
"Adding defines for AIX"
CFLAGS
=
"
$CFLAGS
-Wa,-many -DUNDEF_HAVE_INITGROUPS"
CFLAGS
=
"
$CFLAGS
-Wa,-many -DUNDEF_HAVE_INITGROUPS
-DSIGNALS_DONT_BREAK_READ
"
CXXFLAGS
=
"
$CXXFLAGS
-Wa,-many -DUNDEF_HAVE_INITGROUPS"
CXXFLAGS
=
"
$CXXFLAGS
-Wa,-many -DUNDEF_HAVE_INITGROUPS
-DSIGNALS_DONT_BREAK_READ
"
;;
;;
dnl Is this the right match
for
DEC OSF on alpha?
dnl Is this the right match
for
DEC OSF on alpha?
*
dec-osf
*
)
*
dec-osf
*
)
...
...
innobase/dict/dict0dict.c
View file @
54e36baf
...
@@ -235,6 +235,71 @@ dict_table_get_index_noninline(
...
@@ -235,6 +235,71 @@ dict_table_get_index_noninline(
return
(
dict_table_get_index
(
table
,
name
));
return
(
dict_table_get_index
(
table
,
name
));
}
}
/************************************************************************
Initializes the autoinc counter. It is not an error to initialize already
initialized counter. */
void
dict_table_autoinc_initialize
(
/*==========================*/
dict_table_t
*
table
,
/* in: table */
ib_longlong
value
)
/* in: value which was assigned to a row */
{
mutex_enter
(
&
(
table
->
autoinc_mutex
));
table
->
autoinc_inited
=
TRUE
;
table
->
autoinc
=
value
;
mutex_exit
(
&
(
table
->
autoinc_mutex
));
}
/************************************************************************
Gets the next autoinc value, 0 if not yet initialized. */
ib_longlong
dict_table_autoinc_get
(
/*===================*/
/* out: value for a new row, or 0 */
dict_table_t
*
table
)
/* in: table */
{
ib_longlong
value
;
mutex_enter
(
&
(
table
->
autoinc_mutex
));
if
(
!
table
->
autoinc_inited
)
{
value
=
0
;
}
else
{
table
->
autoinc
=
table
->
autoinc
+
1
;
value
=
table
->
autoinc
;
}
mutex_exit
(
&
(
table
->
autoinc_mutex
));
return
(
value
);
}
/************************************************************************
Updates the autoinc counter if the value supplied is bigger than the
current value. If not inited, does nothing. */
void
dict_table_autoinc_update
(
/*======================*/
dict_table_t
*
table
,
/* in: table */
ib_longlong
value
)
/* in: value which was assigned to a row */
{
mutex_enter
(
&
(
table
->
autoinc_mutex
));
if
(
table
->
autoinc_inited
)
{
if
(
value
>
table
->
autoinc
)
{
table
->
autoinc
=
value
;
}
}
mutex_exit
(
&
(
table
->
autoinc_mutex
));
}
/************************************************************************
/************************************************************************
Looks for column n in an index. */
Looks for column n in an index. */
...
@@ -568,6 +633,8 @@ dict_table_remove_from_cache(
...
@@ -568,6 +633,8 @@ dict_table_remove_from_cache(
/* Remove table from LRU list of tables */
/* Remove table from LRU list of tables */
UT_LIST_REMOVE
(
table_LRU
,
dict_sys
->
table_LRU
,
table
);
UT_LIST_REMOVE
(
table_LRU
,
dict_sys
->
table_LRU
,
table
);
mutex_free
(
&
(
table
->
autoinc_mutex
));
size
=
mem_heap_get_size
(
table
->
heap
);
size
=
mem_heap_get_size
(
table
->
heap
);
ut_ad
(
dict_sys
->
size
>=
size
);
ut_ad
(
dict_sys
->
size
>=
size
);
...
...
innobase/dict/dict0mem.c
View file @
54e36baf
...
@@ -71,6 +71,11 @@ dict_mem_table_create(
...
@@ -71,6 +71,11 @@ dict_mem_table_create(
table
->
stat_modif_counter
=
0
;
table
->
stat_modif_counter
=
0
;
mutex_create
(
&
(
table
->
autoinc_mutex
));
mutex_set_level
(
&
(
table
->
autoinc_mutex
),
SYNC_DICT_AUTOINC_MUTEX
);
table
->
autoinc_inited
=
FALSE
;
table
->
magic_n
=
DICT_TABLE_MAGIC_N
;
table
->
magic_n
=
DICT_TABLE_MAGIC_N
;
return
(
table
);
return
(
table
);
...
...
innobase/ibuf/ibuf0ibuf.c
View file @
54e36baf
...
@@ -1002,24 +1002,40 @@ ibuf_rec_get_volume(
...
@@ -1002,24 +1002,40 @@ ibuf_rec_get_volume(
/*================*/
/*================*/
/* out: size of index record in bytes + an upper
/* out: size of index record in bytes + an upper
limit of the space taken in the page directory */
limit of the space taken in the page directory */
rec_t
*
rec
)
/* in: ibuf record */
rec_t
*
ibuf_rec
)
/* in: ibuf record */
{
{
dtype_t
dtype
;
ulint
data_size
=
0
;
ulint
n_fields
;
ulint
n_fields
;
byte
*
field
;
byte
*
types
;
byte
*
data
;
ulint
len
;
ulint
len
;
ulint
data_size
;
ulint
i
;
ut_ad
(
ibuf_inside
());
ut_ad
(
ibuf_inside
());
ut_ad
(
rec_get_n_fields
(
rec
)
>
2
);
ut_ad
(
rec_get_n_fields
(
rec
)
>
2
);
n_fields
=
rec_get_n_fields
(
ibuf_rec
)
-
2
;
n_fields
=
rec_get_n_fields
(
rec
)
-
2
;
types
=
rec_get_nth_field
(
ibuf_rec
,
1
,
&
len
)
;
field
=
rec_get_nth_field
(
rec
,
2
,
&
len
);
ut_ad
(
len
==
n_fields
*
DATA_ORDER_NULL_TYPE_BUF_SIZE
);
data_size
=
rec_get_data_size
(
rec
)
-
(
field
-
rec
);
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
data
=
rec_get_nth_field
(
ibuf_rec
,
i
+
2
,
&
len
);
dtype_read_for_order_and_null_size
(
&
dtype
,
types
+
i
*
DATA_ORDER_NULL_TYPE_BUF_SIZE
);
if
(
len
==
UNIV_SQL_NULL
)
{
data_size
+=
dtype_get_sql_null_size
(
&
dtype
);
}
else
{
data_size
+=
len
;
}
}
return
(
data_size
+
rec_get_converted_extra_size
(
data_size
,
n_fields
)
return
(
data_size
+
rec_get_converted_extra_size
(
data_size
,
n_fields
)
+
page_dir_calc_reserved_space
(
1
));
+
page_dir_calc_reserved_space
(
1
));
}
}
/*************************************************************************
/*************************************************************************
...
...
innobase/include/dict0dict.h
View file @
54e36baf
...
@@ -88,6 +88,32 @@ ulint
...
@@ -88,6 +88,32 @@ ulint
dict_col_get_clust_pos
(
dict_col_get_clust_pos
(
/*===================*/
/*===================*/
dict_col_t
*
col
);
dict_col_t
*
col
);
/************************************************************************
Initializes the autoinc counter. It is not an error to initialize already
initialized counter. */
void
dict_table_autoinc_initialize
(
/*==========================*/
dict_table_t
*
table
,
/* in: table */
ib_longlong
value
);
/* in: value which was assigned to a row */
/************************************************************************
Gets the next autoinc value, 0 if not yet initialized. */
ib_longlong
dict_table_autoinc_get
(
/*===================*/
/* out: value for a new row, or 0 */
dict_table_t
*
table
);
/* in: table */
/************************************************************************
Updates the autoinc counter if the value supplied is bigger than the
current value. If not inited, does nothing. */
void
dict_table_autoinc_update
(
/*======================*/
dict_table_t
*
table
,
/* in: table */
ib_longlong
value
);
/* in: value which was assigned to a row */
/**************************************************************************
/**************************************************************************
Adds a table object to the dictionary cache. */
Adds a table object to the dictionary cache. */
...
...
innobase/include/dict0mem.h
View file @
54e36baf
...
@@ -302,6 +302,16 @@ struct dict_table_struct{
...
@@ -302,6 +302,16 @@ struct dict_table_struct{
for MySQL SHOW TABLE STATUS; this counter
for MySQL SHOW TABLE STATUS; this counter
is not protected by any latch, because this
is not protected by any latch, because this
is only used for heuristics */
is only used for heuristics */
/*----------------------*/
mutex_t
autoinc_mutex
;
/* mutex protecting the autoincrement
counter */
ibool
autoinc_inited
;
/* TRUE if the autoinc counter has been
inited; MySQL gets the init value by executing
SELECT MAX(auto inc column) */
ib_longlong
autoinc
;
/* autoinc counter value already given to
a row */
ulint
magic_n
;
/* magic number */
ulint
magic_n
;
/* magic number */
};
};
#define DICT_TABLE_MAGIC_N 76333786
#define DICT_TABLE_MAGIC_N 76333786
...
...
innobase/include/os0file.h
View file @
54e36baf
...
@@ -13,12 +13,10 @@ Created 10/21/1995 Heikki Tuuri
...
@@ -13,12 +13,10 @@ Created 10/21/1995 Heikki Tuuri
#ifdef __WIN__
#ifdef __WIN__
#if (defined(__NT__) || defined(__WIN2000__))
/* We define always WIN_ASYNC_IO, and check at run-time whether
the OS actually supports it: Win 95 does not, NT does. */
#define WIN_ASYNC_IO
#define WIN_ASYNC_IO
#endif
#define UNIV_NON_BUFFERED_IO
#define UNIV_NON_BUFFERED_IO
#else
#else
...
@@ -100,7 +98,17 @@ log. */
...
@@ -100,7 +98,17 @@ log. */
requests in a batch, and only after that
requests in a batch, and only after that
wake the i/o-handler thread; this has
wake the i/o-handler thread; this has
effect only in simulated aio */
effect only in simulated aio */
#define OS_WIN31 1
#define OS_WIN95 2
#define OS_WINNT 3
/***************************************************************************
Gets the operating system version. Currently works only on Windows. */
ulint
os_get_os_version
(
void
);
/*===================*/
/* out: OS_WIN95, OS_WIN31, OS_WINNT (2000 == NT) */
/********************************************************************
/********************************************************************
Opens an existing file or creates a new. */
Opens an existing file or creates a new. */
...
...
innobase/include/sync0sync.h
View file @
54e36baf
...
@@ -372,6 +372,7 @@ Memory pool mutex */
...
@@ -372,6 +372,7 @@ Memory pool mutex */
latching order checking */
latching order checking */
#define SYNC_LEVEL_NONE 2000
/* default: level not defined */
#define SYNC_LEVEL_NONE 2000
/* default: level not defined */
#define SYNC_DICT 1000
#define SYNC_DICT 1000
#define SYNC_DICT_AUTOINC_MUTEX 999
#define SYNC_PURGE_IS_RUNNING 997
#define SYNC_PURGE_IS_RUNNING 997
#define SYNC_DICT_HEADER 995
#define SYNC_DICT_HEADER 995
#define SYNC_IBUF_HEADER 914
#define SYNC_IBUF_HEADER 914
...
...
innobase/include/univ.i
View file @
54e36baf
...
@@ -155,6 +155,12 @@ typedef unsigned long int ulint;
...
@@ -155,6 +155,12 @@ typedef unsigned long int ulint;
typedef
long
int
lint
;
typedef
long
int
lint
;
#
ifdef
__WIN__
typedef
__int64
ib_longlong
;
#
else
typedef
longlong
ib_longlong
;
#
endif
/* The following type should be at least a 64-bit floating point number */
/* The following type should be at least a 64-bit floating point number */
typedef
double
utfloat
;
typedef
double
utfloat
;
...
...
innobase/log/log0log.c
View file @
54e36baf
...
@@ -327,7 +327,8 @@ log_pad_current_log_block(void)
...
@@ -327,7 +327,8 @@ log_pad_current_log_block(void)
ulint
i
;
ulint
i
;
dulint
lsn
;
dulint
lsn
;
log_reserve_and_open
(
OS_FILE_LOG_BLOCK_SIZE
);
/* We retrieve lsn only because otherwise gcc crashed on HP-UX */
lsn
=
log_reserve_and_open
(
OS_FILE_LOG_BLOCK_SIZE
);
pad_length
=
OS_FILE_LOG_BLOCK_SIZE
pad_length
=
OS_FILE_LOG_BLOCK_SIZE
-
(
log_sys
->
buf_free
%
OS_FILE_LOG_BLOCK_SIZE
)
-
(
log_sys
->
buf_free
%
OS_FILE_LOG_BLOCK_SIZE
)
...
...
innobase/os/os0file.c
View file @
54e36baf
...
@@ -103,6 +103,38 @@ os_aio_array_t* os_aio_sync_array = NULL;
...
@@ -103,6 +103,38 @@ os_aio_array_t* os_aio_sync_array = NULL;
ulint
os_aio_n_segments
=
ULINT_UNDEFINED
;
ulint
os_aio_n_segments
=
ULINT_UNDEFINED
;
/***************************************************************************
Gets the operating system version. Currently works only on Windows. */
ulint
os_get_os_version
(
void
)
/*===================*/
/* out: OS_WIN95, OS_WIN31, OS_WINNT (2000 == NT) */
{
#ifdef __WIN__
OSVERSIONINFO
os_info
;
os_info
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFO
);
ut_a
(
GetVersionEx
(
&
os_info
));
if
(
os_info
.
dwPlatformId
==
VER_PLATFORM_WIN32s
)
{
return
(
OS_WIN31
);
}
else
if
(
os_info
.
dwPlatformId
==
VER_PLATFORM_WIN32_WINDOWS
)
{
return
(
OS_WIN95
);
}
else
if
(
os_info
.
dwPlatformId
==
VER_PLATFORM_WIN32_NT
)
{
return
(
OS_WINNT
);
}
else
{
ut_error
;
return
(
0
);
}
#else
ut_error
;
return
(
0
);
#endif
}
/***************************************************************************
/***************************************************************************
Retrieves the last error number if an error occurs in a file io function.
Retrieves the last error number if an error occurs in a file io function.
The number should be retrieved before any other OS calls (because they may
The number should be retrieved before any other OS calls (because they may
...
@@ -438,13 +470,13 @@ os_file_set_size(
...
@@ -438,13 +470,13 @@ os_file_set_size(
byte
*
buf
;
byte
*
buf
;
try_again:
try_again:
/* We use a very big
16 MB buffer in writing because Linux is
/* We use a very big
8 MB buffer in writing because Linux may be
extremely slow in fdatasync on 1 MB writes */
extremely slow in fdatasync on 1 MB writes */
buf
=
ut_malloc
(
UNIV_PAGE_SIZE
*
1024
);
buf
=
ut_malloc
(
UNIV_PAGE_SIZE
*
512
);
/* Write buffer full of zeros */
/* Write buffer full of zeros */
for
(
i
=
0
;
i
<
UNIV_PAGE_SIZE
*
1024
;
i
++
)
{
for
(
i
=
0
;
i
<
UNIV_PAGE_SIZE
*
512
;
i
++
)
{
buf
[
i
]
=
'\0'
;
buf
[
i
]
=
'\0'
;
}
}
...
@@ -456,10 +488,10 @@ try_again:
...
@@ -456,10 +488,10 @@ try_again:
UT_NOT_USED
(
size_high
);
UT_NOT_USED
(
size_high
);
#endif
#endif
while
(
offset
<
low
)
{
while
(
offset
<
low
)
{
if
(
low
-
offset
<
UNIV_PAGE_SIZE
*
1024
)
{
if
(
low
-
offset
<
UNIV_PAGE_SIZE
*
512
)
{
n_bytes
=
low
-
offset
;
n_bytes
=
low
-
offset
;
}
else
{
}
else
{
n_bytes
=
UNIV_PAGE_SIZE
*
1024
;
n_bytes
=
UNIV_PAGE_SIZE
*
512
;
}
}
ret
=
os_file_write
(
name
,
file
,
buf
,
offset
,
0
,
n_bytes
);
ret
=
os_file_write
(
name
,
file
,
buf
,
offset
,
0
,
n_bytes
);
...
@@ -475,8 +507,6 @@ try_again:
...
@@ -475,8 +507,6 @@ try_again:
ret
=
os_file_flush
(
file
);
ret
=
os_file_flush
(
file
);
fsync
(
file
);
if
(
ret
)
{
if
(
ret
)
{
return
(
TRUE
);
return
(
TRUE
);
}
}
...
...
innobase/srv/srv0start.c
View file @
54e36baf
...
@@ -549,11 +549,19 @@ innobase_start_or_create_for_mysql(void)
...
@@ -549,11 +549,19 @@ innobase_start_or_create_for_mysql(void)
srv_n_file_io_threads
=
4
;
srv_n_file_io_threads
=
4
;
#endif
#endif
#ifdef WIN_ASYNC_IO
#ifdef __WIN__
/* On NT always use aio */
if
(
os_get_os_version
()
==
OS_WIN95
os_aio_use_native_aio
=
TRUE
;
||
os_get_os_version
()
==
OS_WIN31
)
{
#endif
/* On Win 95, 98, ME, and Win32 subsystem for Windows 3.1 use
simulated aio */
os_aio_use_native_aio
=
FALSE
;
srv_n_file_io_threads
=
4
;
}
else
{
/* On NT and Win 2000 always use aio */
os_aio_use_native_aio
=
TRUE
;
}
#endif
if
(
!
os_aio_use_native_aio
)
{
if
(
!
os_aio_use_native_aio
)
{
os_aio_init
(
4
*
SRV_N_PENDING_IOS_PER_THREAD
os_aio_init
(
4
*
SRV_N_PENDING_IOS_PER_THREAD
*
srv_n_file_io_threads
,
*
srv_n_file_io_threads
,
...
@@ -600,6 +608,19 @@ innobase_start_or_create_for_mysql(void)
...
@@ -600,6 +608,19 @@ innobase_start_or_create_for_mysql(void)
return
(
DB_ERROR
);
return
(
DB_ERROR
);
}
}
sum_of_new_sizes
=
0
;
for
(
i
=
0
;
i
<
srv_n_data_files
;
i
++
)
{
sum_of_new_sizes
+=
srv_data_file_sizes
[
i
];
}
if
(
sum_of_new_sizes
<
640
)
{
fprintf
(
stderr
,
"InnoDB: Error: tablespace size must be at least 10 MB
\n
"
);
return
(
DB_ERROR
);
}
err
=
open_or_create_data_files
(
&
create_new_db
,
err
=
open_or_create_data_files
(
&
create_new_db
,
&
min_flushed_lsn
,
&
min_arch_log_no
,
&
min_flushed_lsn
,
&
min_arch_log_no
,
&
max_flushed_lsn
,
&
max_arch_log_no
,
&
max_flushed_lsn
,
&
max_arch_log_no
,
...
...
innobase/sync/sync0sync.c
View file @
54e36baf
...
@@ -1001,6 +1001,8 @@ sync_thread_add_level(
...
@@ -1001,6 +1001,8 @@ sync_thread_add_level(
&&
!
sync_thread_levels_contain
(
array
,
SYNC_IBUF_MUTEX
)
&&
!
sync_thread_levels_contain
(
array
,
SYNC_IBUF_MUTEX
)
&&
!
sync_thread_levels_contain
(
array
,
&&
!
sync_thread_levels_contain
(
array
,
SYNC_IBUF_PESS_INSERT_MUTEX
));
SYNC_IBUF_PESS_INSERT_MUTEX
));
}
else
if
(
level
==
SYNC_DICT_AUTOINC_MUTEX
)
{
ut_a
(
sync_thread_levels_g
(
array
,
SYNC_DICT_AUTOINC_MUTEX
));
}
else
if
(
level
==
SYNC_DICT_HEADER
)
{
}
else
if
(
level
==
SYNC_DICT_HEADER
)
{
ut_a
(
sync_thread_levels_g
(
array
,
SYNC_DICT_HEADER
));
ut_a
(
sync_thread_levels_g
(
array
,
SYNC_DICT_HEADER
));
}
else
if
(
level
==
SYNC_PURGE_IS_RUNNING
)
{
}
else
if
(
level
==
SYNC_PURGE_IS_RUNNING
)
{
...
...
mysql-test/t/merge.test
View file @
54e36baf
...
@@ -109,3 +109,4 @@ insert into t1 values (1,2),(2,1),(0,0),(4,4),(5,5),(6,6);
...
@@ -109,3 +109,4 @@ insert into t1 values (1,2),(2,1),(0,0),(4,4),(5,5),(6,6);
insert
into
t2
values
(
1
,
1
),(
2
,
2
),(
0
,
0
),(
4
,
4
),(
5
,
5
),(
6
,
6
);
insert
into
t2
values
(
1
,
1
),(
2
,
2
),(
0
,
0
),(
4
,
4
),(
5
,
5
),(
6
,
6
);
flush
tables
;
flush
tables
;
select
*
from
t3
where
a
=
1
order
by
b
limit
2
;
select
*
from
t3
where
a
=
1
order
by
b
limit
2
;
drop
table
t1
,
t2
,
t3
;
mysys/default.c
View file @
54e36baf
...
@@ -222,7 +222,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
...
@@ -222,7 +222,7 @@ static my_bool search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
const
char
*
dir
,
const
char
*
config_file
,
const
char
*
dir
,
const
char
*
config_file
,
const
char
*
ext
,
TYPELIB
*
group
)
const
char
*
ext
,
TYPELIB
*
group
)
{
{
char
name
[
FN_REFLEN
+
10
],
buff
[
257
],
*
ptr
,
*
end
,
*
value
,
*
tmp
;
char
name
[
FN_REFLEN
+
10
],
buff
[
FN_REFLEN
+
1
],
*
ptr
,
*
end
,
*
value
,
*
tmp
;
FILE
*
fp
;
FILE
*
fp
;
uint
line
=
0
;
uint
line
=
0
;
my_bool
read_values
=
0
,
found_group
=
0
;
my_bool
read_values
=
0
,
found_group
=
0
;
...
...
mysys/mf_keycache.c
View file @
54e36baf
...
@@ -381,7 +381,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error)
...
@@ -381,7 +381,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error)
reg1
SEC_LINK
*
next
,
**
start
;
reg1
SEC_LINK
*
next
,
**
start
;
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
DBUG_EXECUTE
(
"check_keycache"
,
test_key_cache
(
"start of find_key_block"
,
0
););
DBUG_EXECUTE
(
"check_keycache
2
"
,
test_key_cache
(
"start of find_key_block"
,
0
););
#endif
#endif
*
error
=
0
;
*
error
=
0
;
...
@@ -459,7 +459,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error)
...
@@ -459,7 +459,7 @@ static SEC_LINK *find_key_block(int file, my_off_t filepos, int *error)
}
}
_my_used_last
=
next
;
_my_used_last
=
next
;
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
DBUG_EXECUTE
(
"check_keycache"
,
test_key_cache
(
"end of find_key_block"
,
0
););
DBUG_EXECUTE
(
"check_keycache
2
"
,
test_key_cache
(
"end of find_key_block"
,
0
););
#endif
#endif
return
next
;
return
next
;
}
/* find_key_block */
}
/* find_key_block */
...
...
sql/ha_innobase.cc
View file @
54e36baf
...
@@ -1242,7 +1242,8 @@ ha_innobase::write_row(
...
@@ -1242,7 +1242,8 @@ ha_innobase::write_row(
{
{
row_prebuilt_t
*
prebuilt
=
(
row_prebuilt_t
*
)
innobase_prebuilt
;
row_prebuilt_t
*
prebuilt
=
(
row_prebuilt_t
*
)
innobase_prebuilt
;
int
error
;
int
error
;
longlong
auto_inc
;
DBUG_ENTER
(
"ha_innobase::write_row"
);
DBUG_ENTER
(
"ha_innobase::write_row"
);
statistic_increment
(
ha_write_count
,
&
LOCK_status
);
statistic_increment
(
ha_write_count
,
&
LOCK_status
);
...
@@ -1261,10 +1262,43 @@ ha_innobase::write_row(
...
@@ -1261,10 +1262,43 @@ ha_innobase::write_row(
make sure all columns are fetched in the select done by
make sure all columns are fetched in the select done by
update_auto_increment */
update_auto_increment */
prebuilt
->
in_update_remember_pos
=
FALSE
;
/* Fetch the value the user possibly has set in the
autoincrement field */
auto_inc
=
table
->
next_number_field
->
val_int
();
if
(
auto_inc
!=
0
)
{
/* This call will calculate the max of the
current value and the value supplied by the user, if
the auto_inc counter is already initialized
for the table */
dict_table_autoinc_update
(
prebuilt
->
table
,
auto_inc
);
}
else
{
auto_inc
=
dict_table_autoinc_get
(
prebuilt
->
table
);
/* If auto_inc is now != 0 the autoinc counter
was already initialized for the table: we can give
the new value for MySQL to place in the field */
if
(
auto_inc
!=
0
)
{
user_thd
->
next_insert_id
=
auto_inc
;
}
}
prebuilt
->
in_update_remember_pos
=
FALSE
;
update_auto_increment
();
update_auto_increment
();
if
(
auto_inc
==
0
)
{
/* The autoinc counter for our table was not yet
initialized, initialize it now */
auto_inc
=
table
->
next_number_field
->
val_int
();
dict_table_autoinc_initialize
(
prebuilt
->
table
,
auto_inc
);
}
/* We have to set sql_stat_start to TRUE because
/* We have to set sql_stat_start to TRUE because
update_auto_increment has called a select, and
update_auto_increment has called a select, and
has reset that flag; row_insert_for_mysql has to
has reset that flag; row_insert_for_mysql has to
...
...
sql/mysqld.cc
View file @
54e36baf
...
@@ -429,7 +429,7 @@ static void close_connections(void)
...
@@ -429,7 +429,7 @@ static void close_connections(void)
if
(
error
!=
0
&&
!
count
++
)
if
(
error
!=
0
&&
!
count
++
)
sql_print_error
(
"Got error %d from pthread_cond_timedwait"
,
error
);
sql_print_error
(
"Got error %d from pthread_cond_timedwait"
,
error
);
#endif
#endif
#if defined(
AIX_3_2) || defined(HAVE_DEC_3_2_THREADS
)
#if defined(
HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ
)
if
(
ip_sock
!=
INVALID_SOCKET
)
if
(
ip_sock
!=
INVALID_SOCKET
)
{
{
DBUG_PRINT
(
"error"
,(
"closing TCP/IP and socket files"
));
DBUG_PRINT
(
"error"
,(
"closing TCP/IP and socket files"
));
...
@@ -544,9 +544,9 @@ static void close_connections(void)
...
@@ -544,9 +544,9 @@ static void close_connections(void)
(
void
)
pthread_mutex_unlock
(
&
LOCK_thread_count
);
(
void
)
pthread_mutex_unlock
(
&
LOCK_thread_count
);
mysql_log
.
close
(
1
);
mysql_log
.
close
(
1
);
mysql_slow_log
.
close
(
1
);
mysql_update_log
.
close
(
1
);
mysql_update_log
.
close
(
1
);
mysql_bin_log
.
close
(
1
);
mysql_bin_log
.
close
(
1
);
my_free
(
charsets_list
,
MYF
(
0
));
DBUG_PRINT
(
"quit"
,(
"close_connections thread"
));
DBUG_PRINT
(
"quit"
,(
"close_connections thread"
));
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
@@ -680,6 +680,7 @@ void clean_up(bool print_message)
...
@@ -680,6 +680,7 @@ void clean_up(bool print_message)
end_raid
();
end_raid
();
#endif
#endif
free_defaults
(
defaults_argv
);
free_defaults
(
defaults_argv
);
my_free
(
charsets_list
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
(
mysql_tmpdir
,
MYF
(
0
));
my_free
(
mysql_tmpdir
,
MYF
(
0
));
x_free
(
opt_bin_logname
);
x_free
(
opt_bin_logname
);
bitmap_free
(
&
temp_pool
);
bitmap_free
(
&
temp_pool
);
...
@@ -2487,9 +2488,7 @@ static struct option long_options[] = {
...
@@ -2487,9 +2488,7 @@ static struct option long_options[] = {
{
"chroot"
,
required_argument
,
0
,
'r'
},
{
"chroot"
,
required_argument
,
0
,
'r'
},
{
"character-sets-dir"
,
required_argument
,
0
,
(
int
)
OPT_CHARSETS_DIR
},
{
"character-sets-dir"
,
required_argument
,
0
,
(
int
)
OPT_CHARSETS_DIR
},
{
"datadir"
,
required_argument
,
0
,
'h'
},
{
"datadir"
,
required_argument
,
0
,
'h'
},
#ifndef DBUG_OFF
{
"debug"
,
optional_argument
,
0
,
'#'
},
{
"debug"
,
optional_argument
,
0
,
'#'
},
#endif
{
"default-character-set"
,
required_argument
,
0
,
'C'
},
{
"default-character-set"
,
required_argument
,
0
,
'C'
},
{
"default-table-type"
,
required_argument
,
0
,
(
int
)
OPT_TABLE_TYPE
},
{
"default-table-type"
,
required_argument
,
0
,
(
int
)
OPT_TABLE_TYPE
},
{
"delay-key-write-for-all-tables"
,
{
"delay-key-write-for-all-tables"
,
...
@@ -2544,10 +2543,8 @@ static struct option long_options[] = {
...
@@ -2544,10 +2543,8 @@ static struct option long_options[] = {
(
int
)
OPT_DISCONNECT_SLAVE_EVENT_COUNT
},
(
int
)
OPT_DISCONNECT_SLAVE_EVENT_COUNT
},
{
"abort-slave-event-count"
,
required_argument
,
0
,
{
"abort-slave-event-count"
,
required_argument
,
0
,
(
int
)
OPT_ABORT_SLAVE_EVENT_COUNT
},
(
int
)
OPT_ABORT_SLAVE_EVENT_COUNT
},
#if !defined(DBUG_OFF) && defined(SAFEMALLOC)
{
"safemalloc-mem-limit"
,
required_argument
,
0
,
(
int
)
{
"safemalloc-mem-limit"
,
required_argument
,
0
,
(
int
)
OPT_SAFEMALLOC_MEM_LIMIT
},
OPT_SAFEMALLOC_MEM_LIMIT
},
#endif
{
"new"
,
no_argument
,
0
,
'n'
},
{
"new"
,
no_argument
,
0
,
'n'
},
{
"old-protocol"
,
no_argument
,
0
,
'o'
},
{
"old-protocol"
,
no_argument
,
0
,
'o'
},
#ifdef ONE_THREAD
#ifdef ONE_THREAD
...
@@ -3165,12 +3162,12 @@ static void get_options(int argc,char **argv)
...
@@ -3165,12 +3162,12 @@ static void get_options(int argc,char **argv)
long_options
,
&
option_index
))
!=
EOF
)
long_options
,
&
option_index
))
!=
EOF
)
{
{
switch
(
c
)
{
switch
(
c
)
{
#ifndef DBUG_OFF
case
'#'
:
case
'#'
:
#ifndef DBUG_OFF
DBUG_PUSH
(
optarg
?
optarg
:
default_dbug_option
);
DBUG_PUSH
(
optarg
?
optarg
:
default_dbug_option
);
#endif
opt_endinfo
=
1
;
/* unireg: memory allocation */
opt_endinfo
=
1
;
/* unireg: memory allocation */
break
;
break
;
#endif
case
'a'
:
case
'a'
:
opt_ansi_mode
=
1
;
opt_ansi_mode
=
1
;
thd_startup_options
|=
OPTION_ANSI_MODE
;
thd_startup_options
|=
OPTION_ANSI_MODE
;
...
@@ -3205,11 +3202,11 @@ static void get_options(int argc,char **argv)
...
@@ -3205,11 +3202,11 @@ static void get_options(int argc,char **argv)
case
'P'
:
case
'P'
:
mysql_port
=
(
unsigned
int
)
atoi
(
optarg
);
mysql_port
=
(
unsigned
int
)
atoi
(
optarg
);
break
;
break
;
#if !defined(DBUG_OFF) && defined(SAFEMALLOC)
case
OPT_SAFEMALLOC_MEM_LIMIT
:
case
OPT_SAFEMALLOC_MEM_LIMIT
:
#if !defined(DBUG_OFF) && defined(SAFEMALLOC)
safemalloc_mem_limit
=
atoi
(
optarg
);
safemalloc_mem_limit
=
atoi
(
optarg
);
break
;
#endif
#endif
break
;
case
OPT_SOCKET
:
case
OPT_SOCKET
:
mysql_unix_port
=
optarg
;
mysql_unix_port
=
optarg
;
break
;
break
;
...
...
sql/violite.c
View file @
54e36baf
...
@@ -179,7 +179,7 @@ int vio_read(Vio * vio, gptr buf, int size)
...
@@ -179,7 +179,7 @@ int vio_read(Vio * vio, gptr buf, int size)
#ifndef DBUG_OFF
#ifndef DBUG_OFF
if
(
r
<
0
)
if
(
r
<
0
)
{
{
DBUG_PRINT
(
"error"
,
(
"Got error %d during read"
,
errno
));
DBUG_PRINT
(
"
vio_
error"
,
(
"Got error %d during read"
,
errno
));
}
}
#endif
/* DBUG_OFF */
#endif
/* DBUG_OFF */
DBUG_PRINT
(
"exit"
,
(
"%d"
,
r
));
DBUG_PRINT
(
"exit"
,
(
"%d"
,
r
));
...
@@ -207,7 +207,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
...
@@ -207,7 +207,7 @@ int vio_write(Vio * vio, const gptr buf, int size)
#ifndef DBUG_OFF
#ifndef DBUG_OFF
if
(
r
<
0
)
if
(
r
<
0
)
{
{
DBUG_PRINT
(
"error"
,
(
"Got error on write: %d"
,
errno
));
DBUG_PRINT
(
"
vio_
error"
,
(
"Got error on write: %d"
,
errno
));
}
}
#endif
/* DBUG_OFF */
#endif
/* DBUG_OFF */
DBUG_PRINT
(
"exit"
,
(
"%d"
,
r
));
DBUG_PRINT
(
"exit"
,
(
"%d"
,
r
));
...
@@ -346,7 +346,7 @@ int vio_close(Vio * vio)
...
@@ -346,7 +346,7 @@ int vio_close(Vio * vio)
}
}
if
(
r
)
if
(
r
)
{
{
DBUG_PRINT
(
"error"
,
(
"close() failed, error: %d"
,
errno
));
DBUG_PRINT
(
"
vio_
error"
,
(
"close() failed, error: %d"
,
errno
));
/* FIXME: error handling (not critical for MySQL) */
/* FIXME: error handling (not critical for MySQL) */
}
}
vio
->
type
=
VIO_CLOSED
;
vio
->
type
=
VIO_CLOSED
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment