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
ae68221d
Commit
ae68221d
authored
Nov 02, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
parents
b45cdbbd
8a809365
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
10 deletions
+60
-10
mysql-test/r/view.result
mysql-test/r/view.result
+19
-0
mysql-test/t/view.test
mysql-test/t/view.test
+15
-0
sql/handler.h
sql/handler.h
+1
-0
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/sql_table.cc
sql/sql_table.cc
+23
-10
No files found.
mysql-test/r/view.result
View file @
ae68221d
...
@@ -2323,3 +2323,22 @@ id select_type table type possible_keys key key_len ref rows Extra
...
@@ -2323,3 +2323,22 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
DROP VIEW v1,v2;
DROP VIEW v1,v2;
DROP TABLE t1,t2,t3;
DROP TABLE t1,t2,t3;
CREATE TABLE t1(id INT) ENGINE=MyISAM;
CREATE VIEW v1 AS SELECT id FROM t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 optimize note You cannot apply optimize to a view
ANALYZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 analyze note You cannot apply analyze to a view
REPAIR TABLE v1;
Table Op Msg_type Msg_text
test.v1 repair note You cannot apply repair to a view
DROP TABLE t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 optimize note You cannot apply optimize to a view
Warnings:
Error 1146 Table 'test.t1' doesn't exist
Error 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP VIEW v1;
mysql-test/t/view.test
View file @
ae68221d
...
@@ -2189,4 +2189,19 @@ EXPLAIN SELECT * FROM v2 WHERE a=1;
...
@@ -2189,4 +2189,19 @@ EXPLAIN SELECT * FROM v2 WHERE a=1;
DROP
VIEW
v1
,
v2
;
DROP
VIEW
v1
,
v2
;
DROP
TABLE
t1
,
t2
,
t3
;
DROP
TABLE
t1
,
t2
,
t3
;
#
# Bug #14540: OPTIMIZE, ANALYZE, REPAIR applied to not a view
#
CREATE
TABLE
t1
(
id
INT
)
ENGINE
=
MyISAM
;
CREATE
VIEW
v1
AS
SELECT
id
FROM
t1
;
OPTIMIZE
TABLE
v1
;
ANALYZE
TABLE
v1
;
REPAIR
TABLE
v1
;
DROP
TABLE
t1
;
OPTIMIZE
TABLE
v1
;
DROP
VIEW
v1
;
sql/handler.h
View file @
ae68221d
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#define HA_ADMIN_REJECT -6
#define HA_ADMIN_REJECT -6
#define HA_ADMIN_TRY_ALTER -7
#define HA_ADMIN_TRY_ALTER -7
#define HA_ADMIN_WRONG_CHECKSUM -8
#define HA_ADMIN_WRONG_CHECKSUM -8
#define HA_ADMIN_NOT_BASE_TABLE -9
/* Bits in table_flags() to show what database can do */
/* Bits in table_flags() to show what database can do */
...
...
sql/share/errmsg.txt
View file @
ae68221d
...
@@ -5421,3 +5421,5 @@ ER_NO_REFERENCED_ROW_2 23000
...
@@ -5421,3 +5421,5 @@ ER_NO_REFERENCED_ROW_2 23000
eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)"
eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)"
ER_SP_BAD_VAR_SHADOW 42000
ER_SP_BAD_VAR_SHADOW 42000
eng "Variable '%-.64s' must be quoted with `...`, or renamed"
eng "Variable '%-.64s' must be quoted with `...`, or renamed"
ER_CHECK_NOT_BASE_TABLE 4200
eng "You cannot apply %s to a view"
sql/sql_table.cc
View file @
ae68221d
...
@@ -2189,7 +2189,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
...
@@ -2189,7 +2189,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
/* if view are unsupported */
/* if view are unsupported */
if
(
table
->
view
&&
view_operator_func
==
NULL
)
if
(
table
->
view
&&
view_operator_func
==
NULL
)
{
{
result_code
=
HA_ADMIN_NOT_
IMPLEMENTED
;
result_code
=
HA_ADMIN_NOT_
BASE_TABLE
;
goto
send_result
;
goto
send_result
;
}
}
thd
->
open_options
&=
~
extra_open_options
;
thd
->
open_options
&=
~
extra_open_options
;
...
@@ -2324,6 +2324,16 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
...
@@ -2324,6 +2324,16 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
}
}
break
;
break
;
case
HA_ADMIN_NOT_BASE_TABLE
:
{
char
buf
[
ERRMSGSIZE
+
20
];
uint
length
=
my_snprintf
(
buf
,
ERRMSGSIZE
,
ER
(
ER_CHECK_NOT_BASE_TABLE
),
operator_name
);
protocol
->
store
(
"note"
,
4
,
system_charset_info
);
protocol
->
store
(
buf
,
length
,
system_charset_info
);
}
break
;
case
HA_ADMIN_OK
:
case
HA_ADMIN_OK
:
protocol
->
store
(
"status"
,
6
,
system_charset_info
);
protocol
->
store
(
"status"
,
6
,
system_charset_info
);
protocol
->
store
(
"OK"
,
2
,
system_charset_info
);
protocol
->
store
(
"OK"
,
2
,
system_charset_info
);
...
@@ -2424,6 +2434,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
...
@@ -2424,6 +2434,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
break
;
break
;
}
}
}
}
if
(
table
->
table
)
{
if
(
fatal_error
)
if
(
fatal_error
)
table
->
table
->
s
->
version
=
0
;
// Force close of table
table
->
table
->
s
->
version
=
0
;
// Force close of table
else
if
(
open_for_modify
)
else
if
(
open_for_modify
)
...
@@ -2432,9 +2444,10 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
...
@@ -2432,9 +2444,10 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
remove_table_from_cache
(
thd
,
table
->
table
->
s
->
db
,
remove_table_from_cache
(
thd
,
table
->
table
->
s
->
db
,
table
->
table
->
s
->
table_name
,
RTFC_NO_FLAG
);
table
->
table
->
s
->
table_name
,
RTFC_NO_FLAG
);
pthread_mutex_unlock
(
&
LOCK_open
);
pthread_mutex_unlock
(
&
LOCK_open
);
/* May be something modified consequentl
y we have to invalidate cache */
/* Something may be modified, that's wh
y we have to invalidate cache */
query_cache_invalidate3
(
thd
,
table
->
table
,
0
);
query_cache_invalidate3
(
thd
,
table
->
table
,
0
);
}
}
}
close_thread_tables
(
thd
);
close_thread_tables
(
thd
);
table
->
table
=
0
;
// For query cache
table
->
table
=
0
;
// For query cache
if
(
protocol
->
write
())
if
(
protocol
->
write
())
...
...
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