Commit 61f4440c authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/stewart/Documents/MySQL/5.0/main

into  mysql.com:/home/stewart/Documents/MySQL/5.1/main


mysql-test/r/ndb_condition_pushdown.result:
  Auto merged
mysql-test/r/type_newdecimal.result:
  Auto merged
mysql-test/r/view_grant.result:
  Auto merged
mysql-test/t/ndb_condition_pushdown.test:
  Auto merged
mysql-test/t/type_newdecimal.test:
  Auto merged
mysql-test/t/view_grant.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
mysql-test/valgrind.supp:
  Manual merge
parents 81284709 9668198e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -880,7 +880,7 @@ int sendData(SSL& ssl, const void* buffer, int sz)
        ssl.SetError(no_error);

    ssl.verfiyHandShakeComplete();
    if (ssl.GetError()) return 0;
    if (ssl.GetError()) return -1;
    int sent = 0;

    for (;;) {
@@ -891,7 +891,7 @@ int sendData(SSL& ssl, const void* buffer, int sz)
        buildMessage(ssl, out, data);
        ssl.Send(out.get_buffer(), out.get_size());

        if (ssl.GetError()) return 0;
        if (ssl.GetError()) return -1;
        sent += len;
        if (sent == sz) break;
    }
@@ -918,14 +918,14 @@ int receiveData(SSL& ssl, Data& data)
        ssl.SetError(no_error);

    ssl.verfiyHandShakeComplete();
    if (ssl.GetError()) return 0;
    if (ssl.GetError()) return -1;

    if (!ssl.bufferedData())
        processReply(ssl);
    ssl.fillData(data);
    ssl.useLog().ShowData(data.get_length());

    if (ssl.GetError()) return 0;
    if (ssl.GetError()) return -1;

    if (data.get_length() == 0 && ssl.getSocket().WouldBlock()) {
        ssl.SetError(YasslError(SSL_ERROR_WANT_READ));
+11 −2
Original line number Diff line number Diff line
@@ -113,13 +113,22 @@ uint Socket::get_ready() const

uint Socket::send(const byte* buf, unsigned int sz, int flags) const
{
    const byte* pos = buf;
    const byte* end = pos + sz;

    assert(socket_ != INVALID_SOCKET);
    int sent = ::send(socket_, reinterpret_cast<const char *>(buf), sz, flags);

    while (pos != end) {
        int sent = ::send(socket_, reinterpret_cast<const char *>(pos),
                          static_cast<int>(end - pos), flags);

    if (sent == -1)
        return 0;

    return sent;
        pos += sent;
    }

    return sz;
}


+24 −0
Original line number Diff line number Diff line
@@ -1842,5 +1842,29 @@ a b
select * from t1 where b like 'abc' or b like 'abc';
a	b
3	abc
drop table t1;
create table  t1 ( fname varchar(255), lname varchar(255) )
engine=ndbcluster;
insert into t1 values ("Young","Foo");
set engine_condition_pushdown = 0;
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
fname	lname
Young	Foo
set engine_condition_pushdown = 1;
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
fname	lname
Young	Foo
insert into t1 values ("aaa", "aaa");
insert into t1 values ("bbb", "bbb");
insert into t1 values ("ccc", "ccc");
insert into t1 values ("ddd", "ddd");
set engine_condition_pushdown = 0;
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
fname	lname
Young	Foo
set engine_condition_pushdown = 1;
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
fname	lname
Young	Foo
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
+11 −0
Original line number Diff line number Diff line
@@ -1397,3 +1397,14 @@ c1
9999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999
drop table t1;
create table t1 (i int, j int);
insert into t1 values (1,1), (1,2), (2,3), (2,4);
select i, count(distinct j) from t1 group by i;
i	count(distinct j)
1	2
2	2
select i+0.0 as i2, count(distinct j) from t1 group by i2;
i2	count(distinct j)
1.0	2
2.0	2
drop table t1;
+29 −0
Original line number Diff line number Diff line
@@ -620,3 +620,32 @@ ERROR HY000: There is no 'no-such-user'@'localhost' registered
DROP VIEW v;
DROP TABLE t1;
USE test;
CREATE USER mysqltest_db1@localhost identified by 'PWD';
GRANT ALL ON mysqltest_db1.* TO mysqltest_db1@localhost WITH GRANT OPTION;
CREATE SCHEMA mysqltest_db1 ;
USE mysqltest_db1 ;
CREATE TABLE t1 (f1 INTEGER);
CREATE VIEW view1 AS
SELECT * FROM t1;
SHOW CREATE VIEW view1;
View	Create View
view1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view1` AS select `t1`.`f1` AS `f1` from `t1`
CREATE VIEW view2 AS
SELECT * FROM view1;
# Here comes a suspicious warning
SHOW CREATE VIEW view2;
View	Create View
view2	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_db1`@`localhost` SQL SECURITY DEFINER VIEW `view2` AS select `view1`.`f1` AS `f1` from `view1`
# But the view view2 is usable
SELECT * FROM view2;
f1
CREATE VIEW view3 AS
SELECT * FROM view2;
SELECT * from view3;
f1
DROP VIEW mysqltest_db1.view3;
DROP VIEW mysqltest_db1.view2;
DROP VIEW mysqltest_db1.view1;
DROP TABLE mysqltest_db1.t1;
DROP SCHEMA mysqltest_db1;
DROP USER mysqltest_db1@localhost;
Loading