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
d66321b9
Commit
d66321b9
authored
Mar 26, 2008
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Merge 2367:2384 from branches/5.1.
parent
ab7b62e7
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
149 additions
and
13 deletions
+149
-13
dict/dict0dict.c
dict/dict0dict.c
+1
-1
include/trx0undo.h
include/trx0undo.h
+1
-0
mysql-test/innodb_bug34300.result
mysql-test/innodb_bug34300.result
+4
-0
mysql-test/innodb_bug34300.test
mysql-test/innodb_bug34300.test
+30
-0
mysql-test/innodb_bug35220.result
mysql-test/innodb_bug35220.result
+1
-0
mysql-test/innodb_bug35220.test
mysql-test/innodb_bug35220.test
+16
-0
os/os0file.c
os/os0file.c
+52
-5
row/row0sel.c
row/row0sel.c
+19
-0
trx/trx0trx.c
trx/trx0trx.c
+3
-3
trx/trx0undo.c
trx/trx0undo.c
+22
-4
No files found.
dict/dict0dict.c
View file @
d66321b9
...
...
@@ -3592,7 +3592,7 @@ loop:
ptr
=
dict_accept
(
cs
,
ptr
,
"FOREIGN"
,
&
success
);
if
(
!
success
)
{
if
(
!
success
||
!
my_isspace
(
cs
,
*
ptr
)
)
{
goto
loop
;
}
...
...
include/trx0undo.h
View file @
d66321b9
...
...
@@ -246,6 +246,7 @@ trx_undo_set_state_at_finish(
/*=========================*/
/* out: undo log segment header page,
x-latched */
trx_rseg_t
*
rseg
,
/* in: rollback segment memory object */
trx_t
*
trx
,
/* in: transaction */
trx_undo_t
*
undo
,
/* in: undo log memory copy */
mtr_t
*
mtr
);
/* in: mtr */
...
...
mysql-test/innodb_bug34300.result
0 → 100644
View file @
d66321b9
f4 f8
xxx zzz
f4 f8
xxx zzz
mysql-test/innodb_bug34300.test
0 → 100644
View file @
d66321b9
#
# Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1
# http://bugs.mysql.com/34300
#
--
source
include
/
have_innodb
.
inc
--
disable_query_log
--
disable_result_log
SET
@@
max_allowed_packet
=
16777216
;
DROP
TABLE
IF
EXISTS
bug34300
;
CREATE
TABLE
bug34300
(
f4
TINYTEXT
,
f6
MEDIUMTEXT
,
f8
TINYBLOB
)
ENGINE
=
InnoDB
;
INSERT
INTO
bug34300
VALUES
(
'xxx'
,
repeat
(
'a'
,
8459264
),
'zzz'
);
--
enable_result_log
SELECT
f4
,
f8
FROM
bug34300
;
ALTER
TABLE
bug34300
ADD
COLUMN
(
f10
INT
);
SELECT
f4
,
f8
FROM
bug34300
;
DROP
TABLE
bug34300
;
mysql-test/innodb_bug35220.result
0 → 100644
View file @
d66321b9
SET storage_engine=InnoDB;
mysql-test/innodb_bug35220.test
0 → 100644
View file @
d66321b9
#
# Bug#35220 ALTER TABLE too picky on reserved word "foreign"
# http://bugs.mysql.com/35220
#
--
source
include
/
have_innodb
.
inc
SET
storage_engine
=
InnoDB
;
# we care only that the following SQL commands do not produce errors
--
disable_query_log
--
disable_result_log
CREATE
TABLE
bug35220
(
foreign_col
INT
,
dummy_cant_delete_all_columns
INT
);
ALTER
TABLE
bug35220
DROP
foreign_col
;
DROP
TABLE
bug35220
;
os/os0file.c
View file @
d66321b9
...
...
@@ -1797,6 +1797,55 @@ os_file_set_eof(
#endif
/* __WIN__ */
}
#ifndef __WIN__
/***************************************************************************
Wrapper to fsync(2) that retries the call on some errors.
Returns the value 0 if successful; otherwise the value -1 is returned and
the global variable errno is set to indicate the error. */
static
int
os_file_fsync
(
/*==========*/
/* out: 0 if success, -1 otherwise */
os_file_t
file
)
/* in: handle to a file */
{
int
ret
;
int
failures
;
ibool
retry
;
failures
=
0
;
do
{
ret
=
fsync
(
file
);
os_n_fsyncs
++
;
if
(
ret
==
-
1
&&
errno
==
ENOLCK
)
{
if
(
failures
%
100
==
0
)
{
ut_print_timestamp
(
stderr
);
fprintf
(
stderr
,
" InnoDB: fsync(): "
"No locks available; retrying
\n
"
);
}
os_thread_sleep
(
200000
/* 0.2 sec */
);
failures
++
;
retry
=
TRUE
;
}
else
{
retry
=
FALSE
;
}
}
while
(
retry
);
return
(
ret
);
}
#endif
/* !__WIN__ */
/***************************************************************************
Flushes the write buffers of a given file to the disk. */
UNIV_INTERN
...
...
@@ -1854,21 +1903,19 @@ os_file_flush(
/* If we are not on an operating system that supports this,
then fall back to a plain fsync. */
ret
=
fsync
(
file
);
ret
=
os_file_
fsync
(
file
);
}
else
{
ret
=
fcntl
(
file
,
F_FULLFSYNC
,
NULL
);
if
(
ret
)
{
/* If we are not on a file system that supports this,
then fall back to a plain fsync. */
ret
=
fsync
(
file
);
ret
=
os_file_
fsync
(
file
);
}
}
#else
/* fprintf(stderr, "Flushing to file %p\n", file); */
ret
=
fsync
(
file
);
ret
=
os_file_fsync
(
file
);
#endif
os_n_fsyncs
++
;
if
(
ret
==
0
)
{
return
(
TRUE
);
...
...
row/row0sel.c
View file @
d66321b9
...
...
@@ -2759,6 +2759,25 @@ row_sel_store_mysql_rec(
data
=
rec_get_nth_field
(
rec
,
offsets
,
templ
->
rec_field_no
,
&
len
);
if
(
UNIV_UNLIKELY
(
templ
->
type
==
DATA_BLOB
)
&&
len
!=
UNIV_SQL_NULL
)
{
/* It is a BLOB field locally stored in the
InnoDB record: we MUST copy its contents to
prebuilt->blob_heap here because later code
assumes all BLOB values have been copied to a
safe place. */
if
(
prebuilt
->
blob_heap
==
NULL
)
{
prebuilt
->
blob_heap
=
mem_heap_create
(
UNIV_PAGE_SIZE
);
}
data
=
memcpy
(
mem_heap_alloc
(
prebuilt
->
blob_heap
,
len
),
data
,
len
);
}
}
if
(
len
!=
UNIV_SQL_NULL
)
{
...
...
trx/trx0trx.c
View file @
d66321b9
...
...
@@ -716,8 +716,8 @@ trx_commit_off_kernel(
mutex_enter
(
&
(
rseg
->
mutex
));
if
(
trx
->
insert_undo
!=
NULL
)
{
trx_undo_set_state_at_finish
(
trx
,
trx
->
insert_undo
,
&
mtr
);
trx_undo_set_state_at_finish
(
rseg
,
trx
,
trx
->
insert_undo
,
&
mtr
);
}
undo
=
trx
->
update_undo
;
...
...
@@ -733,7 +733,7 @@ trx_commit_off_kernel(
transaction commit for this transaction. */
update_hdr_page
=
trx_undo_set_state_at_finish
(
trx
,
undo
,
&
mtr
);
rseg
,
trx
,
undo
,
&
mtr
);
/* We have to do the cleanup for the update log while
holding the rseg mutex because update log headers
...
...
trx/trx0undo.c
View file @
d66321b9
...
...
@@ -1771,6 +1771,7 @@ trx_undo_set_state_at_finish(
/*=========================*/
/* out: undo log segment header page,
x-latched */
trx_rseg_t
*
rseg
,
/* in: rollback segment memory object */
trx_t
*
trx
__attribute__
((
unused
)),
/* in: transaction */
trx_undo_t
*
undo
,
/* in: undo log memory copy */
mtr_t
*
mtr
)
/* in: mtr */
...
...
@@ -1780,7 +1781,10 @@ trx_undo_set_state_at_finish(
page_t
*
undo_page
;
ulint
state
;
ut_ad
(
trx
&&
undo
&&
mtr
);
ut_ad
(
trx
);
ut_ad
(
undo
);
ut_ad
(
mtr
);
ut_ad
(
mutex_own
(
&
rseg
->
mutex
));
if
(
undo
->
id
>=
TRX_RSEG_N_SLOTS
)
{
fprintf
(
stderr
,
"InnoDB: Error: undo->id is %lu
\n
"
,
...
...
@@ -1795,9 +1799,23 @@ trx_undo_set_state_at_finish(
seg_hdr
=
undo_page
+
TRX_UNDO_SEG_HDR
;
page_hdr
=
undo_page
+
TRX_UNDO_PAGE_HDR
;
if
(
undo
->
size
==
1
&&
mach_read_from_2
(
page_hdr
+
TRX_UNDO_PAGE_FREE
)
<
TRX_UNDO_PAGE_REUSE_LIMIT
)
{
state
=
TRX_UNDO_CACHED
;
if
(
undo
->
size
==
1
&&
mach_read_from_2
(
page_hdr
+
TRX_UNDO_PAGE_FREE
)
<
TRX_UNDO_PAGE_REUSE_LIMIT
)
{
/* This is a heuristic to avoid the problem of all UNDO
slots ending up in one of the UNDO lists. Previously if
the server crashed with all the slots in one of the lists,
transactions that required the slots of a different type
would fail for lack of slots. */
if
(
UT_LIST_GET_LEN
(
rseg
->
update_undo_list
)
<
500
&&
UT_LIST_GET_LEN
(
rseg
->
insert_undo_list
)
<
500
)
{
state
=
TRX_UNDO_CACHED
;
}
else
{
state
=
TRX_UNDO_TO_FREE
;
}
}
else
if
(
undo
->
type
==
TRX_UNDO_INSERT
)
{
...
...
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