Commit 3c82f720 authored by unknown's avatar unknown
Browse files

manual merge


sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
strings/ctype-utf8.c:
  Auto merged
parents 428830c5 306ebf7b
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -64,7 +64,12 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record,
}


/* Calculate a hash for a row */
/*
  Calculate a hash for a row

  TODO
    Add support for bit fields
*/

ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
{
@@ -126,8 +131,16 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record)
  return crc;
}


/*
	  Returns 0 if both rows have equal unique value
  compare unique key for two rows

  TODO
    Add support for bit fields

  RETURN
    0   if both rows have equal unique value
    #   Rows are different
*/

int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
+1 −1
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ static struct my_option my_long_options[] =

static void print_version(void)
{
  VOID(printf("%s Ver 1.22 for %s on %s\n",
  VOID(printf("%s Ver 1.23 for %s on %s\n",
              my_progname, SYSTEM_TYPE, MACHINE_TYPE));
  NETWARE_SET_SCREEN_MODE(1);
}
+21 −0
Original line number Diff line number Diff line
@@ -731,6 +731,27 @@ n
Warnings:
Warning	1052	Column 'n' in group statement is ambiguous
DROP TABLE t1;
create table t1 (c1 char(3), c2 char(3));
create table t2 (c3 char(3), c4 char(3));
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2');
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
group by c2;
c2
aaa
aaa
Warnings:
Warning	1052	Column 'c2' in group statement is ambiguous
show warnings;
Level	Code	Message
Warning	1052	Column 'c2' in group statement is ambiguous
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
group by t1.c1;
c2
aaa
show warnings;
Level	Code	Message
drop table t1, t2;
CREATE TABLE t1 (a  int, b int);
INSERT INTO t1 VALUES (1,2), (1,3);
SELECT a, b FROM t1 GROUP BY 'const';
+5 −0
Original line number Diff line number Diff line
@@ -227,6 +227,9 @@ latin1_bin latin1
latin1_general_ci	latin1
latin1_general_cs	latin1
latin1_spanish_ci	latin1
drop procedure if exists sel2;
drop function if exists sub1;
drop function if exists sub2;
create function sub1(i int) returns int
return i+1;
create procedure sel2()
@@ -823,6 +826,8 @@ GRANT SELECT ON *.* TO 'user4'@'localhost'
drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;
use test;
drop database mysqltest;
drop procedure if exists p1;
drop procedure if exists p2;
create procedure p1 () modifies sql data set @a = 5;
create procedure p2 () set @a = 5;
select sql_data_access from information_schema.routines
+21 −0
Original line number Diff line number Diff line
@@ -543,6 +543,27 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
DROP TABLE t1;

#
# Bug#11211: Ambiguous column reference in GROUP BY.
#

create table t1 (c1 char(3), c2 char(3));
create table t2 (c3 char(3), c4 char(3));
insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2');

# query with ambiguous column reference 'c2'
--disable_ps_protocol
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
group by c2;
show warnings;
--enable_ps_protocol

# this query has no ambiguity
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
group by t1.c1;

show warnings;
drop table t1, t2;

#
# Test for bug #11414: crash on Windows for a simple GROUP BY query 
Loading