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
837188e6
Commit
837188e6
authored
Feb 13, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into chilla.local:/home/mydev/mysql-5.1-bug25460
parents
db1aa7e8
51393134
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86 additions
and
4 deletions
+86
-4
include/my_base.h
include/my_base.h
+1
-0
mysql-test/r/keywords.result
mysql-test/r/keywords.result
+13
-0
mysql-test/t/keywords.test
mysql-test/t/keywords.test
+22
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-0
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+19
-3
storage/myisam/mi_dynrec.c
storage/myisam/mi_dynrec.c
+8
-0
storage/myisam/mi_extra.c
storage/myisam/mi_extra.c
+6
-1
storage/myisam/mi_open.c
storage/myisam/mi_open.c
+16
-0
No files found.
include/my_base.h
View file @
837188e6
...
...
@@ -47,6 +47,7 @@
#define HA_OPEN_ABORT_IF_CRASHED 16
#define HA_OPEN_FOR_REPAIR 32
/* open even if crashed */
#define HA_OPEN_FROM_SQL_LAYER 64
#define HA_OPEN_MMAP 128
/* open memory mapped */
/* The following is parameter to ha_rkey() how to use key */
...
...
mysql-test/r/keywords.result
View file @
837188e6
...
...
@@ -16,6 +16,19 @@ select events.binlog from events;
binlog
1
drop table events;
create table t1 (connection int, b int);
create procedure p1()
begin
declare connection int;
select max(t1.connection) into connection from t1;
select concat("max=",connection) 'p1';
end|
insert into t1 (connection) values (1);
call p1();
p1
max=1
drop procedure p1;
drop table t1;
create procedure p1()
begin
declare n int default 2;
...
...
mysql-test/t/keywords.test
View file @
837188e6
...
...
@@ -20,6 +20,28 @@ drop table events;
# End of 4.1 tests
#
# Bug#12204 - CONNECTION should not be a reserved word
#
create
table
t1
(
connection
int
,
b
int
);
delimiter
|
;
create
procedure
p1
()
begin
declare
connection
int
;
select
max
(
t1
.
connection
)
into
connection
from
t1
;
select
concat
(
"max="
,
connection
)
'p1'
;
end
|
delimiter
;
|
insert
into
t1
(
connection
)
values
(
1
);
call
p1
();
drop
procedure
p1
;
drop
table
t1
;
# End of 5.0 tests
#
# Bug#19939 "AUTHORS is not a keyword"
#
...
...
sql/sql_yacc.yy
View file @
837188e6
...
...
@@ -9667,6 +9667,7 @@ keyword_sp:
| COMPLETION_SYM {}
| COMPRESSED_SYM {}
| CONCURRENT {}
| CONNECTION_SYM {}
| CONSISTENT_SYM {}
| CONTRIBUTORS_SYM {}
| CUBE_SYM {}
...
...
storage/myisam/ha_myisam.cc
View file @
837188e6
...
...
@@ -598,15 +598,31 @@ bool ha_myisam::check_if_locking_is_allowed(uint sql_command,
int
ha_myisam
::
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
)
{
uint
i
;
/*
If the user wants to have memory mapped data files, add an
open_flag. Do not memory map temporary tables because they are
expected to be inserted and thus extended a lot. Memory mapping is
efficient for files that keep their size, but very inefficient for
growing files. Using an open_flag instead of calling mi_extra(...
HA_EXTRA_MMAP ...) after mi_open() has the advantage that the
mapping is not repeated for every open, but just done on the initial
open, when the MyISAM share is created. Everytime the server
requires to open a new instance of a table it calls this method. We
will always supply HA_OPEN_MMAP for a permanent table. However, the
MyISAM storage engine will ignore this flag if this is a secondary
open of a table that is in use by other threads already (if the
MyISAM share exists already).
*/
if
(
!
(
test_if_locked
&
HA_OPEN_TMP_TABLE
)
&&
opt_myisam_use_mmap
)
test_if_locked
|=
HA_OPEN_MMAP
;
if
(
!
(
file
=
mi_open
(
name
,
mode
,
test_if_locked
|
HA_OPEN_FROM_SQL_LAYER
)))
return
(
my_errno
?
my_errno
:
-
1
);
if
(
test_if_locked
&
(
HA_OPEN_IGNORE_IF_LOCKED
|
HA_OPEN_TMP_TABLE
))
VOID
(
mi_extra
(
file
,
HA_EXTRA_NO_WAIT_LOCK
,
0
));
if
(
!
(
test_if_locked
&
HA_OPEN_TMP_TABLE
)
&&
opt_myisam_use_mmap
)
VOID
(
mi_extra
(
file
,
HA_EXTRA_MMAP
,
0
));
info
(
HA_STATUS_NO_LOCK
|
HA_STATUS_VARIABLE
|
HA_STATUS_CONST
);
if
(
!
(
test_if_locked
&
HA_OPEN_WAIT_IF_LOCKED
))
VOID
(
mi_extra
(
file
,
HA_EXTRA_WAIT_LOCK
,
0
));
...
...
storage/myisam/mi_dynrec.c
View file @
837188e6
...
...
@@ -71,6 +71,14 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
DBUG_PRINT
(
"warning"
,
(
"File is too large for mmap"
));
DBUG_RETURN
(
1
);
}
/*
I wonder if it is good to use MAP_NORESERVE. From the Linux man page:
MAP_NORESERVE
Do not reserve swap space for this mapping. When swap space is
reserved, one has the guarantee that it is possible to modify the
mapping. When swap space is not reserved one might get SIGSEGV
upon a write if no physical memory is available.
*/
info
->
s
->
file_map
=
(
byte
*
)
my_mmap
(
0
,
(
size_t
)(
size
+
MEMMAP_EXTRA_MARGIN
),
info
->
s
->
mode
==
O_RDONLY
?
PROT_READ
:
...
...
storage/myisam/mi_extra.c
View file @
837188e6
...
...
@@ -349,7 +349,12 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
case
HA_EXTRA_MMAP
:
#ifdef HAVE_MMAP
pthread_mutex_lock
(
&
share
->
intern_lock
);
if
(
!
share
->
file_map
)
/*
Memory map the data file if it is not already mapped and if there
are no other threads using this table. intern_lock prevents other
threads from starting to use the table while we are mapping it.
*/
if
(
!
share
->
file_map
&&
(
share
->
tot_locks
==
1
))
{
if
(
mi_dynmap_file
(
info
,
share
->
state
.
state
.
data_file_length
))
{
...
...
storage/myisam/mi_open.c
View file @
837188e6
...
...
@@ -506,6 +506,22 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share
->
data_file_type
=
DYNAMIC_RECORD
;
my_afree
((
gptr
)
disk_cache
);
mi_setup_functions
(
share
);
if
(
open_flags
&
HA_OPEN_MMAP
)
{
info
.
s
=
share
;
if
(
mi_dynmap_file
(
&
info
,
share
->
state
.
state
.
data_file_length
))
{
/* purecov: begin inspected */
/* Ignore if mmap fails. Use file I/O instead. */
DBUG_PRINT
(
"warning"
,
(
"mmap failed: errno: %d"
,
errno
));
/* purecov: end */
}
else
{
share
->
file_read
=
mi_mmap_pread
;
share
->
file_write
=
mi_mmap_pwrite
;
}
}
share
->
is_log_table
=
FALSE
;
#ifdef THREAD
thr_lock_init
(
&
share
->
lock
);
...
...
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