3727 Tor Didriksen 2012-03-07
Remove warnings from windows 64-bit build.
We have about 8800 warnings, half of which are due to different
function signatures for send()/recv()/sendto()/recvfrom()
They all take int rather than size_t for the buffer length.
modified:
include/mysql/psi/mysql_socket.h
3726 Norvald H. Ryeng 2012-03-07
Bug#13736664 RIGHT JOIN+WHERE QUERY GIVES DIFF RESULTS WHEN USING
SELECT * SUBQ FOR TABLES
Consider the query from the test case:
SELECT d
FROM (SELECT * FROM t2) AS a2 RIGHT JOIN (SELECT * FROM t1) AS a1 ON c = a
WHERE d LIKE '_'
ORDER BY d;
The query is executed by reading t1 as a const table and calling
create_sort_index() to read and sort t2 on column d. The join and
WHERE conditions are checked during filesort().
First, the optimizer decides to read a2 using the JT_REF access
method, so the join condition is removed and replaced with a ref
lookup. Later, when the optimizer decides to first do the filesort and
then the join, the condition is reintroduced since filesort() always
does a full table scan. The condition is added by
add_ref_to_table_cond(), which calls create_cond_for_const_ref() to
create the condition. An Item_func_equal is constructed to compare c
and a. This is equivalent to checking c <=> a, so if a and c are both
NULL, the rows match the join condition and are part of the
result. This is clearly not the same as the original query, so the
query returns rows that shouldn't match the join condition.
Fix: In create_cond_for_const_ref(), create an Item_func_eq instead of
Item_func_equal if join_tab->ref.null_rejecting is set for the key
part.
@ mysql-test/include/subquery.inc
Add test case for bug #13736664.
@ mysql-test/r/subquery_all.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_all_bka.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_all_bka_nixbnl.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_nomat_nosj.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_nomat_nosj_bka.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_none.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_none_bka.result
Add test case for bug #13736664.
@ mysql-test/r/subquery_none_bka_nixbnl.result
Add test case for bug #13736664.
@ sql/sql_optimizer.cc
Consider NULL values when adding conditions for const references.
modified:
mysql-test/include/subquery.inc
mysql-test/r/subquery_all.result
mysql-test/r/subquery_all_bka.result
mysql-test/r/subquery_all_bka_nixbnl.result
mysql-test/r/subquery_nomat_nosj.result
mysql-test/r/subquery_nomat_nosj_bka.result
mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
mysql-test/r/subquery_none.result
mysql-test/r/subquery_none_bka.result
mysql-test/r/subquery_none_bka_nixbnl.result
sql/sql_optimizer.cc
=== modified file 'include/mysql/psi/mysql_socket.h'
--- a/include/mysql/psi/mysql_socket.h 2012-02-16 09:51:14 +0000
+++ b/include/mysql/psi/mysql_socket.h 2012-03-07 08:31:23 +0000
@@ -740,7 +740,7 @@ inline_mysql_socket_send
PSI_SOCKET_SEND, n, src_file, src_line);
/* Instrumented code */
- result= send(mysql_socket.fd, buf, n, flags);
+ result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
/* Instrumentation end */
if (locker != NULL)
@@ -755,7 +755,7 @@ inline_mysql_socket_send
#endif
/* Non instrumented code */
- result= send(mysql_socket.fd, buf, n, flags);
+ result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
return result;
}
@@ -782,7 +782,7 @@ inline_mysql_socket_recv
PSI_SOCKET_RECV, (size_t)0, src_file, src_line);
/* Instrumented code */
- result= recv(mysql_socket.fd, buf, n, flags);
+ result= recv(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
/* Instrumentation end */
if (locker != NULL)
@@ -797,7 +797,7 @@ inline_mysql_socket_recv
#endif
/* Non instrumented code */
- result= recv(mysql_socket.fd, buf, n, flags);
+ result= recv(mysql_socket.fd, buf, IF_WIN((int),) n, flags);
return result;
}
@@ -824,7 +824,7 @@ inline_mysql_socket_sendto
PSI_SOCKET_SEND, n, src_file, src_line);
/* Instrumented code */
- result= sendto(mysql_socket.fd, buf, n, flags, addr, addr_len);
+ result= sendto(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
/* Instrumentation end */
if (locker != NULL)
@@ -839,7 +839,7 @@ inline_mysql_socket_sendto
#endif
/* Non instrumented code */
- result= sendto(mysql_socket.fd, buf, n, flags, addr, addr_len);
+ result= sendto(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
return result;
}
@@ -867,7 +867,7 @@ inline_mysql_socket_recvfrom
PSI_SOCKET_RECV, (size_t)0, src_file, src_line);
/* Instrumented code */
- result= recvfrom(mysql_socket.fd, buf, n, flags, addr, addr_len);
+ result= recvfrom(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
/* Instrumentation end */
if (locker != NULL)
@@ -882,7 +882,7 @@ inline_mysql_socket_recvfrom
#endif
/* Non instrumented code */
- result= recvfrom(mysql_socket.fd, buf, n, flags, addr, addr_len);
+ result= recvfrom(mysql_socket.fd, buf, IF_WIN((int),) n, flags, addr, addr_len);
return result;
}
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (tor.didriksen:3726 to 3727) | Tor Didriksen | 8 Mar |