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
8aec636b
Commit
8aec636b
authored
Nov 29, 2006
by
monty@mysql.com/narttu.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
parents
b67ff612
9c3a2a0d
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
53 additions
and
25 deletions
+53
-25
include/heap.h
include/heap.h
+4
-4
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+1
-1
mysql-test/r/type_bit.result
mysql-test/r/type_bit.result
+8
-0
mysql-test/t/type_bit.test
mysql-test/t/type_bit.test
+11
-0
sql/ha_heap.cc
sql/ha_heap.cc
+1
-1
sql/item_sum.cc
sql/item_sum.cc
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+11
-4
sql/set_var.cc
sql/set_var.cc
+2
-2
sql/sql_class.h
sql/sql_class.h
+9
-8
sql/sql_select.cc
sql/sql_select.cc
+1
-1
sql/table.cc
sql/table.cc
+1
-0
sql/uniques.cc
sql/uniques.cc
+2
-2
No files found.
include/heap.h
View file @
8aec636b
...
@@ -46,8 +46,8 @@ typedef struct st_heapinfo /* Struct from heap_info */
...
@@ -46,8 +46,8 @@ typedef struct st_heapinfo /* Struct from heap_info */
ulong
records
;
/* Records in database */
ulong
records
;
/* Records in database */
ulong
deleted
;
/* Deleted records in database */
ulong
deleted
;
/* Deleted records in database */
ulong
max_records
;
ulong
max_records
;
ulong
data_length
;
ulong
long
data_length
;
ulong
index_length
;
ulong
long
index_length
;
uint
reclength
;
/* Length of one record */
uint
reclength
;
/* Length of one record */
int
errkey
;
int
errkey
;
ulonglong
auto_increment
;
ulonglong
auto_increment
;
...
@@ -135,7 +135,7 @@ typedef struct st_heap_share
...
@@ -135,7 +135,7 @@ typedef struct st_heap_share
HP_BLOCK
block
;
HP_BLOCK
block
;
HP_KEYDEF
*
keydef
;
HP_KEYDEF
*
keydef
;
ulong
min_records
,
max_records
;
/* Params to open */
ulong
min_records
,
max_records
;
/* Params to open */
ulong
data_length
,
index_length
,
max_table_size
;
ulong
long
data_length
,
index_length
,
max_table_size
;
uint
key_stat_version
;
/* version to indicate insert/delete */
uint
key_stat_version
;
/* version to indicate insert/delete */
uint
records
;
/* records */
uint
records
;
/* records */
uint
blength
;
/* records rounded up to 2^n */
uint
blength
;
/* records rounded up to 2^n */
...
@@ -187,7 +187,7 @@ typedef struct st_heap_create_info
...
@@ -187,7 +187,7 @@ typedef struct st_heap_create_info
{
{
uint
auto_key
;
/* keynr [1 - maxkey] for auto key */
uint
auto_key
;
/* keynr [1 - maxkey] for auto key */
uint
auto_key_type
;
uint
auto_key_type
;
ulong
max_table_size
;
ulong
long
max_table_size
;
ulonglong
auto_increment
;
ulonglong
auto_increment
;
my_bool
with_auto_increment
;
my_bool
with_auto_increment
;
}
HP_CREATE_INFO
;
}
HP_CREATE_INFO
;
...
...
mysql-test/r/show_check.result
View file @
8aec636b
...
@@ -296,7 +296,7 @@ SET sql_quote_show_create= @old_sql_quote_show_create;
...
@@ -296,7 +296,7 @@ SET sql_quote_show_create= @old_sql_quote_show_create;
SET sql_mode= @old_sql_mode;
SET sql_mode= @old_sql_mode;
select @@max_heap_table_size;
select @@max_heap_table_size;
@@max_heap_table_size
@@max_heap_table_size
104
7552
104
8576
CREATE TABLE t1 (
CREATE TABLE t1 (
a int(11) default NULL,
a int(11) default NULL,
KEY a USING BTREE (a)
KEY a USING BTREE (a)
...
...
mysql-test/r/type_bit.result
View file @
8aec636b
...
@@ -610,4 +610,12 @@ select hex(a), b from t1;
...
@@ -610,4 +610,12 @@ select hex(a), b from t1;
hex(a) b
hex(a) b
1 2
1 2
drop table t1;
drop table t1;
create table t1(bit_field bit(2), int_field int, key a(bit_field));
insert into t1 values (1,2);
handler t1 open as t1;
handler t1 read a=(1);
bit_field int_field
2
handler t1 close;
drop table t1;
End of 5.0 tests
End of 5.0 tests
mysql-test/t/type_bit.test
View file @
8aec636b
...
@@ -261,4 +261,15 @@ insert into t1 (b, a) values ('2', '1');
...
@@ -261,4 +261,15 @@ insert into t1 (b, a) values ('2', '1');
select
hex
(
a
),
b
from
t1
;
select
hex
(
a
),
b
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# type was not properly initalized, which caused key_copy to fail
#
create
table
t1
(
bit_field
bit
(
2
),
int_field
int
,
key
a
(
bit_field
));
insert
into
t1
values
(
1
,
2
);
handler
t1
open
as
t1
;
handler
t1
read
a
=
(
1
);
handler
t1
close
;
drop
table
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/ha_heap.cc
View file @
8aec636b
...
@@ -631,7 +631,7 @@ int ha_heap::create(const char *name, TABLE *table_arg,
...
@@ -631,7 +631,7 @@ int ha_heap::create(const char *name, TABLE *table_arg,
}
}
mem_per_row
+=
MY_ALIGN
(
share
->
reclength
+
1
,
sizeof
(
char
*
));
mem_per_row
+=
MY_ALIGN
(
share
->
reclength
+
1
,
sizeof
(
char
*
));
max_rows
=
(
ha_rows
)
(
table
->
in_use
->
variables
.
max_heap_table_size
/
max_rows
=
(
ha_rows
)
(
table
->
in_use
->
variables
.
max_heap_table_size
/
mem_per_row
);
(
ulonglong
)
mem_per_row
);
if
(
table_arg
->
found_next_number_field
)
if
(
table_arg
->
found_next_number_field
)
{
{
keydef
[
share
->
next_number_index
].
flag
|=
HA_AUTO_KEY
;
keydef
[
share
->
next_number_index
].
flag
|=
HA_AUTO_KEY
;
...
...
sql/item_sum.cc
View file @
8aec636b
...
@@ -3409,8 +3409,8 @@ bool Item_func_group_concat::setup(THD *thd)
...
@@ -3409,8 +3409,8 @@ bool Item_func_group_concat::setup(THD *thd)
duplicate values (according to the syntax of this function). If there
duplicate values (according to the syntax of this function). If there
is no DISTINCT or ORDER BY clauses, we don't create this tree.
is no DISTINCT or ORDER BY clauses, we don't create this tree.
*/
*/
init_tree
(
tree
,
min
(
thd
->
variables
.
max_heap_table_size
,
init_tree
(
tree
,
(
uint
)
min
(
thd
->
variables
.
max_heap_table_size
,
thd
->
variables
.
sortbuff_size
/
16
),
0
,
thd
->
variables
.
sortbuff_size
/
16
),
0
,
tree_key_length
,
compare_key
,
0
,
NULL
,
(
void
*
)
this
);
tree_key_length
,
compare_key
,
0
,
NULL
,
(
void
*
)
this
);
}
}
...
...
sql/mysqld.cc
View file @
8aec636b
...
@@ -70,6 +70,12 @@
...
@@ -70,6 +70,12 @@
#define IF_PURIFY(A,B) (B)
#define IF_PURIFY(A,B) (B)
#endif
#endif
#if SIZEOF_CHARP == 4
#define MAX_MEM_TABLE_SIZE ~(ulong) 0
#else
#define MAX_MEM_TABLE_SIZE ~(ulonglong) 0
#endif
/* stack traces are only supported on linux intel */
/* stack traces are only supported on linux intel */
#if defined(__linux__) && defined(__i386__) && defined(USE_PSTACK)
#if defined(__linux__) && defined(__i386__) && defined(USE_PSTACK)
#define HAVE_STACK_TRACE_ON_SEGV
#define HAVE_STACK_TRACE_ON_SEGV
...
@@ -5718,8 +5724,9 @@ The minimum value for this variable is 4096.",
...
@@ -5718,8 +5724,9 @@ The minimum value for this variable is 4096.",
{
"max_heap_table_size"
,
OPT_MAX_HEP_TABLE_SIZE
,
{
"max_heap_table_size"
,
OPT_MAX_HEP_TABLE_SIZE
,
"Don't allow creation of heap tables bigger than this."
,
"Don't allow creation of heap tables bigger than this."
,
(
gptr
*
)
&
global_system_variables
.
max_heap_table_size
,
(
gptr
*
)
&
global_system_variables
.
max_heap_table_size
,
(
gptr
*
)
&
max_system_variables
.
max_heap_table_size
,
0
,
GET_ULONG
,
(
gptr
*
)
&
max_system_variables
.
max_heap_table_size
,
0
,
GET_ULL
,
REQUIRED_ARG
,
16
*
1024
*
1024L
,
16384
,
~
0L
,
MALLOC_OVERHEAD
,
1024
,
0
},
REQUIRED_ARG
,
16
*
1024
*
1024L
,
16384
,
MAX_MEM_TABLE_SIZE
,
MALLOC_OVERHEAD
,
1024
,
0
},
{
"max_join_size"
,
OPT_MAX_JOIN_SIZE
,
{
"max_join_size"
,
OPT_MAX_JOIN_SIZE
,
"Joins that are probably going to read more than max_join_size records return an error."
,
"Joins that are probably going to read more than max_join_size records return an error."
,
(
gptr
*
)
&
global_system_variables
.
max_join_size
,
(
gptr
*
)
&
global_system_variables
.
max_join_size
,
...
@@ -5994,8 +6001,8 @@ The minimum value for this variable is 4096.",
...
@@ -5994,8 +6001,8 @@ The minimum value for this variable is 4096.",
{
"tmp_table_size"
,
OPT_TMP_TABLE_SIZE
,
{
"tmp_table_size"
,
OPT_TMP_TABLE_SIZE
,
"If an in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM table."
,
"If an in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM table."
,
(
gptr
*
)
&
global_system_variables
.
tmp_table_size
,
(
gptr
*
)
&
global_system_variables
.
tmp_table_size
,
(
gptr
*
)
&
max_system_variables
.
tmp_table_size
,
0
,
GET_UL
ONG
,
(
gptr
*
)
&
max_system_variables
.
tmp_table_size
,
0
,
GET_UL
L
,
REQUIRED_ARG
,
32
*
1024
*
1024L
,
1024
,
~
0L
,
0
,
1
,
0
},
REQUIRED_ARG
,
32
*
1024
*
1024L
,
1024
,
MAX_MEM_TABLE_SIZE
,
0
,
1
,
0
},
{
"transaction_alloc_block_size"
,
OPT_TRANS_ALLOC_BLOCK_SIZE
,
{
"transaction_alloc_block_size"
,
OPT_TRANS_ALLOC_BLOCK_SIZE
,
"Allocation block size for transactions to be stored in binary log"
,
"Allocation block size for transactions to be stored in binary log"
,
(
gptr
*
)
&
global_system_variables
.
trans_alloc_block_size
,
(
gptr
*
)
&
global_system_variables
.
trans_alloc_block_size
,
...
...
sql/set_var.cc
View file @
8aec636b
...
@@ -248,7 +248,7 @@ sys_var_thd_ulong sys_max_delayed_threads("max_delayed_threads",
...
@@ -248,7 +248,7 @@ sys_var_thd_ulong sys_max_delayed_threads("max_delayed_threads",
fix_max_connections
);
fix_max_connections
);
sys_var_thd_ulong
sys_max_error_count
(
"max_error_count"
,
sys_var_thd_ulong
sys_max_error_count
(
"max_error_count"
,
&
SV
::
max_error_count
);
&
SV
::
max_error_count
);
sys_var_thd_ulong
sys_max_heap_table_size
(
"max_heap_table_size"
,
sys_var_thd_ulong
long
sys_max_heap_table_size
(
"max_heap_table_size"
,
&
SV
::
max_heap_table_size
);
&
SV
::
max_heap_table_size
);
sys_var_thd_ulong
sys_pseudo_thread_id
(
"pseudo_thread_id"
,
sys_var_thd_ulong
sys_pseudo_thread_id
(
"pseudo_thread_id"
,
&
SV
::
pseudo_thread_id
,
&
SV
::
pseudo_thread_id
,
...
@@ -415,7 +415,7 @@ sys_var_thd_enum sys_tx_isolation("tx_isolation",
...
@@ -415,7 +415,7 @@ sys_var_thd_enum sys_tx_isolation("tx_isolation",
&
SV
::
tx_isolation
,
&
SV
::
tx_isolation
,
&
tx_isolation_typelib
,
&
tx_isolation_typelib
,
fix_tx_isolation
);
fix_tx_isolation
);
sys_var_thd_ulong
sys_tmp_table_size
(
"tmp_table_size"
,
sys_var_thd_ulong
long
sys_tmp_table_size
(
"tmp_table_size"
,
&
SV
::
tmp_table_size
);
&
SV
::
tmp_table_size
);
sys_var_bool_ptr
sys_timed_mutexes
(
"timed_mutexes"
,
sys_var_bool_ptr
sys_timed_mutexes
(
"timed_mutexes"
,
&
timed_mutexes
);
&
timed_mutexes
);
...
...
sql/sql_class.h
View file @
8aec636b
...
@@ -495,6 +495,8 @@ struct system_variables
...
@@ -495,6 +495,8 @@ struct system_variables
{
{
ulonglong
myisam_max_extra_sort_file_size
;
ulonglong
myisam_max_extra_sort_file_size
;
ulonglong
myisam_max_sort_file_size
;
ulonglong
myisam_max_sort_file_size
;
ulonglong
max_heap_table_size
;
ulonglong
tmp_table_size
;
ha_rows
select_limit
;
ha_rows
select_limit
;
ha_rows
max_join_size
;
ha_rows
max_join_size
;
ulong
auto_increment_increment
,
auto_increment_offset
;
ulong
auto_increment_increment
,
auto_increment_offset
;
...
@@ -503,7 +505,6 @@ struct system_variables
...
@@ -503,7 +505,6 @@ struct system_variables
ulong
long_query_time
;
ulong
long_query_time
;
ulong
max_allowed_packet
;
ulong
max_allowed_packet
;
ulong
max_error_count
;
ulong
max_error_count
;
ulong
max_heap_table_size
;
ulong
max_length_for_sort_data
;
ulong
max_length_for_sort_data
;
ulong
max_sort_length
;
ulong
max_sort_length
;
ulong
max_tmp_tables
;
ulong
max_tmp_tables
;
...
@@ -527,7 +528,6 @@ struct system_variables
...
@@ -527,7 +528,6 @@ struct system_variables
ulong
div_precincrement
;
ulong
div_precincrement
;
ulong
sortbuff_size
;
ulong
sortbuff_size
;
ulong
table_type
;
ulong
table_type
;
ulong
tmp_table_size
;
ulong
tx_isolation
;
ulong
tx_isolation
;
ulong
completion_type
;
ulong
completion_type
;
/* Determines which non-standard SQL behaviour should be enabled */
/* Determines which non-standard SQL behaviour should be enabled */
...
@@ -2074,7 +2074,8 @@ class user_var_entry
...
@@ -2074,7 +2074,8 @@ class user_var_entry
class
Unique
:
public
Sql_alloc
class
Unique
:
public
Sql_alloc
{
{
DYNAMIC_ARRAY
file_ptrs
;
DYNAMIC_ARRAY
file_ptrs
;
ulong
max_elements
,
max_in_memory_size
;
ulong
max_elements
;
ulonglong
max_in_memory_size
;
IO_CACHE
file
;
IO_CACHE
file
;
TREE
tree
;
TREE
tree
;
byte
*
record_pointers
;
byte
*
record_pointers
;
...
@@ -2084,7 +2085,7 @@ class Unique :public Sql_alloc
...
@@ -2084,7 +2085,7 @@ class Unique :public Sql_alloc
public:
public:
ulong
elements
;
ulong
elements
;
Unique
(
qsort_cmp2
comp_func
,
void
*
comp_func_fixed_arg
,
Unique
(
qsort_cmp2
comp_func
,
void
*
comp_func_fixed_arg
,
uint
size_arg
,
ulong
max_in_memory_size_arg
);
uint
size_arg
,
ulong
long
max_in_memory_size_arg
);
~
Unique
();
~
Unique
();
ulong
elements_in_tree
()
{
return
tree
.
elements_in_tree
;
}
ulong
elements_in_tree
()
{
return
tree
.
elements_in_tree
;
}
inline
bool
unique_add
(
void
*
ptr
)
inline
bool
unique_add
(
void
*
ptr
)
...
@@ -2098,13 +2099,13 @@ class Unique :public Sql_alloc
...
@@ -2098,13 +2099,13 @@ class Unique :public Sql_alloc
bool
get
(
TABLE
*
table
);
bool
get
(
TABLE
*
table
);
static
double
get_use_cost
(
uint
*
buffer
,
uint
nkeys
,
uint
key_size
,
static
double
get_use_cost
(
uint
*
buffer
,
uint
nkeys
,
uint
key_size
,
ulong
max_in_memory_size
);
ulong
long
max_in_memory_size
);
inline
static
int
get_cost_calc_buff_size
(
ulong
nkeys
,
uint
key_size
,
inline
static
int
get_cost_calc_buff_size
(
ulong
nkeys
,
uint
key_size
,
ulong
max_in_memory_size
)
ulong
long
max_in_memory_size
)
{
{
register
ulong
max_elems_in_tree
=
register
ulong
long
max_elems_in_tree
=
(
1
+
max_in_memory_size
/
ALIGN_SIZE
(
sizeof
(
TREE_ELEMENT
)
+
key_size
));
(
1
+
max_in_memory_size
/
ALIGN_SIZE
(
sizeof
(
TREE_ELEMENT
)
+
key_size
));
return
sizeof
(
uint
)
*
(
1
+
nkeys
/
max_elems_in_tree
);
return
(
int
)
(
sizeof
(
uint
)
*
(
1
+
nkeys
/
max_elems_in_tree
)
);
}
}
void
reset
();
void
reset
();
...
...
sql/sql_select.cc
View file @
8aec636b
...
@@ -9320,7 +9320,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
...
@@ -9320,7 +9320,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
param
->
recinfo
=
recinfo
;
param
->
recinfo
=
recinfo
;
store_record
(
table
,
s
->
default_values
);
// Make empty default record
store_record
(
table
,
s
->
default_values
);
// Make empty default record
if
(
thd
->
variables
.
tmp_table_size
==
~
(
u
long
)
0
)
// No limit
if
(
thd
->
variables
.
tmp_table_size
==
~
(
ulong
long
)
0
)
// No limit
table
->
s
->
max_rows
=
~
(
ha_rows
)
0
;
table
->
s
->
max_rows
=
~
(
ha_rows
)
0
;
else
else
table
->
s
->
max_rows
=
(((
table
->
s
->
db_type
==
DB_TYPE_HEAP
)
?
table
->
s
->
max_rows
=
(((
table
->
s
->
db_type
==
DB_TYPE_HEAP
)
?
...
...
sql/table.cc
View file @
8aec636b
...
@@ -730,6 +730,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
...
@@ -730,6 +730,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
if
(
key_part
->
fieldnr
)
if
(
key_part
->
fieldnr
)
{
// Should always be true !
{
// Should always be true !
Field
*
field
=
key_part
->
field
=
outparam
->
field
[
key_part
->
fieldnr
-
1
];
Field
*
field
=
key_part
->
field
=
outparam
->
field
[
key_part
->
fieldnr
-
1
];
key_part
->
type
=
field
->
key_type
();
if
(
field
->
null_ptr
)
if
(
field
->
null_ptr
)
{
{
key_part
->
null_offset
=
(
uint
)
((
byte
*
)
field
->
null_ptr
-
key_part
->
null_offset
=
(
uint
)
((
byte
*
)
field
->
null_ptr
-
...
...
sql/uniques.cc
View file @
8aec636b
...
@@ -55,7 +55,7 @@ int unique_write_to_ptrs(gptr key, element_count count, Unique *unique)
...
@@ -55,7 +55,7 @@ int unique_write_to_ptrs(gptr key, element_count count, Unique *unique)
}
}
Unique
::
Unique
(
qsort_cmp2
comp_func
,
void
*
comp_func_fixed_arg
,
Unique
::
Unique
(
qsort_cmp2
comp_func
,
void
*
comp_func_fixed_arg
,
uint
size_arg
,
ulong
max_in_memory_size_arg
)
uint
size_arg
,
ulong
long
max_in_memory_size_arg
)
:
max_in_memory_size
(
max_in_memory_size_arg
),
size
(
size_arg
),
elements
(
0
)
:
max_in_memory_size
(
max_in_memory_size_arg
),
size
(
size_arg
),
elements
(
0
)
{
{
my_b_clear
(
&
file
);
my_b_clear
(
&
file
);
...
@@ -260,7 +260,7 @@ static double get_merge_many_buffs_cost(uint *buffer,
...
@@ -260,7 +260,7 @@ static double get_merge_many_buffs_cost(uint *buffer,
*/
*/
double
Unique
::
get_use_cost
(
uint
*
buffer
,
uint
nkeys
,
uint
key_size
,
double
Unique
::
get_use_cost
(
uint
*
buffer
,
uint
nkeys
,
uint
key_size
,
ulong
max_in_memory_size
)
ulong
long
max_in_memory_size
)
{
{
ulong
max_elements_in_tree
;
ulong
max_elements_in_tree
;
ulong
last_tree_elems
;
ulong
last_tree_elems
;
...
...
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