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
034a2f35
Commit
034a2f35
authored
Mar 26, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up things if mysql.proc doesn't exists
parent
f9e2c6cd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
3 deletions
+17
-3
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/opt_range.cc
sql/opt_range.cc
+1
-1
sql/sp.cc
sql/sp.cc
+13
-0
sql/sql_acl.cc
sql/sql_acl.cc
+1
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-1
No files found.
sql/mysql_priv.h
View file @
034a2f35
...
...
@@ -867,6 +867,7 @@ extern bool using_update_log, opt_large_files;
extern
bool
opt_log
,
opt_update_log
,
opt_bin_log
,
opt_slow_log
,
opt_error_log
;
extern
bool
opt_disable_networking
,
opt_skip_show_db
;
extern
bool
volatile
abort_loop
,
shutdown_in_progress
,
grant_option
;
extern
bool
mysql_proc_table_exists
;
extern
uint
volatile
thread_count
,
thread_running
,
global_read_lock
;
extern
my_bool
opt_sql_bin_update
,
opt_safe_user_create
,
opt_no_mix_types
;
extern
my_bool
opt_safe_show_db
,
opt_local_infile
,
lower_case_table_names
;
...
...
sql/opt_range.cc
View file @
034a2f35
...
...
@@ -1335,7 +1335,7 @@ static int get_index_merge_params(PARAM *param, key_map& needed_reg,
else
{
double
n_blocks
=
ceil
((
double
)
(
longlong
)
param
->
table
->
file
->
data_file_length
/
IO_SIZE
);
ceil
((
double
)
((
longlong
)
param
->
table
->
file
->
data_file_length
/
IO_SIZE
)
);
double
busy_blocks
=
n_blocks
*
(
1.0
-
pow
(
1.0
-
1.0
/
n_blocks
,
(
double
)
records_for_unique
));
...
...
sql/sp.cc
View file @
034a2f35
...
...
@@ -56,6 +56,8 @@ enum
MYSQL_PROC_FIELD_COUNT
};
bool
mysql_proc_table_exists
=
1
;
/* *opened=true means we opened ourselves */
static
int
db_find_routine_aux
(
THD
*
thd
,
int
type
,
char
*
name
,
uint
namelen
,
...
...
@@ -67,6 +69,14 @@ db_find_routine_aux(THD *thd, int type, char *name, uint namelen,
DBUG_ENTER
(
"db_find_routine_aux"
);
DBUG_PRINT
(
"enter"
,
(
"type: %d name: %*s"
,
type
,
namelen
,
name
));
/*
Speed up things if mysql.proc doesn't exists
mysql_proc_table_exists is set when on creates a stored procedure
or on flush privileges
*/
if
(
!
mysql_proc_table_exists
&&
ltype
==
TL_READ
)
DBUG_RETURN
(
SP_OPEN_TABLE_FAILED
);
// Put the key used to read the row together
memset
(
key
,
(
int
)
' '
,
64
);
// QQ Empty db for now
keylen
=
namelen
;
...
...
@@ -93,10 +103,12 @@ db_find_routine_aux(THD *thd, int type, char *name, uint namelen,
if
(
!
(
table
=
open_ltable
(
thd
,
&
tables
,
ltype
)))
{
*
tablep
=
NULL
;
mysql_proc_table_exists
=
0
;
DBUG_RETURN
(
SP_OPEN_TABLE_FAILED
);
}
*
opened
=
TRUE
;
}
mysql_proc_table_exists
=
1
;
if
(
table
->
file
->
index_read_idx
(
table
->
record
[
0
],
0
,
key
,
keylen
,
...
...
@@ -718,6 +730,7 @@ sp_function_exists(THD *thd, LEX_STRING *name)
ret
=
TRUE
;
if
(
opened
)
close_thread_tables
(
thd
,
0
,
1
);
thd
->
clear_error
();
DBUG_RETURN
(
ret
);
}
...
...
sql/sql_acl.cc
View file @
034a2f35
...
...
@@ -140,7 +140,6 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
MYSQL_LOCK
*
lock
;
my_bool
return_val
=
1
;
bool
check_no_resolve
=
specialflag
&
SPECIAL_NO_RESOLVE
;
DBUG_ENTER
(
"acl_init"
);
if
(
!
acl_cache
)
...
...
@@ -153,6 +152,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
}
priv_version
++
;
/* Privileges updated */
mysql_proc_table_exists
=
1
;
// Assume mysql.proc exists
/*
To be able to run this from boot, we allocate a temporary THD
...
...
sql/sql_lex.cc
View file @
034a2f35
...
...
@@ -169,7 +169,7 @@ static int find_keyword(LEX *lex, uint len, bool function)
LEX_STRING
ls
;
ls
.
str
=
(
char
*
)
tok
;
ls
.
length
=
len
;
if
(
function
&&
sp_function_exists
(
current_
thd
,
&
ls
))
// QQ temp fix
if
(
function
&&
sp_function_exists
(
lex
->
thd
,
&
ls
))
// QQ temp fix
{
lex
->
safe_to_cache_query
=
0
;
lex
->
yylval
->
lex_str
.
str
=
lex
->
thd
->
strmake
((
char
*
)
lex
->
tok_start
,
len
);
...
...
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