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
10957fb0
Commit
10957fb0
authored
Apr 03, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
One test case, one bug fix and one new feature
parent
c588cf68
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
8 deletions
+38
-8
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+9
-0
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+8
-0
sql/sql_show.cc
sql/sql_show.cc
+4
-1
sql/sql_table.cc
sql/sql_table.cc
+17
-7
No files found.
mysql-test/r/innodb.result
View file @
10957fb0
...
...
@@ -1201,3 +1201,12 @@ a b
8 5
9 5
drop table t1,t2;
CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) TYPE=MyISAM;
CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) TYPE=InnoDB;
SET AUTOCOMMIT=0;
INSERT INTO t1 ( B_ID ) VALUES ( 1 );
INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
ROLLBACK;
SELECT * FROM t1;
B_ID
drop table t1,t2;
mysql-test/t/innodb.test
View file @
10957fb0
...
...
@@ -797,3 +797,11 @@ select * from t1;
select
*
from
t2
;
drop
table
t1
,
t2
;
CREATE
TABLE
t2
(
NEXT_T
BIGINT
NOT
NULL
PRIMARY
KEY
)
TYPE
=
MyISAM
;
CREATE
TABLE
t1
(
B_ID
INTEGER
NOT
NULL
PRIMARY
KEY
)
TYPE
=
InnoDB
;
SET
AUTOCOMMIT
=
0
;
INSERT
INTO
t1
(
B_ID
)
VALUES
(
1
);
INSERT
INTO
t2
(
NEXT_T
)
VALUES
(
1
);
ROLLBACK
;
SELECT
*
FROM
t1
;
drop
table
t1
,
t2
;
sql/sql_show.cc
View file @
10957fb0
...
...
@@ -728,7 +728,10 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
net_store_data
(
packet
,
convert
,(
const
char
*
)
pos
);
net_store_data
(
packet
,
convert
,
table
->
file
->
index_type
(
i
));
/* Comment */
net_store_data
(
packet
,
convert
,
""
);
if
(
!
(
table
->
keys_in_use
&
((
key_map
)
1
<<
i
)))
net_store_data
(
packet
,
convert
,
"disabled"
,
8
);
else
net_store_data
(
packet
,
convert
,
""
);
if
(
my_net_write
(
&
thd
->
net
,(
char
*
)
packet
->
ptr
(),
packet
->
length
()))
DBUG_RETURN
(
1
);
/* purecov: inspected */
}
...
...
sql/sql_table.cc
View file @
10957fb0
...
...
@@ -912,12 +912,9 @@ mysql_rename_table(enum db_type base,
Win32 clients must also have a WRITE LOCK on the table !
*/
bool
close_cached_tabl
e
(
THD
*
thd
,
TABLE
*
table
)
static
void
safe_remove_from_cach
e
(
THD
*
thd
,
TABLE
*
table
)
{
bool
result
=
0
;
DBUG_ENTER
(
"close_cached_table"
);
safe_mutex_assert_owner
(
&
LOCK_open
);
DBUG_ENTER
(
"safe_remove_from_cache"
);
if
(
table
)
{
DBUG_PRINT
(
"enter"
,(
"table: %s"
,
table
->
real_name
));
...
...
@@ -940,7 +937,18 @@ bool close_cached_table(THD *thd,TABLE *table)
#endif
/* When lock on LOCK_open is freed other threads can continue */
pthread_cond_broadcast
(
&
COND_refresh
);
}
DBUG_VOID_RETURN
;
}
bool
close_cached_table
(
THD
*
thd
,
TABLE
*
table
)
{
DBUG_ENTER
(
"close_cached_table"
);
safe_mutex_assert_owner
(
&
LOCK_open
);
if
(
table
)
{
safe_remove_from_cache
(
thd
,
table
);
/* Close lock if this is not got with LOCK TABLES */
if
(
thd
->
lock
)
{
...
...
@@ -949,7 +957,7 @@ bool close_cached_table(THD *thd,TABLE *table)
/* Close all copies of 'table'. This also frees all LOCK TABLES lock */
thd
->
open_tables
=
unlink_open_table
(
thd
,
thd
->
open_tables
,
table
);
}
DBUG_RETURN
(
result
);
DBUG_RETURN
(
0
);
}
static
int
send_check_errmsg
(
THD
*
thd
,
TABLE_LIST
*
table
,
...
...
@@ -1456,9 +1464,11 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
case
LEAVE_AS_IS
:
break
;
case
ENABLE
:
error
=
table
->
file
->
activate_all_index
(
thd
);
safe_remove_from_cache
(
thd
,
table
);
error
=
table
->
file
->
activate_all_index
(
thd
);
break
;
case
DISABLE
:
safe_remove_from_cache
(
thd
,
table
);
table
->
file
->
deactivate_non_unique_index
(
HA_POS_ERROR
);
break
;
}
...
...
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