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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
63a2ba1b
Commit
63a2ba1b
authored
Nov 20, 2002
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/my/mysql-4.0 into mashka.mysql.fi:/home/my/mysql-4.0
parents
7fff8afe
61eb4ca1
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
48 additions
and
18 deletions
+48
-18
include/my_tree.h
include/my_tree.h
+2
-0
myisam/mi_write.c
myisam/mi_write.c
+2
-1
mysql-test/r/bdb.result
mysql-test/r/bdb.result
+2
-2
mysql-test/t/bdb.test
mysql-test/t/bdb.test
+1
-1
mysys/tree.c
mysys/tree.c
+5
-3
sql/mysql_priv.h
sql/mysql_priv.h
+2
-1
sql/mysqld.cc
sql/mysqld.cc
+19
-2
sql/sql_insert.cc
sql/sql_insert.cc
+7
-3
sql/sql_yacc.yy
sql/sql_yacc.yy
+5
-4
sql/table.cc
sql/table.cc
+2
-1
sql/table.h
sql/table.h
+1
-0
No files found.
include/my_tree.h
View file @
63a2ba1b
...
@@ -76,6 +76,8 @@ int tree_walk(TREE *tree,tree_walk_action action,
...
@@ -76,6 +76,8 @@ int tree_walk(TREE *tree,tree_walk_action action,
void
*
argument
,
TREE_WALK
visit
);
void
*
argument
,
TREE_WALK
visit
);
int
tree_delete
(
TREE
*
tree
,
void
*
key
);
int
tree_delete
(
TREE
*
tree
,
void
*
key
);
#define TREE_ELEMENT_EXTRA_SIZE (sizeof(TREE_ELEMENT) + sizeof(void*))
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
myisam/mi_write.c
View file @
63a2ba1b
...
@@ -842,8 +842,9 @@ int _mi_init_bulk_insert(MI_INFO *info, ulong cache_size)
...
@@ -842,8 +842,9 @@ int _mi_init_bulk_insert(MI_INFO *info, ulong cache_size)
{
{
params
->
info
=
info
;
params
->
info
=
info
;
params
->
keynr
=
i
;
params
->
keynr
=
i
;
/* Only allocate a 16'th of the buffer at a time */
init_tree
(
&
info
->
bulk_insert
[
i
],
init_tree
(
&
info
->
bulk_insert
[
i
],
cache_size
/
num_keys
/
4
+
10
,
cache_size
/
num_keys
/
16
+
10
,
cache_size
/
num_keys
,
0
,
cache_size
/
num_keys
,
0
,
(
qsort_cmp2
)
keys_compare
,
0
,
(
qsort_cmp2
)
keys_compare
,
0
,
(
tree_element_free
)
keys_free
,
(
void
*
)
params
++
);
(
tree_element_free
)
keys_free
,
(
void
*
)
params
++
);
...
...
mysql-test/r/bdb.result
View file @
63a2ba1b
...
@@ -133,11 +133,11 @@ id parent_id level
...
@@ -133,11 +133,11 @@ id parent_id level
1202 107 2
1202 107 2
1204 107 2
1204 107 2
update ignore t1 set id=1023 where id=1010;
update ignore t1 set id=1023 where id=1010;
select * from t1 where parent_id=102;
select * from t1 where parent_id=102
order by parent_id,id
;
id parent_id level
id parent_id level
1008 102 2
1008 102 2
1015 102 2
1010 102 2
1010 102 2
1015 102 2
explain select level from t1 where level=1;
explain select level from t1 where level=1;
table type possible_keys key key_len ref rows Extra
table type possible_keys key key_len ref rows Extra
t1 ref level level 1 const 1 Using where; Using index
t1 ref level level 1 const 1 Using where; Using index
...
...
mysql-test/t/bdb.test
View file @
63a2ba1b
...
@@ -39,7 +39,7 @@ select * from t1;
...
@@ -39,7 +39,7 @@ select * from t1;
update
ignore
t1
set
id
=
id
+
1
;
# This will change all rows
update
ignore
t1
set
id
=
id
+
1
;
# This will change all rows
select
*
from
t1
;
select
*
from
t1
;
update
ignore
t1
set
id
=
1023
where
id
=
1010
;
update
ignore
t1
set
id
=
1023
where
id
=
1010
;
select
*
from
t1
where
parent_id
=
102
;
select
*
from
t1
where
parent_id
=
102
order
by
parent_id
,
id
;
explain
select
level
from
t1
where
level
=
1
;
explain
select
level
from
t1
where
level
=
1
;
explain
select
level
,
id
from
t1
where
level
=
1
;
explain
select
level
,
id
from
t1
where
level
=
1
;
explain
select
level
,
id
,
parent_id
from
t1
where
level
=
1
;
explain
select
level
,
id
,
parent_id
from
t1
where
level
=
1
;
...
...
mysys/tree.c
View file @
63a2ba1b
...
@@ -45,7 +45,8 @@
...
@@ -45,7 +45,8 @@
#define BLACK 1
#define BLACK 1
#define RED 0
#define RED 0
#define DEFAULT_ALLOC_SIZE (8192-MALLOC_OVERHEAD)
#define DEFAULT_ALLOC_SIZE 8192
#define DEFAULT_ALIGN_SIZE 8192
static
void
delete_tree_element
(
TREE
*
,
TREE_ELEMENT
*
);
static
void
delete_tree_element
(
TREE
*
,
TREE_ELEMENT
*
);
static
int
tree_walk_left_root_right
(
TREE
*
,
TREE_ELEMENT
*
,
static
int
tree_walk_left_root_right
(
TREE
*
,
TREE_ELEMENT
*
,
...
@@ -72,8 +73,9 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
...
@@ -72,8 +73,9 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
DBUG_ENTER
(
"init_tree"
);
DBUG_ENTER
(
"init_tree"
);
DBUG_PRINT
(
"enter"
,(
"tree: %lx size: %d"
,
tree
,
size
));
DBUG_PRINT
(
"enter"
,(
"tree: %lx size: %d"
,
tree
,
size
));
if
(
!
default_alloc_size
)
if
(
default_alloc_size
<
DEFAULT_ALLOC_SIZE
)
default_alloc_size
=
DEFAULT_ALLOC_SIZE
;
default_alloc_size
=
DEFAULT_ALLOC_SIZE
;
default_alloc_size
=
MY_ALIGN
(
default_alloc_size
,
DEFAULT_ALIGN_SIZE
);
bzero
((
gptr
)
&
tree
->
null_element
,
sizeof
(
tree
->
null_element
));
bzero
((
gptr
)
&
tree
->
null_element
,
sizeof
(
tree
->
null_element
));
tree
->
root
=
&
tree
->
null_element
;
tree
->
root
=
&
tree
->
null_element
;
tree
->
compare
=
compare
;
tree
->
compare
=
compare
;
...
...
sql/mysql_priv.h
View file @
63a2ba1b
...
@@ -83,6 +83,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
...
@@ -83,6 +83,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
*/
*/
#define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (16L*1024*1024)
#define MIN_FILE_LENGTH_TO_USE_ROW_CACHE (16L*1024*1024)
#define MIN_ROWS_TO_USE_TABLE_CACHE 100
#define MIN_ROWS_TO_USE_TABLE_CACHE 100
#define MIN_ROWS_TO_USE_BULK_INSERT 100
/*
/*
The following is used to decide if MySQL should use table scanning
The following is used to decide if MySQL should use table scanning
...
@@ -707,7 +708,7 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list);
...
@@ -707,7 +708,7 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list);
/* old unireg functions */
/* old unireg functions */
void
unireg_init
(
ulong
options
);
void
unireg_init
(
ulong
options
);
void
unireg_end
(
int
signal
);
void
unireg_end
(
void
);
int
rea_create_table
(
my_string
file_name
,
HA_CREATE_INFO
*
create_info
,
int
rea_create_table
(
my_string
file_name
,
HA_CREATE_INFO
*
create_info
,
List
<
create_field
>
&
create_field
,
List
<
create_field
>
&
create_field
,
uint
key_count
,
KEY
*
key_info
);
uint
key_count
,
KEY
*
key_info
);
...
...
sql/mysqld.cc
View file @
63a2ba1b
...
@@ -764,7 +764,7 @@ static void __cdecl kill_server(int sig_ptr)
...
@@ -764,7 +764,7 @@ static void __cdecl kill_server(int sig_ptr)
if
(
sig
!=
MYSQL_KILL_SIGNAL
&&
sig
!=
0
)
if
(
sig
!=
MYSQL_KILL_SIGNAL
&&
sig
!=
0
)
unireg_abort
(
1
);
/* purecov: inspected */
unireg_abort
(
1
);
/* purecov: inspected */
else
else
unireg_end
(
0
);
unireg_end
();
pthread_exit
(
0
);
/* purecov: deadcode */
pthread_exit
(
0
);
/* purecov: deadcode */
RETURN_FROM_KILL_SERVER
;
RETURN_FROM_KILL_SERVER
;
}
}
...
@@ -803,12 +803,29 @@ extern "C" sig_handler print_signal_warning(int sig)
...
@@ -803,12 +803,29 @@ extern "C" sig_handler print_signal_warning(int sig)
#endif
#endif
}
}
/*
cleanup all memory and end program nicely
SYNOPSIS
unireg_end()
NOTES
This function never returns.
If SIGNALS_DONT_BREAK_READ is defined, this function is called
by the main thread. To get MySQL to shut down nicely in this case
(Mac OS X) we have to call exit() instead if pthread_exit().
*/
void
unireg_end
(
int
signal_number
__attribute__
((
unused
))
)
void
unireg_end
(
void
)
{
{
clean_up
();
clean_up
();
my_thread_end
();
my_thread_end
();
#ifdef SIGNALS_DONT_BREAK_READ
exit
(
0
);
#else
pthread_exit
(
0
);
// Exit is in main thread
pthread_exit
(
0
);
// Exit is in main thread
#endif
}
}
...
...
sql/sql_insert.cc
View file @
63a2ba1b
...
@@ -194,15 +194,19 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
...
@@ -194,15 +194,19 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
thd
->
proc_info
=
"update"
;
thd
->
proc_info
=
"update"
;
if
(
duplic
==
DUP_IGNORE
||
duplic
==
DUP_REPLACE
)
if
(
duplic
==
DUP_IGNORE
||
duplic
==
DUP_REPLACE
)
table
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
table
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
if
((
bulk_insert
=
(
values_list
.
elements
>
1
&&
if
((
bulk_insert
=
(
values_list
.
elements
>
=
MIN_ROWS_TO_USE_BULK_INSERT
&&
lock_type
!=
TL_WRITE_DELAYED
&&
lock_type
!=
TL_WRITE_DELAYED
&&
!
(
specialflag
&
SPECIAL_SAFE_MODE
))))
!
(
specialflag
&
SPECIAL_SAFE_MODE
))))
{
{
table
->
file
->
extra_opt
(
HA_EXTRA_WRITE_CACHE
,
table
->
file
->
extra_opt
(
HA_EXTRA_WRITE_CACHE
,
thd
->
variables
.
read_buff_size
);
min
(
thd
->
variables
.
read_buff_size
,
table
->
avg_row_length
*
values_list
.
elements
));
if
(
thd
->
variables
.
bulk_insert_buff_size
)
if
(
thd
->
variables
.
bulk_insert_buff_size
)
table
->
file
->
extra_opt
(
HA_EXTRA_BULK_INSERT_BEGIN
,
table
->
file
->
extra_opt
(
HA_EXTRA_BULK_INSERT_BEGIN
,
thd
->
variables
.
bulk_insert_buff_size
);
min
(
thd
->
variables
.
bulk_insert_buff_size
,
(
table
->
total_key_length
+
table
->
keys
*
TREE_ELEMENT_EXTRA_SIZE
)
*
values_list
.
elements
));
table
->
bulk_insert
=
1
;
table
->
bulk_insert
=
1
;
}
}
...
...
sql/sql_yacc.yy
View file @
63a2ba1b
...
@@ -3107,12 +3107,13 @@ ident:
...
@@ -3107,12 +3107,13 @@ ident:
IDENT { $$=$1; }
IDENT { $$=$1; }
| keyword
| keyword
{
{
LEX *lex;
LEX *lex
= Lex
;
$$.str=
sql_
strmake($1.str,$1.length);
$$.str=
lex->thd->
strmake($1.str,$1.length);
$$.length=$1.length;
$$.length=$1.length;
if (
(lex=Lex)
->next_state != STATE_END)
if (
lex
->next_state != STATE_END)
lex->next_state=STATE_OPERATOR_OR_IDENT;
lex->next_state=STATE_OPERATOR_OR_IDENT;
};
}
;
ident_or_text:
ident_or_text:
ident { $$=$1;}
ident { $$=$1;}
...
...
sql/table.cc
View file @
63a2ba1b
...
@@ -143,7 +143,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
...
@@ -143,7 +143,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
goto
err_not_open
;
/* purecov: inspected */
goto
err_not_open
;
/* purecov: inspected */
bzero
((
char
*
)
keyinfo
,
n_length
);
bzero
((
char
*
)
keyinfo
,
n_length
);
outparam
->
key_info
=
keyinfo
;
outparam
->
key_info
=
keyinfo
;
outparam
->
max_key_length
=
0
;
outparam
->
max_key_length
=
outparam
->
total_key_length
=
0
;
key_part
=
(
KEY_PART_INFO
*
)
(
keyinfo
+
keys
);
key_part
=
(
KEY_PART_INFO
*
)
(
keyinfo
+
keys
);
strpos
=
disk_buff
+
6
;
strpos
=
disk_buff
+
6
;
...
@@ -201,6 +201,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
...
@@ -201,6 +201,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
}
}
set_if_bigger
(
outparam
->
max_key_length
,
keyinfo
->
key_length
+
set_if_bigger
(
outparam
->
max_key_length
,
keyinfo
->
key_length
+
keyinfo
->
key_parts
);
keyinfo
->
key_parts
);
outparam
->
total_key_length
+=
keyinfo
->
key_length
;
if
(
keyinfo
->
flags
&
HA_NOSAME
)
if
(
keyinfo
->
flags
&
HA_NOSAME
)
set_if_bigger
(
outparam
->
max_unique_length
,
keyinfo
->
key_length
);
set_if_bigger
(
outparam
->
max_unique_length
,
keyinfo
->
key_length
);
}
}
...
...
sql/table.h
View file @
63a2ba1b
...
@@ -58,6 +58,7 @@ struct st_table {
...
@@ -58,6 +58,7 @@ struct st_table {
uint
reclength
;
/* Recordlength */
uint
reclength
;
/* Recordlength */
uint
rec_buff_length
;
uint
rec_buff_length
;
uint
keys
,
key_parts
,
primary_key
,
max_key_length
,
max_unique_length
;
uint
keys
,
key_parts
,
primary_key
,
max_key_length
,
max_unique_length
;
uint
total_key_length
;
uint
uniques
;
uint
uniques
;
uint
null_fields
;
/* number of null fields */
uint
null_fields
;
/* number of null fields */
uint
blob_fields
;
/* number of blob fields */
uint
blob_fields
;
/* number of blob fields */
...
...
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