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
beb29e1b
Commit
beb29e1b
authored
May 26, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mashka.mysql.fi:/home/my/mysql-4.1-narttu
parents
bd4b9522
b8e5b65f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
46 deletions
+62
-46
sql/ha_innodb.cc
sql/ha_innodb.cc
+2
-2
sql/sql_delete.cc
sql/sql_delete.cc
+13
-11
sql/sql_insert.cc
sql/sql_insert.cc
+20
-13
sql/sql_load.cc
sql/sql_load.cc
+4
-2
sql/sql_update.cc
sql/sql_update.cc
+23
-18
No files found.
sql/ha_innodb.cc
View file @
beb29e1b
...
...
@@ -560,12 +560,12 @@ innobase_query_caching_of_table_permitted(
#endif
if
(
row_search_check_if_query_cache_permitted
(
trx
,
norm_name
))
{
printf
(
"Query cache for %s permitted
\n
"
,
norm_name
);
/* printf("Query cache for %s permitted\n", norm_name); */
return
((
my_bool
)
TRUE
);
}
printf
(
"Query cache for %s NOT permitted
\n
"
,
norm_name
);
/* printf("Query cache for %s NOT permitted\n", norm_name); */
return
((
my_bool
)
FALSE
);
}
...
...
sql/sql_delete.cc
View file @
beb29e1b
...
...
@@ -178,6 +178,15 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order,
(
void
)
table
->
file
->
extra
(
HA_EXTRA_NORMAL
);
cleanup:
/*
Invalidate the table in the query cache if something changed. This must
be before binlog writing and ha_autocommit_...
*/
if
(
deleted
)
{
query_cache_invalidate3
(
thd
,
table_list
,
1
);
}
transactional_table
=
table
->
file
->
has_transactions
();
log_delayed
=
(
transactional_table
||
table
->
tmp_table
);
if
(
deleted
&&
(
error
<=
0
||
!
transactional_table
))
...
...
@@ -199,14 +208,6 @@ cleanup:
error
=
1
;
}
/*
Store table for future invalidation or invalidate it in
the query cache if something changed
*/
if
(
deleted
)
{
query_cache_invalidate3
(
thd
,
table_list
,
1
);
}
if
(
thd
->
lock
)
{
mysql_unlock_tables
(
thd
,
thd
->
lock
);
...
...
@@ -480,6 +481,10 @@ bool multi_delete::send_eof()
/* reset used flags */
thd
->
proc_info
=
"end"
;
/* We must invalidate the query cache before binlog writing and
ha_autocommit_... */
if
(
deleted
)
query_cache_invalidate3
(
thd
,
delete_tables
,
1
);
/*
Write the SQL statement to the binlog if we deleted
...
...
@@ -505,9 +510,6 @@ bool multi_delete::send_eof()
if
(
ha_autocommit_or_rollback
(
thd
,
local_error
>
0
))
local_error
=
1
;
if
(
deleted
)
query_cache_invalidate3
(
thd
,
delete_tables
,
1
);
if
(
local_error
)
::
send_error
(
thd
);
else
...
...
sql/sql_insert.cc
View file @
beb29e1b
...
...
@@ -344,7 +344,18 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
else
if
(
table
->
next_number_field
)
id
=
table
->
next_number_field
->
val_int
();
// Return auto_increment value
/*
Invalidate the table in the query cache if something changed.
For the transactional algorithm to work the invalidation must be
before binlog writing and ha_autocommit_...
*/
if
(
info
.
copied
||
info
.
deleted
)
{
query_cache_invalidate3
(
thd
,
table_list
,
1
);
}
transactional_table
=
table
->
file
->
has_transactions
();
log_delayed
=
(
transactional_table
||
table
->
tmp_table
);
if
((
info
.
copied
||
info
.
deleted
)
&&
(
error
<=
0
||
!
transactional_table
))
{
...
...
@@ -362,14 +373,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
if
(
transactional_table
)
error
=
ha_autocommit_or_rollback
(
thd
,
error
);
/*
Store table for future invalidation or invalidate it in
the query cache if something changed
*/
if
(
info
.
copied
||
info
.
deleted
)
{
query_cache_invalidate3
(
thd
,
table_list
,
1
);
}
if
(
thd
->
lock
)
{
mysql_unlock_tables
(
thd
,
thd
->
lock
);
...
...
@@ -1420,11 +1423,11 @@ void select_insert::send_error(uint errcode,const char *err)
::
send_error
(
thd
,
errcode
,
err
);
table
->
file
->
extra
(
HA_EXTRA_NO_CACHE
);
table
->
file
->
activate_all_index
(
thd
);
ha_rollback_stmt
(
thd
);
if
(
info
.
copied
||
info
.
deleted
)
{
query_cache_invalidate3
(
thd
,
table
,
1
);
}
ha_rollback_stmt
(
thd
);
}
...
...
@@ -1435,6 +1438,14 @@ bool select_insert::send_eof()
error
=
table
->
file
->
activate_all_index
(
thd
);
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
/* We must invalidate the table in the query cache before binlog writing
and ha_autocommit_... */
if
(
info
.
copied
||
info
.
deleted
)
{
query_cache_invalidate3
(
thd
,
table
,
1
);
}
/* Write to binlog before commiting transaction */
if
(
mysql_bin_log
.
is_open
())
{
...
...
@@ -1444,10 +1455,6 @@ bool select_insert::send_eof()
}
if
((
error2
=
ha_autocommit_or_rollback
(
thd
,
error
))
&&
!
error
)
error
=
error2
;
if
(
info
.
copied
||
info
.
deleted
)
{
query_cache_invalidate3
(
thd
,
table
,
1
);
}
if
(
error
)
{
table
->
file
->
print_error
(
error
,
MYF
(
0
));
...
...
sql/sql_load.cc
View file @
beb29e1b
...
...
@@ -283,6 +283,10 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table
->
copy_blobs
=
0
;
thd
->
count_cuted_fields
=
0
;
/* Don`t calc cuted fields */
/* We must invalidate the table in query cache before binlog writing and
ha_autocommit_... */
query_cache_invalidate3
(
thd
,
table_list
,
0
);
if
(
error
)
{
if
(
transactional_table
)
...
...
@@ -344,8 +348,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
if
(
transactional_table
)
error
=
ha_autocommit_or_rollback
(
thd
,
error
);
query_cache_invalidate3
(
thd
,
table_list
,
0
);
err:
if
(
thd
->
lock
)
{
...
...
sql/sql_update.cc
View file @
beb29e1b
...
...
@@ -332,6 +332,21 @@ int mysql_update(THD *thd,
free_io_cache
(
table
);
// If ORDER BY
thd
->
proc_info
=
"end"
;
VOID
(
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
));
/*
Invalidate the table in the query cache if something changed.
This must be before binlog writing and ha_autocommit_...
*/
if
(
updated
)
{
query_cache_invalidate3
(
thd
,
table_list
,
1
);
}
if
(
thd
->
lock
)
{
mysql_unlock_tables
(
thd
,
thd
->
lock
);
thd
->
lock
=
0
;
}
transactional_table
=
table
->
file
->
has_transactions
();
log_delayed
=
(
transactional_table
||
table
->
tmp_table
);
if
(
updated
&&
(
error
<=
0
||
!
transactional_table
))
...
...
@@ -353,20 +368,6 @@ int mysql_update(THD *thd,
error
=
1
;
}
/*
Store table for future invalidation or invalidate it in
the query cache if something changed
*/
if
(
updated
)
{
query_cache_invalidate3
(
thd
,
table_list
,
1
);
}
if
(
thd
->
lock
)
{
mysql_unlock_tables
(
thd
,
thd
->
lock
);
thd
->
lock
=
0
;
}
delete
select
;
free_underlaid_joins
(
thd
,
&
thd
->
lex
.
select_lex
);
if
(
error
>=
0
)
...
...
@@ -950,6 +951,14 @@ bool multi_update::send_eof()
int
local_error
=
(
table_count
)
?
do_updates
(
0
)
:
0
;
thd
->
proc_info
=
"end"
;
/* We must invalidate the query cache before binlog writing and
ha_autocommit_... */
if
(
updated
)
{
query_cache_invalidate3
(
thd
,
update_tables
,
1
);
}
/*
Write the SQL statement to the binlog if we updated
rows and we succeeded or if we updated some non
...
...
@@ -988,10 +997,6 @@ bool multi_update::send_eof()
sprintf
(
buff
,
ER
(
ER_UPDATE_INFO
),
(
long
)
found
,
(
long
)
updated
,
(
long
)
thd
->
cuted_fields
);
if
(
updated
)
{
query_cache_invalidate3
(
thd
,
update_tables
,
1
);
}
::
send_ok
(
thd
,
(
thd
->
client_capabilities
&
CLIENT_FOUND_ROWS
)
?
found
:
updated
,
thd
->
insert_id_used
?
thd
->
insert_id
()
:
0L
,
buff
);
...
...
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