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
7acead9c
Commit
7acead9c
authored
Jan 17, 2007
by
baker@bk-internal.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
parents
affdd4b3
f9ac031d
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
104 additions
and
45 deletions
+104
-45
mysql-test/r/type_enum.result
mysql-test/r/type_enum.result
+26
-0
mysql-test/t/type_enum.test
mysql-test/t/type_enum.test
+23
-1
sql/table.cc
sql/table.cc
+0
-11
sql/unireg.cc
sql/unireg.cc
+40
-21
storage/innobase/buf/buf0buf.c
storage/innobase/buf/buf0buf.c
+1
-1
storage/innobase/dict/dict0dict.c
storage/innobase/dict/dict0dict.c
+2
-2
storage/innobase/fil/fil0fil.c
storage/innobase/fil/fil0fil.c
+2
-2
storage/innobase/ha/ha0ha.c
storage/innobase/ha/ha0ha.c
+1
-1
storage/innobase/ha/hash0hash.c
storage/innobase/ha/hash0hash.c
+1
-1
storage/innobase/include/hash0hash.h
storage/innobase/include/hash0hash.h
+4
-1
storage/innobase/lock/lock0lock.c
storage/innobase/lock/lock0lock.c
+1
-1
storage/innobase/log/log0recv.c
storage/innobase/log/log0recv.c
+2
-2
storage/innobase/thr/thr0loc.c
storage/innobase/thr/thr0loc.c
+1
-1
No files found.
mysql-test/r/type_enum.result
View file @
7acead9c
...
...
@@ -1754,3 +1754,29 @@ t1 CREATE TABLE `t1` (
`f2` enum('') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
End of 4.1 tests
create table t1(russian enum('E','F','EF','FE') NOT NULL DEFAULT'E');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`russian` enum('E','F','EF','FE') NOT NULL DEFAULT 'E'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`denormal` enum('E','F','E,F','F,E') NOT NULL DEFAULT 'E'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1(russian_deviant enum('E','F','EF','F,E') NOT NULL DEFAULT'E');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`russian_deviant` enum('E','F','EF','F,E') NOT NULL DEFAULT 'E'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','
!"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz'));
ERROR 42000: Field separator argument is not what is expected; check the manual
End of 5.1 tests
...
...
mysql-test/t/type_enum.test
View file @
7acead9c
...
...
@@ -136,4 +136,26 @@ alter table t1 add f2 enum(0xFFFF);
show
create
table
t1
;
drop
table
t1
;
# End of 4.1 tests
--
echo
End
of
4.1
tests
#
# Bug#24660 "enum" field type definition problem
#
create
table
t1
(
russian
enum
(
'E'
,
'F'
,
'EF'
,
'FE'
)
NOT
NULL
DEFAULT
'E'
);
show
create
table
t1
;
drop
table
t1
;
create
table
t1
(
denormal
enum
(
'E'
,
'F'
,
'E,F'
,
'F,E'
)
NOT
NULL
DEFAULT
'E'
);
show
create
table
t1
;
drop
table
t1
;
create
table
t1
(
russian_deviant
enum
(
'E'
,
'F'
,
'EF'
,
'F,E'
)
NOT
NULL
DEFAULT
'E'
);
show
create
table
t1
;
drop
table
t1
;
# ER_WRONG_FIELD_TERMINATORS
--
error
1083
create
table
t1
(
exhausting_charset
enum
(
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
,
'
!"'
,
'#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
,
'xx\'
,
'yy\','
zz
'
));
--
echo
End
of
5.1
tests
...
...
sql/table.cc
View file @
7acead9c
...
...
@@ -803,17 +803,6 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
{
char
*
val
=
(
char
*
)
interval
->
type_names
[
count
];
interval
->
type_lengths
[
count
]
=
strlen
(
val
);
/*
Replace all ',' symbols with NAMES_SEP_CHAR.
See the comment in unireg.cc, pack_fields() function
for details.
*/
for
(
uint
cnt
=
0
;
cnt
<
interval
->
type_lengths
[
count
]
;
cnt
++
)
{
char
c
=
val
[
cnt
];
if
(
c
==
','
)
val
[
cnt
]
=
NAMES_SEP_CHAR
;
}
}
interval
->
type_lengths
[
count
]
=
0
;
}
...
...
sql/unireg.cc
View file @
7acead9c
...
...
@@ -788,29 +788,48 @@ static bool pack_fields(File file, List<create_field> &create_fields,
{
if
(
field
->
interval_id
>
int_count
)
{
int_count
=
field
->
interval_id
;
tmp
.
append
(
NAMES_SEP_CHAR
);
for
(
const
char
**
pos
=
field
->
interval
->
type_names
;
*
pos
;
pos
++
)
{
char
*
val
=
(
char
*
)
*
pos
;
uint
str_len
=
strlen
(
val
);
/*
Note, hack: in old frm NAMES_SEP_CHAR is used to separate
names in the interval (ENUM/SET). To allow names to contain
NAMES_SEP_CHAR, we replace it with a comma before writing frm.
Backward conversion is done during frm file opening,
See table.cc, openfrm() function
*/
for
(
uint
cnt
=
0
;
cnt
<
str_len
;
cnt
++
)
unsigned
char
sep
=
0
;
unsigned
char
occ
[
256
];
uint
i
;
unsigned
char
*
val
=
NULL
;
bzero
(
occ
,
sizeof
(
occ
));
for
(
i
=
0
;
(
val
=
(
unsigned
char
*
)
field
->
interval
->
type_names
[
i
]);
i
++
)
for
(
uint
j
=
0
;
j
<
field
->
interval
->
type_lengths
[
i
];
j
++
)
occ
[(
unsigned
int
)
(
val
[
j
])]
=
1
;
if
(
!
occ
[(
unsigned
char
)
NAMES_SEP_CHAR
])
sep
=
(
unsigned
char
)
NAMES_SEP_CHAR
;
else
if
(
!
occ
[(
unsigned
int
)
','
])
sep
=
','
;
else
{
for
(
uint
i
=
1
;
i
<
256
;
i
++
)
{
if
(
!
occ
[
i
])
{
sep
=
i
;
break
;
}
}
if
(
!
sep
)
/* disaster, enum uses all characters, none left as separator */
{
char
c
=
val
[
cnt
];
if
(
c
==
NAMES_SEP_CHAR
)
val
[
cnt
]
=
','
;
my_message
(
ER_WRONG_FIELD_TERMINATORS
,
ER
(
ER_WRONG_FIELD_TERMINATORS
),
MYF
(
0
));
DBUG_RETURN
(
1
)
;
}
tmp
.
append
(
*
pos
);
tmp
.
append
(
NAMES_SEP_CHAR
);
}
tmp
.
append
(
'\0'
);
// End of intervall
}
int_count
=
field
->
interval_id
;
tmp
.
append
(
sep
);
for
(
const
char
**
pos
=
field
->
interval
->
type_names
;
*
pos
;
pos
++
)
{
tmp
.
append
(
*
pos
);
tmp
.
append
(
sep
);
}
tmp
.
append
(
'\0'
);
// End of intervall
}
}
if
(
my_write
(
file
,(
byte
*
)
tmp
.
ptr
(),
tmp
.
length
(),
MYF_RW
))
...
...
storage/innobase/buf/buf0buf.c
View file @
7acead9c
...
...
@@ -704,7 +704,7 @@ buf_pool_init(
}
}
buf_pool
->
page_hash
=
hash
0
_create
(
2
*
max_size
);
buf_pool
->
page_hash
=
hash_create
(
2
*
max_size
);
buf_pool
->
n_pend_reads
=
0
;
...
...
storage/innobase/dict/dict0dict.c
View file @
7acead9c
...
...
@@ -782,10 +782,10 @@ dict_init(void)
mutex_create
(
&
dict_sys
->
mutex
,
SYNC_DICT
);
dict_sys
->
table_hash
=
hash
0
_create
(
buf_pool_get_max_size
()
dict_sys
->
table_hash
=
hash_create
(
buf_pool_get_max_size
()
/
(
DICT_POOL_PER_TABLE_HASH
*
UNIV_WORD_SIZE
));
dict_sys
->
table_id_hash
=
hash
0
_create
(
buf_pool_get_max_size
()
dict_sys
->
table_id_hash
=
hash_create
(
buf_pool_get_max_size
()
/
(
DICT_POOL_PER_TABLE_HASH
*
UNIV_WORD_SIZE
));
dict_sys
->
size
=
0
;
...
...
storage/innobase/fil/fil0fil.c
View file @
7acead9c
...
...
@@ -1323,8 +1323,8 @@ fil_system_create(
mutex_create
(
&
system
->
mutex
,
SYNC_ANY_LATCH
);
system
->
spaces
=
hash
0
_create
(
hash_size
);
system
->
name_hash
=
hash
0
_create
(
hash_size
);
system
->
spaces
=
hash_create
(
hash_size
);
system
->
name_hash
=
hash_create
(
hash_size
);
UT_LIST_INIT
(
system
->
LRU
);
...
...
storage/innobase/ha/ha0ha.c
View file @
7acead9c
...
...
@@ -34,7 +34,7 @@ ha_create_func(
hash_table_t
*
table
;
ulint
i
;
table
=
hash
0
_create
(
n
);
table
=
hash_create
(
n
);
if
(
in_btr_search
)
{
table
->
adaptive
=
TRUE
;
...
...
storage/innobase/ha/hash0hash.c
View file @
7acead9c
...
...
@@ -74,7 +74,7 @@ Creates a hash table with >= n array cells. The actual number of cells is
chosen to be a prime number slightly bigger than n. */
hash_table_t
*
hash
0
_create
(
hash_create
(
/*========*/
/* out, own: created table */
ulint
n
)
/* in: number of array cells */
...
...
storage/innobase/include/hash0hash.h
View file @
7acead9c
...
...
@@ -18,12 +18,15 @@ typedef struct hash_cell_struct hash_cell_t;
typedef
void
*
hash_node_t
;
/* Fix Bug #13859: symbol collision between imap/mysql */
#define hash_create hash0_create
/*****************************************************************
Creates a hash table with >= n array cells. The actual number
of cells is chosen to be a prime number slightly bigger than n. */
hash_table_t
*
hash
0
_create
(
hash_create
(
/*========*/
/* out, own: created table */
ulint
n
);
/* in: number of array cells */
...
...
storage/innobase/lock/lock0lock.c
View file @
7acead9c
...
...
@@ -586,7 +586,7 @@ lock_sys_create(
{
lock_sys
=
mem_alloc
(
sizeof
(
lock_sys_t
));
lock_sys
->
rec_hash
=
hash
0
_create
(
n_cells
);
lock_sys
->
rec_hash
=
hash_create
(
n_cells
);
/* hash_create_mutexes(lock_sys->rec_hash, 2, SYNC_REC_LOCK); */
...
...
storage/innobase/log/log0recv.c
View file @
7acead9c
...
...
@@ -147,7 +147,7 @@ recv_sys_init(
recv_sys
->
len
=
0
;
recv_sys
->
recovered_offset
=
0
;
recv_sys
->
addr_hash
=
hash
0
_create
(
available_memory
/
64
);
recv_sys
->
addr_hash
=
hash_create
(
available_memory
/
64
);
recv_sys
->
n_addrs
=
0
;
recv_sys
->
apply_log_recs
=
FALSE
;
...
...
@@ -188,7 +188,7 @@ recv_sys_empty_hash(void)
hash_table_free
(
recv_sys
->
addr_hash
);
mem_heap_empty
(
recv_sys
->
heap
);
recv_sys
->
addr_hash
=
hash
0
_create
(
buf_pool_get_curr_size
()
/
256
);
recv_sys
->
addr_hash
=
hash_create
(
buf_pool_get_curr_size
()
/
256
);
}
#ifndef UNIV_LOG_DEBUG
...
...
storage/innobase/thr/thr0loc.c
View file @
7acead9c
...
...
@@ -224,7 +224,7 @@ thr_local_init(void)
ut_a
(
thr_local_hash
==
NULL
);
thr_local_hash
=
hash
0
_create
(
OS_THREAD_MAX_N
+
100
);
thr_local_hash
=
hash_create
(
OS_THREAD_MAX_N
+
100
);
mutex_create
(
&
thr_local_mutex
,
SYNC_THR_LOCAL
);
}
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