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
b8907ffa
Commit
b8907ffa
authored
Sep 26, 2011
by
Bjorn Munch
Browse files
Options
Browse Files
Download
Plain Diff
merge from 5.1 main
parents
43996d3d
74076bcf
Changes
48
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
545 additions
and
568 deletions
+545
-568
client/sql_string.cc
client/sql_string.cc
+4
-2
include/m_string.h
include/m_string.h
+9
-0
mysql-test/r/myisampack.result
mysql-test/r/myisampack.result
+32
-0
mysql-test/r/order_by.result
mysql-test/r/order_by.result
+7
-0
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+16
-0
mysql-test/r/sp.result
mysql-test/r/sp.result
+15
-0
mysql-test/r/type_float.result
mysql-test/r/type_float.result
+9
-0
mysql-test/r/union.result
mysql-test/r/union.result
+57
-0
mysql-test/suite/innodb_plugin/r/innodb-index.result
mysql-test/suite/innodb_plugin/r/innodb-index.result
+77
-14
mysql-test/suite/innodb_plugin/t/innodb-index.test
mysql-test/suite/innodb_plugin/t/innodb-index.test
+68
-19
mysql-test/t/myisampack.test
mysql-test/t/myisampack.test
+45
-0
mysql-test/t/order_by.test
mysql-test/t/order_by.test
+7
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+22
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+20
-0
mysql-test/t/type_float.test
mysql-test/t/type_float.test
+17
-0
mysql-test/t/union.test
mysql-test/t/union.test
+41
-0
sql/sql_lex.cc
sql/sql_lex.cc
+3
-0
sql/sql_string.cc
sql/sql_string.cc
+4
-2
sql/sql_union.cc
sql/sql_union.cc
+30
-9
sql/sql_yacc.yy
sql/sql_yacc.yy
+15
-0
sql/unireg.h
sql/unireg.h
+0
-1
storage/innobase/btr/btr0pcur.c
storage/innobase/btr/btr0pcur.c
+0
-27
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+0
-19
storage/innobase/include/btr0pcur.h
storage/innobase/include/btr0pcur.h
+3
-16
storage/innobase/include/btr0pcur.ic
storage/innobase/include/btr0pcur.ic
+3
-4
storage/innobase/include/buf0buf.h
storage/innobase/include/buf0buf.h
+0
-19
storage/innobase/include/buf0buf.ic
storage/innobase/include/buf0buf.ic
+0
-46
storage/innobase/include/mtr0mtr.h
storage/innobase/include/mtr0mtr.h
+0
-10
storage/innobase/include/ut0mem.h
storage/innobase/include/ut0mem.h
+0
-37
storage/innobase/include/ut0mem.ic
storage/innobase/include/ut0mem.ic
+0
-21
storage/innobase/mtr/mtr0mtr.c
storage/innobase/mtr/mtr0mtr.c
+0
-34
storage/innobase/row/row0purge.c
storage/innobase/row/row0purge.c
+8
-6
storage/innobase/ut/ut0mem.c
storage/innobase/ut/ut0mem.c
+0
-47
storage/innodb_plugin/ChangeLog
storage/innodb_plugin/ChangeLog
+5
-0
storage/innodb_plugin/btr/btr0pcur.c
storage/innodb_plugin/btr/btr0pcur.c
+0
-27
storage/innodb_plugin/handler/ha_innodb.cc
storage/innodb_plugin/handler/ha_innodb.cc
+1
-20
storage/innodb_plugin/include/btr0pcur.h
storage/innodb_plugin/include/btr0pcur.h
+4
-17
storage/innodb_plugin/include/btr0pcur.ic
storage/innodb_plugin/include/btr0pcur.ic
+4
-5
storage/innodb_plugin/include/mtr0mtr.h
storage/innodb_plugin/include/mtr0mtr.h
+0
-10
storage/innodb_plugin/include/ut0mem.h
storage/innodb_plugin/include/ut0mem.h
+1
-38
storage/innodb_plugin/include/ut0mem.ic
storage/innodb_plugin/include/ut0mem.ic
+1
-22
storage/innodb_plugin/mtr/mtr0mtr.c
storage/innodb_plugin/mtr/mtr0mtr.c
+0
-34
storage/innodb_plugin/row/row0purge.c
storage/innodb_plugin/row/row0purge.c
+11
-9
storage/innodb_plugin/ut/ut0mem.c
storage/innodb_plugin/ut/ut0mem.c
+1
-48
storage/myisam/ft_boolean_search.c
storage/myisam/ft_boolean_search.c
+1
-1
storage/myisam/ft_nlq_search.c
storage/myisam/ft_nlq_search.c
+1
-1
storage/myisam/mi_check.c
storage/myisam/mi_check.c
+2
-2
storage/myisam/mi_write.c
storage/myisam/mi_write.c
+1
-1
No files found.
client/sql_string.cc
View file @
b8907ffa
...
...
@@ -118,7 +118,7 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
bool
String
::
set
(
double
num
,
uint
decimals
,
CHARSET_INFO
*
cs
)
{
char
buff
[
331
];
char
buff
[
FLOATING_POINT_BUFFER
];
uint
dummy_errors
;
str_charset
=
cs
;
...
...
@@ -188,7 +188,9 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
#else
#ifdef HAVE_SNPRINTF
buff
[
sizeof
(
buff
)
-
1
]
=
0
;
// Safety
snprintf
(
buff
,
sizeof
(
buff
)
-
1
,
"%.*f"
,(
int
)
decimals
,
num
);
int
num_chars
=
snprintf
(
buff
,
sizeof
(
buff
)
-
1
,
"%.*f"
,(
int
)
decimals
,
num
);
DBUG_ASSERT
(
num_chars
>
0
);
DBUG_ASSERT
(
num_chars
<
(
int
)
sizeof
(
buff
));
#else
sprintf
(
buff
,
"%.*f"
,(
int
)
decimals
,
num
);
#endif
...
...
include/m_string.h
View file @
b8907ffa
...
...
@@ -179,6 +179,15 @@ extern int is_prefix(const char *, const char *);
double
my_strtod
(
const
char
*
str
,
char
**
end
,
int
*
error
);
double
my_atof
(
const
char
*
nptr
);
#ifndef NOT_FIXED_DEC
#define NOT_FIXED_DEC 31
#endif
/*
Max length of a floating point number.
*/
#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC)
extern
char
*
llstr
(
longlong
value
,
char
*
buff
);
extern
char
*
ullstr
(
longlong
value
,
char
*
buff
);
#ifndef HAVE_STRTOUL
...
...
mysql-test/r/myisampack.result
View file @
b8907ffa
...
...
@@ -87,3 +87,35 @@ COUNT(*)
128
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
#
# BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
#
CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
FLUSH TABLE t1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
a
aaaa
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
a
aaaa
DROP TABLE t1;
# Test table with key_reflength > rec_reflength
CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
# Populating a table, so it's index file exceeds 65K
# Populating a table, so index file has second level fulltext tree
FLUSH TABLE t1;
# Compressing table
# Fixing index (repair by sort)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
FLUSH TABLE t1;
# Fixing index (repair with keycache)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
mysql-test/r/order_by.result
View file @
b8907ffa
...
...
@@ -1664,4 +1664,11 @@ a 1
3 1
2 1
DROP TABLE t1;
#
# Bug#11765255 58201:
# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
#
select 1 order by max(1) + min(1);
1
1
End of 5.1 tests
mysql-test/r/sp-error.result
View file @
b8907ffa
...
...
@@ -1685,4 +1685,20 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
#
# Bug#12428824 - PARSER STACK OVERFLOW AND CRASH IN SP_ADD_USED_ROUTINE
# WITH OBSCURE QUERY
#
SELECT very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
ERROR 42000: Identifier name 'very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
CALL very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
ERROR 42000: Identifier name 'very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
SELECT very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_func();
ERROR 42000: Incorrect database name 'very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222'
CALL very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_proc();
ERROR 42000: Incorrect database name 'very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222'
SELECT db_name.very_long_fn_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
ERROR 42000: Identifier name 'very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
CALL db_name.very_long_pr_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
ERROR 42000: Identifier name 'very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
End of 5.1 tests
mysql-test/r/sp.result
View file @
b8907ffa
...
...
@@ -7054,6 +7054,21 @@ SET @@GLOBAL.init_connect= @old_init_connect;
DROP PROCEDURE p2;
DROP PROCEDURE p5;
#
# Bug#11840395 (formerly known as bug#60347):
# The string "versiondata" seems
# to be 'leaking' into the schema name space
#
DROP DATABASE IF EXISTS mixedCaseDbName;
CREATE DATABASE mixedCaseDbName;
CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end|
CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin return 'IT WORKS'; end
|
call mixedCaseDbName.tryMyProc();
select mixedCaseDbName.tryMyFunc();
mixedCaseDbName.tryMyFunc()
IT WORKS
DROP DATABASE mixedCaseDbName;
#
# Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
#
CREATE TABLE t1 (a INT, b INT, KEY(b));
...
...
mysql-test/r/type_float.result
View file @
b8907ffa
...
...
@@ -407,4 +407,13 @@ SELECT f1 FROM t1;
f1
-1.79769313486231e+308
DROP TABLE t1;
#
# Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
#
# Ignoring output from misc. float operations
select format(-1.7976931348623157E+307,256) as foo;
select least(-1.1111111111111111111111111,
- group_concat(1.7976931348623157E+308)) as foo;
select concat((truncate((-1.7976931348623157E+307),(0x1e))),
(99999999999999999999999999999999999999999999999999999999999999999)) into @a;
End of 5.0 tests
mysql-test/r/union.result
View file @
b8907ffa
...
...
@@ -1647,4 +1647,61 @@ b
1
2
DROP TABLE t1,t2;
#
# Bug#11765255 58201:
# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
#
select 1 as foo
union
select 2
union
select 3
union
select 4
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
foo
1
prepare stmt1 from 'select 1 as foo
union
select 2
union
select 3
union
select 4
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
';
execute stmt1;
foo
1
execute stmt1;
foo
1
select 1 as foo
union
select 2
union
select 3
union
(select 4)
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
foo
1
prepare stmt1 from 'select 1 as foo
union
select 2
union
select 3
union
(select 4)
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
';
execute stmt1;
foo
1
execute stmt1;
foo
1
deallocate prepare stmt1;
End of 5.1 tests
mysql-test/suite/innodb_plugin/r/innodb-index.result
View file @
b8907ffa
...
...
@@ -39,6 +39,81 @@ DELETE FROM t1_purge;
DELETE FROM t2_purge;
DELETE FROM t3_purge;
DELETE FROM t4_purge;
SET @r=REPEAT('a',500);
CREATE TABLE t12637786(a INT,
v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t12637786(a,v1);
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t12637786 SET a=1000;
DELETE FROM t12637786;
create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
engine=innodb row_format=dynamic;
SET @r = repeat('a', 767);
insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
create index ndx_a on t12963823 (a(500));
create index ndx_b on t12963823 (b(500));
create index ndx_c on t12963823 (c(500));
create index ndx_d on t12963823 (d(500));
create index ndx_e on t12963823 (e(500));
create index ndx_f on t12963823 (f(500));
create index ndx_k on t12963823 (k(500));
create index ndx_l on t12963823 (l(500));
SET @r = repeat('b', 500);
update t12963823 set a=@r,b=@r,c=@r,d=@r;
update t12963823 set e=@r,f=@r,g=@r,h=@r;
update t12963823 set i=@r,j=@r,k=@r,l=@r;
update t12963823 set m=@r,n=@r,o=@r,p=@r;
alter table t12963823 drop index ndx_a;
alter table t12963823 drop index ndx_b;
create index ndx_g on t12963823 (g(500));
create index ndx_h on t12963823 (h(500));
create index ndx_i on t12963823 (i(500));
create index ndx_j on t12963823 (j(500));
create index ndx_m on t12963823 (m(500));
create index ndx_n on t12963823 (n(500));
create index ndx_o on t12963823 (o(500));
create index ndx_p on t12963823 (p(500));
show create table t12963823;
Table Create Table
t12963823 CREATE TABLE `t12963823` (
`a` blob,
`b` blob,
`c` blob,
`d` blob,
`e` blob,
`f` blob,
`g` blob,
`h` blob,
`i` blob,
`j` blob,
`k` blob,
`l` blob,
`m` blob,
`n` blob,
`o` blob,
`p` blob,
KEY `ndx_c` (`c`(500)),
KEY `ndx_d` (`d`(500)),
KEY `ndx_e` (`e`(500)),
KEY `ndx_f` (`f`(500)),
KEY `ndx_k` (`k`(500)),
KEY `ndx_l` (`l`(500)),
KEY `ndx_g` (`g`(500)),
KEY `ndx_h` (`h`(500)),
KEY `ndx_i` (`i`(500)),
KEY `ndx_j` (`j`(500)),
KEY `ndx_m` (`m`(500)),
KEY `ndx_n` (`n`(500)),
KEY `ndx_o` (`o`(500)),
KEY `ndx_p` (`p`(500))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
set global innodb_file_per_table=0;
set global innodb_file_format=Antelope;
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
...
...
@@ -1010,20 +1085,6 @@ ERROR HY000: Too big row
alter table t1 row_format=compact;
create index t1u on t1 (u(1));
drop table t1;
SET @r=REPEAT('a',500);
CREATE TABLE t1(a INT,
v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t1(a,v1);
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t1 SET a=1000;
DELETE FROM t1;
DROP TABLE t1;
CREATE TABLE bug12547647(
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
PRIMARY KEY (b(10), a), INDEX (c(10))
...
...
@@ -1237,3 +1298,5 @@ a b
3 b
DROP TABLE t1;
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
DROP TABLE t12637786;
DROP TABLE t12963823;
mysql-test/suite/innodb_plugin/t/innodb-index.test
View file @
b8907ffa
...
...
@@ -9,7 +9,7 @@ let $format=`select @@innodb_file_format`;
set
global
innodb_file_per_table
=
on
;
set
global
innodb_file_format
=
'Barracuda'
;
# Test an assertion failure on purge.
#
Bug #12429576 -
Test an assertion failure on purge.
CREATE
TABLE
t1_purge
(
A
INT
,
B
BLOB
,
C
BLOB
,
D
BLOB
,
E
BLOB
,
...
...
@@ -59,6 +59,68 @@ DELETE FROM t1_purge;
DELETE
FROM
t2_purge
;
DELETE
FROM
t3_purge
;
DELETE
FROM
t4_purge
;
# Instead of doing a --sleep 10, wait until the rest of the tests in
# this file complete before dropping the tables. By then, the purge thread
# will have delt with the updates above.
# Bug#12637786 - Bad assert by purge thread for records with external data
# used in secondary indexes.
SET
@
r
=
REPEAT
(
'a'
,
500
);
CREATE
TABLE
t12637786
(
a
INT
,
v1
VARCHAR
(
500
),
v2
VARCHAR
(
500
),
v3
VARCHAR
(
500
),
v4
VARCHAR
(
500
),
v5
VARCHAR
(
500
),
v6
VARCHAR
(
500
),
v7
VARCHAR
(
500
),
v8
VARCHAR
(
500
),
v9
VARCHAR
(
500
),
v10
VARCHAR
(
500
),
v11
VARCHAR
(
500
),
v12
VARCHAR
(
500
),
v13
VARCHAR
(
500
),
v14
VARCHAR
(
500
),
v15
VARCHAR
(
500
),
v16
VARCHAR
(
500
),
v17
VARCHAR
(
500
),
v18
VARCHAR
(
500
)
)
ENGINE
=
InnoDB
ROW_FORMAT
=
DYNAMIC
;
CREATE
INDEX
idx1
ON
t12637786
(
a
,
v1
);
INSERT
INTO
t12637786
VALUES
(
9
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
);
UPDATE
t12637786
SET
a
=
1000
;
DELETE
FROM
t12637786
;
# We need to activate the purge thread at this point to make sure it does not
# assert and is able to clean up the old versions of secondary index entries.
# But instead of doing a --sleep 10, wait until the rest of the tests in
# this file complete before dropping the table. By then, the purge thread
# will have delt with the updates above.
# Bug#12963823 - Test that the purge thread does not crash when
# the number of indexes has changed since the UNDO record was logged.
create
table
t12963823
(
a
blob
,
b
blob
,
c
blob
,
d
blob
,
e
blob
,
f
blob
,
g
blob
,
h
blob
,
i
blob
,
j
blob
,
k
blob
,
l
blob
,
m
blob
,
n
blob
,
o
blob
,
p
blob
)
engine
=
innodb
row_format
=
dynamic
;
SET
@
r
=
repeat
(
'a'
,
767
);
insert
into
t12963823
values
(
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
);
create
index
ndx_a
on
t12963823
(
a
(
500
));
create
index
ndx_b
on
t12963823
(
b
(
500
));
create
index
ndx_c
on
t12963823
(
c
(
500
));
create
index
ndx_d
on
t12963823
(
d
(
500
));
create
index
ndx_e
on
t12963823
(
e
(
500
));
create
index
ndx_f
on
t12963823
(
f
(
500
));
create
index
ndx_k
on
t12963823
(
k
(
500
));
create
index
ndx_l
on
t12963823
(
l
(
500
));
SET
@
r
=
repeat
(
'b'
,
500
);
update
t12963823
set
a
=@
r
,
b
=@
r
,
c
=@
r
,
d
=@
r
;
update
t12963823
set
e
=@
r
,
f
=@
r
,
g
=@
r
,
h
=@
r
;
update
t12963823
set
i
=@
r
,
j
=@
r
,
k
=@
r
,
l
=@
r
;
update
t12963823
set
m
=@
r
,
n
=@
r
,
o
=@
r
,
p
=@
r
;
alter
table
t12963823
drop
index
ndx_a
;
alter
table
t12963823
drop
index
ndx_b
;
create
index
ndx_g
on
t12963823
(
g
(
500
));
create
index
ndx_h
on
t12963823
(
h
(
500
));
create
index
ndx_i
on
t12963823
(
i
(
500
));
create
index
ndx_j
on
t12963823
(
j
(
500
));
create
index
ndx_m
on
t12963823
(
m
(
500
));
create
index
ndx_n
on
t12963823
(
n
(
500
));
create
index
ndx_o
on
t12963823
(
o
(
500
));
create
index
ndx_p
on
t12963823
(
p
(
500
));
show
create
table
t12963823
;
# We need to activate the purge thread at this point to see if it crashes
# but instead of doing a --sleep 10, wait until the rest of the tests in
# this file complete before dropping the table. By then, the purge thread
# will have delt with the updates above.
eval
set
global
innodb_file_per_table
=
$per_table
;
eval
set
global
innodb_file_format
=
$format
;
...
...
@@ -462,24 +524,6 @@ create index t1u on t1 (u(1));
drop
table
t1
;
# Bug#12637786
SET
@
r
=
REPEAT
(
'a'
,
500
);
CREATE
TABLE
t1
(
a
INT
,
v1
VARCHAR
(
500
),
v2
VARCHAR
(
500
),
v3
VARCHAR
(
500
),
v4
VARCHAR
(
500
),
v5
VARCHAR
(
500
),
v6
VARCHAR
(
500
),
v7
VARCHAR
(
500
),
v8
VARCHAR
(
500
),
v9
VARCHAR
(
500
),
v10
VARCHAR
(
500
),
v11
VARCHAR
(
500
),
v12
VARCHAR
(
500
),
v13
VARCHAR
(
500
),
v14
VARCHAR
(
500
),
v15
VARCHAR
(
500
),
v16
VARCHAR
(
500
),
v17
VARCHAR
(
500
),
v18
VARCHAR
(
500
)
)
ENGINE
=
InnoDB
ROW_FORMAT
=
DYNAMIC
;
CREATE
INDEX
idx1
ON
t1
(
a
,
v1
);
INSERT
INTO
t1
VALUES
(
9
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
,
@
r
);
UPDATE
t1
SET
a
=
1000
;
DELETE
FROM
t1
;
# Let the purge thread clean up this file.
--
sleep
10
DROP
TABLE
t1
;
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
CREATE
TABLE
bug12547647
(
a
INT
NOT
NULL
,
b
BLOB
NOT
NULL
,
c
TEXT
,
...
...
@@ -630,7 +674,12 @@ disconnect a;
disconnect
b
;
DROP
TABLE
t1
;
# Drop these tables since the purge thread must have run by now
# and did not crash.
DROP
TABLE
t1_purge
,
t2_purge
,
t3_purge
,
t4_purge
;
DROP
TABLE
t12637786
;
DROP
TABLE
t12963823
;
#
# restore environment to the state it was before this test execution
...
...
mysql-test/t/myisampack.test
View file @
b8907ffa
...
...
@@ -107,3 +107,48 @@ SELECT COUNT(*) FROM mysql_db1.t1 WHERE c2 < 5;
#
DROP
TABLE
mysql_db1
.
t1
;
DROP
DATABASE
mysql_db1
;
--
echo
#
--
echo
# BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
--
echo
#
CREATE
TABLE
t1
(
a
CHAR
(
4
),
FULLTEXT
(
a
));
INSERT
INTO
t1
VALUES
(
'aaaa'
),(
'bbbb'
),(
'cccc'
);
FLUSH
TABLE
t1
;
--
exec
$MYISAMPACK
-
sf
$MYSQLD_DATADIR
/
test
/
t1
--
exec
$MYISAMCHK
-
srq
$MYSQLD_DATADIR
/
test
/
t1
CHECK
TABLE
t1
;
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'aaaa'
IN
BOOLEAN
MODE
);
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'aaaa'
);
DROP
TABLE
t1
;
--
echo
# Test table with key_reflength > rec_reflength
CREATE
TABLE
t1
(
a
CHAR
(
30
),
FULLTEXT
(
a
));
--
disable_query_log
--
echo
# Populating a table, so it's index file exceeds 65K
let
$
1
=
1700
;
while
(
$
1
)
{
eval
INSERT
INTO
t1
VALUES
(
'$1aaaaaaaaaaaaaaaaaaaaaaaaaa'
);
dec
$
1
;
}
--
echo
# Populating a table, so index file has second level fulltext tree
let
$
1
=
60
;
while
(
$
1
)
{
eval
INSERT
INTO
t1
VALUES
(
'aaaa'
),(
'aaaa'
),(
'aaaa'
),(
'aaaa'
),(
'aaaa'
);
dec
$
1
;
}
--
enable_query_log
FLUSH
TABLE
t1
;
--
echo
# Compressing table
--
exec
$MYISAMPACK
-
sf
$MYSQLD_DATADIR
/
test
/
t1
--
echo
# Fixing index (repair by sort)
--
exec
$MYISAMCHK
-
srnq
$MYSQLD_DATADIR
/
test
/
t1
CHECK
TABLE
t1
;
FLUSH
TABLE
t1
;
--
echo
# Fixing index (repair with keycache)
--
exec
$MYISAMCHK
-
soq
$MYSQLD_DATADIR
/
test
/
t1
CHECK
TABLE
t1
;
DROP
TABLE
t1
;
mysql-test/t/order_by.test
View file @
b8907ffa
...
...
@@ -1508,4 +1508,11 @@ SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#11765255 58201:
--
echo
# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
--
echo
#
select
1
order
by
max
(
1
)
+
min
(
1
);
--
echo
End
of
5.1
tests
mysql-test/t/sp-error.test
View file @
b8907ffa
...
...
@@ -2471,4 +2471,26 @@ DROP PROCEDURE p1;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#12428824 - PARSER STACK OVERFLOW AND CRASH IN SP_ADD_USED_ROUTINE
--
echo
# WITH OBSCURE QUERY
--
echo
#
--
error
ER_TOO_LONG_IDENT
SELECT
very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999
();
--
error
ER_TOO_LONG_IDENT
CALL
very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999
();
--
error
ER_WRONG_DB_NAME
SELECT
very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999
.
simple_func
();
--
error
ER_WRONG_DB_NAME
CALL
very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999
.
simple_proc
();
--
error
ER_TOO_LONG_IDENT
SELECT
db_name
.
very_long_fn_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999
();
--
error
ER_TOO_LONG_IDENT
CALL
db_name
.
very_long_pr_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999
();
--
echo
End
of
5.1
tests
mysql-test/t/sp.test
View file @
b8907ffa
...
...
@@ -8350,6 +8350,26 @@ SET @@GLOBAL.init_connect= @old_init_connect;
DROP PROCEDURE p2;
DROP PROCEDURE p5;
--echo #
--echo # Bug#11840395 (formerly known as bug#60347):
--echo # The string "versiondata" seems
--echo # to be '
leaking
' into the schema name space
--echo #
--disable_warnings
DROP DATABASE IF EXISTS mixedCaseDbName;
--enable_warnings
CREATE DATABASE mixedCaseDbName;
DELIMITER |;
CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end|
CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin return '
IT
WORKS
'
;
end
|
DELIMITER
;
|
call
mixedCaseDbName
.
tryMyProc
();
select
mixedCaseDbName
.
tryMyFunc
();
DROP
DATABASE
mixedCaseDbName
;
--
echo
#
--
echo
# Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
--
echo
#
...
...
mysql-test/t/type_float.test
View file @
b8907ffa
...
...
@@ -276,4 +276,21 @@ INSERT INTO t1 VALUES(-1.79769313486231e+308);
SELECT
f1
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
--
echo
#
--
echo
# Ignoring output from misc. float operations
--
disable_result_log
let
$nine_65
=
99999999999999999999999999999999999999999999999999999999999999999
;
select
format
(
-
1.7976931348623157E+307
,
256
)
as
foo
;
select
least
(
-
1.1111111111111111111111111
,
-
group_concat
(
1.7976931348623157E+308
))
as
foo
;
eval
select
concat
((
truncate
((
-
1.7976931348623157E+307
),(
0x1e
))),
(
$nine_65
))
into
@
a
;
--
enable_result_log
--
echo
End
of
5.0
tests
mysql-test/t/union.test
View file @
b8907ffa
...
...
@@ -1156,4 +1156,45 @@ SELECT * FROM t2 UNION SELECT * FROM t2
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# Bug#11765255 58201:
--
echo
# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
--
echo
#
let
$my_stmt
=
select
1
as
foo
union
select
2
union
select
3
union
select
4
order
by
max
(
42
)
+
max
(
1
)
+
max
(
1
)
+
max
(
1
)
+
max
(
1
)
+
max
(
1
)
;
eval
$my_stmt
;
eval
prepare
stmt1
from
'$my_stmt'
;
execute
stmt1
;
execute
stmt1
;
let
$my_stmt
=
select
1
as
foo
union
select
2
union
select
3
union
(
select
4
)
order
by
max
(
42
)
+
max
(
1
)
+
max
(
1
)
+
max
(
1
)
+
max
(
1
)
+
max
(
1
)
;
eval
$my_stmt
;
eval
prepare
stmt1
from
'$my_stmt'
;
execute
stmt1
;
execute
stmt1
;
deallocate
prepare
stmt1
;
--
echo
End
of
5.1
tests
sql/sql_lex.cc
View file @
b8907ffa
...
...
@@ -1988,6 +1988,9 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
if
(
ref_pointer_array
)
return
0
;
// find_order_in_list() may need some extra space, so multiply by two.
order_group_num
*=
2
;
/*
We have to create array in prepared statement memory if it is
prepared statement
...
...
sql/sql_string.cc
View file @
b8907ffa
...
...
@@ -130,7 +130,7 @@ bool String::set_int(longlong num, bool unsigned_flag, CHARSET_INFO *cs)
bool
String
::
set_real
(
double
num
,
uint
decimals
,
CHARSET_INFO
*
cs
)
{
char
buff
[
331
];
char
buff
[
FLOATING_POINT_BUFFER
];
uint
dummy_errors
;
str_charset
=
cs
;
...
...
@@ -200,7 +200,9 @@ bool String::set_real(double num,uint decimals, CHARSET_INFO *cs)
#else
#ifdef HAVE_SNPRINTF
buff
[
sizeof
(
buff
)
-
1
]
=
0
;
// Safety
snprintf
(
buff
,
sizeof
(
buff
)
-
1
,
"%.*f"
,(
int
)
decimals
,
num
);
int
num_chars
=
snprintf
(
buff
,
sizeof
(
buff
)
-
1
,
"%.*f"
,(
int
)
decimals
,
num
);
DBUG_ASSERT
(
num_chars
>
0
);
DBUG_ASSERT
(
num_chars
<
(
int
)
sizeof
(
buff
));
#else
sprintf
(
buff
,
"%.*f"
,(
int
)
decimals
,
num
);
#endif
...
...
sql/sql_union.cc
View file @
b8907ffa
/*
Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -403,15 +402,27 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
fake_select_lex
->
table_list
.
empty
();
DBUG_RETURN
(
TRUE
);
}
/*
Fake st_select_lex should have item list for correct ref_array
allocation.
*/
fake_select_lex
->
item_list
=
item_list
;
thd_arg
->
lex
->
current_select
=
fake_select_lex
;
/*
We need to add up n_sum_items in order to make the correct
allocation in setup_ref_array().
*/
fake_select_lex
->
n_child_sum_items
+=
global_parameters
->
n_sum_items
;
saved_error
=
fake_select_lex
->
join
->
prepare
(
&
fake_select_lex
->
ref_pointer_array
,
fake_select_lex
->
table_list
.
first
,
0
,
0
,
fake_select_lex
->
order_list
.
elements
,
fake_select_lex
->
order_list
.
first
,
global_parameters
->
order_list
.
elements
,
// og_num
global_parameters
->
order_list
.
first
,
// order
NULL
,
NULL
,
NULL
,
fake_select_lex
,
this
);
fake_select_lex
->
table_list
.
empty
();
...
...
@@ -579,11 +590,21 @@ bool st_select_lex_unit::exec()
}
fake_select_lex
->
join
->
no_const_tables
=
TRUE
;
/*
Fake st_select_lex should have item list for correctref_array
allocation.
*/
fake_select_lex
->
item_list
=
item_list
;
/*
Fake st_select_lex should have item list for correct ref_array
allocation.
*/
fake_select_lex
->
item_list
=
item_list
;
/*
We need to add up n_sum_items in order to make the correct
allocation in setup_ref_array().
Don't add more sum_items if we have already done JOIN::prepare
for this (with a different join object)
*/
if
(
!
fake_select_lex
->
ref_pointer_array
)
fake_select_lex
->
n_child_sum_items
+=
global_parameters
->
n_sum_items
;
saved_error
=
mysql_select
(
thd
,
&
fake_select_lex
->
ref_pointer_array
,
&
result_table_list
,
0
,
item_list
,
NULL
,
...
...
sql/sql_yacc.yy
View file @
b8907ffa
...
...
@@ -8025,6 +8025,11 @@ function_call_generic:
Create_func *builder;
Item *item= NULL;
if (check_routine_name(&$1))
{
MYSQL_YYABORT;
}
/*
Implementation note:
names are resolved with the following order:
...
...
@@ -8088,6 +8093,16 @@ function_call_generic:
version() (a vendor can specify any schema).
*/
if (!$1.str || check_db_name(&$1))
{
my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
MYSQL_YYABORT;
}
if (check_routine_name(&$3))
{
MYSQL_YYABORT;
}
builder= find_qualified_function_builder(thd);
DBUG_ASSERT(builder);
item= builder->create(thd, $1, $3, true, $5);
...
...
sql/unireg.h
View file @
b8907ffa
...
...
@@ -210,7 +210,6 @@
*/
#define BIN_LOG_HEADER_SIZE 4
#define FLOATING_POINT_BUFFER 331
#define DEFAULT_KEY_CACHE_NAME "default"
...
...
storage/innobase/btr/btr0pcur.c
View file @
b8907ffa
...
...
@@ -339,33 +339,6 @@ btr_pcur_restore_position(
return
(
FALSE
);
}
/******************************************************************
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/* in: persistent cursor */
mtr_t
*
mtr
)
/* in: mtr */
{
page_t
*
page
;
ut_a
(
cursor
->
pos_state
==
BTR_PCUR_IS_POSITIONED
);
ut_ad
(
cursor
->
latch_mode
!=
BTR_NO_LATCHES
);
page
=
btr_cur_get_page
(
btr_pcur_get_btr_cur
(
cursor
));
btr_leaf_page_release
(
page
,
cursor
->
latch_mode
,
mtr
);
cursor
->
latch_mode
=
BTR_NO_LATCHES
;
cursor
->
pos_state
=
BTR_PCUR_WAS_POSITIONED
;
}
/*************************************************************
Moves the persistent cursor to the first record on the next page. Releases the
latch on the current page, and bufferunfixes it. Note that there must not be
...
...
storage/innobase/handler/ha_innodb.cc
View file @
b8907ffa
...
...
@@ -3082,25 +3082,6 @@ field_in_record_is_null(
return
(
0
);
}
/******************************************************************
Sets a field in a record to SQL NULL. Uses the record format
information in table to track the null bit in record. */
inline
void
set_field_in_record_to_null
(
/*========================*/
TABLE
*
table
,
/* in: MySQL table object */
Field
*
field
,
/* in: MySQL field object */
char
*
record
)
/* in: a row in MySQL format */
{
int
null_offset
;
null_offset
=
(
uint
)
((
char
*
)
field
->
null_ptr
-
(
char
*
)
table
->
record
[
0
]);
record
[
null_offset
]
=
record
[
null_offset
]
|
field
->
null_bit
;
}
extern
"C"
{
/*****************************************************************
InnoDB uses this function to compare two data fields for which the data type
...
...
storage/innobase/include/btr0pcur.h
View file @
b8907ffa
...
...
@@ -210,18 +210,6 @@ btr_pcur_restore_position(
ulint
latch_mode
,
/* in: BTR_SEARCH_LEAF, ... */
btr_pcur_t
*
cursor
,
/* in: detached persistent cursor */
mtr_t
*
mtr
);
/* in: mtr */
/******************************************************************
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/* in: persistent cursor */
mtr_t
*
mtr
);
/* in: mtr */
/*************************************************************
Gets the rel_pos field for a cursor whose position has been stored. */
UNIV_INLINE
...
...
@@ -248,10 +236,9 @@ btr_pcur_get_mtr(
btr_pcur_t
*
cursor
);
/* in: persistent cursor */
/******************************************************************
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit
(
...
...
storage/innobase/include/btr0pcur.ic
View file @
b8907ffa
...
...
@@ -376,10 +376,9 @@ btr_pcur_move_to_next(
/******************************************************************
Commits the pcur mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit(
...
...
storage/innobase/include/buf0buf.h
View file @
b8907ffa
...
...
@@ -176,25 +176,6 @@ buf_page_optimistic_get_func(
ulint
line
,
/* in: line where called */
mtr_t
*
mtr
);
/* in: mini-transaction */
/************************************************************************
Tries to get the page, but if file io is required, releases all latches
in mtr down to the given savepoint. If io is required, this function
retrieves the page to buffer buf_pool, but does not bufferfix it or latch
it. */
UNIV_INLINE
buf_frame_t
*
buf_page_get_release_on_io
(
/*=======================*/
/* out: pointer to the frame, or NULL
if not in buffer buf_pool */
ulint
space
,
/* in: space id */
ulint
offset
,
/* in: offset of the page within space
in units of a page */
buf_frame_t
*
guess
,
/* in: guessed frame or NULL */
ulint
rw_latch
,
/* in: RW_X_LATCH, RW_S_LATCH,
or RW_NO_LATCH */
ulint
savepoint
,
/* in: mtr savepoint */
mtr_t
*
mtr
);
/* in: mtr */
/************************************************************************
This is used to get access to a known database page, when no waiting can be
done. */
...
...
storage/innobase/include/buf0buf.ic
View file @
b8907ffa
...
...
@@ -560,52 +560,6 @@ buf_page_hash_get(
return(block);
}
/************************************************************************
Tries to get the page, but if file io is required, releases all latches
in mtr down to the given savepoint. If io is required, this function
retrieves the page to buffer buf_pool, but does not bufferfix it or latch
it. */
UNIV_INLINE
buf_frame_t*
buf_page_get_release_on_io(
/*=======================*/
/* out: pointer to the frame, or NULL
if not in buffer buf_pool */
ulint space, /* in: space id */
ulint offset, /* in: offset of the page within space
in units of a page */
buf_frame_t* guess, /* in: guessed frame or NULL */
ulint rw_latch, /* in: RW_X_LATCH, RW_S_LATCH,
or RW_NO_LATCH */
ulint savepoint, /* in: mtr savepoint */
mtr_t* mtr) /* in: mtr */
{
buf_frame_t* frame;
frame = buf_page_get_gen(space, offset, rw_latch, guess,
BUF_GET_IF_IN_POOL,
__FILE__, __LINE__,
mtr);
if (frame != NULL) {
return(frame);
}
/* The page was not in the buffer buf_pool: release the latches
down to the savepoint */
mtr_rollback_to_savepoint(mtr, savepoint);
buf_page_get(space, offset, RW_S_LATCH, mtr);
/* When we get here, the page is in buffer, but we release
the latches again down to the savepoint, before returning */
mtr_rollback_to_savepoint(mtr, savepoint);
return(NULL);
}
/************************************************************************
Decrements the bufferfix count of a buffer control block and releases
a latch, if specified. */
...
...
storage/innobase/include/mtr0mtr.h
View file @
b8907ffa
...
...
@@ -178,16 +178,6 @@ mtr_set_savepoint(
/* out: savepoint */
mtr_t
*
mtr
);
/* in: mtr */
/**************************************************************
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/* in: mtr */
ulint
savepoint
);
/* in: savepoint */
/**************************************************************
Releases the (index tree) s-latch stored in an mtr memo after a
savepoint. */
UNIV_INLINE
...
...
storage/innobase/include/ut0mem.h
View file @
b8907ffa
...
...
@@ -144,43 +144,6 @@ ut_strlcpy_rev(
const
char
*
src
,
/* in: source buffer */
ulint
size
);
/* in: size of destination buffer */
/**************************************************************************
Compute strlen(ut_strcpyq(str, q)). */
UNIV_INLINE
ulint
ut_strlenq
(
/*=======*/
/* out: length of the string when quoted */
const
char
*
str
,
/* in: null-terminated string */
char
q
);
/* in: the quote character */
/**************************************************************************
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq(). */
char
*
ut_strcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
);
/* in: null-terminated string */
/**************************************************************************
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq(). */
char
*
ut_memcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
,
/* in: string to be quoted */
ulint
len
);
/* in: length of src */
/**************************************************************************
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once. */
...
...
storage/innobase/include/ut0mem.ic
View file @
b8907ffa
...
...
@@ -47,24 +47,3 @@ ut_strcmp(const void* str1, const void* str2)
{
return(strcmp((const char*)str1, (const char*)str2));
}
/**************************************************************************
Compute strlen(ut_strcpyq(str, q)). */
UNIV_INLINE
ulint
ut_strlenq(
/*=======*/
/* out: length of the string when quoted */
const char* str, /* in: null-terminated string */
char q) /* in: the quote character */
{
ulint len;
for (len = 0; *str; len++, str++) {
if (*str == q) {
len++;
}
}
return(len);
}
storage/innobase/mtr/mtr0mtr.c
View file @
b8907ffa
...
...
@@ -197,40 +197,6 @@ mtr_commit(
dyn_array_free
(
&
(
mtr
->
log
));
}
/**************************************************************
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/* in: mtr */
ulint
savepoint
)
/* in: savepoint */
{
mtr_memo_slot_t
*
slot
;
dyn_array_t
*
memo
;
ulint
offset
;
ut_ad
(
mtr
);
ut_ad
(
mtr
->
magic_n
==
MTR_MAGIC_N
);
ut_ad
(
mtr
->
state
==
MTR_ACTIVE
);
memo
=
&
(
mtr
->
memo
);
offset
=
dyn_array_get_data_size
(
memo
);
ut_ad
(
offset
>=
savepoint
);
while
(
offset
>
savepoint
)
{
offset
-=
sizeof
(
mtr_memo_slot_t
);
slot
=
dyn_array_get_element
(
memo
,
offset
);
ut_ad
(
slot
->
type
!=
MTR_MEMO_MODIFY
);
mtr_memo_slot_release
(
mtr
,
slot
);
}
}
/*******************************************************
Releases an object in the memo stack. */
...
...
storage/innobase/row/row0purge.c
View file @
b8907ffa
...
...
@@ -379,7 +379,8 @@ row_purge_upd_exist_or_extern(
ut_ad
(
node
);
if
(
node
->
rec_type
==
TRX_UNDO_UPD_DEL_REC
)
{
if
(
node
->
rec_type
==
TRX_UNDO_UPD_DEL_REC
||
(
node
->
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
))
{
goto
skip_secondaries
;
}
...
...
@@ -488,14 +489,14 @@ row_purge_parse_undo_rec(
dulint
roll_ptr
;
ulint
info_bits
;
ulint
type
;
ulint
cmpl_info
;
ut_ad
(
node
&&
thr
);
trx
=
thr_get_trx
(
thr
);
ptr
=
trx_undo_rec_get_pars
(
node
->
undo_rec
,
&
type
,
&
cmpl_info
,
updated_extern
,
&
undo_no
,
&
table_id
);
ptr
=
trx_undo_rec_get_pars
(
node
->
undo_rec
,
&
type
,
&
node
->
cmpl_info
,
updated_extern
,
&
undo_no
,
&
table_id
);
node
->
rec_type
=
type
;
if
(
type
==
TRX_UNDO_UPD_DEL_REC
&&
!
(
*
updated_extern
))
{
...
...
@@ -508,7 +509,8 @@ row_purge_parse_undo_rec(
node
->
table
=
NULL
;
if
(
type
==
TRX_UNDO_UPD_EXIST_REC
&&
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
&&
!
(
*
updated_extern
))
{
&&
node
->
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
&&
!
(
*
updated_extern
))
{
/* Purge requires no changes to indexes: we may return */
...
...
@@ -563,7 +565,7 @@ row_purge_parse_undo_rec(
/* Read to the partial row the fields that occur in indexes */
if
(
!
(
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
))
{
if
(
!
(
node
->
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
))
{
ptr
=
trx_undo_rec_get_partial_row
(
ptr
,
clust_index
,
&
(
node
->
row
),
node
->
heap
);
}
...
...
storage/innobase/ut/ut0mem.c
View file @
b8907ffa
...
...
@@ -407,53 +407,6 @@ ut_strlcpy_rev(
return
(
src_size
);
}
/**************************************************************************
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq(). */
char
*
ut_strcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
)
/* in: null-terminated string */
{
while
(
*
src
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
/**************************************************************************
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq(). */
char
*
ut_memcpyq
(
/*=======*/
/* out: pointer to end of dest */
char
*
dest
,
/* in: output buffer */
char
q
,
/* in: the quote character */
const
char
*
src
,
/* in: string to be quoted */
ulint
len
)
/* in: length of src */
{
const
char
*
srcend
=
src
+
len
;
while
(
src
<
srcend
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
/**************************************************************************
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once. */
...
...
storage/innodb_plugin/ChangeLog
View file @
b8907ffa
2011-09-20 The InnoDB Team
* row/row0purge.c:
Fix Bug#12963823 CRASH IN PURGE THREAD UNDER UNUSUAL CIRCUMSTANCES
2011-09-12 The InnoDB Team
* row/row0sel.c:
...
...
storage/innodb_plugin/btr/btr0pcur.c
View file @
b8907ffa
...
...
@@ -358,33 +358,6 @@ btr_pcur_restore_position_func(
return
(
FALSE
);
}
/**************************************************************//**
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
UNIV_INTERN
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/*!< in: persistent cursor */
mtr_t
*
mtr
)
/*!< in: mtr */
{
buf_block_t
*
block
;
ut_a
(
cursor
->
pos_state
==
BTR_PCUR_IS_POSITIONED
);
ut_ad
(
cursor
->
latch_mode
!=
BTR_NO_LATCHES
);
block
=
btr_pcur_get_block
(
cursor
);
btr_leaf_page_release
(
block
,
cursor
->
latch_mode
,
mtr
);
cursor
->
latch_mode
=
BTR_NO_LATCHES
;
cursor
->
pos_state
=
BTR_PCUR_WAS_POSITIONED
;
}
/*********************************************************//**
Moves the persistent cursor to the first record on the next page. Releases the
latch on the current page, and bufferunfixes it. Note that there must not be
...
...
storage/innodb_plugin/handler/ha_innodb.cc
View file @
b8907ffa
/*****************************************************************************
Copyright (c) 2000, 201
0, MySQL AB & Innobase Oy
. All Rights Reserved.
Copyright (c) 2000, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
...
...
@@ -3792,25 +3792,6 @@ field_in_record_is_null(
return
(
0
);
}
/**************************************************************//**
Sets a field in a record to SQL NULL. Uses the record format
information in table to track the null bit in record. */
static
inline
void
set_field_in_record_to_null
(
/*========================*/
TABLE
*
table
,
/*!< in: MySQL table object */
Field
*
field
,
/*!< in: MySQL field object */
char
*
record
)
/*!< in: a row in MySQL format */
{
int
null_offset
;
null_offset
=
(
uint
)
((
char
*
)
field
->
null_ptr
-
(
char
*
)
table
->
record
[
0
]);
record
[
null_offset
]
=
record
[
null_offset
]
|
field
->
null_bit
;
}
/*************************************************************//**
InnoDB uses this function to compare two data fields for which the data type
is such that we must use MySQL code to compare them. NOTE that the prototype
...
...
storage/innodb_plugin/include/btr0pcur.h
View file @
b8907ffa
/*****************************************************************************
Copyright (c) 1996, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -244,18 +244,6 @@ btr_pcur_restore_position_func(
mtr_t
*
mtr
);
/*!< in: mtr */
#define btr_pcur_restore_position(l,cur,mtr) \
btr_pcur_restore_position_func(l,cur,__FILE__,__LINE__,mtr)
/**************************************************************//**
If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
releases the page latch and bufferfix reserved by the cursor.
NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
made by the current mini-transaction to the data protected by the
cursor latch, as then the latch must not be released until mtr_commit. */
UNIV_INTERN
void
btr_pcur_release_leaf
(
/*==================*/
btr_pcur_t
*
cursor
,
/*!< in: persistent cursor */
mtr_t
*
mtr
);
/*!< in: mtr */
/*********************************************************//**
Gets the rel_pos field for a cursor whose position has been stored.
@return BTR_PCUR_ON, ... */
...
...
@@ -282,10 +270,9 @@ btr_pcur_get_mtr(
btr_pcur_t
*
cursor
);
/*!< in: persistent cursor */
/**************************************************************//**
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit_specify_mtr
(
...
...
storage/innodb_plugin/include/btr0pcur.ic
View file @
b8907ffa
/*****************************************************************************
Copyright (c) 1996, 201
0, Innobase Oy
. All Rights Reserved.
Copyright (c) 1996, 201
1, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -396,10 +396,9 @@ btr_pcur_move_to_next(
/**************************************************************//**
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
to the page where pcur is positioned, this can be used instead of
btr_pcur_release_leaf. Function btr_pcur_store_position should be used
before calling this, if restoration of cursor is wanted later. */
that is, the cursor becomes detached.
Function btr_pcur_store_position should be used before calling this,
if restoration of cursor is wanted later. */
UNIV_INLINE
void
btr_pcur_commit_specify_mtr(
...
...
storage/innodb_plugin/include/mtr0mtr.h
View file @
b8907ffa
...
...
@@ -215,16 +215,6 @@ ulint
mtr_set_savepoint
(
/*==============*/
mtr_t
*
mtr
);
/*!< in: mtr */
/**********************************************************//**
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
UNIV_INTERN
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/*!< in: mtr */
ulint
savepoint
);
/*!< in: savepoint */
#ifndef UNIV_HOTBACKUP
/**********************************************************//**
Releases the (index tree) s-latch stored in an mtr memo after a
...
...
storage/innodb_plugin/include/ut0mem.h
View file @
b8907ffa
/*****************************************************************************
Copyright (c) 1994, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1994, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -209,43 +209,6 @@ ut_strlcpy_rev(
const
char
*
src
,
/*!< in: source buffer */
ulint
size
);
/*!< in: size of destination buffer */
/**********************************************************************//**
Compute strlen(ut_strcpyq(str, q)).
@return length of the string when quoted */
UNIV_INLINE
ulint
ut_strlenq
(
/*=======*/
const
char
*
str
,
/*!< in: null-terminated string */
char
q
);
/*!< in: the quote character */
/**********************************************************************//**
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_strcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
);
/*!< in: null-terminated string */
/**********************************************************************//**
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_memcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
,
/*!< in: string to be quoted */
ulint
len
);
/*!< in: length of src */
/**********************************************************************//**
Return the number of times s2 occurs in s1. Overlapping instances of s2
are only counted once.
...
...
storage/innodb_plugin/include/ut0mem.ic
View file @
b8907ffa
/*****************************************************************************
Copyright (c) 1994, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1994, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -98,27 +98,6 @@ ut_strcmp(const char* str1, const char* str2)
return(strcmp(str1, str2));
}
/**********************************************************************//**
Compute strlen(ut_strcpyq(str, q)).
@return length of the string when quoted */
UNIV_INLINE
ulint
ut_strlenq(
/*=======*/
const char* str, /*!< in: null-terminated string */
char q) /*!< in: the quote character */
{
ulint len;
for (len = 0; *str; len++, str++) {
if (*str == q) {
len++;
}
}
return(len);
}
/**********************************************************************//**
Converts a raw binary data to a NUL-terminated hex string. The output is
truncated if there is not enough space in "hex", make sure "hex_size" is at
...
...
storage/innodb_plugin/mtr/mtr0mtr.c
View file @
b8907ffa
...
...
@@ -210,40 +210,6 @@ mtr_commit(
}
#ifndef UNIV_HOTBACKUP
/**********************************************************//**
Releases the latches stored in an mtr memo down to a savepoint.
NOTE! The mtr must not have made changes to buffer pages after the
savepoint, as these can be handled only by mtr_commit. */
UNIV_INTERN
void
mtr_rollback_to_savepoint
(
/*======================*/
mtr_t
*
mtr
,
/*!< in: mtr */
ulint
savepoint
)
/*!< in: savepoint */
{
mtr_memo_slot_t
*
slot
;
dyn_array_t
*
memo
;
ulint
offset
;
ut_ad
(
mtr
);
ut_ad
(
mtr
->
magic_n
==
MTR_MAGIC_N
);
ut_ad
(
mtr
->
state
==
MTR_ACTIVE
);
memo
=
&
(
mtr
->
memo
);
offset
=
dyn_array_get_data_size
(
memo
);
ut_ad
(
offset
>=
savepoint
);
while
(
offset
>
savepoint
)
{
offset
-=
sizeof
(
mtr_memo_slot_t
);
slot
=
dyn_array_get_element
(
memo
,
offset
);
ut_ad
(
slot
->
type
!=
MTR_MEMO_MODIFY
);
mtr_memo_slot_release
(
mtr
,
slot
);
}
}
/***************************************************//**
Releases an object in the memo stack. */
UNIV_INTERN
...
...
storage/innodb_plugin/row/row0purge.c
View file @
b8907ffa
/*****************************************************************************
Copyright (c) 1997, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1997, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
59 Temple
Place, Suite 330, Boston, MA 02111-1307
USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335
USA
*****************************************************************************/
...
...
@@ -406,7 +406,8 @@ row_purge_upd_exist_or_extern_func(
ut_ad
(
node
);
if
(
node
->
rec_type
==
TRX_UNDO_UPD_DEL_REC
)
{
if
(
node
->
rec_type
==
TRX_UNDO_UPD_DEL_REC
||
(
node
->
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
))
{
goto
skip_secondaries
;
}
...
...
@@ -530,14 +531,14 @@ row_purge_parse_undo_rec(
roll_ptr_t
roll_ptr
;
ulint
info_bits
;
ulint
type
;
ulint
cmpl_info
;
ut_ad
(
node
&&
thr
);
trx
=
thr_get_trx
(
thr
);
ptr
=
trx_undo_rec_get_pars
(
node
->
undo_rec
,
&
type
,
&
cmpl_info
,
updated_extern
,
&
undo_no
,
&
table_id
);
ptr
=
trx_undo_rec_get_pars
(
node
->
undo_rec
,
&
type
,
&
node
->
cmpl_info
,
updated_extern
,
&
undo_no
,
&
table_id
);
node
->
rec_type
=
type
;
if
(
type
==
TRX_UNDO_UPD_DEL_REC
&&
!
(
*
updated_extern
))
{
...
...
@@ -550,7 +551,8 @@ row_purge_parse_undo_rec(
node
->
table
=
NULL
;
if
(
type
==
TRX_UNDO_UPD_EXIST_REC
&&
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
&&
!
(
*
updated_extern
))
{
&&
node
->
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
&&
!
(
*
updated_extern
))
{
/* Purge requires no changes to indexes: we may return */
...
...
@@ -600,7 +602,7 @@ row_purge_parse_undo_rec(
/* Read to the partial row the fields that occur in indexes */
if
(
!
(
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
))
{
if
(
!
(
node
->
cmpl_info
&
UPD_NODE_NO_ORD_CHANGE
))
{
ptr
=
trx_undo_rec_get_partial_row
(
ptr
,
clust_index
,
&
node
->
row
,
type
==
TRX_UNDO_UPD_DEL_REC
,
...
...
storage/innodb_plugin/ut/ut0mem.c
View file @
b8907ffa
/*****************************************************************************
Copyright (c) 1994, 20
09, Innobase Oy
. All Rights Reserved.
Copyright (c) 1994, 20
11, Oracle and/or its affiliates
. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -489,53 +489,6 @@ ut_strlcpy_rev(
return
(
src_size
);
}
/**********************************************************************//**
Make a quoted copy of a NUL-terminated string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_memcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_strcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
)
/*!< in: null-terminated string */
{
while
(
*
src
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
/**********************************************************************//**
Make a quoted copy of a fixed-length string. Leading and trailing
quotes will not be included; only embedded quotes will be escaped.
See also ut_strlenq() and ut_strcpyq().
@return pointer to end of dest */
UNIV_INTERN
char
*
ut_memcpyq
(
/*=======*/
char
*
dest
,
/*!< in: output buffer */
char
q
,
/*!< in: the quote character */
const
char
*
src
,
/*!< in: string to be quoted */
ulint
len
)
/*!< in: length of src */
{
const
char
*
srcend
=
src
+
len
;
while
(
src
<
srcend
)
{
if
((
*
dest
++
=
*
src
++
)
==
q
)
{
*
dest
++
=
q
;
}
}
return
(
dest
);
}
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Return the number of times s2 occurs in s1. Overlapping instances of s2
...
...
storage/myisam/ft_boolean_search.c
View file @
b8907ffa
...
...
@@ -361,7 +361,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
int
subkeys
=
1
;
my_bool
can_go_down
;
MI_INFO
*
info
=
ftb
->
info
;
uint
UNINIT_VAR
(
off
),
extra
=
HA_FT_WLEN
+
info
->
s
->
base
.
rec_reflength
;
uint
UNINIT_VAR
(
off
),
extra
=
HA_FT_WLEN
+
info
->
s
->
rec_reflength
;
uchar
*
lastkey_buf
=
ftbw
->
word
+
ftbw
->
off
;
if
(
ftbw
->
flags
&
FTB_FLAG_TRUNC
)
...
...
storage/myisam/ft_nlq_search.c
View file @
b8907ffa
...
...
@@ -74,7 +74,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar
*
keybuff
=
aio
->
keybuff
;
MI_KEYDEF
*
keyinfo
=
info
->
s
->
keyinfo
+
aio
->
keynr
;
my_off_t
key_root
=
info
->
s
->
state
.
key_root
[
aio
->
keynr
];
uint
extra
=
HA_FT_WLEN
+
info
->
s
->
base
.
rec_reflength
;
uint
extra
=
HA_FT_WLEN
+
info
->
s
->
rec_reflength
;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float
tmp_weight
;
#else
...
...
storage/myisam/mi_check.c
View file @
b8907ffa
...
...
@@ -3913,7 +3913,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
SORT_FT_BUF
*
ft_buf
=
sort_info
->
ft_buf
;
SORT_KEY_BLOCKS
*
key_block
=
sort_info
->
key_block
;
val_len
=
HA_FT_WLEN
+
sort_info
->
info
->
s
->
base
.
rec_reflength
;
val_len
=
HA_FT_WLEN
+
sort_info
->
info
->
s
->
rec_reflength
;
get_key_full_length_rdonly
(
a_len
,
(
uchar
*
)
a
);
if
(
!
ft_buf
)
...
...
@@ -3923,7 +3923,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
and row format is NOT static - for _mi_dpointer not to garble offsets
*/
if
((
sort_info
->
info
->
s
->
base
.
key_reflength
<=
sort_info
->
info
->
s
->
base
.
rec_reflength
)
&&
sort_info
->
info
->
s
->
rec_reflength
)
&&
(
sort_info
->
info
->
s
->
options
&
(
HA_OPTION_PACK_RECORD
|
HA_OPTION_COMPRESS_RECORD
)))
ft_buf
=
(
SORT_FT_BUF
*
)
my_malloc
(
sort_param
->
keyinfo
->
block_length
+
...
...
storage/myisam/mi_write.c
View file @
b8907ffa
...
...
@@ -528,7 +528,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
if
(
keyinfo
->
block_length
-
a_length
<
32
&&
keyinfo
->
flag
&
HA_FULLTEXT
&&
key_pos
==
endpos
&&
info
->
s
->
base
.
key_reflength
<=
info
->
s
->
base
.
rec_reflength
&&
info
->
s
->
base
.
key_reflength
<=
info
->
s
->
rec_reflength
&&
info
->
s
->
options
&
(
HA_OPTION_PACK_RECORD
|
HA_OPTION_COMPRESS_RECORD
))
{
/*
...
...
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