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
458c4d31
Commit
458c4d31
authored
Feb 20, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gweir@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/bk/mysql-4.0
parents
ea9aa4d3
c198934d
Changes
50
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
77 additions
and
2945 deletions
+77
-2945
innobase/btr/btr0sea.c
innobase/btr/btr0sea.c
+0
-69
innobase/buf/buf0buf.c
innobase/buf/buf0buf.c
+0
-15
innobase/com/com0shm.c
innobase/com/com0shm.c
+4
-37
innobase/data/data0data.c
innobase/data/data0data.c
+0
-413
innobase/dict/dict0crea.c
innobase/dict/dict0crea.c
+27
-58
innobase/fsp/fsp0fsp.c
innobase/fsp/fsp0fsp.c
+4
-10
innobase/ha/ha0ha.c
innobase/ha/ha0ha.c
+0
-27
innobase/include/btr0cur.h
innobase/include/btr0cur.h
+0
-11
innobase/include/btr0sea.h
innobase/include/btr0sea.h
+0
-35
innobase/include/buf0buf.ic
innobase/include/buf0buf.ic
+3
-2
innobase/include/data0data.h
innobase/include/data0data.h
+0
-78
innobase/include/dict0crea.h
innobase/include/dict0crea.h
+0
-9
innobase/include/dict0dict.h
innobase/include/dict0dict.h
+0
-7
innobase/include/ibuf0ibuf.h
innobase/include/ibuf0ibuf.h
+0
-9
innobase/include/lock0lock.h
innobase/include/lock0lock.h
+0
-8
innobase/include/mem0dbg.h
innobase/include/mem0dbg.h
+4
-14
innobase/include/mem0mem.ic
innobase/include/mem0mem.ic
+0
-20
innobase/include/mtr0log.h
innobase/include/mtr0log.h
+0
-9
innobase/include/mtr0mtr.h
innobase/include/mtr0mtr.h
+0
-10
innobase/include/os0proc.h
innobase/include/os0proc.h
+0
-31
innobase/include/os0thread.h
innobase/include/os0thread.h
+0
-7
innobase/include/rem0cmp.ic
innobase/include/rem0cmp.ic
+0
-18
innobase/include/row0row.h
innobase/include/row0row.h
+0
-25
innobase/include/srv0srv.h
innobase/include/srv0srv.h
+1
-24
innobase/include/sync0sync.h
innobase/include/sync0sync.h
+0
-9
innobase/lock/lock0lock.c
innobase/lock/lock0lock.c
+5
-178
innobase/log/log0recv.c
innobase/log/log0recv.c
+7
-3
innobase/mem/mem0dbg.c
innobase/mem/mem0dbg.c
+1
-144
innobase/mtr/mtr0mtr.c
innobase/mtr/mtr0mtr.c
+1
-1
innobase/odbc/Makefile.am
innobase/odbc/Makefile.am
+0
-24
innobase/odbc/makefilewin
innobase/odbc/makefilewin
+0
-7
innobase/odbc/odbc0dummy.c
innobase/odbc/odbc0dummy.c
+0
-62
innobase/odbc/odbc0odbc.c
innobase/odbc/odbc0odbc.c
+0
-714
innobase/os/os0proc.c
innobase/os/os0proc.c
+0
-77
innobase/os/os0trash.c
innobase/os/os0trash.c
+0
-43
innobase/page/page0page.c
innobase/page/page0page.c
+0
-28
innobase/que/que0que.c
innobase/que/que0que.c
+0
-147
innobase/rem/rem0cmp.c
innobase/rem/rem0cmp.c
+1
-1
innobase/row/row0ins.c
innobase/row/row0ins.c
+1
-60
innobase/row/row0mysql.c
innobase/row/row0mysql.c
+4
-2
innobase/row/row0row.c
innobase/row/row0row.c
+0
-55
innobase/srv/srv0srv.c
innobase/srv/srv0srv.c
+3
-254
innobase/srv/srv0start.c
innobase/srv/srv0start.c
+0
-74
innobase/sync/sync0sync.c
innobase/sync/sync0sync.c
+0
-40
innobase/trx/trx0rec.c
innobase/trx/trx0rec.c
+0
-41
innobase/trx/trx0trx.c
innobase/trx/trx0trx.c
+0
-23
innobase/ut/ut0dbg.c
innobase/ut/ut0dbg.c
+0
-7
innobase/ut/ut0mem.c
innobase/ut/ut0mem.c
+1
-1
innobase/ut/ut0ut.c
innobase/ut/ut0ut.c
+1
-0
scripts/mysql_config.sh
scripts/mysql_config.sh
+9
-4
No files found.
innobase/btr/btr0sea.c
View file @
458c4d31
...
...
@@ -1497,75 +1497,6 @@ function_exit:
}
}
/************************************************************************
Prints info of the search system. */
void
btr_search_print_info
(
void
)
/*=======================*/
{
printf
(
"SEARCH SYSTEM INFO
\n
"
);
rw_lock_x_lock
(
&
btr_search_latch
);
/* ha_print_info(btr_search_sys->hash_index); */
rw_lock_x_unlock
(
&
btr_search_latch
);
}
/************************************************************************
Prints info of searches on an index. */
void
btr_search_index_print_info
(
/*========================*/
dict_index_t
*
index
)
/* in: index */
{
btr_search_t
*
info
;
printf
(
"INDEX SEARCH INFO
\n
"
);
rw_lock_x_lock
(
&
btr_search_latch
);
info
=
btr_search_get_info
(
index
);
printf
(
"Searches %lu, hash succ %lu, fail %lu, patt succ %lu
\n
"
,
info
->
n_searches
,
info
->
n_hash_succ
,
info
->
n_hash_fail
,
info
->
n_patt_succ
);
printf
(
"Total of page cur short succ for all indexes %lu
\n
"
,
page_cur_short_succ
);
rw_lock_x_unlock
(
&
btr_search_latch
);
}
/************************************************************************
Prints info of searches on a table. */
void
btr_search_table_print_info
(
/*========================*/
char
*
name
)
/* in: table name */
{
dict_table_t
*
table
;
dict_index_t
*
index
;
mutex_enter
(
&
(
dict_sys
->
mutex
));
table
=
dict_table_get_low
(
name
);
ut_a
(
table
);
mutex_exit
(
&
(
dict_sys
->
mutex
));
index
=
dict_table_get_first_index
(
table
);
while
(
index
)
{
btr_search_index_print_info
(
index
);
index
=
dict_table_get_next_index
(
index
);
}
}
/************************************************************************
Validates the search system. */
...
...
innobase/buf/buf0buf.c
View file @
458c4d31
...
...
@@ -1540,21 +1540,6 @@ buf_page_io_complete(
"InnoDB: Error: page n:o stored in the page read in is %lu, should be %lu!
\n
"
,
read_page_no
,
block
->
offset
);
}
#ifdef notdefined
if
(
block
->
offset
!=
0
&&
read_page_no
==
0
)
{
/* Check that the page is really uninited */
for
(
i
=
0
;
i
<
UNIV_PAGE_SIZE
;
i
++
)
{
if
(
*
((
block
->
frame
)
+
i
)
!=
'\0'
)
{
fprintf
(
stderr
,
"InnoDB: Error: page n:o in the page read in is 0, but page %lu is inited!
\n
"
,
block
->
offset
);
break
;
}
}
}
#endif
/* From version 3.23.38 up we store the page checksum
to the 4 first bytes of the page end lsn field */
...
...
innobase/com/com0shm.c
View file @
458c4d31
...
...
@@ -964,19 +964,6 @@ loop:
ut_ad
(
loop_count
<
2
);
#ifdef notdefined
if
(
!
com_shm_get_not_empty
(
map
))
{
/* There was no datagram, give up the time slice
for some writer thread to insert a datagram */
com_shm_exit
(
ep
);
os_thread_yield
();
com_shm_enter
(
ep
);
}
#endif
com_shm_enter
(
ep
);
if
(
!
com_shm_get_not_empty
(
map
))
{
...
...
@@ -1130,33 +1117,13 @@ loop:
ut_memcpy
(
com_shm_get_addr
(
map
),
com_shm_endpoint_get_addr
(
ep
),
sender_len
);
com_shm_set_not_empty
(
map
,
TRUE
);
#ifdef notdefined
com_shm_exit
(
ep2
);
/* Now we give up our time slice voluntarily to give some reader
thread chance to fetch the datagram */
os_thread_yield
();
com_shm_enter
(
ep2
);
if
(
com_shm_get_not_empty
(
map
))
{
#endif
com_shm_system_call_count
++
;
com_shm_exit
(
ep2
);
/* Signal the event */
com_shm_system_call_count
++
;
os_event_set
(
com_shm_endpoint_get_not_empty
(
ep2
)
);
com_shm_exit
(
ep2
);
return
(
0
);
/* Signal the event */
#ifdef notdefined
}
os_event_set
(
com_shm_endpoint_get_not_empty
(
ep2
));
com_shm_exit
(
ep2
);
return
(
0
);
#endif
}
innobase/data/data0data.c
View file @
458c4d31
...
...
@@ -725,416 +725,3 @@ dtuple_big_rec_free(
{
mem_heap_free
(
vector
->
heap
);
}
#ifdef notdefined
/******************************************************************
Generates random numbers, where 10/16 is uniformly
distributed between 0 and n1, 5/16 between 0 and n2,
and 1/16 between 0 and n3. */
static
ulint
dtuple_gen_rnd_ulint
(
/*=================*/
/* out: random ulint */
ulint
n1
,
ulint
n2
,
ulint
n3
)
{
ulint
m
;
ulint
n
;
m
=
ut_rnd_gen_ulint
()
%
16
;
if
(
m
<
10
)
{
n
=
n1
;
}
else
if
(
m
<
15
)
{
n
=
n2
;
}
else
{
n
=
n3
;
}
m
=
ut_rnd_gen_ulint
();
return
(
m
%
n
);
}
/***************************************************************
Generates a random tuple. */
dtuple_t
*
dtuple_gen_rnd_tuple
(
/*=================*/
/* out: pointer to the tuple */
mem_heap_t
*
heap
)
/* in: memory heap where generated */
{
ulint
n_fields
;
dfield_t
*
field
;
ulint
len
;
dtuple_t
*
tuple
;
ulint
i
;
ulint
j
;
byte
*
ptr
;
n_fields
=
dtuple_gen_rnd_ulint
(
5
,
30
,
300
)
+
1
;
tuple
=
dtuple_create
(
heap
,
n_fields
);
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
if
(
n_fields
<
7
)
{
len
=
dtuple_gen_rnd_ulint
(
5
,
30
,
400
);
}
else
{
len
=
dtuple_gen_rnd_ulint
(
7
,
5
,
17
);
}
field
=
dtuple_get_nth_field
(
tuple
,
i
);
if
(
len
==
0
)
{
dfield_set_data
(
field
,
NULL
,
UNIV_SQL_NULL
);
}
else
{
ptr
=
mem_heap_alloc
(
heap
,
len
);
dfield_set_data
(
field
,
ptr
,
len
-
1
);
for
(
j
=
0
;
j
<
len
;
j
++
)
{
*
ptr
=
(
byte
)(
65
+
dtuple_gen_rnd_ulint
(
22
,
22
,
22
));
ptr
++
;
}
}
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
500
,
0
);
}
ut_a
(
dtuple_validate
(
tuple
));
return
(
tuple
);
}
/*******************************************************************
Generates a test tuple for sort and comparison tests. */
void
dtuple_gen_test_tuple
(
/*==================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 3 fields */
ulint
i
)
/* in: a number < 512 */
{
ulint
j
;
dfield_t
*
field
;
void
*
data
=
NULL
;
ulint
len
=
0
;
for
(
j
=
0
;
j
<
3
;
j
++
)
{
switch
(
i
%
8
)
{
case
0
:
data
=
""
;
len
=
0
;
break
;
case
1
:
data
=
"A"
;
len
=
1
;
break
;
case
2
:
data
=
"AA"
;
len
=
2
;
break
;
case
3
:
data
=
"AB"
;
len
=
2
;
break
;
case
4
:
data
=
"B"
;
len
=
1
;
break
;
case
5
:
data
=
"BA"
;
len
=
2
;
break
;
case
6
:
data
=
"BB"
;
len
=
2
;
break
;
case
7
:
len
=
UNIV_SQL_NULL
;
break
;
}
field
=
dtuple_get_nth_field
(
tuple
,
2
-
j
);
dfield_set_data
(
field
,
data
,
len
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
i
=
i
/
8
;
}
ut_ad
(
dtuple_validate
(
tuple
));
}
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_test_tuple3
(
/*===================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with >= 3 fields */
ulint
i
,
/* in: a number < 1000000 */
ulint
type
,
/* in: DTUPLE_TEST_FIXED30, ... */
byte
*
buf
)
/* in: a buffer of size >= 16 bytes */
{
dfield_t
*
field
;
ulint
third_size
;
ut_ad
(
tuple
&&
buf
);
ut_ad
(
i
<
1000000
);
field
=
dtuple_get_nth_field
(
tuple
,
0
);
ut_strcpy
((
char
*
)
buf
,
"0000000"
);
buf
[
1
]
=
(
byte
)(
'0'
+
(
i
/
100000
)
%
10
);
buf
[
2
]
=
(
byte
)(
'0'
+
(
i
/
10000
)
%
10
);
buf
[
3
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
4
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
5
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
6
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
,
8
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
field
=
dtuple_get_nth_field
(
tuple
,
1
);
i
=
i
%
1000
;
/* ut_rnd_gen_ulint() % 1000000; */
ut_strcpy
((
char
*
)
buf
+
8
,
"0000000"
);
buf
[
9
]
=
(
byte
)(
'0'
+
(
i
/
100000
)
%
10
);
buf
[
10
]
=
(
byte
)(
'0'
+
(
i
/
10000
)
%
10
);
buf
[
11
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
12
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
13
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
14
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
+
8
,
8
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
field
=
dtuple_get_nth_field
(
tuple
,
2
);
data_rnd
+=
8757651
;
if
(
type
==
DTUPLE_TEST_FIXED30
)
{
third_size
=
30
;
}
else
if
(
type
==
DTUPLE_TEST_RND30
)
{
third_size
=
data_rnd
%
30
;
}
else
if
(
type
==
DTUPLE_TEST_RND3500
)
{
third_size
=
data_rnd
%
3500
;
}
else
if
(
type
==
DTUPLE_TEST_FIXED2000
)
{
third_size
=
2000
;
}
else
if
(
type
==
DTUPLE_TEST_FIXED3
)
{
third_size
=
3
;
}
else
{
ut_error
;
}
if
(
type
==
DTUPLE_TEST_FIXED30
)
{
dfield_set_data
(
field
,
"12345678901234567890123456789"
,
third_size
);
}
else
{
dfield_set_data
(
field
,
data_buf
,
third_size
);
}
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
ut_ad
(
dtuple_validate
(
tuple
));
}
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_search_tuple3
(
/*=====================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 1 or 2 fields */
ulint
i
,
/* in: a number < 1000000 */
byte
*
buf
)
/* in: a buffer of size >= 16 bytes */
{
dfield_t
*
field
;
ut_ad
(
tuple
&&
buf
);
ut_ad
(
i
<
1000000
);
field
=
dtuple_get_nth_field
(
tuple
,
0
);
ut_strcpy
((
char
*
)
buf
,
"0000000"
);
buf
[
1
]
=
(
byte
)(
'0'
+
(
i
/
100000
)
%
10
);
buf
[
2
]
=
(
byte
)(
'0'
+
(
i
/
10000
)
%
10
);
buf
[
3
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
4
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
5
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
6
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
,
8
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
if
(
dtuple_get_n_fields
(
tuple
)
==
1
)
{
return
;
}
field
=
dtuple_get_nth_field
(
tuple
,
1
);
i
=
(
i
*
1000
)
%
1000000
;
ut_strcpy
((
char
*
)
buf
+
8
,
"0000000"
);
buf
[
9
]
=
(
byte
)(
'0'
+
(
i
/
100000
)
%
10
);
buf
[
10
]
=
(
byte
)(
'0'
+
(
i
/
10000
)
%
10
);
buf
[
11
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
12
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
13
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
14
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
+
8
,
8
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
ut_ad
(
dtuple_validate
(
tuple
));
}
/*******************************************************************
Generates a test tuple for TPC-A speed test. */
void
dtuple_gen_test_tuple_TPC_A
(
/*========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with >= 3 fields */
ulint
i
,
/* in: a number < 10000 */
byte
*
buf
)
/* in: a buffer of size >= 16 bytes */
{
dfield_t
*
field
;
ulint
third_size
;
ut_ad
(
tuple
&&
buf
);
ut_ad
(
i
<
10000
);
field
=
dtuple_get_nth_field
(
tuple
,
0
);
ut_strcpy
((
char
*
)
buf
,
"0000"
);
buf
[
0
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
1
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
2
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
3
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
,
5
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
field
=
dtuple_get_nth_field
(
tuple
,
1
);
dfield_set_data
(
field
,
buf
+
8
,
5
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
field
=
dtuple_get_nth_field
(
tuple
,
2
);
third_size
=
90
;
dfield_set_data
(
field
,
data_buf
,
third_size
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
ut_ad
(
dtuple_validate
(
tuple
));
}
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_search_tuple_TPC_A
(
/*==========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 1 field */
ulint
i
,
/* in: a number < 10000 */
byte
*
buf
)
/* in: a buffer of size >= 16 bytes */
{
dfield_t
*
field
;
ut_ad
(
tuple
&&
buf
);
ut_ad
(
i
<
10000
);
field
=
dtuple_get_nth_field
(
tuple
,
0
);
ut_strcpy
((
char
*
)
buf
,
"0000"
);
buf
[
0
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
1
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
2
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
3
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
,
5
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
ut_ad
(
dtuple_validate
(
tuple
));
}
/*******************************************************************
Generates a test tuple for TPC-C speed test. */
void
dtuple_gen_test_tuple_TPC_C
(
/*========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with >= 12 fields */
ulint
i
,
/* in: a number < 100000 */
byte
*
buf
)
/* in: a buffer of size >= 16 bytes */
{
dfield_t
*
field
;
ulint
size
;
ulint
j
;
ut_ad
(
tuple
&&
buf
);
ut_ad
(
i
<
100000
);
field
=
dtuple_get_nth_field
(
tuple
,
0
);
buf
[
0
]
=
(
byte
)(
'0'
+
(
i
/
10000
)
%
10
);
buf
[
1
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
2
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
3
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
4
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
,
5
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
field
=
dtuple_get_nth_field
(
tuple
,
1
);
dfield_set_data
(
field
,
buf
,
5
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
for
(
j
=
0
;
j
<
10
;
j
++
)
{
field
=
dtuple_get_nth_field
(
tuple
,
2
+
j
);
size
=
24
;
dfield_set_data
(
field
,
data_buf
,
size
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
}
ut_ad
(
dtuple_validate
(
tuple
));
}
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_search_tuple_TPC_C
(
/*==========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 1 field */
ulint
i
,
/* in: a number < 100000 */
byte
*
buf
)
/* in: a buffer of size >= 16 bytes */
{
dfield_t
*
field
;
ut_ad
(
tuple
&&
buf
);
ut_ad
(
i
<
100000
);
field
=
dtuple_get_nth_field
(
tuple
,
0
);
buf
[
0
]
=
(
byte
)(
'0'
+
(
i
/
10000
)
%
10
);
buf
[
1
]
=
(
byte
)(
'0'
+
(
i
/
1000
)
%
10
);
buf
[
2
]
=
(
byte
)(
'0'
+
(
i
/
100
)
%
10
);
buf
[
3
]
=
(
byte
)(
'0'
+
(
i
/
10
)
%
10
);
buf
[
4
]
=
(
byte
)(
'0'
+
(
i
%
10
));
dfield_set_data
(
field
,
buf
,
5
);
dtype_set
(
dfield_get_type
(
field
),
DATA_VARCHAR
,
DATA_ENGLISH
,
100
,
0
);
ut_ad
(
dtuple_validate
(
tuple
));
}
#endif
/* notdefined */
innobase/dict/dict0crea.c
View file @
458c4d31
...
...
@@ -25,6 +25,11 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0roll.h"
#include "usr0sess.h"
/* Maximum lengths of identifiers in MySQL, in bytes */
#define MAX_TABLE_NAME_LEN 64
#define MAX_COLUMN_NAME_LEN 64
#define MAX_IDENTIFIER_LEN 255
/*********************************************************************
Based on a table object, this function builds the entry to be inserted
in the SYS_TABLES system table. */
...
...
@@ -316,34 +321,6 @@ dict_build_col_def_step(
return
(
DB_SUCCESS
);
}
#ifdef notdefined
/*************************************************************************
Creates the single index for a cluster: it contains all the columns of
the cluster definition in the order they were defined. */
static
void
dict_create_index_for_cluster_step
(
/*===============================*/
tab_node_t
*
node
)
/* in: table create node */
{
dict_index_t
*
index
;
ulint
i
;
dict_col_t
*
col
;
index
=
dict_mem_index_create
(
table
->
name
,
"IND_DEFAULT_CLUSTERED"
,
table
->
space
,
DICT_CLUSTERED
,
table
->
n_cols
);
for
(
i
=
0
;
i
<
table
->
n_cols
;
i
++
)
{
col
=
dict_table_get_nth_col
(
table
,
i
);
dict_mem_index_add_field
(
index
,
col
->
name
,
0
,
0
);
}
(
node
->
cluster
)
->
index
=
index
;
}
#endif
/*********************************************************************
Based on an index object, this function builds the entry to be inserted
in the SYS_INDEXES system table. */
...
...
@@ -727,27 +704,6 @@ dict_drop_index_tree(
page_rec_write_index_page_no
(
rec
,
DICT_SYS_INDEXES_PAGE_NO_FIELD
,
FIL_NULL
,
mtr
);
}
#ifdef notdefined
/*************************************************************************
Creates the default clustered index for a table: the records are ordered
by row id. */
void
dict_create_default_index
(
/*======================*/
dict_table_t
*
table
,
/* in: table */
trx_t
*
trx
)
/* in: transaction handle */
{
dict_index_t
*
index
;
index
=
dict_mem_index_create
(
table
->
name
,
"IND_DEFAULT_CLUSTERED"
,
table
->
space
,
DICT_CLUSTERED
,
0
);
dict_create_index
(
index
,
trx
);
}
#endif
/*************************************************************************
Creates a table create graph. */
...
...
@@ -1198,6 +1154,7 @@ dict_create_add_foreigns_to_dictionary(
que_t
*
graph
;
ulint
number
=
start_id
+
1
;
ulint
len
;
ulint
namelen
;
ulint
error
;
char
*
ebuf
=
dict_foreign_err_buf
;
ulint
i
;
...
...
@@ -1228,15 +1185,21 @@ loop:
"PROCEDURE ADD_FOREIGN_DEFS_PROC () IS
\n
"
"BEGIN
\n
"
);
namelen
=
strlen
(
table
->
name
);
ut_a
(
namelen
<
MAX_TABLE_NAME_LEN
);
if
(
foreign
->
id
==
NULL
)
{
/* Generate a new constraint id */
foreign
->
id
=
mem_heap_alloc
(
foreign
->
heap
,
ut_strlen
(
table
->
name
)
+
20
);
foreign
->
id
=
mem_heap_alloc
(
foreign
->
heap
,
namelen
+
20
);
/* no overflow if number < 1e13 */
sprintf
(
foreign
->
id
,
"%s_ibfk_%lu"
,
table
->
name
,
number
);
number
++
;
}
ut_a
(
strlen
(
foreign
->
id
)
<
MAX_IDENTIFIER_LEN
);
ut_a
(
len
<
(
sizeof
buf
)
-
46
-
2
*
MAX_TABLE_NAME_LEN
-
MAX_IDENTIFIER_LEN
-
20
);
len
+=
sprintf
(
buf
+
len
,
"INSERT INTO SYS_FOREIGN VALUES('%s', '%s', '%s', %lu);
\n
"
,
foreign
->
id
,
...
...
@@ -1246,6 +1209,9 @@ loop:
+
(
foreign
->
type
<<
24
));
for
(
i
=
0
;
i
<
foreign
->
n_fields
;
i
++
)
{
ut_a
(
len
<
(
sizeof
buf
)
-
51
-
2
*
MAX_COLUMN_NAME_LEN
-
MAX_IDENTIFIER_LEN
-
20
);
len
+=
sprintf
(
buf
+
len
,
"INSERT INTO SYS_FOREIGN_COLS VALUES('%s', %lu, '%s', '%s');
\n
"
,
...
...
@@ -1255,6 +1221,7 @@ loop:
foreign
->
referenced_col_names
[
i
]);
}
ut_a
(
len
<
(
sizeof
buf
)
-
19
)
len
+=
sprintf
(
buf
+
len
,
"COMMIT WORK;
\n
END;
\n
"
);
graph
=
pars_sql
(
buf
);
...
...
@@ -1276,15 +1243,15 @@ loop:
if
(
error
==
DB_DUPLICATE_KEY
)
{
mutex_enter
(
&
dict_foreign_err_mutex
);
ut_sprintf_timestamp
(
dict_foreign_err_buf
);
ut_sprintf_timestamp
(
ebuf
);
ut_a
(
strlen
(
ebuf
)
<
DICT_FOREIGN_ERR_BUF_LEN
-
MAX_TABLE_NAME_LEN
-
MAX_IDENTIFIER_LEN
-
201
);
sprintf
(
ebuf
+
strlen
(
ebuf
),
" Error in foreign key constraint creation for table %
.500
s.
\n
"
"A foreign key constraint of name %
.500
s
\n
"
" Error in foreign key constraint creation for table %s.
\n
"
"A foreign key constraint of name %s
\n
"
"already exists (note that internally InnoDB adds 'databasename/'
\n
"
"in front of the user-defined constraint name).
\n
"
,
table
->
name
,
foreign
->
id
);
ut_a
(
strlen
(
ebuf
)
<
DICT_FOREIGN_ERR_BUF_LEN
);
mutex_exit
(
&
dict_foreign_err_mutex
);
return
(
error
);
...
...
@@ -1297,8 +1264,10 @@ loop:
mutex_enter
(
&
dict_foreign_err_mutex
);
ut_sprintf_timestamp
(
ebuf
);
ut_a
(
strlen
(
ebuf
)
<
DICT_FOREIGN_ERR_BUF_LEN
-
MAX_TABLE_NAME_LEN
-
124
);
sprintf
(
ebuf
+
strlen
(
ebuf
),
" Internal error in foreign key constraint creation for table %
.500
s.
\n
"
" Internal error in foreign key constraint creation for table %s.
\n
"
"See the MySQL .err log in the datadir for more information.
\n
"
,
table
->
name
);
mutex_exit
(
&
dict_foreign_err_mutex
);
...
...
innobase/fsp/fsp0fsp.c
View file @
458c4d31
...
...
@@ -764,19 +764,12 @@ fsp_init_file_page_low(
byte
*
ptr
)
/* in: pointer to a page */
{
page_t
*
page
;
#ifdef UNIV_BASIC_LOG_DEBUG
ulint
i
;
#endif
page
=
buf_frame_align
(
ptr
);
buf_block_align
(
page
)
->
check_index_page_at_flush
=
FALSE
;
#ifdef UNIV_BASIC_LOG_DEBUG
/* printf("In log debug version: Erase the contents of the file page\n");
*/
for
(
i
=
0
;
i
<
UNIV_PAGE_SIZE
;
i
++
)
{
page
[
i
]
=
0xFF
;
}
#ifdef UNIV_BASIC_LOG_DEBUG
memset
(
page
,
0xff
,
UNIV_PAGE_SIZE
);
#endif
mach_write_to_8
(
page
+
UNIV_PAGE_SIZE
-
FIL_PAGE_END_LSN_OLD_CHKSUM
,
ut_dulint_zero
);
...
...
@@ -786,6 +779,7 @@ fsp_init_file_page_low(
/***************************************************************
Inits a file page whose prior contents should be ignored. */
static
void
fsp_init_file_page
(
/*===============*/
...
...
innobase/ha/ha0ha.c
View file @
458c4d31
...
...
@@ -59,33 +59,6 @@ ha_create(
return
(
table
);
}
/*****************************************************************
Checks that a hash table node is in the chain. */
ibool
ha_node_in_chain
(
/*=============*/
/* out: TRUE if in chain */
hash_cell_t
*
cell
,
/* in: hash table cell */
ha_node_t
*
node
)
/* in: external chain node */
{
ha_node_t
*
node2
;
node2
=
cell
->
node
;
while
(
node2
!=
NULL
)
{
if
(
node2
==
node
)
{
return
(
TRUE
);
}
node2
=
node2
->
next
;
}
return
(
FALSE
);
}
/*****************************************************************
Inserts an entry into a hash table. If an entry with the same fold number
is found, its node is updated to point to the new data, and no new node
...
...
innobase/include/btr0cur.h
View file @
458c4d31
...
...
@@ -365,17 +365,6 @@ btr_cur_parse_update_in_place(
byte
*
ptr
,
/* in: buffer */
byte
*
end_ptr
,
/* in: buffer end */
page_t
*
page
);
/* in: page or NULL */
/***************************************************************
Parses a redo log record of updating a record, but not in-place. */
byte
*
btr_cur_parse_opt_update
(
/*=====================*/
/* out: end of log record or NULL */
byte
*
ptr
,
/* in: buffer */
byte
*
end_ptr
,
/* in: buffer end */
page_t
*
page
,
/* in: page or NULL */
mtr_t
*
mtr
);
/* in: mtr or NULL */
/********************************************************************
Parses the redo log record for delete marking or unmarking of a clustered
index record. */
...
...
innobase/include/btr0sea.h
View file @
458c4d31
...
...
@@ -49,21 +49,6 @@ btr_search_info_update(
dict_index_t
*
index
,
/* in: index of the cursor */
btr_cur_t
*
cursor
);
/* in: cursor which was just positioned */
/**********************************************************************
Tries to guess the right search position based on the search pattern info
of the index. */
ibool
btr_search_guess_on_pattern
(
/*========================*/
/* out: TRUE if succeeded */
dict_index_t
*
index
,
/* in: index */
btr_search_t
*
info
,
/* in: index search info */
dtuple_t
*
tuple
,
/* in: logical record */
ulint
mode
,
/* in: PAGE_CUR_L, ... */
ulint
latch_mode
,
/* in: BTR_SEARCH_LEAF, ... */
btr_cur_t
*
cursor
,
/* out: tree cursor */
mtr_t
*
mtr
);
/* in: mtr */
/**********************************************************************
Tries to guess the right search position based on the hash search info
of the index. Note that if mode is PAGE_CUR_LE, which is used in inserts,
and the function returns TRUE, then cursor->up_match and cursor->low_match
...
...
@@ -140,26 +125,6 @@ btr_search_update_hash_on_delete(
record to delete using btr_cur_search_...,
the record is not yet deleted */
/************************************************************************
Prints info of the search system. */
void
btr_search_print_info
(
void
);
/*=======================*/
/************************************************************************
Prints info of searches on an index. */
void
btr_search_index_print_info
(
/*========================*/
dict_index_t
*
index
);
/* in: index */
/************************************************************************
Prints info of searches on a table. */
void
btr_search_table_print_info
(
/*========================*/
char
*
name
);
/* in: table name */
/************************************************************************
Validates the search system. */
ibool
...
...
innobase/include/buf0buf.ic
View file @
458c4d31
...
...
@@ -501,6 +501,7 @@ buf_frame_get_modify_clock(
return(block->modify_clock);
}
#ifdef UNIV_SYNC_DEBUG
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
...
...
@@ -519,7 +520,7 @@ buf_block_buf_fix_inc_debug(
block->buf_fix_count++;
}
#else /* UNIV_SYNC_DEBUG */
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
...
...
@@ -530,7 +531,7 @@ buf_block_buf_fix_inc(
{
block->buf_fix_count++;
}
#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Returns the control block of a file page, NULL if not found. */
UNIV_INLINE
...
...
innobase/include/data0data.h
View file @
458c4d31
...
...
@@ -375,84 +375,6 @@ dtuple_big_rec_free(
/*================*/
big_rec_t
*
vector
);
/* in, own: big rec vector; it is
freed in this function */
/***************************************************************
Generates a random tuple. */
dtuple_t
*
dtuple_gen_rnd_tuple
(
/*=================*/
/* out: pointer to the tuple */
mem_heap_t
*
heap
);
/* in: memory heap where generated */
/*******************************************************************
Generates a test tuple for sort and comparison tests. */
void
dtuple_gen_test_tuple
(
/*==================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 3 fields */
ulint
i
);
/* in: a number, 0 <= i < 512 */
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_test_tuple3
(
/*===================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 3 fields */
ulint
i
,
/* in: a number < 1000000 */
ulint
type
,
/* in: DTUPLE_TEST_FIXED30, ... */
byte
*
buf
);
/* in: a buffer of size >= 8 bytes */
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_search_tuple3
(
/*=====================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 1 or 2 fields */
ulint
i
,
/* in: a number < 1000000 */
byte
*
buf
);
/* in: a buffer of size >= 8 bytes */
/*******************************************************************
Generates a test tuple for TPC-A speed test. */
void
dtuple_gen_test_tuple_TPC_A
(
/*========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with >= 3 fields */
ulint
i
,
/* in: a number < 10000 */
byte
*
buf
);
/* in: a buffer of size >= 16 bytes */
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_search_tuple_TPC_A
(
/*==========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 1 field */
ulint
i
,
/* in: a number < 10000 */
byte
*
buf
);
/* in: a buffer of size >= 16 bytes */
/*******************************************************************
Generates a test tuple for TPC-C speed test. */
void
dtuple_gen_test_tuple_TPC_C
(
/*========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with >= 12 fields */
ulint
i
,
/* in: a number < 100000 */
byte
*
buf
);
/* in: a buffer of size >= 16 bytes */
/*******************************************************************
Generates a test tuple for B-tree speed tests. */
void
dtuple_gen_search_tuple_TPC_C
(
/*==========================*/
dtuple_t
*
tuple
,
/* in/out: a tuple with 1 field */
ulint
i
,
/* in: a number < 100000 */
byte
*
buf
);
/* in: a buffer of size >= 16 bytes */
/* Types of the third field in dtuple_gen_test_tuple3 */
#define DTUPLE_TEST_FIXED30 1
#define DTUPLE_TEST_RND30 2
#define DTUPLE_TEST_RND3500 3
#define DTUPLE_TEST_FIXED2000 4
#define DTUPLE_TEST_FIXED3 5
/*######################################################################*/
...
...
innobase/include/dict0crea.h
View file @
458c4d31
...
...
@@ -16,15 +16,6 @@ Created 1/8/1996 Heikki Tuuri
#include "row0types.h"
#include "mtr0mtr.h"
/*************************************************************************
Creates the default clustered index for a table: the records are ordered
by row id. */
void
dict_create_default_index
(
/*======================*/
dict_table_t
*
table
,
/* in: table */
trx_t
*
trx
);
/* in: transaction handle */
/*************************************************************************
Creates a table create graph. */
...
...
innobase/include/dict0dict.h
View file @
458c4d31
...
...
@@ -658,13 +658,6 @@ dict_index_get_tree(
/* out: index tree */
dict_index_t
*
index
);
/* in: index */
/*************************************************************************
Gets the column data type. */
UNIV_INLINE
dtype_t
*
dict_col_get_type
(
/*==============*/
dict_col_t
*
col
);
/*************************************************************************
Gets the field order criterion. */
UNIV_INLINE
ulint
...
...
innobase/include/ibuf0ibuf.h
View file @
458c4d31
...
...
@@ -170,15 +170,6 @@ ibuf_page_low(
mtr_t
*
mtr
);
/* in: mtr which will contain an x-latch to the
bitmap page if the page is not one of the fixed
address ibuf pages */
/*************************************************************************
Checks if an index page has so much free space that the free bit should
be set TRUE in the ibuf bitmap. */
ibool
ibuf_index_page_has_free
(
/*=====================*/
/* out: TRUE if there is enough free space */
page_t
*
page
);
/* in: non-unique secondary index page */
/***************************************************************************
Frees excess pages from the ibuf free list. This function is called when an OS
thread calls fsp services to allocate a new file segment, or a new page to a
...
...
innobase/include/lock0lock.h
View file @
458c4d31
...
...
@@ -442,14 +442,6 @@ lock_rec_hash(
ulint
space
,
/* in: space */
ulint
page_no
);
/* in: page number */
/*************************************************************************
Gets the mutex protecting record locks on a given page address. */
mutex_t
*
lock_rec_get_mutex_for_addr
(
/*========================*/
ulint
space
,
/* in: space id */
ulint
page_no
);
/* in: page number */
/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
ibool
...
...
innobase/include/mem0dbg.h
View file @
458c4d31
...
...
@@ -60,6 +60,7 @@ mem_heap_validate_or_print(
ulint
*
n_blocks
);
/* out: number of blocks in the heap,
if a NULL pointer is passed as this
argument, it is ignored */
#ifdef UNIV_MEM_DEBUG
/******************************************************************
Prints the contents of a memory heap. */
...
...
@@ -67,6 +68,7 @@ void
mem_heap_print
(
/*===========*/
mem_heap_t
*
heap
);
/* in: memory heap */
#endif
/* UNIV_MEM_DEBUG */
/******************************************************************
Checks that an object is a memory heap (or a block of it) */
...
...
@@ -83,20 +85,7 @@ mem_heap_validate(
/*==============*/
/* out: TRUE if ok */
mem_heap_t
*
heap
);
/* in: memory heap */
/*********************************************************************
Prints information of dynamic memory usage and currently live
memory heaps or buffers. Can only be used in the debug version. */
void
mem_print_info
(
void
);
/*=================*/
/*********************************************************************
Prints information of dynamic memory usage and currently allocated memory
heaps or buffers since the last ..._print_info or..._print_new_info. */
void
mem_print_new_info
(
void
);
/*====================*/
#ifdef UNIV_MEM_DEBUG
/*********************************************************************
TRUE if no memory is currently allocated. */
...
...
@@ -118,6 +107,7 @@ ibool
mem_validate
(
void
);
/*===============*/
/* out: TRUE if ok */
#endif
/* UNIV_MEM_DEBUG */
/****************************************************************
Tries to find neigboring memory allocation blocks and dumps to stderr
the neighborhood of a given pointer. */
...
...
innobase/include/mem0mem.ic
View file @
458c4d31
...
...
@@ -493,18 +493,6 @@ mem_alloc_func(
ulint line /* in: line where created */
)
{
#ifdef notdefined
void* buf;
buf = mem_area_alloc(n, mem_comm_pool);
#ifdef UNIV_SET_MEM_TO_ZERO
memset(buf, '\0', n);
#endif
return(buf);
#else
mem_heap_t* heap;
void* buf;
...
...
@@ -525,8 +513,6 @@ mem_alloc_func(
ut_a((byte*)heap == (byte*)buf - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
return(buf);
#endif
}
/*******************************************************************
...
...
@@ -542,17 +528,11 @@ mem_free_func(
ulint line /* in: line where created */
)
{
#ifdef notdefined
mem_area_free(ptr, mem_comm_pool);
#else
mem_heap_t* heap;
heap = (mem_heap_t*)((byte*)ptr - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
mem_heap_free_func(heap, file_name, line);
#endif
}
/*********************************************************************
...
...
innobase/include/mtr0log.h
View file @
458c4d31
...
...
@@ -120,15 +120,6 @@ mlog_write_initial_log_record_fast(
byte
type
,
/* in: log item type: MLOG_1BYTE, ... */
byte
*
log_ptr
,
/* in: pointer to mtr log which has been opened */
mtr_t
*
mtr
);
/* in: mtr */
/****************************************************************
Writes the contents of a mini-transaction log, if any, to the database log. */
dulint
mlog_write
(
/*=======*/
dyn_array_t
*
mlog
,
/* in: mlog */
ibool
*
modifications
);
/* out: TRUE if there were
log items to write */
/************************************************************
Parses an initial log record written by mlog_write_initial_log_record. */
...
...
innobase/include/mtr0mtr.h
View file @
458c4d31
...
...
@@ -126,16 +126,6 @@ void
mtr_commit
(
/*=======*/
mtr_t
*
mtr
);
/* in: mini-transaction */
/****************************************************************
Writes to the database log the full contents of the pages that this mtr is
the first to modify in the buffer pool. This function is called when the
database is in the online backup state. */
void
mtr_log_write_backup_entries
(
/*=========================*/
mtr_t
*
mtr
,
/* in: mini-transaction */
dulint
backup_lsn
);
/* in: online backup lsn */
/**************************************************************
Sets and returns a savepoint in mtr. */
UNIV_INLINE
...
...
innobase/include/os0proc.h
View file @
458c4d31
...
...
@@ -32,37 +32,6 @@ os_mem_alloc_nocache(
/*=================*/
/* out: allocated memory */
ulint
n
);
/* in: number of bytes */
#ifdef notdefined
/********************************************************************
Creates a new process. */
ibool
os_process_create
(
/*==============*/
char
*
name
,
/* in: name of the executable to start
or its full path name */
char
*
cmd
,
/* in: command line for the starting
process, or NULL if no command line
specified */
os_process_t
*
proc
,
/* out: handle to the process */
os_process_id_t
*
id
);
/* out: process id */
/**************************************************************************
Exits a process. */
void
os_process_exit
(
/*============*/
ulint
code
);
/* in: exit code */
/**************************************************************************
Gets process exit code. */
ibool
os_process_get_exit_code
(
/*=====================*/
/* out: TRUE if succeed, FALSE if fail */
os_process_t
proc
,
/* in: handle to the process */
ulint
*
code
);
/* out: exit code */
#endif
/********************************************************************
Sets the priority boost for threads released from waiting within the current
process. */
...
...
innobase/include/os0thread.h
View file @
458c4d31
...
...
@@ -99,13 +99,6 @@ os_thread_t
os_thread_get_curr
(
void
);
/*====================*/
/*********************************************************************
Waits for a thread to terminate. */
void
os_thread_wait
(
/*===========*/
os_thread_t
thread
);
/* in: thread to wait */
/*********************************************************************
Advises the os to give up remainder of the thread's time slice. */
void
...
...
innobase/include/rem0cmp.ic
View file @
458c4d31
...
...
@@ -6,24 +6,6 @@ Comparison services for records
Created 7/1/1994 Heikki Tuuri
************************************************************************/
/*****************************************************************
This function is used to compare two data fields for which we know the
data type. */
int
cmp_data_data_slow(
/*===============*/
/* out: 1, 0, -1, if data1 is greater, equal,
less than data2, respectively */
dtype_t* cur_type,/* in: data type of the fields */
byte* data1, /* in: data field (== a pointer to a memory
buffer) */
ulint len1, /* in: data field length or UNIV_SQL_NULL */
byte* data2, /* in: data field (== a pointer to a memory
buffer) */
ulint len2); /* in: data field length or UNIV_SQL_NULL */
/*****************************************************************
This function is used to compare two data fields for which we know the
data type. */
...
...
innobase/include/row0row.h
View file @
458c4d31
...
...
@@ -68,16 +68,6 @@ row_build_index_entry(
dict_index_t
*
index
,
/* in: index on the table */
mem_heap_t
*
heap
);
/* in: memory heap from which the memory for
the index entry is allocated */
/*********************************************************************
Builds an index entry from a row. */
void
row_build_index_entry_to_tuple
(
/*===========================*/
dtuple_t
*
entry
,
/* in/out: index entry; the dtuple must have
enough fields for the index! */
dtuple_t
*
row
,
/* in: row */
dict_index_t
*
index
);
/* in: index on the table */
/***********************************************************************
An inverse function to dict_row_build_index_entry. Builds a row from a
record in a clustered index. */
...
...
@@ -103,21 +93,6 @@ row_build(
mem_heap_t
*
heap
);
/* in: memory heap from which the memory
needed is allocated */
/***********************************************************************
An inverse function to dict_row_build_index_entry. Builds a row from a
record in a clustered index. */
void
row_build_to_tuple
(
/*===============*/
dtuple_t
*
row
,
/* in/out: row built; see the NOTE below! */
dict_index_t
*
index
,
/* in: clustered index */
rec_t
*
rec
);
/* in: record in the clustered index;
NOTE: the data fields in the row will point
directly into this record, therefore,
the buffer page of this record must be
at least s-latched and the latch held
as long as the row dtuple is used! */
/***********************************************************************
Converts an index record to a typed data tuple. */
dtuple_t
*
...
...
innobase/include/srv0srv.h
View file @
458c4d31
...
...
@@ -209,13 +209,7 @@ srv_boot(void);
/*==========*/
/* out: DB_SUCCESS or error code */
/*************************************************************************
Initializes the server. */
void
srv_init
(
void
);
/*==========*/
/*************************************************************************
Frees the OS fast mutex created in srv_init(). */
Frees the OS fast mutex created in srv_boot(). */
void
srv_free
(
void
);
...
...
@@ -265,23 +259,6 @@ srv_master_thread(
/* out: a dummy parameter */
void
*
arg
);
/* in: a dummy parameter required by
os_thread_create */
/*************************************************************************
Reads a keyword and a value from a file. */
ulint
srv_read_init_val
(
/*==============*/
/* out: DB_SUCCESS or error code */
FILE
*
initfile
,
/* in: file pointer */
char
*
keyword
,
/* in: keyword before value(s), or NULL if
no keyword read */
char
*
str_buf
,
/* in/out: buffer for a string value to read,
buffer size must be 10000 bytes, if NULL
then not read */
ulint
*
num_val
,
/* out: numerical value to read, if NULL
then not read */
ibool
print_not_err
);
/* in: if TRUE, then we will not print
error messages to console */
/***********************************************************************
Tells the Innobase server that there has been activity in the database
and wakes up the master thread if it is suspended (not sleeping). Used
...
...
innobase/include/sync0sync.h
View file @
458c4d31
...
...
@@ -234,15 +234,6 @@ mutex_get_waiters(
/*==============*/
/* out: value to set */
mutex_t
*
mutex
);
/* in: mutex */
/**********************************************************************
Implements the memory barrier operation which makes a serialization point to
the instruction flow. This is needed because the Pentium may speculatively
execute reads before preceding writes are committed. We could also use here
any LOCKed instruction (see Intel Software Dev. Manual, Vol. 3). */
void
mutex_fence
(
void
);
/*=============*/
/*
LATCHING ORDER WITHIN THE DATABASE
...
...
innobase/lock/lock0lock.c
View file @
458c4d31
...
...
@@ -343,179 +343,6 @@ lock_deadlock_recursive(
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)
#define lock_mutex_exit_kernel() mutex_exit(&kernel_mutex)
#ifdef notdefined
/*************************************************************************
Reserves the kernel mutex. This function is used in this module to allow
monitoring the contention degree on the kernel mutex caused by the lock
operations. */
UNIV_INLINE
void
lock_mutex_enter_kernel
(
void
)
/*=========================*/
{
mutex_enter
(
&
kernel_mutex
);
}
/*************************************************************************
Releases the kernel mutex. This function is used in this module to allow
monitoring the contention degree on the kernel mutex caused by the lock
operations. */
UNIV_INLINE
void
lock_mutex_exit_kernel
(
void
)
/*=========================*/
{
mutex_exit
(
&
kernel_mutex
);
}
#endif
#ifdef notdefined
/*************************************************************************
Gets the mutex protecting record locks for a page in the buffer pool. */
UNIV_INLINE
mutex_t
*
lock_rec_get_mutex
(
/*===============*/
byte
*
ptr
)
/* in: pointer to somewhere within a buffer frame */
{
return
(
buf_frame_get_lock_mutex
(
ptr
));
}
/*************************************************************************
Reserves the mutex protecting record locks for a page in the buffer pool. */
UNIV_INLINE
void
lock_rec_mutex_enter
(
/*=================*/
byte
*
ptr
)
/* in: pointer to somewhere within a buffer frame */
{
mutex_enter
(
lock_rec_get_mutex
(
ptr
));
}
/*************************************************************************
Releases the mutex protecting record locks for a page in the buffer pool. */
UNIV_INLINE
void
lock_rec_mutex_exit
(
/*================*/
byte
*
ptr
)
/* in: pointer to somewhere within a buffer frame */
{
mutex_exit
(
lock_rec_get_mutex
(
ptr
));
}
/*************************************************************************
Checks if the caller owns the mutex to record locks of a page. Works only in
the debug version. */
UNIV_INLINE
ibool
lock_rec_mutex_own
(
/*===============*/
/* out: TRUE if the current OS thread has reserved the
mutex */
byte
*
ptr
)
/* in: pointer to somewhere within a buffer frame */
{
return
(
mutex_own
(
lock_rec_get_mutex
(
ptr
)));
}
/*************************************************************************
Gets the mutex protecting record locks on a given page address. */
mutex_t
*
lock_rec_get_mutex_for_addr
(
/*========================*/
ulint
space
,
/* in: space id */
ulint
page_no
)
/* in: page number */
{
return
(
hash_get_mutex
(
lock_sys
->
rec_hash
,
lock_rec_fold
(
space
,
page_no
)));
}
/*************************************************************************
Checks if the caller owns the mutex to record locks of a page. Works only in
the debug version. */
UNIV_INLINE
ibool
lock_rec_mutex_own_addr
(
/*====================*/
ulint
space
,
/* in: space id */
ulint
page_no
)
/* in: page number */
{
return
(
mutex_own
(
lock_rec_get_mutex_for_addr
(
space
,
page_no
)));
}
/*************************************************************************
Reserves all the mutexes protecting record locks. */
UNIV_INLINE
void
lock_rec_mutex_enter_all
(
void
)
/*==========================*/
{
hash_table_t
*
table
;
ulint
n_mutexes
;
ulint
i
;
table
=
lock_sys
->
rec_hash
;
n_mutexes
=
table
->
n_mutexes
;
for
(
i
=
0
;
i
<
n_mutexes
;
i
++
)
{
mutex_enter
(
hash_get_nth_mutex
(
table
,
i
));
}
}
/*************************************************************************
Releases all the mutexes protecting record locks. */
UNIV_INLINE
void
lock_rec_mutex_exit_all
(
void
)
/*=========================*/
{
hash_table_t
*
table
;
ulint
n_mutexes
;
ulint
i
;
table
=
lock_sys
->
rec_hash
;
n_mutexes
=
table
->
n_mutexes
;
for
(
i
=
0
;
i
<
n_mutexes
;
i
++
)
{
mutex_exit
(
hash_get_nth_mutex
(
table
,
i
));
}
}
/*************************************************************************
Checks that the current OS thread owns all the mutexes protecting record
locks. */
UNIV_INLINE
ibool
lock_rec_mutex_own_all
(
void
)
/*========================*/
/* out: TRUE if owns all */
{
hash_table_t
*
table
;
ulint
n_mutexes
;
ibool
owns_yes
=
TRUE
;
ulint
i
;
table
=
lock_sys
->
rec_hash
;
n_mutexes
=
table
->
n_mutexes
;
for
(
i
=
0
;
i
<
n_mutexes
;
i
++
)
{
if
(
!
mutex_own
(
hash_get_nth_mutex
(
table
,
i
)))
{
owns_yes
=
FALSE
;
}
}
return
(
owns_yes
);
}
#endif
/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
...
...
@@ -2022,7 +1849,7 @@ possible, enqueues a waiting lock request. This is a low-level function
which does NOT look at implicit locks! Checks lock compatibility within
explicit locks. This function sets a normal next-key lock, or in the case
of a page supremum record, a gap type lock. */
static
ulint
lock_rec_lock
(
/*==========*/
...
...
@@ -2104,7 +1931,7 @@ lock_rec_has_to_wait_in_queue(
/*****************************************************************
Grants a lock to a waiting lock request and releases the waiting
transaction. */
static
void
lock_grant
(
/*=======*/
...
...
@@ -2171,7 +1998,7 @@ lock_rec_cancel(
Removes a record lock request, waiting or granted, from the queue and
grants locks to other transactions in the queue if they now are entitled
to a lock. NOTE: all record locks contained in in_lock are removed. */
static
void
lock_rec_dequeue_from_page
(
/*=======================*/
...
...
@@ -2342,7 +2169,7 @@ lock_rec_inherit_to_gap(
Makes a record to inherit the gap locks (except LOCK_INSERT_INTENTION type)
of another record as gap type locks, but does not reset the lock bits of the
other record. Also waiting lock requests are inherited as GRANTED gap locks. */
static
void
lock_rec_inherit_to_gap_if_gap_lock
(
/*================================*/
...
...
@@ -3582,7 +3409,7 @@ lock_table_has_to_wait_in_queue(
Removes a table lock request, waiting or granted, from the queue and grants
locks to other transactions in the queue, if they now are entitled to a
lock. */
static
void
lock_table_dequeue
(
/*===============*/
...
...
innobase/log/log0recv.c
View file @
458c4d31
...
...
@@ -167,9 +167,10 @@ recv_sys_empty_hash(void)
recv_sys
->
addr_hash
=
hash_create
(
buf_pool_get_curr_size
()
/
256
);
}
#ifndef UNIV_LOG_DEBUG
/************************************************************
Frees the recovery system. */
static
void
recv_sys_free
(
void
)
/*===============*/
...
...
@@ -186,6 +187,7 @@ recv_sys_free(void)
mutex_exit
(
&
(
recv_sys
->
mutex
));
}
#endif
/* !UNIV_LOG_DEBUG */
/************************************************************
Truncates possible corrupted or extra records from a log group. */
...
...
@@ -343,7 +345,7 @@ Copies a log segment from the most up-to-date log group to the other log
groups, so that they all contain the latest log data. Also writes the info
about the latest checkpoint to the groups, and inits the fields in the group
memory structs to up-to-date values. */
static
void
recv_synchronize_groups
(
/*====================*/
...
...
@@ -1767,10 +1769,11 @@ recv_calc_lsn_on_data_add(
return
(
ut_dulint_add
(
lsn
,
lsn_len
));
}
#ifdef UNIV_LOG_DEBUG
/***********************************************************
Checks that the parser recognizes incomplete initial segments of a log
record as incomplete. */
static
void
recv_check_incomplete_log_recs
(
/*===========================*/
...
...
@@ -1788,6 +1791,7 @@ recv_check_incomplete_log_recs(
&
page_no
,
&
body
));
}
}
#endif
/* UNIV_LOG_DEBUG */
/***********************************************************
Prints diagnostic info of corrupt log. */
...
...
innobase/mem/mem0dbg.c
View file @
458c4d31
...
...
@@ -582,130 +582,7 @@ mem_heap_validate(
return
(
TRUE
);
}
/*********************************************************************
Prints information of dynamic memory usage and currently allocated
memory heaps or buffers. Can only be used in the debug version. */
static
void
mem_print_info_low
(
/*===============*/
ibool
print_all
__attribute__
((
unused
)))
/* in: if TRUE, all heaps are printed,
else only the heaps allocated after the
previous call of this function */
{
#ifdef UNIV_MEM_DEBUG
mem_hash_node_t
*
node
;
ulint
n_heaps
=
0
;
ulint
allocated_mem
;
ulint
ph_size
;
ulint
total_allocated_mem
=
0
;
ibool
error
;
ulint
n_blocks
;
#endif
FILE
*
outfile
;
/* outfile = fopen("ibdebug", "a"); */
outfile
=
stdout
;
fprintf
(
outfile
,
"
\n
"
);
fprintf
(
outfile
,
"________________________________________________________
\n
"
);
fprintf
(
outfile
,
"MEMORY ALLOCATION INFORMATION
\n\n
"
);
#ifndef UNIV_MEM_DEBUG
mem_pool_print_info
(
outfile
,
mem_comm_pool
);
fprintf
(
outfile
,
"Sorry, non-debug version cannot give more memory info
\n
"
);
/* fclose(outfile); */
return
;
#else
mutex_enter
(
&
mem_hash_mutex
);
fprintf
(
outfile
,
"LIST OF CREATED HEAPS AND ALLOCATED BUFFERS:
\n\n
"
);
if
(
!
print_all
)
{
fprintf
(
outfile
,
"AFTER THE LAST PRINT INFO
\n
"
);
}
node
=
UT_LIST_GET_FIRST
(
mem_all_list_base
);
while
(
node
!=
NULL
)
{
n_heaps
++
;
if
(
!
print_all
&&
node
->
nth_heap
<
mem_last_print_info
)
{
goto
next_heap
;
}
mem_heap_validate_or_print
(
node
->
heap
,
NULL
,
FALSE
,
&
error
,
&
allocated_mem
,
&
ph_size
,
&
n_blocks
);
total_allocated_mem
+=
allocated_mem
;
fprintf
(
outfile
,
"%lu: file %s line %lu of size %lu phys.size %lu with %lu blocks, type %lu
\n
"
,
node
->
nth_heap
,
node
->
file_name
,
node
->
line
,
allocated_mem
,
ph_size
,
n_blocks
,
(
node
->
heap
)
->
type
);
next_heap:
node
=
UT_LIST_GET_NEXT
(
all_list
,
node
);
}
fprintf
(
outfile
,
"
\n
"
);
fprintf
(
outfile
,
"Current allocated memory : %lu
\n
"
,
mem_current_allocated_memory
);
fprintf
(
outfile
,
"Current allocated heaps and buffers : %lu
\n
"
,
n_heaps
);
fprintf
(
outfile
,
"Cumulative allocated memory : %lu
\n
"
,
mem_total_allocated_memory
);
fprintf
(
outfile
,
"Maximum allocated memory : %lu
\n
"
,
mem_max_allocated_memory
);
fprintf
(
outfile
,
"Cumulative created heaps and buffers : %lu
\n
"
,
mem_n_created_heaps
);
fprintf
(
outfile
,
"Cumulative number of allocations : %lu
\n
"
,
mem_n_allocations
);
mem_last_print_info
=
mem_n_created_heaps
;
mutex_exit
(
&
mem_hash_mutex
);
mem_pool_print_info
(
outfile
,
mem_comm_pool
);
/* mem_validate(); */
/* fclose(outfile); */
#endif
}
/*********************************************************************
Prints information of dynamic memory usage and currently allocated memory
heaps or buffers. Can only be used in the debug version. */
void
mem_print_info
(
void
)
/*================*/
{
mem_print_info_low
(
TRUE
);
}
/*********************************************************************
Prints information of dynamic memory usage and currently allocated memory
heaps or buffers since the last ..._print_info or..._print_new_info. */
void
mem_print_new_info
(
void
)
/*====================*/
{
mem_print_info_low
(
FALSE
);
}
/*********************************************************************
TRUE if no memory is currently allocated. */
...
...
@@ -714,8 +591,6 @@ mem_all_freed(void)
/*===============*/
/* out: TRUE if no heaps exist */
{
#ifdef UNIV_MEM_DEBUG
mem_hash_node_t
*
node
;
ulint
heap_count
=
0
;
ulint
i
;
...
...
@@ -743,15 +618,6 @@ mem_all_freed(void)
}
else
{
return
(
FALSE
);
}
#else
printf
(
"Sorry, non-debug version cannot check if all memory is freed.
\n
"
);
return
(
FALSE
);
#endif
}
/*********************************************************************
...
...
@@ -762,8 +628,6 @@ mem_validate_no_assert(void)
/*========================*/
/* out: TRUE if error */
{
#ifdef UNIV_MEM_DEBUG
mem_hash_node_t
*
node
;
ulint
n_heaps
=
0
;
ulint
allocated_mem
;
...
...
@@ -822,14 +686,6 @@ mem_validate_no_assert(void)
mutex_exit
(
&
mem_hash_mutex
);
return
(
error
);
#else
printf
(
"Sorry, non-debug version cannot validate dynamic memory
\n
"
);
return
(
FALSE
);
#endif
}
/****************************************************************
...
...
@@ -844,6 +700,7 @@ mem_validate(void)
return
(
TRUE
);
}
#endif
/* UNIV_MEM_DEBUG */
/****************************************************************
Tries to find neigboring memory allocation blocks and dumps to stderr
...
...
innobase/mtr/mtr0mtr.c
View file @
458c4d31
...
...
@@ -171,7 +171,7 @@ mtr_log_parse_full_page(
/****************************************************************
Writes to the database log the full contents of the pages that this mtr has
modified. */
static
void
mtr_log_write_backup_full_pages
(
/*============================*/
...
...
innobase/odbc/Makefile.am
deleted
100644 → 0
View file @
ea9aa4d3
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
# & Innobase Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
include
../include/Makefile.i
noinst_LIBRARIES
=
libodbc.a
libodbc_a_SOURCES
=
odbc0odbc.c
EXTRA_PROGRAMS
=
innobase/odbc/makefilewin
deleted
100644 → 0
View file @
ea9aa4d3
include ..\include\makefile.i
innobase.lib: odbc0odbc.obj
lib -out:..\libs\innobase.lib odbc0odbc.obj ..\libs\btr.lib ..\libs\eval.lib ..\libs\ibuf.lib ..\libs\trx.lib ..\libs\pars.lib ..\libs\que.lib ..\libs\lock.lib ..\libs\row.lib ..\libs\read.lib ..\libs\srv.lib ..\libs\com.lib ..\libs\usr.lib ..\libs\thr.lib ..\libs\fut.lib ..\libs\fsp.lib ..\libs\page.lib ..\libs\dyn.lib ..\libs\mtr.lib ..\libs\log.lib ..\libs\rem.lib ..\libs\fil.lib ..\libs\buf.lib ..\libs\dict.lib ..\libs\data.lib ..\libs\mach.lib ..\libs\ha.lib ..\libs\ut.lib ..\libs\sync.lib ..\libs\mem.lib ..\libs\os.lib
odbc0odbc.obj: odbc0odbc.c
$(CCOM) $(CFL) -c odbc0odbc.c
innobase/odbc/odbc0dummy.c
deleted
100644 → 0
View file @
ea9aa4d3
/* Used to screen off linker 'undefined symbol' errors
when making an ODBC client library */
unsigned
long
srv_test_cache_evict
;
void
buf_frame_alloc
(
void
)
{}
void
buf_frame_free
(
void
)
{}
void
trx_create
(
void
)
{}
void
*
kernel_mutex_temp
;
void
trx_sig_send
(
void
)
{}
void
rec_sprintf
(
void
)
{}
void
dtuple_sprintf
(
void
)
{}
void
pars_write_query_param_info
(
void
)
{}
void
que_graph_try_free
(
void
)
{}
void
pars_sql
(
void
)
{}
void
que_run_threads
(
void
)
{}
void
que_fork_start_command
(
void
)
{}
void
dict_procedure_add_to_cache
(
void
)
{}
void
dict_mem_procedure_create
(
void
)
{}
void
pars_proc_read_input_params_from_buf
(
void
)
{}
void
dict_procedure_reserve_parsed_copy
(
void
)
{}
void
*
srv_sys
;
void
*
srv_print_latch_waits
;
void
*
srv_spin_wait_delay
;
void
*
srv_n_spin_wait_rounds
;
void
*
buf_debug_prints
;
innobase/odbc/odbc0odbc.c
deleted
100644 → 0
View file @
ea9aa4d3
/******************************************************
Innobase ODBC client library
(c) 1998 Innobase Oy
Created 2/22/1998 Heikki Tuuri
*******************************************************/
#include "odbc0odbc.h"
#include "mem0mem.h"
#include "com0com.h"
#include "usr0sess.h"
#define ODBC_STAT_INITIAL 1
#define ODBC_STAT_PREPARED 2
#define ODBC_STAT_EXECUTED 3
typedef
struct
odbc_conn_struct
odbc_conn_t
;
typedef
struct
odbc_env_struct
odbc_env_t
;
/* ODBC parameter description struct */
typedef
struct
odbc_param_struct
odbc_param_t
;
struct
odbc_param_struct
{
ulint
data_type
;
/* SQL_CHAR, ... */
ibool
is_input
;
/* TRUE if an input parameter of a stored
procedure, FALSE if an output parameter */
byte
*
buf
;
/* buffer where the value is stored before
SQLExecute, or where it comes after SQLExecute
in the case of an output parameter */
lint
*
data_len
;
/* pointer to where the data len or the value
SQL_NULL_DATA is stored */
ulint
buf_len
;
/* buffer size */
};
/* ODBC statement data structure */
typedef
struct
odbc_stat_struct
odbc_stat_t
;
struct
odbc_stat_struct
{
ulint
state
;
/* ODBC_STAT_INITIAL,
ODBC_STAT_PREPARED,
ODBC_STAT_EXECUTED */
ulint
id
;
/* statement id */
ulint
n_params
;
/* number of parameters */
odbc_param_t
*
params
;
/* pointer to an array describing
the parameters, if any */
ulint
n_params_bound
;
/* number of parameters that have
been bound: the statement cannot be
executed before n_params_bound
== n_params */
byte
*
error_msg
;
/* possible error message, or NULL;
allocated separately from dynamic
memory */
ulint
error_msg_len
;
/* error mesage length if it is
non-NULL */
odbc_conn_t
*
conn
;
/* connection */
UT_LIST_NODE_T
(
odbc_stat_t
)
stat_list
;
/* list of the statements of the
connection */
};
/* ODBC connection data structure */
struct
odbc_conn_struct
{
ibool
connected
;
/* TRUE if connected */
char
*
server_name
;
/* server name where connected
(= server address) */
ulint
server_name_len
;
/* length of the server name */
com_endpoint_t
*
com_endpoint
;
/* connection endpoint for this client
connection */
dulint
out_msg_count
;
/* count of outgoing messages */
byte
*
out_datagram_buf
;
/* buffer for outgoing datagrams to
the server */
byte
*
in_datagram_buf
;
/* buffer for incoming datagrams from
the server */
byte
*
addr_buf
;
/* buffer for the address from which
an incoming datagram came; in practice,
this will be the server address */
dulint
sess_id
;
/* user session id, once the
connection to the server is
established */
odbc_env_t
*
env
;
/* environment */
UT_LIST_BASE_NODE_T
(
odbc_stat_t
)
stat_list
;
/* list of the statements of the
connection */
UT_LIST_NODE_T
(
odbc_conn_t
)
conn_list
;
/* list of the connections of the
environment */
};
/* ODBC environment data structure */
struct
odbc_env_struct
{
UT_LIST_BASE_NODE_T
(
odbc_conn_t
)
conn_list
;
/* list of the connections of the
environment */
};
/**************************************************************************
Gets the nth parameter description struct for a statement. */
UNIV_INLINE
odbc_param_t
*
stat_get_nth_param
(
/*===============*/
/* out: nth parameter */
odbc_stat_t
*
stat
,
/* in: pointer to statement handle */
ulint
i
)
/* in: parameter index */
{
ut_ad
(
stat
->
n_params
>
i
);
return
(
stat
->
params
+
i
);
}
/**************************************************************************
Allocates an SQL environment. */
RETCODE
SQLAllocEnv
(
/*========*/
/* out: SQL_SUCCESS */
HENV
*
phenv
)
/* out: pointer to an environment handle */
{
odbc_env_t
*
env
;
if
(
!
sync_initialized
)
{
sync_init
();
mem_init
(
2000000
);
}
env
=
mem_alloc
(
sizeof
(
odbc_env_t
));
UT_LIST_INIT
(
env
->
conn_list
);
*
phenv
=
env
;
return
(
SQL_SUCCESS
);
}
/**************************************************************************
Allocates an SQL connection. */
RETCODE
SQLAllocConnect
(
/*============*/
/* out: SQL_SUCCESS */
HENV
henv
,
/* in: pointer to an environment handle */
HDBC
*
phdbc
)
/* out: pointer to a connection handle */
{
odbc_conn_t
*
conn
;
odbc_env_t
*
env
;
ut_a
(
henv
);
env
=
henv
;
conn
=
mem_alloc
(
sizeof
(
odbc_conn_t
));
conn
->
connected
=
FALSE
;
conn
->
env
=
env
;
UT_LIST_INIT
(
conn
->
stat_list
);
UT_LIST_ADD_LAST
(
conn_list
,
env
->
conn_list
,
conn
);
*
phdbc
=
conn
;
return
(
SQL_SUCCESS
);
}
/**************************************************************************
Allocates an SQL statement. */
RETCODE
SQLAllocStmt
(
/*=========*/
HDBC
hdbc
,
/* in: SQL connection */
HSTMT
*
phstmt
)
/* out: pointer to a statement handle */
{
odbc_conn_t
*
conn
;
odbc_stat_t
*
stat
;
ut_a
(
hdbc
);
conn
=
hdbc
;
stat
=
mem_alloc
(
sizeof
(
odbc_stat_t
));
stat
->
state
=
ODBC_STAT_INITIAL
;
stat
->
error_msg
=
NULL
;
stat
->
conn
=
conn
;
UT_LIST_ADD_LAST
(
stat_list
,
conn
->
stat_list
,
stat
);
*
phstmt
=
stat
;
return
(
SQL_SUCCESS
);
}
/**************************************************************************
Sends the message in datagram_buf to the server. */
static
void
odbc_send_cli_msg
(
/*==============*/
odbc_conn_t
*
conn
,
/* in: connection, does not have to be
connected yet */
ulint
len
)
/* in: message length (excluding the standard
header of size SESS_CLI_MSG_DATA) */
{
ulint
ret
;
ulint
fold
;
byte
*
msg
;
ut_a
(
len
+
SESS_CLI_MSG_DATA
<=
ODBC_DATAGRAM_SIZE
);
msg
=
conn
->
out_datagram_buf
;
mach_write_to_8
(
msg
+
SESS_CLI_MSG_NO
,
conn
->
out_msg_count
);
UT_DULINT_INC
(
conn
->
out_msg_count
);
fold
=
ut_fold_binary
(
msg
+
4
,
len
+
SESS_CLI_MSG_DATA
-
4
);
ut_ad
(
SESS_CLI_MSG_CHECKSUM
==
0
);
mach_write_to_4
(
msg
+
SESS_CLI_MSG_CHECKSUM
,
fold
);
ret
=
com_sendto
(
conn
->
com_endpoint
,
msg
,
SESS_CLI_MSG_DATA
+
len
,
conn
->
server_name
,
conn
->
server_name_len
);
ut_a
(
ret
==
0
);
}
/**************************************************************************
Receives a message in datagram_buf from the server. */
static
void
odbc_recv_srv_msg
(
/*==============*/
odbc_conn_t
*
conn
,
/* in: connection, does not have to be
connected yet */
ulint
*
len
)
/* out: received message length (excluding the
standard header of size SESS_SRV_MSG_DATA) */
{
ulint
total_len
;
ulint
addr_len
;
ulint
ret
;
ret
=
com_recvfrom
(
conn
->
com_endpoint
,
conn
->
in_datagram_buf
,
ODBC_DATAGRAM_SIZE
,
&
total_len
,
(
char
*
)
conn
->
addr_buf
,
ODBC_ADDRESS_SIZE
,
&
addr_len
);
ut_a
(
ret
==
0
);
ut_a
(
total_len
>=
SESS_SRV_MSG_DATA
);
*
len
=
total_len
-
SESS_SRV_MSG_DATA
;
}
/**************************************************************************
Connects to a database server process (establishes a connection and a
session). */
RETCODE
SQLConnect
(
/*=======*/
/* out: SQL_SUCCESS */
HDBC
hdbc
,
/* in: SQL connection handle */
UCHAR
*
szDSN
,
/* in: data source name (server name) */
SWORD
cbDSN
,
/* in: data source name length */
UCHAR
*
szUID
,
/* in: user name */
SWORD
cbUID
,
/* in: user name length */
UCHAR
*
szAuthStr
,
/* in: password */
SWORD
cbAuthStr
)
/* in: password length */
{
com_endpoint_t
*
ep
;
odbc_conn_t
*
conn
;
ulint
err
;
ulint
size
;
byte
*
msg
;
ulint
len
;
UCHAR
catenated_name
[
100
];
ut_a
(
hdbc
&&
szDSN
);
UT_NOT_USED
(
szUID
);
UT_NOT_USED
(
cbUID
);
UT_NOT_USED
(
szAuthStr
);
UT_NOT_USED
(
cbAuthStr
);
conn
=
hdbc
;
ut_a
(
!
conn
->
connected
);
conn
->
server_name
=
mem_alloc
(
cbDSN
);
ut_memcpy
(
conn
->
server_name
,
szDSN
,
cbDSN
);
conn
->
server_name_len
=
cbDSN
;
ep
=
com_endpoint_create
(
COM_SHM
);
ut_a
(
ep
);
conn
->
com_endpoint
=
ep
;
conn
->
out_msg_count
=
ut_dulint_zero
;
size
=
ODBC_DATAGRAM_SIZE
;
err
=
com_endpoint_set_option
(
ep
,
COM_OPT_MAX_DGRAM_SIZE
,
(
byte
*
)
&
size
,
4
);
ut_a
(
err
==
0
);
/* Make the data source name catenated to user name as the
address of the communications endpoint */
ut_a
((
ulint
)
cbDSN
+
(
ulint
)
cbUID
<
100
);
ut_memcpy
(
catenated_name
,
szDSN
,
(
ulint
)
cbDSN
);
ut_memcpy
(
catenated_name
+
(
ulint
)
cbDSN
,
szUID
,
(
ulint
)
cbUID
);
err
=
com_bind
(
ep
,
(
char
*
)
catenated_name
,
(
ulint
)
cbDSN
+
(
ulint
)
cbUID
);
ut_a
(
err
==
0
);
conn
->
in_datagram_buf
=
mem_alloc
(
ODBC_DATAGRAM_SIZE
);
msg
=
mem_alloc
(
ODBC_DATAGRAM_SIZE
);
conn
->
out_datagram_buf
=
msg
;
conn
->
addr_buf
=
mem_alloc
(
ODBC_ADDRESS_SIZE
);
/* Set the session id to dulint 0 as we are not yet connected */
sess_cli_msg_set_sess
(
msg
,
ut_dulint_zero
);
sess_cli_msg_set_type
(
msg
,
SESS_CLI_CONNECT
);
/*------------------------------------------*/
odbc_send_cli_msg
(
conn
,
0
);
odbc_recv_srv_msg
(
conn
,
&
len
);
/*------------------------------------------*/
ut_a
(
len
==
0
);
ut_a
(
sess_srv_msg_get_type
(
conn
->
in_datagram_buf
)
==
SESS_SRV_ACCEPT_CONNECT
);
conn
->
sess_id
=
mach_read_from_8
(
conn
->
in_datagram_buf
+
SESS_SRV_MSG_SESS_ID
);
/* Write the session id to out_datagram_buf: it will not be rewritten
until the connection is closed, as the session id will stay the same */
sess_cli_msg_set_sess
(
msg
,
conn
->
sess_id
);
/* We currently only send single part messages: the following will
stay 0 during the connection */
mach_write_to_4
(
msg
+
SESS_CLI_MSG_CONTINUE
,
0
);
mach_write_to_4
(
msg
+
SESS_CLI_MSG_CONT_SIZE
,
0
);
conn
->
connected
=
TRUE
;
return
(
SQL_SUCCESS
);
}
/**************************************************************************
Stores an error message to a statement handle, so that it can be later
queried with SQLError. */
static
void
odbc_stat_store_error_msg
(
/*======================*/
odbc_stat_t
*
stat
,
/* in: statement handle */
byte
*
msg
,
/* in: error message sent by the server */
ulint
len
)
/* in: length of msg */
{
if
(
stat
->
error_msg
)
{
mem_free
(
stat
->
error_msg
);
}
stat
->
error_msg_len
=
len
;
len
+=
SESS_SRV_MSG_DATA
;
stat
->
error_msg
=
mem_alloc
(
len
);
ut_memcpy
(
stat
->
error_msg
,
msg
,
len
);
}
/**************************************************************************
Queries an error message. */
RETCODE
SQLError
(
/*=====*/
/* out: SQL_SUCCESS or SQL_NO_DATA_FOUND */
HENV
henv
,
/* in: SQL_NULL_HENV */
HDBC
hdbc
,
/* in: SQL_NULL_HDBC */
HSTMT
hstmt
,
/* in: statement handle */
UCHAR
*
szSqlState
,
/* in/out: SQLSTATE as a null-terminated string,
(currently, always == "S1000") */
SDWORD
*
pfNativeError
,
/* out: native error code */
UCHAR
*
szErrorMsg
,
/* in/out: buffer for an error message as a
null-terminated string */
SWORD
cbErrorMsgMax
,
/* in: buffer size for szErrorMsg */
SWORD
*
pcbErrorMsg
)
/* out: error message length */
{
odbc_stat_t
*
stat
;
ulint
len
;
ut_a
(
henv
==
SQL_NULL_HENV
);
ut_a
(
hdbc
==
SQL_NULL_HDBC
);
ut_a
(
hstmt
);
ut_a
(
cbErrorMsgMax
>
1
);
stat
=
hstmt
;
if
(
stat
->
error_msg
==
NULL
)
{
return
(
SQL_NO_DATA_FOUND
);
}
*
pfNativeError
=
0
;
ut_memcpy
(
szSqlState
,
(
char
*
)
"S1000"
,
6
);
len
=
(
ulint
)
cbErrorMsgMax
-
1
;
if
(
stat
->
error_msg_len
<
len
)
{
len
=
stat
->
error_msg_len
;
}
ut_memcpy
(
szErrorMsg
,
stat
->
error_msg
+
SESS_SRV_MSG_DATA
,
len
);
*
(
szErrorMsg
+
len
)
=
'\0'
;
*
pcbErrorMsg
=
(
SWORD
)
len
;
if
(
stat
->
error_msg
)
{
mem_free
(
stat
->
error_msg
);
stat
->
error_msg
=
NULL
;
}
return
(
SQL_SUCCESS
);
}
/**************************************************************************
Makes the server to parse and optimize an SQL string. */
RETCODE
SQLPrepare
(
/*=======*/
/* out: SQL_SUCCESS or SQL_ERROR */
HSTMT
hstmt
,
/* in: statement handle */
UCHAR
*
szSqlStr
,
/* in: SQL string */
SDWORD
cbSqlStr
)
/* in: SQL string length */
{
odbc_stat_t
*
stat
;
odbc_conn_t
*
conn
;
odbc_param_t
*
param
;
ulint
len
;
byte
*
msg
;
ulint
i
;
stat
=
hstmt
;
conn
=
stat
->
conn
;
if
(
stat
->
error_msg
)
{
mem_free
(
stat
->
error_msg
);
stat
->
error_msg
=
NULL
;
}
ut_memcpy
(
conn
->
out_datagram_buf
+
SESS_CLI_MSG_DATA
,
szSqlStr
,
1
+
(
ulint
)
cbSqlStr
);
sess_cli_msg_set_type
(
conn
->
out_datagram_buf
,
SESS_CLI_PREPARE
);
/* The client message will be decoded in sess_receive_prepare */
/*------------------------------------------*/
odbc_send_cli_msg
(
conn
,
1
+
(
ulint
)
cbSqlStr
);
odbc_recv_srv_msg
(
conn
,
&
len
);
/*------------------------------------------*/
/* The server message was coded in sess_receive_prepare */
ut_a
(
len
>=
8
);
msg
=
conn
->
in_datagram_buf
;
if
(
sess_srv_msg_get_type
(
msg
)
!=
SESS_SRV_SUCCESS
)
{
ut_a
(
sess_srv_msg_get_type
(
msg
)
==
SESS_SRV_ERROR
);
odbc_stat_store_error_msg
(
stat
,
msg
,
len
);
return
(
SQL_ERROR
);
}
stat
->
id
=
mach_read_from_4
(
msg
+
SESS_SRV_MSG_DATA
);
stat
->
n_params
=
mach_read_from_4
(
msg
+
SESS_SRV_MSG_DATA
+
4
);
stat
->
n_params_bound
=
0
;
ut_a
(
len
==
8
+
stat
->
n_params
);
if
(
stat
->
n_params
>
0
)
{
stat
->
params
=
mem_alloc
(
stat
->
n_params
*
sizeof
(
odbc_param_t
));
for
(
i
=
0
;
i
<
stat
->
n_params
;
i
++
)
{
param
=
stat_get_nth_param
(
stat
,
i
);
param
->
is_input
=
mach_read_from_1
(
msg
+
SESS_SRV_MSG_DATA
+
8
+
i
);
/* Set buf to NULL so that we know when the parameter
has been bound */
param
->
buf
=
NULL
;
}
}
stat
->
state
=
ODBC_STAT_PREPARED
;
return
(
SQL_SUCCESS
);
}
/**************************************************************************
Binds a parameter in a prepared statement. */
RETCODE
SQLBindParameter
(
/*=============*/
/* out: SQL_SUCCESS */
HSTMT
hstmt
,
/* in: statement handle */
UWORD
ipar
,
/* in: parameter index, starting from 1 */
SWORD
fParamType
,
/* in: SQL_PARAM_INPUT or SQL_PARAM_OUTPUT */
SWORD
fCType
,
/* in: SQL_C_CHAR, ... */
SWORD
fSqlType
,
/* in: SQL_CHAR, ... */
UDWORD
cbColDef
,
/* in: precision: ignored */
SWORD
ibScale
,
/* in: scale: ignored */
PTR
rgbValue
,
/* in: pointer to a buffer for the data */
SDWORD
cbValueMax
,
/* in: buffer size */
SDWORD
*
pcbValue
)
/* in: pointer to a buffer for the data
length or SQL_NULL_DATA */
{
odbc_stat_t
*
stat
;
odbc_param_t
*
param
;
stat
=
hstmt
;
ut_a
(
stat
->
state
!=
ODBC_STAT_INITIAL
);
ut_a
(
rgbValue
);
ut_a
(
ipar
<=
stat
->
n_params
);
ut_a
(
ipar
>
0
);
ut_a
(
cbValueMax
>=
0
);
ut_a
(
pcbValue
);
UT_NOT_USED
(
ibScale
);
UT_NOT_USED
(
fCType
);
UT_NOT_USED
(
cbColDef
);
if
(
stat
->
error_msg
)
{
mem_free
(
stat
->
error_msg
);
stat
->
error_msg
=
NULL
;
}
param
=
stat_get_nth_param
(
stat
,
ipar
-
1
);
if
(
param
->
buf
==
NULL
)
{
stat
->
n_params_bound
++
;
}
param
->
data_type
=
fSqlType
;
ut_a
((
fParamType
!=
SQL_PARAM_INPUT
)
||
param
->
is_input
);
ut_a
((
fParamType
==
SQL_PARAM_INPUT
)
||
!
param
->
is_input
);
param
->
buf
=
rgbValue
;
param
->
buf_len
=
cbValueMax
;
param
->
data_len
=
pcbValue
;
return
(
SQL_SUCCESS
);
}
/**************************************************************************
Executes a prepared statement where all parameters have been bound. */
RETCODE
SQLExecute
(
/*=======*/
/* out: SQL_SUCCESS or SQL_ERROR */
HSTMT
hstmt
)
/* in: statement handle */
{
odbc_stat_t
*
stat
;
odbc_conn_t
*
conn
;
odbc_param_t
*
param
;
lint
len
;
ulint
msg_len
;
byte
*
msg
;
byte
*
ptr
;
lint
int_val
;
ulint
i
;
stat
=
hstmt
;
ut_a
(
stat
->
state
!=
ODBC_STAT_INITIAL
);
ut_a
(
stat
->
n_params
==
stat
->
n_params_bound
);
if
(
stat
->
error_msg
)
{
mem_free
(
stat
->
error_msg
);
stat
->
error_msg
=
NULL
;
}
conn
=
stat
->
conn
;
msg
=
conn
->
out_datagram_buf
;
sess_cli_msg_set_type
(
msg
,
SESS_CLI_EXECUTE
);
ptr
=
msg
+
SESS_CLI_MSG_DATA
;
mach_write_to_4
(
ptr
,
stat
->
id
);
ptr
+=
4
;
for
(
i
=
0
;
i
<
stat
->
n_params
;
i
++
)
{
param
=
stat_get_nth_param
(
stat
,
i
);
if
(
param
->
is_input
)
{
/* Copy its length and data to the message buffer */
len
=
*
(
param
->
data_len
);
mach_write_to_4
(
ptr
,
(
ulint
)
len
);
ptr
+=
4
;
if
(
len
!=
SQL_NULL_DATA
)
{
if
(
param
->
data_type
==
SQL_INTEGER
)
{
ut_ad
(
len
==
4
);
int_val
=
*
((
lint
*
)(
param
->
buf
));
mach_write_to_4
(
ptr
,
(
ulint
)
int_val
);
}
else
{
ut_memcpy
(
ptr
,
param
->
buf
,
len
);
}
ptr
+=
len
;
}
}
}
/* The client message will be decoded in sess_receive_command */
/*------------------------------------------*/
odbc_send_cli_msg
(
conn
,
ptr
-
(
msg
+
SESS_CLI_MSG_DATA
));
odbc_recv_srv_msg
(
conn
,
&
msg_len
);
/*------------------------------------------*/
/* The server message was coded in sess_command_completed_message */
msg
=
conn
->
in_datagram_buf
;
if
(
sess_srv_msg_get_type
(
msg
)
!=
SESS_SRV_SUCCESS
)
{
ut_a
(
sess_srv_msg_get_type
(
msg
)
==
SESS_SRV_ERROR
);
odbc_stat_store_error_msg
(
stat
,
msg
,
msg_len
);
return
(
SQL_ERROR
);
}
ptr
=
msg
+
SESS_SRV_MSG_DATA
;
for
(
i
=
0
;
i
<
stat
->
n_params
;
i
++
)
{
param
=
stat_get_nth_param
(
stat
,
i
);
if
(
!
param
->
is_input
)
{
/* Copy its length and data from the message buffer */
len
=
(
lint
)
mach_read_from_4
(
ptr
);
ptr
+=
4
;
*
(
param
->
data_len
)
=
len
;
if
(
len
!=
SQL_NULL_DATA
)
{
if
(
param
->
data_type
==
SQL_INTEGER
)
{
ut_ad
(
len
==
4
);
int_val
=
(
lint
)
mach_read_from_4
(
ptr
);
*
((
lint
*
)(
param
->
buf
))
=
int_val
;
}
else
{
ut_memcpy
(
param
->
buf
,
ptr
,
(
ulint
)
len
);
}
ptr
+=
len
;
}
}
}
ut_ad
(
msg
+
SESS_SRV_MSG_DATA
+
msg_len
==
ptr
);
return
(
SQL_SUCCESS
);
}
innobase/os/os0proc.c
View file @
458c4d31
...
...
@@ -57,83 +57,6 @@ os_mem_alloc_nocache(
#endif
}
#ifdef notdefined
/********************************************************************
Creates a new process. */
ibool
os_process_create
(
/*==============*/
char
*
name
,
/* in: name of the executable to start
or its full path name */
char
*
cmd
,
/* in: command line for the starting
process, or NULL if no command line
specified */
os_process_t
*
proc
,
/* out: handle to the process */
os_process_id_t
*
id
)
/* out: process id */
{
BOOL
ret
;
PROCESS_INFORMATION
pinfo
;
STARTUPINFO
sinfo
;
/* The following assignments are default for the startupinfo
structure */
sinfo
.
cb
=
sizeof
(
STARTUPINFO
);
sinfo
.
lpReserved
=
NULL
;
sinfo
.
lpDesktop
=
NULL
;
sinfo
.
cbReserved2
=
0
;
sinfo
.
lpReserved
=
NULL
;
ret
=
CreateProcess
(
name
,
cmd
,
NULL
,
/* No security attributes */
NULL
,
/* No thread security attrs */
FALSE
,
/* Do not inherit handles */
0
,
/* No creation flags */
NULL
,
/* No environment */
NULL
,
/* Same current directory */
&
sinfo
,
&
pinfo
);
*
proc
=
pinfo
.
hProcess
;
*
id
=
pinfo
.
dwProcessId
;
return
(
ret
);
}
/**************************************************************************
Exits a process. */
void
os_process_exit
(
/*============*/
ulint
code
)
/* in: exit code */
{
ExitProcess
((
UINT
)
code
);
}
/**************************************************************************
Gets a process exit code. */
ibool
os_process_get_exit_code
(
/*=====================*/
/* out: TRUE if succeed, FALSE if fail */
os_process_t
proc
,
/* in: handle to the process */
ulint
*
code
)
/* out: exit code */
{
DWORD
ex_code
;
BOOL
ret
;
ret
=
GetExitCodeProcess
(
proc
,
&
ex_code
);
*
code
=
(
ulint
)
ex_code
;
return
(
ret
);
}
#endif
/* notdedfined */
/********************************************************************
Sets the priority boost for threads released from waiting within the current
process. */
...
...
innobase/os/os0trash.c
deleted
100644 → 0
View file @
ea9aa4d3
/* Stores the old console mode when echo is turned off */
ulint
os_old_console_mode
;
/********************************************************************
Turns off echo from console input. */
void
os_console_echo_off
(
void
)
/*=====================*/
{
GetConsoleMode
(
stdio
,
&
os_old_console_mode
);
SetConsoleMode
(
stdio
,
ENABLE_PROCESSED_INPUT
);
}
/********************************************************************
Turns on echo in console input. */
void
os_console_echo_on
(
void
)
/*====================*/
{
SetConsoleMode
(
stdio
,
&
os_old_console_mode
);
}
/********************************************************************
Reads a character from the console. */
char
os_read_console
(
void
)
/*=================*/
{
char
input_char
;
ulint
n_chars
;
n_chars
=
0
;
while
(
n_chars
==
0
)
{
ReadConsole
(
stdio
,
&
input_char
,
1
,
&
n_chars
,
NULL
);
}
return
(
input_char
);
}
innobase/page/page0page.c
View file @
458c4d31
...
...
@@ -19,9 +19,6 @@ Created 2/2/1994 Heikki Tuuri
#include "btr0sea.h"
#include "buf0buf.h"
/* A cached template page used in page_create */
page_t
*
page_template
=
NULL
;
/* THE INDEX PAGE
==============
...
...
@@ -321,20 +318,6 @@ page_create(
fil_page_set_type
(
page
,
FIL_PAGE_INDEX
);
/* If we have a page template, copy the page structure from there */
if
(
page_template
)
{
ut_memcpy
(
page
+
PAGE_HEADER
,
page_template
+
PAGE_HEADER
,
PAGE_HEADER_PRIV_END
);
ut_memcpy
(
page
+
PAGE_DATA
,
page_template
+
PAGE_DATA
,
PAGE_SUPREMUM_END
-
PAGE_DATA
);
ut_memcpy
(
page
+
UNIV_PAGE_SIZE
-
PAGE_EMPTY_DIR_START
,
page_template
+
UNIV_PAGE_SIZE
-
PAGE_EMPTY_DIR_START
,
PAGE_EMPTY_DIR_START
-
PAGE_DIR
);
return
(
frame
);
}
heap
=
mem_heap_create
(
200
);
/* 3. CREATE THE INFIMUM AND SUPREMUM RECORDS */
...
...
@@ -409,17 +392,6 @@ page_create(
rec_set_next_offs
(
infimum_rec
,
(
ulint
)(
supremum_rec
-
page
));
rec_set_next_offs
(
supremum_rec
,
0
);
#ifdef notdefined
/* Disable the use of page_template: there is a race condition here:
while one thread is creating page_template, another one can start
using it before the memcpy completes! */
if
(
page_template
==
NULL
)
{
page_template
=
mem_alloc
(
UNIV_PAGE_SIZE
);
ut_memcpy
(
page_template
,
page
,
UNIV_PAGE_SIZE
);
}
#endif
return
(
page
);
}
...
...
innobase/que/que0que.c
View file @
458c4d31
...
...
@@ -73,37 +73,6 @@ void
que_thr_move_to_run_state
(
/*======================*/
que_thr_t
*
thr
);
/* in: an query thread */
/**************************************************************************
Tries to parallelize query if it is not parallel enough yet. */
static
que_thr_t
*
que_try_parallelize
(
/*================*/
/* out: next thread to execute */
que_thr_t
*
thr
);
/* in: query thread */
#ifdef notdefined
/********************************************************************
Adds info about the number of inserted rows etc. to the message to the
client. */
static
void
que_thr_add_update_info
(
/*====================*/
que_thr_t
*
thr
)
/* in: query thread */
{
que_fork_t
*
graph
;
graph
=
thr
->
graph
;
mach_write_to_8
(
thr
->
msg_buf
+
SESS_SRV_MSG_N_INSERTS
,
graph
->
n_inserts
);
mach_write_to_8
(
thr
->
msg_buf
+
SESS_SRV_MSG_N_UPDATES
,
graph
->
n_updates
);
mach_write_to_8
(
thr
->
msg_buf
+
SESS_SRV_MSG_N_DELETES
,
graph
->
n_deletes
);
}
#endif
/***************************************************************************
Adds a query graph to the session's list of graphs. */
...
...
@@ -711,22 +680,6 @@ que_thr_handle_error(
/* Does nothing */
}
/**************************************************************************
Tries to parallelize query if it is not parallel enough yet. */
static
que_thr_t
*
que_try_parallelize
(
/*================*/
/* out: next thread to execute */
que_thr_t
*
thr
)
/* in: query thread */
{
ut_ad
(
thr
);
/* Does nothing yet */
return
(
thr
);
}
/********************************************************************
Builds a command completed-message to the client. */
static
...
...
@@ -1328,85 +1281,6 @@ que_thr_step(
return
(
thr
);
}
/***********************************************************************
Checks if there is a need for a query thread switch or stopping the current
thread. */
que_thr_t
*
que_thr_check_if_switch
(
/*====================*/
que_thr_t
*
thr
,
/* in: current query thread */
ulint
*
cumul_resource
)
/* in: amount of resources used
by the current call of que_run_threads
(resources used by the OS thread!) */
{
que_thr_t
*
next_thr
;
ibool
stopped
;
if
(
que_thr_peek_stop
(
thr
))
{
mutex_enter
(
&
kernel_mutex
);
stopped
=
que_thr_stop
(
thr
);
mutex_exit
(
&
kernel_mutex
);
if
(
stopped
)
{
/* If a signal is processed, we may get a new query
thread next_thr to run */
next_thr
=
NULL
;
que_thr_dec_refer_count
(
thr
,
&
next_thr
);
if
(
next_thr
==
NULL
)
{
return
(
NULL
);
}
thr
=
next_thr
;
}
}
if
(
thr
->
resource
>
QUE_PARALLELIZE_LIMIT
)
{
/* Try parallelization of the query thread */
thr
=
que_try_parallelize
(
thr
);
thr
->
resource
=
0
;
}
(
*
cumul_resource
)
++
;
if
(
*
cumul_resource
>
QUE_ROUND_ROBIN_LIMIT
)
{
/* It is time to round-robin query threads in the
server task queue */
if
(
srv_get_thread_type
()
==
SRV_COM
)
{
/* This OS thread is a SRV_COM thread: we put
the query thread to the task queue and return
to allow the OS thread to receive more
messages from clients */
ut_ad
(
thr
->
is_active
);
srv_que_task_enqueue
(
thr
);
return
(
NULL
);
}
else
{
/* Change the query thread if there is another
in the server task queue */
thr
=
srv_que_round_robin
(
thr
);
}
*
cumul_resource
=
0
;
}
return
(
thr
);
}
/**************************************************************************
Runs query threads. Note that the individual query thread which is run
within this function may change if, e.g., the OS thread executing this
...
...
@@ -1430,27 +1304,6 @@ que_run_threads(
loop_count
=
QUE_MAX_LOOPS_WITHOUT_CHECK
;
cumul_resource
=
0
;
loop:
if
(
loop_count
>=
QUE_MAX_LOOPS_WITHOUT_CHECK
)
{
/* In MySQL this thread switch is never needed!
loop_count = 0;
next_thr = que_thr_check_if_switch(thr, &cumul_resource);
if (next_thr != thr) {
if (next_thr == NULL) {
return;
}
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
}
thr = next_thr;
*/
}
/* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch
more than about 4 pages, checks must be made also within the query
...
...
innobase/rem/rem0cmp.c
View file @
458c4d31
...
...
@@ -58,7 +58,7 @@ cmp_debug_dtuple_rec_with_match(
This function is used to compare two data fields for which the data type
is such that we must use MySQL code to compare them. The prototype here
must be a copy of the the one in ha_innobase.cc! */
extern
int
innobase_mysql_cmp
(
/*===============*/
...
...
innobase/row/row0ins.c
View file @
458c4d31
...
...
@@ -38,7 +38,7 @@ This prototype is copied from /mysql/sql/ha_innodb.cc.
Invalidates the MySQL query cache for the table.
NOTE that the exact prototype of this function has to be in
/innobase/row/row0ins.c! */
extern
void
innobase_invalidate_query_cache
(
/*============================*/
...
...
@@ -1349,58 +1349,6 @@ row_ins_check_foreign_constraints(
return
(
DB_SUCCESS
);
}
/*************************************************************************
Reports a UNIQUE key error to dict_unique_err_buf so that SHOW INNODB
STATUS can print it. */
static
void
row_ins_unique_report_err
(
/*======================*/
que_thr_t
*
thr
,
/* in: query thread */
rec_t
*
rec
,
/* in: a record in the index */
dtuple_t
*
entry
,
/* in: index entry to insert in the index */
dict_index_t
*
index
)
/* in: index */
{
UT_NOT_USED
(
thr
);
UT_NOT_USED
(
rec
);
UT_NOT_USED
(
entry
);
UT_NOT_USED
(
index
);
#ifdef notdefined
/* Disable reporting to test if the slowdown of REPLACE in 4.0.13 was
caused by this! */
char
*
buf
=
dict_unique_err_buf
;
/* The foreign err mutex protects also dict_unique_err_buf */
mutex_enter
(
&
dict_foreign_err_mutex
);
ut_sprintf_timestamp
(
buf
);
sprintf
(
buf
+
strlen
(
buf
),
" Transaction:
\n
"
);
trx_print
(
buf
+
strlen
(
buf
),
thr_get_trx
(
thr
));
sprintf
(
buf
+
strlen
(
buf
),
"Unique key constraint fails for table %.500s.
\n
"
,
index
->
table_name
);
sprintf
(
buf
+
strlen
(
buf
),
"Trying to add in index %.500s (%lu fields unique) tuple:
\n
"
,
index
->
name
,
dict_index_get_n_unique
(
index
));
dtuple_sprintf
(
buf
+
strlen
(
buf
),
1000
,
entry
);
sprintf
(
buf
+
strlen
(
buf
),
"
\n
But there is already a record:
\n
"
);
rec_sprintf
(
buf
+
strlen
(
buf
),
1000
,
rec
);
sprintf
(
buf
+
strlen
(
buf
),
"
\n
"
);
ut_a
(
strlen
(
buf
)
<
DICT_FOREIGN_ERR_BUF_LEN
);
mutex_exit
(
&
dict_foreign_err_mutex
);
#endif
}
/*******************************************************************
Checks if a unique key violation to rec would occur at the index entry
insert. */
...
...
@@ -1531,8 +1479,6 @@ row_ins_scan_sec_index_for_duplicate(
if
(
cmp
==
0
)
{
if
(
row_ins_dupl_error_with_rec
(
rec
,
entry
,
index
))
{
row_ins_unique_report_err
(
thr
,
rec
,
entry
,
index
);
err
=
DB_DUPLICATE_KEY
;
thr_get_trx
(
thr
)
->
error_info
=
index
;
...
...
@@ -1627,8 +1573,6 @@ row_ins_duplicate_error_in_clust(
if
(
row_ins_dupl_error_with_rec
(
rec
,
entry
,
cursor
->
index
))
{
trx
->
error_info
=
cursor
->
index
;
row_ins_unique_report_err
(
thr
,
rec
,
entry
,
cursor
->
index
);
return
(
DB_DUPLICATE_KEY
);
}
}
...
...
@@ -1651,9 +1595,6 @@ row_ins_duplicate_error_in_clust(
if
(
row_ins_dupl_error_with_rec
(
rec
,
entry
,
cursor
->
index
))
{
trx
->
error_info
=
cursor
->
index
;
row_ins_unique_report_err
(
thr
,
rec
,
entry
,
cursor
->
index
);
return
(
DB_DUPLICATE_KEY
);
}
}
...
...
innobase/row/row0mysql.c
View file @
458c4d31
...
...
@@ -1386,10 +1386,12 @@ row_create_table_for_mysql(
"UNIV_MEM_DEBUG defined in univ.i and the server must be
\n
"
"quiet because allocation from a mem heap is not protected
\n
"
"by any semaphore.
\n
"
);
#ifdef UNIV_MEM_DEBUG
ut_a
(
mem_validate
());
printf
(
"Memory validated
\n
"
);
#else
/* UNIV_MEM_DEBUG */
puts
(
"Memory NOT validated (recompile with UNIV_MEM_DEBUG)"
);
#endif
/* UNIV_MEM_DEBUG */
}
heap
=
mem_heap_create
(
512
);
...
...
innobase/row/row0row.c
View file @
458c4d31
...
...
@@ -236,61 +236,6 @@ row_build(
return
(
row
);
}
#ifdef notdefined
/***********************************************************************
An inverse function to dict_row_build_index_entry. Builds a row from a
record in a clustered index. */
void
row_build_to_tuple
(
/*===============*/
dtuple_t
*
row
,
/* in/out: row built; see the NOTE below! */
dict_index_t
*
index
,
/* in: clustered index */
rec_t
*
rec
)
/* in: record in the clustered index;
NOTE: the data fields in the row will point
directly into this record, therefore,
the buffer page of this record must be
at least s-latched and the latch held
as long as the row dtuple is used!
NOTE 2: does not work with externally
stored fields! */
{
dict_table_t
*
table
;
ulint
n_fields
;
ulint
i
;
dfield_t
*
dfield
;
byte
*
field
;
ulint
len
;
ulint
row_len
;
dict_col_t
*
col
;
ut_ad
(
index
&&
rec
);
ut_ad
(
index
->
type
&
DICT_CLUSTERED
);
table
=
index
->
table
;
row_len
=
dict_table_get_n_cols
(
table
);
dtuple_set_info_bits
(
row
,
rec_get_info_bits
(
rec
));
n_fields
=
dict_index_get_n_fields
(
index
);
ut_ad
(
n_fields
==
rec_get_n_fields
(
rec
));
dict_table_copy_types
(
row
,
table
);
for
(
i
=
0
;
i
<
n_fields
;
i
++
)
{
col
=
dict_field_get_col
(
dict_index_get_nth_field
(
index
,
i
));
dfield
=
dtuple_get_nth_field
(
row
,
dict_col_get_no
(
col
));
field
=
rec_get_nth_field
(
rec
,
i
,
&
len
);
dfield_set_data
(
dfield
,
field
,
len
);
}
ut_ad
(
dtuple_check_typed
(
row
));
}
#endif
/***********************************************************************
Converts an index record to a typed data tuple. NOTE that externally
stored (often big) fields are NOT copied to heap. */
...
...
innobase/srv/srv0srv.c
View file @
458c4d31
...
...
@@ -721,247 +721,9 @@ srv_get_thread_type(void)
return
(
type
);
}
/***********************************************************************
Increments by 1 the count of active threads of the type given
and releases master thread if necessary. */
static
void
srv_inc_thread_count
(
/*=================*/
ulint
type
)
/* in: type of the thread */
{
mutex_enter
(
&
kernel_mutex
);
srv_activity_count
++
;
srv_n_threads_active
[
type
]
++
;
if
(
srv_n_threads_active
[
SRV_MASTER
]
==
0
)
{
srv_release_threads
(
SRV_MASTER
,
1
);
}
mutex_exit
(
&
kernel_mutex
);
}
/***********************************************************************
Decrements by 1 the count of active threads of the type given. */
static
void
srv_dec_thread_count
(
/*=================*/
ulint
type
)
/* in: type of the thread */
{
mutex_enter
(
&
kernel_mutex
);
/* FIXME: the following assertion sometimes fails: */
if
(
srv_n_threads_active
[
type
]
==
0
)
{
printf
(
"Error: thread type %lu
\n
"
,
type
);
ut_ad
(
0
);
}
srv_n_threads_active
[
type
]
--
;
mutex_exit
(
&
kernel_mutex
);
}
/***********************************************************************
Calculates the number of allowed utility threads for a thread to decide if
it has to suspend itself in the thread table. */
static
ulint
srv_max_n_utilities
(
/*================*/
/* out: maximum number of allowed utilities
of the type given */
ulint
type
)
/* in: utility type */
{
ulint
ret
;
if
(
srv_n_threads_active
[
SRV_COM
]
==
0
)
{
if
(
srv_meter
[
type
]
>
srv_meter_low_water
[
type
])
{
return
(
srv_n_threads
[
type
]
/
2
);
}
else
{
return
(
0
);
}
}
else
{
if
(
srv_meter
[
type
]
<
srv_meter_foreground
[
type
])
{
return
(
0
);
}
ret
=
1
+
((
srv_n_threads
[
type
]
*
(
ulint
)(
srv_meter
[
type
]
-
srv_meter_foreground
[
type
]))
/
(
ulint
)(
1000
-
srv_meter_foreground
[
type
]));
if
(
ret
>
srv_n_threads
[
type
])
{
return
(
srv_n_threads
[
type
]);
}
else
{
return
(
ret
);
}
}
}
/***********************************************************************
Increments the utility meter by the value given and releases utility
threads if necessary. */
void
srv_increment_meter
(
/*================*/
ulint
type
,
/* in: utility type */
ulint
n
)
/* in: value to add to meter */
{
ulint
m
;
mutex_enter
(
&
kernel_mutex
);
srv_meter
[
type
]
+=
n
;
m
=
srv_max_n_utilities
(
type
);
if
(
m
>
srv_n_threads_active
[
type
])
{
srv_release_threads
(
type
,
m
-
srv_n_threads_active
[
type
]);
}
mutex_exit
(
&
kernel_mutex
);
}
/***********************************************************************
Releases max number of utility threads if no queries are active and
the high-water mark for the utility is exceeded. */
void
srv_release_max_if_no_queries
(
void
)
/*===============================*/
{
ulint
m
;
ulint
type
;
mutex_enter
(
&
kernel_mutex
);
if
(
srv_n_threads_active
[
SRV_COM
]
>
0
)
{
mutex_exit
(
&
kernel_mutex
);
return
;
}
type
=
SRV_RECOVERY
;
m
=
srv_n_threads
[
type
]
/
2
;
if
((
srv_meter
[
type
]
>
srv_meter_high_water
[
type
])
&&
(
srv_n_threads_active
[
type
]
<
m
))
{
srv_release_threads
(
type
,
m
-
srv_n_threads_active
[
type
]);
printf
(
"Releasing max background
\n
"
);
}
mutex_exit
(
&
kernel_mutex
);
}
/*************************************************************************
Creates the first communication endpoint for the server. This
first call also initializes the com0com.* module. */
void
srv_communication_init
(
/*===================*/
char
*
endpoint
)
/* in: server address */
{
ulint
ret
;
ulint
len
;
srv_sys
->
endpoint
=
com_endpoint_create
(
COM_SHM
);
ut_a
(
srv_sys
->
endpoint
);
len
=
ODBC_DATAGRAM_SIZE
;
ret
=
com_endpoint_set_option
(
srv_sys
->
endpoint
,
COM_OPT_MAX_DGRAM_SIZE
,
(
byte
*
)
&
len
,
sizeof
(
ulint
));
ut_a
(
ret
==
0
);
ret
=
com_bind
(
srv_sys
->
endpoint
,
endpoint
,
ut_strlen
(
endpoint
));
ut_a
(
ret
==
0
);
}
/*************************************************************************
Creates the utility threads. */
void
srv_create_utility_threads
(
void
)
/*============================*/
{
/* os_thread_t thread;
os_thread_id_t thr_id; */
ulint
i
;
mutex_enter
(
&
kernel_mutex
);
srv_n_threads
[
SRV_RECOVERY
]
=
1
;
srv_n_threads_active
[
SRV_RECOVERY
]
=
1
;
mutex_exit
(
&
kernel_mutex
);
for
(
i
=
0
;
i
<
1
;
i
++
)
{
/* thread = os_thread_create(srv_recovery_thread, NULL, &thr_id); */
/* ut_a(thread); */
}
/* thread = os_thread_create(srv_purge_thread, NULL, &thr_id);
ut_a(thread); */
}
/*************************************************************************
Creates the communication threads. */
void
srv_create_com_threads
(
void
)
/*========================*/
{
/* os_thread_t thread;
os_thread_id_t thr_id; */
ulint
i
;
srv_n_threads
[
SRV_COM
]
=
srv_n_com_threads
;
for
(
i
=
0
;
i
<
srv_n_com_threads
;
i
++
)
{
/* thread = os_thread_create(srv_com_thread, NULL, &thr_id); */
/* ut_a(thread); */
}
}
/*************************************************************************
Creates the worker threads. */
void
srv_create_worker_threads
(
void
)
/*===========================*/
{
/* os_thread_t thread;
os_thread_id_t thr_id; */
ulint
i
;
srv_n_threads
[
SRV_WORKER
]
=
srv_n_worker_threads
;
srv_n_threads_active
[
SRV_WORKER
]
=
srv_n_worker_threads
;
for
(
i
=
0
;
i
<
srv_n_worker_threads
;
i
++
)
{
/* thread = os_thread_create(srv_worker_thread, NULL, &thr_id); */
/* ut_a(thread); */
}
}
/*************************************************************************
Initializes the server. */
static
void
srv_init
(
void
)
/*==========*/
...
...
@@ -1762,13 +1524,13 @@ srv_sprintf_innodb_monitor(
#ifdef UNIV_LINUX
buf
+=
sprintf
(
buf
,
"Main thread process no. %lu, id %lu, state: %s
\n
"
,
"Main thread process no. %lu, id %lu, state: %
.29
s
\n
"
,
srv_main_thread_process_no
,
srv_main_thread_id
,
srv_main_thread_op_info
);
#else
buf
+=
sprintf
(
buf
,
"Main thread id %lu, state: %s
\n
"
,
"Main thread id %lu, state: %
.29
s
\n
"
,
srv_main_thread_id
,
srv_main_thread_op_info
);
#endif
...
...
@@ -2018,13 +1780,6 @@ loop:
srv_refresh_innodb_monitor_stats
();
}
/* mem_print_new_info();
if (cnt % 10 == 0) {
mem_print_info();
}
*/
sync_array_print_long_waits
();
/* Flush stdout and stderr so that a database user gets their output
...
...
@@ -2490,12 +2245,6 @@ flush_loop:
goto
background_loop
;
}
/* mem_print_new_info();
*/
#ifdef UNIV_SEARCH_PERF_STAT
/* btr_search_print_info(); */
#endif
/* There is no work for background operations either: suspend
master thread to wait for more server activity */
...
...
innobase/srv/srv0start.c
View file @
458c4d31
...
...
@@ -868,80 +868,6 @@ open_or_create_data_files(
return
(
DB_SUCCESS
);
}
#ifdef notdefined
/*********************************************************************
This thread is used to measure contention of latches. */
static
ulint
test_measure_cont
(
/*==============*/
void
*
arg
)
{
ulint
i
,
j
;
ulint
pcount
,
kcount
,
s_scount
,
s_xcount
,
s_mcount
,
lcount
;
UT_NOT_USED
(
arg
);
fprintf
(
stderr
,
"Starting contention measurement
\n
"
);
for
(
i
=
0
;
i
<
1000
;
i
++
)
{
pcount
=
0
;
kcount
=
0
;
s_scount
=
0
;
s_xcount
=
0
;
s_mcount
=
0
;
lcount
=
0
;
for
(
j
=
0
;
j
<
100
;
j
++
)
{
if
(
srv_measure_by_spin
)
{
ut_delay
(
ut_rnd_interval
(
0
,
20000
));
}
else
{
os_thread_sleep
(
20000
);
}
if
(
kernel_mutex
.
lock_word
)
{
kcount
++
;
}
if
(
buf_pool
->
mutex
.
lock_word
)
{
pcount
++
;
}
if
(
log_sys
->
mutex
.
lock_word
)
{
lcount
++
;
}
if
(
btr_search_latch
.
reader_count
)
{
s_scount
++
;
}
if
(
btr_search_latch
.
writer
!=
RW_LOCK_NOT_LOCKED
)
{
s_xcount
++
;
}
if
(
btr_search_latch
.
mutex
.
lock_word
)
{
s_mcount
++
;
}
}
fprintf
(
stderr
,
"Mutex res. l %lu, p %lu, k %lu s x %lu s s %lu s mut %lu of %lu
\n
"
,
lcount
,
pcount
,
kcount
,
s_xcount
,
s_scount
,
s_mcount
,
j
);
/* sync_print_wait_info(); */
fprintf
(
stderr
,
"log i/o %lu n non sea %lu n succ %lu n h fail %lu
\n
"
,
log_sys
->
n_log_ios
,
btr_cur_n_non_sea
,
btr_search_n_succ
,
btr_search_n_hash_fail
);
}
return
(
0
);
}
#endif
/********************************************************************
Starts InnoDB and creates a new database if database files
are not found and the user wants. Server parameters are
...
...
innobase/sync/sync0sync.c
View file @
458c4d31
...
...
@@ -167,46 +167,6 @@ struct sync_level_struct{
ulint
level
;
/* level of the latch in the latching order */
};
#if defined(notdefined) && defined(__GNUC__) && defined(UNIV_INTEL_X86)
ulint
sync_gnuc_intelx86_test_and_set
(
/* out: old value of the lock word */
ulint
*
lw
)
/* in: pointer to the lock word */
{
ulint
res
;
/* In assembly we use the so-called AT & T syntax where
the order of operands is inverted compared to the ordinary Intel
syntax. The 'l' after the mnemonics denotes a 32-bit operation.
The line after the code tells which values come out of the asm
code, and the second line tells the input to the asm code. */
asm
volatile
(
"movl $1, %%eax; xchgl (%%ecx), %%eax"
:
"=eax"
(
res
),
"=m"
(
*
lw
)
:
"ecx"
(
lw
));
return
(
res
);
}
void
sync_gnuc_intelx86_reset
(
ulint
*
lw
)
/* in: pointer to the lock word */
{
/* In assembly we use the so-called AT & T syntax where
the order of operands is inverted compared to the ordinary Intel
syntax. The 'l' after the mnemonics denotes a 32-bit operation. */
asm
volatile
(
"movl $0, %%eax; xchgl (%%ecx), %%eax"
:
"=m"
(
*
lw
)
:
"ecx"
(
lw
)
:
"eax"
);
/* gcc does not seem to understand
that our asm code resets eax: tell it
explicitly that after the third ':' */
}
#endif
/**********************************************************************
Creates, or rather, initializes a mutex object in a specified memory
location (which must be appropriately aligned). The mutex is initialized
...
...
innobase/trx/trx0rec.c
View file @
458c4d31
...
...
@@ -41,47 +41,6 @@ trx_undof_page_add_undo_rec_log(
byte
*
log_ptr
;
ulint
len
;
#ifdef notdefined
ulint
i
;
byte
*
prev_rec_ptr
;
byte
*
ptr
;
ulint
min_len
;
ut_ad
(
new_free
>=
old_free
+
4
);
i
=
0
;
ptr
=
undo_page
+
old_free
+
2
;
if
(
old_free
>
mach_read_from_2
(
undo_page
+
TRX_UNDO_PAGE_HDR
+
TRX_UNDO_PAGE_START
))
{
prev_rec_ptr
=
undo_page
+
mach_read_from_2
(
ptr
-
4
)
+
2
;
min_len
=
ut_min
(
new_free
-
old_free
-
4
,
(
undo_page
+
old_free
-
2
)
-
prev_rec_ptr
);
for
(;;)
{
if
(
i
>=
min_len
)
{
break
;
}
else
if
((
*
ptr
==
*
prev_rec_ptr
)
||
((
*
ptr
==
*
prev_rec_ptr
+
1
)
&&
(
ptr
+
1
==
suffix
)))
{
i
++
;
ptr
++
;
prev_rec_ptr
++
;
}
else
{
break
;
}
}
}
mlog_write_initial_log_record
(
undo_page
,
MLOG_UNDO_INSERT
,
mtr
);
mlog_catenate_ulint
(
mtr
,
old_free
,
MLOG_2BYTES
);
mlog_catenate_ulint_compressed
(
mtr
,
i
);
mlog_catenate_string
(
mtr
,
ptr
,
new_free
-
old_free
-
2
-
i
);
#endif
log_ptr
=
mlog_open
(
mtr
,
30
+
MLOG_BUF_MARGIN
);
if
(
log_ptr
==
NULL
)
{
...
...
innobase/trx/trx0trx.c
View file @
458c4d31
...
...
@@ -650,29 +650,6 @@ trx_commit_off_kernel(
if
(
undo
)
{
mutex_enter
(
&
kernel_mutex
);
#ifdef notdefined
/* !!!!!!!!! There is a bug here: purge and rollback
need the whole stack of old record versions even if no
consistent read would need them!! This is because they
decide on the basis of the old versions when we can
remove delete marked secondary index records! */
if
(
!
undo
->
del_marks
&&
(
undo
->
size
==
1
)
&&
(
UT_LIST_GET_LEN
(
trx_sys
->
view_list
)
==
1
))
{
/* There is no need to save the update undo
log: discard it; note that &mtr gets committed
while we must hold the kernel mutex and
therefore this optimization may add to the
contention of the kernel mutex. */
lsn
=
trx_undo_update_cleanup_by_discard
(
trx
,
&
mtr
);
mutex_exit
(
&
(
rseg
->
mutex
));
goto
shortcut
;
}
#endif
trx
->
no
=
trx_sys_get_new_trx_no
();
mutex_exit
(
&
kernel_mutex
);
...
...
innobase/ut/ut0dbg.c
View file @
458c4d31
...
...
@@ -18,10 +18,3 @@ ibool ut_dbg_stop_threads = FALSE;
/* Null pointer used to generate memory trap */
ulint
*
ut_dbg_null_ptr
=
NULL
;
/* Dummy function to prevent gcc from ignoring this file */
void
ut_dummy
(
void
)
{
printf
(
"Hello world
\n
"
);
}
innobase/ut/ut0mem.c
View file @
458c4d31
...
...
@@ -244,4 +244,4 @@ ut_str_contains(
}
return
(
FALSE
);
}
\ No newline at end of file
}
innobase/ut/ut0ut.c
View file @
458c4d31
...
...
@@ -13,6 +13,7 @@ Created 5/11/1994 Heikki Tuuri
#endif
#include <stdarg.h>
#include <string.h>
#include "ut0sort.h"
...
...
scripts/mysql_config.sh
View file @
458c4d31
...
...
@@ -84,20 +84,25 @@ port='@MYSQL_TCP_PORT@'
ldflags
=
'@LDFLAGS@'
client_libs
=
'@CLIENT_LIBS@'
# Create options
, without end space
# Create options
libs
=
"
$ldflags
-L
$pkglibdir
-lmysqlclient
$client_libs
"
libs
=
`
echo
"
$libs
"
|
sed
-e
's; \+; ;g'
|
sed
-e
's;^ *;;'
|
sed
-e
's; *\$;;'
`
libs_r
=
"
$ldflags
-L
$pkglibdir
-lmysqlclient_r @LIBS@ @openssl_libs@"
libs_r
=
`
echo
"
$libs_r
"
|
sed
-e
's; \+; ;g'
|
sed
-e
's;^ *;;'
|
sed
-e
's; *\$;;'
`
cflags
=
"-I
$pkgincludedir
@CFLAGS@
"
cflags
=
"-I
$pkgincludedir
@CFLAGS@
"
#note: end space!
include
=
"-I
$pkgincludedir
"
embedded_libs
=
"
$ldflags
-L
$pkglibdir
-lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
embedded_libs
=
`
echo
"
$embedded_libs
"
|
sed
-e
's; \+; ;g'
|
sed
-e
's;^ *;;'
|
sed
-e
's; *\$;;'
`
# Remove some options that a client doesn't have to care about
cflags
=
`
echo
"
$cflags
"
|
sed
-e
's;\(-DDBUG_OFF\|-DSAFEMALLOC\|-USAFEMALLOC\|-DSAFE_MUTEX\|-DPEDANTIC_SAFEMALLOC\|-DUNIV_MUST_NOT_INLINE\|-DFORCE_INIT_OF_VARS\|-DEXTRA_DEBUG\|-DHAVE_purify\|-O[0-9]\|-W[-A-Za-z]*\) *;;g'
|
sed
-e
's; *\$;;'
`
for
remove
in
DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX
\
DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS
\
DEXTRA_DEBUG DHAVE_purify
'O[0-9]'
'W[-A-Za-z]*'
do
cflags
=
`
echo
"
$cflags
"
|sed
-e
"s/-
$remove
*//g"
`
done
cflags
=
`
echo
"
$cflags
"
|sed
-e
's/ *\$//'
`
usage
()
{
cat
<<
EOF
...
...
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