diff --git a/include/my_global.h b/include/my_global.h
index 55ec427e3e1..f051ed2918e 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -235,18 +235,6 @@ C_MODE_END
#define BAD_MEMCPY
#endif
-/* In Linux-alpha we have atomic.h if we are using gcc */
-#if defined(TARGET_OS_LINUX) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) && !defined(HAVE_ATOMIC_ADD)
-#define HAVE_ATOMIC_ADD
-#define HAVE_ATOMIC_SUB
-#endif
-
-/* In Linux-ia64 including atomic.h will give us an error */
-#if (defined(TARGET_OS_LINUX) && defined(__GNUC__) && (defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD)
-#undef HAVE_ATOMIC_ADD
-#undef HAVE_ATOMIC_SUB
-#endif
-
#if defined(_lint) && !defined(lint)
#define lint
#endif
diff --git a/mysql-test/r/ctype_latin2.result b/mysql-test/r/ctype_latin2.result
index 2876accaf72..c2c021b0760 100644
Binary files a/mysql-test/r/ctype_latin2.result and b/mysql-test/r/ctype_latin2.result differ
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index c53779582f1..26ebf492eb2 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -4,9 +4,9 @@ skip_show_database OFF
grant select, update, execute on test.* to mysqltest_2@localhost;
grant select, update on test.* to mysqltest_1@localhost;
select * from information_schema.SCHEMATA where schema_name > 'm';
-CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME SQL_PATH
-NULL mysql latin1 NULL
-NULL test latin1 NULL
+CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
+NULL mysql latin1 latin1_swedish_ci NULL
+NULL test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata;
schema_name
information_schema
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index ff45eff68da..fd67903a576 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2455,3 +2455,24 @@ a
select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1;
a a a
drop table t1,t2;
+create table t1 (s1 varchar(5));
+insert into t1 values ('Wall');
+select min(s1) from t1 group by s1 with rollup;
+min(s1)
+Wall
+Wall
+drop table t1;
+create table t1 (s1 int) engine=myisam;
+insert into t1 values (0);
+select avg(distinct s1) from t1 group by s1 with rollup;
+avg(distinct s1)
+0.0000
+0.0000
+drop table t1;
+create table t1 (s1 int);
+insert into t1 values (null),(1);
+select distinct avg(s1) as x from t1 group by s1 with rollup;
+x
+NULL
+1.0000
+drop table t1;
diff --git a/mysql-test/t/ctype_latin2.test b/mysql-test/t/ctype_latin2.test
index 445223f534c..cc232adeaec 100644
--- a/mysql-test/t/ctype_latin2.test
+++ b/mysql-test/t/ctype_latin2.test
@@ -7,10 +7,6 @@ drop table if exists t1;
SET NAMES latin2;
CREATE TABLE t1 (a char(1) character set latin2);
-INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07);
-INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
-INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17);
-INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27);
INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37);
@@ -45,3 +41,10 @@ INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF);
#
SELECT hex(a) ha, hex(lower(a)) hl, hex(upper(a)) hu,
a, lower(a) l, upper(a) u from t1 order by ha;
+
+
+#
+# Bug#6505 wrong sorting order
+#
+SELECT group_concat(a collate latin2_croatian_ci order by binary a) from t1 group by a collate latin2_croatian_ci;
+drop table t1;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index a92c8ffdc66..64f6674181c 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2029,3 +2029,30 @@ select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1;
select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1;
select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1;
drop table t1,t2;
+
+#
+# Bug#9820
+#
+
+create table t1 (s1 varchar(5));
+insert into t1 values ('Wall');
+select min(s1) from t1 group by s1 with rollup;
+drop table t1;
+
+#
+# Bug#9799
+#
+
+create table t1 (s1 int) engine=myisam;
+insert into t1 values (0);
+select avg(distinct s1) from t1 group by s1 with rollup;
+drop table t1;
+
+#
+# Bug#9800
+#
+
+create table t1 (s1 int);
+insert into t1 values (null),(1);
+select distinct avg(s1) as x from t1 group by s1 with rollup;
+drop table t1;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index a7bc08ea170..76bf8189a0e 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -240,6 +240,8 @@ Item_sum_hybrid::Item_sum_hybrid(THD *thd, Item_sum_hybrid *item)
case REAL_RESULT:
sum= item->sum;
break;
+ case STRING_RESULT: // This can happen with ROLLUP. Note that the value is already
+ break; // copied at function call.
case ROW_RESULT:
default:
DBUG_ASSERT(0);
@@ -585,7 +587,10 @@ bool Item_sum_distinct::setup(THD *thd)
DBUG_ENTER("Item_sum_distinct::setup");
- DBUG_ASSERT(tree == 0); /* setup can not be called twice */
+ /*
+ Setup can be called twice for ROLLUP items. This is a bug.
+ Please add DBUG_ASSERT(tree == 0) here when it's fixed.
+ */
/*
Virtual table and the tree are created anew on each re-execution of
diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml
index 3c35ec98a92..a6bb4bad99b 100644
--- a/sql/share/charsets/Index.xml
+++ b/sql/share/charsets/Index.xml
@@ -367,6 +367,9 @@ To make maintaining easier please:
Slovenian
Sorbian
+
+ Croatian
+
compiled
diff --git a/sql/share/charsets/cp1250.xml b/sql/share/charsets/cp1250.xml
index 8e7102b6737..1e62e64ad5a 100644
--- a/sql/share/charsets/cp1250.xml
+++ b/sql/share/charsets/cp1250.xml
@@ -57,7 +57,7 @@
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 9A 8B 9C 9D 9E 9F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
- A0 A1 A2 B3 A4 B9 A6 DF A8 A9 BA AB AC AD AE BF
+ A0 A1 A2 B3 A4 B9 A6 A7 A8 A9 BA AB AC AD AE BF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BE BD BE BF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
@@ -82,7 +82,7 @@
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 A3 B4 B5 B6 B7 B8 A5 AA BB BC BD BC AF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
- D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE A7
+ D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
@@ -132,6 +132,27 @@
+
+
+
+
diff --git a/sql/share/charsets/latin2.xml b/sql/share/charsets/latin2.xml
index 3ae239cb8fd..7f00148a1df 100644
--- a/sql/share/charsets/latin2.xml
+++ b/sql/share/charsets/latin2.xml
@@ -135,22 +135,22 @@
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 98cdbb599f0..f48a8d67d54 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2002,11 +2002,12 @@ err:
bool store_schema_shemata(THD* thd, TABLE *table, const char *db_name,
- const char* cs_name)
+ CHARSET_INFO *cs)
{
restore_record(table, s->default_values);
table->field[1]->store(db_name, strlen(db_name), system_charset_info);
- table->field[2]->store(cs_name, strlen(cs_name), system_charset_info);
+ table->field[2]->store(cs->csname, strlen(cs->csname), system_charset_info);
+ table->field[3]->store(cs->name, strlen(cs->name), system_charset_info);
return schema_table_store_record(thd, table);
}
@@ -2037,7 +2038,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
if (with_i_schema) // information schema name is always first in list
{
if (store_schema_shemata(thd, table, file_name,
- system_charset_info->csname))
+ system_charset_info))
DBUG_RETURN(1);
with_i_schema= 0;
continue;
@@ -2062,7 +2063,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
strmov(path+length, MY_DB_OPT_FILE);
load_db_opt(thd, path, &create);
if (store_schema_shemata(thd, table, file_name,
- create.default_table_charset->csname))
+ create.default_table_charset))
DBUG_RETURN(1);
}
}
@@ -3484,6 +3485,7 @@ ST_FIELD_INFO schema_fields_info[]=
{"CATALOG_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"SCHEMA_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Database"},
{"DEFAULT_CHARACTER_SET_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
+ {"DEFAULT_COLLATION_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0},
{"SQL_PATH", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};