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
17e99909
Commit
17e99909
authored
May 29, 2002
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fixes for user resources management
parent
0ba01513
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
sql/sql_parse.cc
sql/sql_parse.cc
+3
-8
No files found.
sql/sql_parse.cc
View file @
17e99909
...
@@ -160,7 +160,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
...
@@ -160,7 +160,7 @@ static int get_or_create_user_conn(THD *thd, const char *user,
uc
->
connections
=
1
;
uc
->
connections
=
1
;
uc
->
questions
=
uc
->
updates
=
uc
->
conn_per_hour
=
0
;
uc
->
questions
=
uc
->
updates
=
uc
->
conn_per_hour
=
0
;
uc
->
user_resources
=*
mqh
;
uc
->
user_resources
=*
mqh
;
if
(
mqh
->
connections
>
max_user_connections
)
if
(
m
ax_user_connections
&&
m
qh
->
connections
>
max_user_connections
)
uc
->
user_resources
.
connections
=
max_user_connections
;
uc
->
user_resources
.
connections
=
max_user_connections
;
uc
->
intime
=
thd
->
thr_create_time
;
uc
->
intime
=
thd
->
thr_create_time
;
if
(
hash_insert
(
&
hash_user_connections
,
(
byte
*
)
uc
))
if
(
hash_insert
(
&
hash_user_connections
,
(
byte
*
)
uc
))
...
@@ -298,7 +298,7 @@ static int check_for_max_user_connections(USER_CONN *uc)
...
@@ -298,7 +298,7 @@ static int check_for_max_user_connections(USER_CONN *uc)
goto
end
;
goto
end
;
}
}
uc
->
connections
++
;
uc
->
connections
++
;
if
(
uc
->
user_resources
.
connections
&&
uc
->
conn_per_hour
++
>=
uc
->
user_resources
.
connections
)
if
(
uc
->
user_resources
.
connections
&&
uc
->
conn_per_hour
++
>=
uc
->
user_resources
.
connections
)
{
{
net_printf
(
&
current_thd
->
net
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_connections"
,
net_printf
(
&
current_thd
->
net
,
ER_USER_LIMIT_REACHED
,
uc
->
user
,
"max_connections"
,
(
long
)
uc
->
user_resources
.
connections
);
(
long
)
uc
->
user_resources
.
connections
);
...
@@ -317,12 +317,7 @@ static void decrease_user_connections(USER_CONN *uc)
...
@@ -317,12 +317,7 @@ static void decrease_user_connections(USER_CONN *uc)
*/
*/
DBUG_ENTER
(
"decrease_user_connections"
);
DBUG_ENTER
(
"decrease_user_connections"
);
if
(
mqh_used
)
if
(
!
mqh_used
&&
uc
->
connections
&&
!--
uc
->
connections
)
{
if
(
uc
->
conn_per_hour
)
uc
->
conn_per_hour
--
;
}
else
if
(
!--
uc
->
connections
)
{
{
/* Last connection for user; Delete it */
/* Last connection for user; Delete it */
(
void
)
pthread_mutex_lock
(
&
LOCK_user_conn
);
(
void
)
pthread_mutex_lock
(
&
LOCK_user_conn
);
...
...
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