Commit d2e6f23b authored by unknown's avatar unknown
Browse files

Merge lgrimmer@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/space/my/mysql-5.0


mysql-test/t/ctype_utf8.test:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
parents 56a6aa9e 9e1cf0e2
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1774,6 +1774,7 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row);
static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row);
static int stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row);
static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row);
static int stmt_read_row_no_result_set(MYSQL_STMT *stmt, unsigned char **row);

/*
  This function is used in mysql_stmt_store_result if
@@ -2036,7 +2037,7 @@ mysql_stmt_init(MYSQL *mysql)
  stmt->list.data= stmt;
  stmt->state= MYSQL_STMT_INIT_DONE;
  stmt->mysql= mysql;
  stmt->read_row_func= stmt_read_row_no_data;
  stmt->read_row_func= stmt_read_row_no_result_set;
  stmt->prefetch_rows= DEFAULT_PREFETCH_ROWS;
  /* The rest of statement members was bzeroed inside malloc */

@@ -2778,6 +2779,13 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
static int
stmt_read_row_no_data(MYSQL_STMT *stmt  __attribute__((unused)),
                      unsigned char **row  __attribute__((unused)))
{
  return MYSQL_NO_DATA;
}

static int
stmt_read_row_no_result_set(MYSQL_STMT *stmt  __attribute__((unused)),
                      unsigned char **row  __attribute__((unused)))
{
  set_stmt_error(stmt, CR_NO_RESULT_SET, unknown_sqlstate);
  return 1;
@@ -4600,7 +4608,8 @@ int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt)
      ((rc= stmt_fetch_row(stmt, row)) && rc != MYSQL_DATA_TRUNCATED))
  {
    stmt->state= MYSQL_STMT_PREPARE_DONE;       /* XXX: this is buggy */
    stmt->read_row_func= stmt_read_row_no_data;
    stmt->read_row_func= (rc == MYSQL_NO_DATA) ? 
      stmt_read_row_no_data : stmt_read_row_no_result_set;
  }
  else
  {
@@ -4937,7 +4946,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
      for (; param < param_end; param++)
        param->long_data_used= 0;
    }
    stmt->read_row_func= stmt_read_row_no_data;
    stmt->read_row_func= stmt_read_row_no_result_set;
    if (mysql)
    {
      if ((int) stmt->state > (int) MYSQL_STMT_PREPARE_DONE)
+16 −0
Original line number Diff line number Diff line
@@ -778,3 +778,19 @@ lily
river
drop table t1;
deallocate prepare stmt;
create table t1 (a int);
prepare stmt from "select ??";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
prepare stmt from "select ?FROM t1";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?FROM t1' at line 1
prepare stmt from "select FROM t1 WHERE?=1";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM t1 WHERE?=1' at line 1
prepare stmt from "update t1 set a=a+?WHERE 1";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?WHERE 1' at line 1
select ?;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
select ??;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??' at line 1
select ? from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t1' at line 1
drop table t1;
+17 −0
Original line number Diff line number Diff line
@@ -3062,4 +3062,21 @@ l
drop procedure bug6063|
drop procedure bug7088_1|
drop procedure bug7088_2|
drop procedure if exists bug9565_sub|
drop procedure if exists bug9565|
create procedure bug9565_sub()
begin
select * from t1;
end|
create procedure bug9565()
begin
insert into t1 values ("one", 1);
call bug9565_sub();
end|
call bug9565()|
id	data
one	1
delete from t1|
drop procedure bug9565_sub|
drop procedure bug9565|
drop table t1,t2;
+10 −0
Original line number Diff line number Diff line
@@ -1235,3 +1235,13 @@ create table t1(a varchar(65537));
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
create table t1(a varbinary(65537));
ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead
set @@sql_mode='traditional';
create table t1(a int, b date not null);
alter table t1 modify a bigint unsigned not null;
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` bigint(20) unsigned NOT NULL,
  `b` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+14 −0
Original line number Diff line number Diff line
@@ -1977,3 +1977,17 @@ A
B
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 ( bug_table_seq   INTEGER NOT NULL);
CREATE OR REPLACE VIEW v1 AS SELECT * from t1;
DROP PROCEDURE IF EXISTS p1;
Warnings:
Note	1305	PROCEDURE p1 does not exist
CREATE PROCEDURE p1 ( )
BEGIN
DO (SELECT  @next := IFNULL(max(bug_table_seq),0) + 1 FROM v1);
INSERT INTO t1 VALUES (1);
END //
CALL p1();
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
Loading