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
c187798f
Commit
c187798f
authored
Dec 16, 2004
by
jan@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print a error message if the handler don't support transactional table
locks (LOCK TABLES ... WHERE ENGINE = ).
parent
ee4f2783
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
sql/handler.h
sql/handler.h
+7
-1
sql/lock.cc
sql/lock.cc
+14
-6
No files found.
sql/handler.h
View file @
c187798f
...
@@ -452,7 +452,13 @@ public:
...
@@ -452,7 +452,13 @@ public:
{
return
extra
(
operation
);
}
{
return
extra
(
operation
);
}
virtual
int
reset
()
{
return
extra
(
HA_EXTRA_RESET
);
}
virtual
int
reset
()
{
return
extra
(
HA_EXTRA_RESET
);
}
virtual
int
external_lock
(
THD
*
thd
,
int
lock_type
)
{
return
0
;
}
virtual
int
external_lock
(
THD
*
thd
,
int
lock_type
)
{
return
0
;
}
virtual
int
transactional_table_lock
(
THD
*
thd
,
int
lock_type
)
{
return
0
;}
/*
This is called to set transactional table lock to a table.
If the handler don't support this, then this function will
return HA_ERR_WRONG_COMMAND and MySQL will give
ER_ILLEGAL_HA error message.
*/
virtual
int
transactional_table_lock
(
THD
*
thd
,
int
lock_type
)
{
return
HA_ERR_WRONG_COMMAND
;}
virtual
void
unlock_row
()
{}
virtual
void
unlock_row
()
{}
virtual
int
start_stmt
(
THD
*
thd
)
{
return
0
;}
virtual
int
start_stmt
(
THD
*
thd
)
{
return
0
;}
/*
/*
...
...
sql/lock.cc
View file @
c187798f
...
@@ -79,7 +79,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table,uint count,
...
@@ -79,7 +79,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table,uint count,
bool
unlock
,
TABLE
**
write_locked
);
bool
unlock
,
TABLE
**
write_locked
);
static
int
lock_external
(
THD
*
thd
,
TABLE
**
table
,
uint
count
);
static
int
lock_external
(
THD
*
thd
,
TABLE
**
table
,
uint
count
);
static
int
unlock_external
(
THD
*
thd
,
TABLE
**
table
,
uint
count
);
static
int
unlock_external
(
THD
*
thd
,
TABLE
**
table
,
uint
count
);
static
void
print_lock_error
(
int
error
);
static
void
print_lock_error
(
int
error
,
const
char
*
);
MYSQL_LOCK
*
mysql_lock_tables
(
THD
*
thd
,
TABLE
**
tables
,
uint
count
)
MYSQL_LOCK
*
mysql_lock_tables
(
THD
*
thd
,
TABLE
**
tables
,
uint
count
)
...
@@ -187,7 +187,7 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
...
@@ -187,7 +187,7 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
(
*
tables
)
->
file
->
external_lock
(
thd
,
F_UNLCK
);
(
*
tables
)
->
file
->
external_lock
(
thd
,
F_UNLCK
);
(
*
tables
)
->
current_lock
=
F_UNLCK
;
(
*
tables
)
->
current_lock
=
F_UNLCK
;
}
}
print_lock_error
(
error
);
print_lock_error
(
error
,
(
*
tables
)
->
file
->
table_type
()
);
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
else
else
...
@@ -380,7 +380,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
...
@@ -380,7 +380,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
table
++
;
table
++
;
}
while
(
--
count
);
}
while
(
--
count
);
if
(
error_code
)
if
(
error_code
)
print_lock_error
(
error_code
);
print_lock_error
(
error_code
,
(
*
table
)
->
file
->
table_type
()
);
DBUG_RETURN
(
error_code
);
DBUG_RETURN
(
error_code
);
}
}
...
@@ -683,7 +683,7 @@ void unlock_table_names(THD *thd, TABLE_LIST *table_list,
...
@@ -683,7 +683,7 @@ void unlock_table_names(THD *thd, TABLE_LIST *table_list,
}
}
static
void
print_lock_error
(
int
error
)
static
void
print_lock_error
(
int
error
,
const
char
*
table
)
{
{
int
textno
;
int
textno
;
DBUG_ENTER
(
"print_lock_error"
);
DBUG_ENTER
(
"print_lock_error"
);
...
@@ -698,11 +698,19 @@ static void print_lock_error(int error)
...
@@ -698,11 +698,19 @@ static void print_lock_error(int error)
case
HA_ERR_LOCK_DEADLOCK
:
case
HA_ERR_LOCK_DEADLOCK
:
textno
=
ER_LOCK_DEADLOCK
;
textno
=
ER_LOCK_DEADLOCK
;
break
;
break
;
case
HA_ERR_WRONG_COMMAND
:
textno
=
ER_ILLEGAL_HA
;
break
;
default:
default:
textno
=
ER_CANT_LOCK
;
textno
=
ER_CANT_LOCK
;
break
;
break
;
}
}
my_error
(
textno
,
MYF
(
ME_BELL
+
ME_OLDWIN
+
ME_WAITTANG
),
error
);
if
(
textno
==
ER_ILLEGAL_HA
)
my_error
(
textno
,
MYF
(
ME_BELL
+
ME_OLDWIN
+
ME_WAITTANG
),
table
);
else
my_error
(
textno
,
MYF
(
ME_BELL
+
ME_OLDWIN
+
ME_WAITTANG
),
error
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
@@ -977,7 +985,7 @@ int transactional_lock_tables(THD *thd, TABLE_LIST *tables, uint counter)
...
@@ -977,7 +985,7 @@ int transactional_lock_tables(THD *thd, TABLE_LIST *tables, uint counter)
if
((
error
=
(
*
start
)
->
file
->
transactional_table_lock
(
thd
,
lock_type
)))
if
((
error
=
(
*
start
)
->
file
->
transactional_table_lock
(
thd
,
lock_type
)))
{
{
print_lock_error
(
error
);
print_lock_error
(
error
,
(
*
start
)
->
file
->
table_type
()
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
else
else
...
...
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