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
e7810fa9
Commit
e7810fa9
authored
Jan 12, 2005
by
paul@kite-hub.kitebird.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge paul@bk-internal.mysql.com:/home/bk/mysql-5.0
into kite-hub.kitebird.com:/src/extern/MySQL/bk/mysql-5.0
parents
48802d5b
77fae118
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
4 deletions
+95
-4
innobase/include/sync0sync.h
innobase/include/sync0sync.h
+2
-0
innobase/row/row0ins.c
innobase/row/row0ins.c
+4
-1
libmysql_r/Makefile.am
libmysql_r/Makefile.am
+1
-1
mysql-test/r/analyse.result
mysql-test/r/analyse.result
+6
-0
mysql-test/t/analyse.test
mysql-test/t/analyse.test
+4
-0
scripts/Makefile.am
scripts/Makefile.am
+1
-0
sql/ha_innodb.cc
sql/ha_innodb.cc
+19
-1
sql/sql_analyse.cc
sql/sql_analyse.cc
+58
-1
No files found.
innobase/include/sync0sync.h
View file @
e7810fa9
...
@@ -415,6 +415,8 @@ or row lock! */
...
@@ -415,6 +415,8 @@ or row lock! */
/*------------------------------------- Insert buffer tree */
/*------------------------------------- Insert buffer tree */
#define SYNC_IBUF_BITMAP_MUTEX 351
#define SYNC_IBUF_BITMAP_MUTEX 351
#define SYNC_IBUF_BITMAP 350
#define SYNC_IBUF_BITMAP 350
/*------------------------------------- MySQL query cache mutex */
/*------------------------------------- MySQL binlog mutex */
/*-------------------------------*/
/*-------------------------------*/
#define SYNC_KERNEL 300
#define SYNC_KERNEL 300
#define SYNC_REC_LOCK 299
#define SYNC_REC_LOCK 299
...
...
innobase/row/row0ins.c
View file @
e7810fa9
...
@@ -723,7 +723,10 @@ row_ins_foreign_check_on_constraint(
...
@@ -723,7 +723,10 @@ row_ins_foreign_check_on_constraint(
trx
=
thr_get_trx
(
thr
);
trx
=
thr_get_trx
(
thr
);
/* Since we are going to delete or update a row, we have to invalidate
/* Since we are going to delete or update a row, we have to invalidate
the MySQL query cache for table */
the MySQL query cache for table. A deadlock of threads is not possible
here because the caller of this function does not hold any latches with
the sync0sync.h rank above the kernel mutex. The query cache mutex has
a rank just above the kernel mutex. */
row_ins_invalidate_query_cache
(
thr
,
table
->
name
);
row_ins_invalidate_query_cache
(
thr
,
table
->
name
);
...
...
libmysql_r/Makefile.am
View file @
e7810fa9
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
target
=
libmysqlclient_r.la
target
=
libmysqlclient_r.la
target_defs
=
-DDONT_USE_RAID
-DMYSQL_CLIENT
@LIB_EXTRA_CCFLAGS@
target_defs
=
-DDONT_USE_RAID
-DMYSQL_CLIENT
@LIB_EXTRA_CCFLAGS@
LIBS
=
@LIBS@ @openssl_libs@
LIBS
=
@LIBS@ @
ZLIB_LIBS@ @
openssl_libs@
INCLUDES
=
@MT_INCLUDES@
\
INCLUDES
=
@MT_INCLUDES@
\
-I
$(top_srcdir)
/include
$(openssl_includes)
@ZLIB_INCLUDES@
\
-I
$(top_srcdir)
/include
$(openssl_includes)
@ZLIB_INCLUDES@
\
...
...
mysql-test/r/analyse.result
View file @
e7810fa9
...
@@ -96,3 +96,9 @@ select * from t2;
...
@@ -96,3 +96,9 @@ select * from t2;
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t1.a 1 2 1 1 0 0 1.5000 0.5000 ENUM('1','2') NOT NULL
test.t1.a 1 2 1 1 0 0 1.5000 0.5000 ENUM('1','2') NOT NULL
drop table t1,t2;
drop table t1,t2;
create table t1 (v varchar(128));
insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd');
select * from t1 procedure analyse();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t1.v " \\ 1 19 0 0 3.7619 NULL ENUM('"','""','"c','\'\0\\"','\'','\'\'','\'b','a\0\0\0b','a\0','a""""b','a\'\'\'\'b','abc','abc\'def\\hij"klm\0opq','a\\\\\\\\b','b\'','c"','d\\','The\ZEnd','\\','\\d','\\\\') NOT NULL
drop table t1;
mysql-test/t/analyse.test
View file @
e7810fa9
...
@@ -38,3 +38,7 @@ select * from t2;
...
@@ -38,3 +38,7 @@ select * from t2;
insert
into
t2
select
*
from
t1
procedure
analyse
();
insert
into
t2
select
*
from
t1
procedure
analyse
();
select
*
from
t2
;
select
*
from
t2
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
create
table
t1
(
v
varchar
(
128
));
insert
into
t1
values
(
'abc'
),(
'abc\'def\\hij\"klm\0opq'
),(
'\''
),(
'\"'
),(
'\\'
),(
'a\0'
),(
'b\''
),(
'c\"'
),(
'd\\'
),(
'\'b'
),(
'\"c'
),(
'\\d'
),(
'a\0\0\0b'
),(
'a\'\'\'\'b'
),(
'a\"\"\"\"b'
),(
'a\\\\\\\\b'
),(
'\'\0\\\"'
),(
'\'\''
),(
'\"\"'
),(
'\\\\'
),(
'The\ZEnd'
);
select
*
from
t1
procedure
analyse
();
drop
table
t1
;
scripts/Makefile.am
View file @
e7810fa9
...
@@ -121,6 +121,7 @@ SUFFIXES = .sh
...
@@ -121,6 +121,7 @@ SUFFIXES = .sh
-e
's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'
\
-e
's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'
\
-e
's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'
\
-e
's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'
\
-e
's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!'
\
-e
's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!'
\
-e
's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!'
\
-e
's!@''LIBS''@!@LIBS@!'
\
-e
's!@''LIBS''@!@LIBS@!'
\
-e
's!@''WRAPLIBS''@!@WRAPLIBS@!'
\
-e
's!@''WRAPLIBS''@!@WRAPLIBS@!'
\
-e
's!@''innodb_system_libs''@!@innodb_system_libs@!'
\
-e
's!@''innodb_system_libs''@!@innodb_system_libs@!'
\
...
...
sql/ha_innodb.cc
View file @
e7810fa9
...
@@ -765,7 +765,14 @@ returns TRUE for all tables in the query.
...
@@ -765,7 +765,14 @@ returns TRUE for all tables in the query.
If thd is not in the autocommit state, this function also starts a new
If thd is not in the autocommit state, this function also starts a new
transaction for thd if there is no active trx yet, and assigns a consistent
transaction for thd if there is no active trx yet, and assigns a consistent
read view to it if there is no read view yet. */
read view to it if there is no read view yet.
Why a deadlock of threads is not possible: the query cache calls this function
at the start of a SELECT processing. Then the calling thread cannot be
holding any InnoDB semaphores. The calling thread is holding the
query cache mutex, and this function will reserver the InnoDB kernel mutex.
Thus, the 'rank' in sync0sync.h of the MySQL query cache mutex is above
the InnoDB kernel mutex. */
my_bool
my_bool
innobase_query_caching_of_table_permitted
(
innobase_query_caching_of_table_permitted
(
...
@@ -802,6 +809,13 @@ innobase_query_caching_of_table_permitted(
...
@@ -802,6 +809,13 @@ innobase_query_caching_of_table_permitted(
trx
=
check_trx_exists
(
thd
);
trx
=
check_trx_exists
(
thd
);
}
}
if
(
trx
->
has_search_latch
)
{
ut_print_timestamp
(
stderr
);
fprintf
(
stderr
,
" InnoDB: Error: the calling thread is holding the adaptive search
\n
"
"InnoDB: latch though calling innobase_query_caching_of_table_permitted
\n
"
);
}
innobase_release_stat_resources
(
trx
);
innobase_release_stat_resources
(
trx
);
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
)))
{
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
)))
{
...
@@ -877,6 +891,10 @@ innobase_invalidate_query_cache(
...
@@ -877,6 +891,10 @@ innobase_invalidate_query_cache(
ulint
full_name_len
)
/* in: full name length where also the null
ulint
full_name_len
)
/* in: full name length where also the null
chars count */
chars count */
{
{
/* Note that the sync0sync.h rank of the query cache mutex is just
above the InnoDB kernel mutex. The caller of this function must not
have latches of a lower rank. */
/* Argument TRUE below means we are using transactions */
/* Argument TRUE below means we are using transactions */
#ifdef HAVE_QUERY_CACHE
#ifdef HAVE_QUERY_CACHE
query_cache
.
invalidate
((
THD
*
)(
trx
->
mysql_thd
),
query_cache
.
invalidate
((
THD
*
)(
trx
->
mysql_thd
),
...
...
sql/sql_analyse.cc
View file @
e7810fa9
...
@@ -59,6 +59,7 @@ int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
...
@@ -59,6 +59,7 @@ int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
return
compare_ulonglong
(
s
,
t
);
return
compare_ulonglong
(
s
,
t
);
}
}
static
bool
append_escaped
(
String
*
to_str
,
String
*
from_str
);
Procedure
*
Procedure
*
proc_analyse_init
(
THD
*
thd
,
ORDER
*
param
,
select_result
*
result
,
proc_analyse_init
(
THD
*
thd
,
ORDER
*
param
,
select_result
*
result
,
...
@@ -890,7 +891,8 @@ int collect_string(String *element,
...
@@ -890,7 +891,8 @@ int collect_string(String *element,
else
else
info
->
found
=
1
;
info
->
found
=
1
;
info
->
str
->
append
(
'\''
);
info
->
str
->
append
(
'\''
);
info
->
str
->
append
(
*
element
);
if
(
append_escaped
(
info
->
str
,
element
))
return
1
;
info
->
str
->
append
(
'\''
);
info
->
str
->
append
(
'\''
);
return
0
;
return
0
;
}
// collect_string
}
// collect_string
...
@@ -1025,3 +1027,58 @@ uint check_ulonglong(const char *str, uint length)
...
@@ -1025,3 +1027,58 @@ uint check_ulonglong(const char *str, uint length)
while
(
*
cmp
&&
*
cmp
++
==
*
str
++
)
;
while
(
*
cmp
&&
*
cmp
++
==
*
str
++
)
;
return
((
uchar
)
str
[
-
1
]
<=
(
uchar
)
cmp
[
-
1
])
?
smaller
:
bigger
;
return
((
uchar
)
str
[
-
1
]
<=
(
uchar
)
cmp
[
-
1
])
?
smaller
:
bigger
;
}
/* check_ulonlong */
}
/* check_ulonlong */
/*
FUNCTION: append_escaped()
DESCRIPTION
append_escaped() takes a String type variable, where it appends
escaped the second argument. Only characters that require escaping
will be escaped.
ARGUMENTS
A pointer to a String variable, where results will be appended
A pointer to a String variable, which is appended to the result
String, escaping those characters that require it.
RETURN VALUES
0 Success
1 Out of memory
*/
static
bool
append_escaped
(
String
*
to_str
,
String
*
from_str
)
{
char
*
from
,
*
end
,
c
;
if
(
to_str
->
realloc
(
to_str
->
length
()
+
from_str
->
length
()))
return
1
;
from
=
(
char
*
)
from_str
->
ptr
();
end
=
from
+
from_str
->
length
();
for
(;
from
<
end
;
from
++
)
{
c
=
*
from
;
switch
(
c
)
{
case
'\0'
:
c
=
'0'
;
break
;
case
'\032'
:
c
=
'Z'
;
break
;
case
'\\'
:
case
'\''
:
break
;
default:
goto
normal_character
;
}
if
(
to_str
->
append
(
'\\'
))
return
1
;
normal_character:
if
(
to_str
->
append
(
c
))
return
1
;
}
return
0
;
}
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