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
f2559fbc
Commit
f2559fbc
authored
Dec 02, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge moonbone.local:/work/15028-bug-5.0-mysql
into moonbone.local:/work/15028-bug-5.1-new-mysql
parents
e7a7af07
70abb812
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
24 deletions
+110
-24
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+25
-0
mysql-test/r/update.result
mysql-test/r/update.result
+13
-0
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+14
-0
mysql-test/t/update.test
mysql-test/t/update.test
+17
-0
sql/sql_cache.cc
sql/sql_cache.cc
+24
-13
sql/sql_update.cc
sql/sql_update.cc
+7
-6
storage/ndb/src/kernel/blocks/backup/Backup.cpp
storage/ndb/src/kernel/blocks/backup/Backup.cpp
+10
-5
No files found.
mysql-test/r/query_cache.result
View file @
f2559fbc
...
...
@@ -1024,6 +1024,31 @@ Variable_name Value
Qcache_hits 1
drop table t1;
create table t1 (a int);
flush status;
(select a from t1) union (select a from t1);
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
(select a from t1) union (select a from t1);
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
drop table t1;
create table t1 (a int);
insert into t1 values (1),(2);
CREATE PROCEDURE `p1`()
begin
...
...
mysql-test/r/update.result
View file @
f2559fbc
...
...
@@ -345,3 +345,16 @@ f1
2000-01-01
2002-02-02
drop table t1;
create table t1 (f1 int);
create table t2 (f2 int);
insert into t1 values(1),(2);
insert into t2 values(1),(1);
update t1,t2 set f1=3,f2=3 where f1=f2 and f1=1;
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
update t2 set f2=1;
update t1 set f1=1 where f1=3;
update t2,t1 set f1=3,f2=3 where f1=f2 and f1=1;
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
drop table t1,t2;
mysql-test/t/query_cache.test
View file @
f2559fbc
...
...
@@ -747,6 +747,20 @@ show status like "Qcache_hits";
drop
table
t1
;
#
# BUG#14652: Queries with leading '(' characters.
#
create
table
t1
(
a
int
);
flush
status
;
(
select
a
from
t1
)
union
(
select
a
from
t1
);
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
(
select
a
from
t1
)
union
(
select
a
from
t1
);
show
status
like
"Qcache_queries_in_cache"
;
show
status
like
"Qcache_inserts"
;
show
status
like
"Qcache_hits"
;
drop
table
t1
;
# SP cursors and selects with query cache (BUG#9715)
#
create
table
t1
(
a
int
);
...
...
mysql-test/t/update.test
View file @
f2559fbc
...
...
@@ -270,4 +270,21 @@ insert into t1 values('2000-01-01'),('0000-00-00');
update
t1
set
f1
=
'2002-02-02'
where
f1
is
null
;
select
*
from
t1
;
drop
table
t1
;
#
# Bug#15028 Multitable update returns different numbers of matched rows
# depending on table order
create
table
t1
(
f1
int
);
create
table
t2
(
f2
int
);
insert
into
t1
values
(
1
),(
2
);
insert
into
t2
values
(
1
),(
1
);
--
enable_info
update
t1
,
t2
set
f1
=
3
,
f2
=
3
where
f1
=
f2
and
f1
=
1
;
--
disable_info
update
t2
set
f2
=
1
;
update
t1
set
f1
=
1
where
f1
=
3
;
--
enable_info
update
t2
,
t1
set
f1
=
3
,
f2
=
3
where
f1
=
f2
and
f1
=
1
;
--
disable_info
drop
table
t1
,
t2
;
# End of 4.1 tests
sql/sql_cache.cc
View file @
f2559fbc
...
...
@@ -977,21 +977,32 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
goto
err
;
}
/*
Test if the query is a SELECT
(pre-space is removed in dispatch_command).
{
uint
i
=
0
;
/*
Skip '(' characters in queries like following:
(select a from t1) union (select a from t1);
*/
while
(
sql
[
i
]
==
'('
)
i
++
;
First '/' looks like comment before command it is not
frequently appeared in real lihe, consequently we can
check all such queries, too.
*/
if
((
my_toupper
(
system_charset_info
,
sql
[
0
])
!=
'S'
||
my_toupper
(
system_charset_info
,
sql
[
1
])
!=
'E'
||
my_toupper
(
system_charset_info
,
sql
[
2
])
!=
'L'
)
&&
/*
Test if the query is a SELECT
(pre-space is removed in dispatch_command).
First '/' looks like comment before command it is not
frequently appeared in real lihe, consequently we can
check all such queries, too.
*/
if
((
my_toupper
(
system_charset_info
,
sql
[
i
])
!=
'S'
||
my_toupper
(
system_charset_info
,
sql
[
i
+
1
])
!=
'E'
||
my_toupper
(
system_charset_info
,
sql
[
i
+
2
])
!=
'L'
)
&&
sql
[
0
]
!=
'/'
)
{
DBUG_PRINT
(
"qcache"
,
(
"The statement is not a SELECT; Not cached"
));
goto
err
;
{
DBUG_PRINT
(
"qcache"
,
(
"The statement is not a SELECT; Not cached"
));
goto
err
;
}
}
STRUCT_LOCK
(
&
structure_guard_mutex
);
...
...
sql/sql_update.cc
View file @
f2559fbc
...
...
@@ -1396,22 +1396,23 @@ bool multi_update::send_data(List<Item> ¬_used_values)
int
error
;
TABLE
*
tmp_table
=
tmp_tables
[
offset
];
fill_record
(
thd
,
tmp_table
->
field
+
1
,
*
values_for_table
[
offset
],
1
);
found
++
;
/* Store pointer to row */
memcpy
((
char
*
)
tmp_table
->
field
[
0
]
->
ptr
,
(
char
*
)
table
->
file
->
ref
,
table
->
file
->
ref_length
);
/* Write row, ignoring duplicated updates to a row */
if
((
error
=
tmp_table
->
file
->
write_row
(
tmp_table
->
record
[
0
]))
&&
(
error
!=
HA_ERR_FOUND_DUPP_KEY
&&
error
!=
HA_ERR_FOUND_DUPP_UNIQUE
))
if
(
error
=
tmp_table
->
file
->
write_row
(
tmp_table
->
record
[
0
]))
{
if
(
create_myisam_from_heap
(
thd
,
tmp_table
,
tmp_table_param
+
offset
,
error
,
1
))
if
(
error
!=
HA_ERR_FOUND_DUPP_KEY
&&
error
!=
HA_ERR_FOUND_DUPP_UNIQUE
&&
create_myisam_from_heap
(
thd
,
tmp_table
,
tmp_table_param
+
offset
,
error
,
1
))
{
do_update
=
0
;
DBUG_RETURN
(
1
);
// Not a table_is_full error
}
}
else
found
++
;
}
}
DBUG_RETURN
(
0
);
...
...
storage/ndb/src/kernel/blocks/backup/Backup.cpp
View file @
f2559fbc
...
...
@@ -802,13 +802,17 @@ Backup::checkNodeFail(Signal* signal,
pos
=
&
ref
->
nodeId
-
signal
->
getDataPtr
();
break
;
}
case
GSN_WAIT_GCP_REQ
:
case
GSN_DROP_TRIG_REQ
:
case
GSN_CREATE_TRIG_REQ
:
case
GSN_ALTER_TRIG_REQ
:
case
GSN_WAIT_GCP_REQ
:
ptr
.
p
->
setErrorCode
(
AbortBackupOrd
::
BackupFailureDueToNodeFail
);
return
;
case
GSN_UTIL_SEQUENCE_REQ
:
case
GSN_UTIL_LOCK_REQ
:
case
GSN_DROP_TRIG_REQ
:
return
;
default:
ndbrequire
(
false
);
}
for
(
Uint32
i
=
0
;
(
i
=
mask
.
find
(
i
+
1
))
!=
NdbNodeBitmask
::
NotFound
;
)
...
...
@@ -1820,7 +1824,7 @@ Backup::execBACKUP_FRAGMENT_CONF(Signal* signal)
const
Uint32
nodeId
=
refToNode
(
signal
->
senderBlockRef
());
const
Uint32
noOfBytes
=
conf
->
noOfBytes
;
const
Uint32
noOfRecords
=
conf
->
noOfRecords
;
BackupRecordPtr
ptr
;
c_backupPool
.
getPtr
(
ptr
,
ptrI
);
...
...
@@ -1897,7 +1901,7 @@ Backup::execBACKUP_FRAGMENT_REF(Signal* signal)
}
}
}
ndbrequire
(
false
)
;
goto
err
;
done:
ptr
.
p
->
masterData
.
sendCounter
--
;
...
...
@@ -1909,7 +1913,8 @@ done:
masterAbort
(
signal
,
ptr
);
return
;
}
//if
err:
AbortBackupOrd
*
ord
=
(
AbortBackupOrd
*
)
signal
->
getDataPtrSend
();
ord
->
backupId
=
ptr
.
p
->
backupId
;
ord
->
backupPtr
=
ptr
.
i
;
...
...
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