Commit 55ee2001 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.0

into mysql.com:/home/jimw/my/mysql-5.0-clean

parents 9ec5da11 34b7d36c
...@@ -25,6 +25,7 @@ bar@bar.intranet.mysql.r18.ru ...@@ -25,6 +25,7 @@ bar@bar.intranet.mysql.r18.ru
bar@bar.mysql.r18.ru bar@bar.mysql.r18.ru
bar@bar.udmsearch.izhnet.ru bar@bar.udmsearch.izhnet.ru
bar@deer.(none) bar@deer.(none)
bar@eagle.intranet.mysql.r18.ru
bar@gw.udmsearch.izhnet.ru bar@gw.udmsearch.izhnet.ru
bar@mysql.com bar@mysql.com
bar@noter.intranet.mysql.r18.ru bar@noter.intranet.mysql.r18.ru
......
...@@ -427,8 +427,8 @@ static void usage(void) ...@@ -427,8 +427,8 @@ static void usage(void)
can't fix the data file.\n\ can't fix the data file.\n\
--character-sets-dir=...\n\ --character-sets-dir=...\n\
Directory where character sets are.\n\ Directory where character sets are.\n\
--set-character-set=name\n\ --set-collation=name\n\
Change the character set used by the index.\n\ Change the collation used by the index.\n\
-q, --quick Faster repair by not modifying the data file.\n\ -q, --quick Faster repair by not modifying the data file.\n\
One can give a second '-q' to force myisamchk to\n\ One can give a second '-q' to force myisamchk to\n\
modify the original datafile in case of duplicate keys.\n\ modify the original datafile in case of duplicate keys.\n\
......
...@@ -77,3 +77,10 @@ big5_bin 6109 ...@@ -77,3 +77,10 @@ big5_bin 6109
big5_bin 61 big5_bin 61
big5_bin 6120 big5_bin 6120
drop table t1; drop table t1;
SET NAMES big5;
CREATE TABLE t1 (a text) character set big5;
INSERT INTO t1 VALUES ('ùØ');
SELECT * FROM t1;
a
ùØ
DROP TABLE t1;
...@@ -642,3 +642,11 @@ Warnings: ...@@ -642,3 +642,11 @@ Warnings:
Warning 1264 Out of range value adjusted for column 'Field1' at row 1 Warning 1264 Out of range value adjusted for column 'Field1' at row 1
DROP TABLE t1; DROP TABLE t1;
SET NAMES latin1; SET NAMES latin1;
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
update t1 set b=a;
SELECT * FROM t1;
a b
1.1 1.100
2.1 2.100
DROP TABLE t1;
...@@ -639,6 +639,26 @@ drop table t1; ...@@ -639,6 +639,26 @@ drop table t1;
select charset(null), collation(null), coercibility(null); select charset(null), collation(null), coercibility(null);
charset(null) collation(null) coercibility(null) charset(null) collation(null) coercibility(null)
binary binary 5 binary binary 5
CREATE TABLE t1 (a int, b int);
CREATE TABLE t2 (a int, b int);
INSERT INTO t1 VALUES (1,1),(2,2);
INSERT INTO t2 VALUES (2,2),(3,3);
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where collation(t2.a) = _utf8'binary' order by t1.a,t2.a;
a b a b
1 1 NULL NULL
2 2 2 2
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where charset(t2.a) = _utf8'binary' order by t1.a,t2.a;
a b a b
1 1 NULL NULL
2 2 2 2
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where coercibility(t2.a) = 2 order by t1.a,t2.a;
a b a b
1 1 NULL NULL
2 2 2 2
DROP TABLE t1, t2;
select SUBSTR('abcdefg',3,2); select SUBSTR('abcdefg',3,2);
SUBSTR('abcdefg',3,2) SUBSTR('abcdefg',3,2)
cd cd
......
...@@ -441,7 +441,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` ( ...@@ -441,7 +441,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` (
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '', `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
`DESCRIPTION` varchar(60) NOT NULL default '', `DESCRIPTION` varchar(60) NOT NULL default '',
`MAXLEN` bigint(3) NOT NULL default '0' `MAXLEN` bigint(3) NOT NULL default '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=1818 ) ENGINE=MEMORY DEFAULT CHARSET=utf8
set names latin2; set names latin2;
SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets; SHOW CREATE TABLE INFORMATION_SCHEMA.character_sets;
Table Create Table Table Create Table
...@@ -450,7 +450,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` ( ...@@ -450,7 +450,7 @@ character_sets CREATE TEMPORARY TABLE `character_sets` (
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '', `DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
`DESCRIPTION` varchar(60) NOT NULL default '', `DESCRIPTION` varchar(60) NOT NULL default '',
`MAXLEN` bigint(3) NOT NULL default '0' `MAXLEN` bigint(3) NOT NULL default '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8 MAX_ROWS=1818 ) ENGINE=MEMORY DEFAULT CHARSET=utf8
set names latin1; set names latin1;
create table t1 select * from information_schema.CHARACTER_SETS create table t1 select * from information_schema.CHARACTER_SETS
where CHARACTER_SET_NAME like "latin1"; where CHARACTER_SET_NAME like "latin1";
...@@ -651,6 +651,8 @@ drop table t1, t2; ...@@ -651,6 +651,8 @@ drop table t1, t2;
CREATE TABLE t_crashme ( f1 BIGINT); CREATE TABLE t_crashme ( f1 BIGINT);
CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
count(*)
100
drop view a2, a1; drop view a2, a1;
drop table t_crashme; drop table t_crashme;
select table_schema,table_name, column_name from select table_schema,table_name, column_name from
......
...@@ -180,14 +180,6 @@ t1 CREATE TABLE `t1` ( ...@@ -180,14 +180,6 @@ t1 CREATE TABLE `t1` (
`-(-1.1)` decimal(7,1) NOT NULL default '0.0' `-(-1.1)` decimal(7,1) NOT NULL default '0.0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
update t1 set b=a;
SELECT * FROM t1;
a b
1.1 1.100
2.1 2.100
DROP TABLE t1;
set session sql_mode='traditional'; set session sql_mode='traditional';
select 1e10/0e0; select 1e10/0e0;
1e10/0e0 1e10/0e0
......
...@@ -16,3 +16,12 @@ SET collation_connection='big5_chinese_ci'; ...@@ -16,3 +16,12 @@ SET collation_connection='big5_chinese_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
SET collation_connection='big5_bin'; SET collation_connection='big5_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
#
# Bugs#9357: TEXT columns break string with special word in BIG5 charset.
#
SET NAMES big5;
CREATE TABLE t1 (a text) character set big5;
INSERT INTO t1 VALUES ('');
SELECT * FROM t1;
DROP TABLE t1;
...@@ -414,3 +414,12 @@ CREATE TABLE t1 (Field1 int(10) unsigned default '0'); ...@@ -414,3 +414,12 @@ CREATE TABLE t1 (Field1 int(10) unsigned default '0');
INSERT INTO t1 VALUES ('-1'); INSERT INTO t1 VALUES ('-1');
DROP TABLE t1; DROP TABLE t1;
SET NAMES latin1; SET NAMES latin1;
#
# Conversion from an UCS2 string to a decimal column
#
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
update t1 set b=a;
SELECT * FROM t1;
DROP TABLE t1;
...@@ -377,6 +377,20 @@ insert into t1 values (null); ...@@ -377,6 +377,20 @@ insert into t1 values (null);
select charset(a), collation(a), coercibility(a) from t1; select charset(a), collation(a), coercibility(a) from t1;
drop table t1; drop table t1;
select charset(null), collation(null), coercibility(null); select charset(null), collation(null), coercibility(null);
#
# Make sure OUTER JOIN is not replaced with a regular joun
#
CREATE TABLE t1 (a int, b int);
CREATE TABLE t2 (a int, b int);
INSERT INTO t1 VALUES (1,1),(2,2);
INSERT INTO t2 VALUES (2,2),(3,3);
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where collation(t2.a) = _utf8'binary' order by t1.a,t2.a;
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where charset(t2.a) = _utf8'binary' order by t1.a,t2.a;
select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b)
where coercibility(t2.a) = 2 order by t1.a,t2.a;
DROP TABLE t1, t2;
# #
# test for SUBSTR # test for SUBSTR
......
...@@ -403,6 +403,7 @@ while ($tab_count) ...@@ -403,6 +403,7 @@ while ($tab_count)
--disable_result_log --disable_result_log
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES; SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES;
--enable_result_log --enable_result_log
SELECT count(*) FROM INFORMATION_SCHEMA.TABLES;
let $tab_count= 65; let $tab_count= 65;
while ($tab_count) while ($tab_count)
{ {
......
...@@ -90,15 +90,6 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(- ...@@ -90,15 +90,6 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(-
show create table t1; show create table t1;
drop table t1; drop table t1;
#
# conversion from ucs2
#
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
update t1 set b=a;
SELECT * FROM t1;
DROP TABLE t1;
# #
# Trydy's tests # Trydy's tests
# #
......
...@@ -704,7 +704,8 @@ public: ...@@ -704,7 +704,8 @@ public:
Item_func_coercibility(Item *a) :Item_int_func(a) {} Item_func_coercibility(Item *a) :Item_int_func(a) {}
longlong val_int(); longlong val_int();
const char *func_name() const { return "coercibility"; } const char *func_name() const { return "coercibility"; }
void fix_length_and_dec() { max_length=10; } void fix_length_and_dec() { max_length=10; maybe_null= 0; }
table_map not_null_tables() const { return 0; }
}; };
class Item_func_locate :public Item_int_func class Item_func_locate :public Item_int_func
......
...@@ -653,7 +653,9 @@ public: ...@@ -653,7 +653,9 @@ public:
{ {
collation.set(system_charset_info); collation.set(system_charset_info);
max_length= 64 * collation.collation->mbmaxlen; // should be enough max_length= 64 * collation.collation->mbmaxlen; // should be enough
maybe_null= 0;
}; };
table_map not_null_tables() const { return 0; }
}; };
class Item_func_collation :public Item_str_func class Item_func_collation :public Item_str_func
...@@ -666,7 +668,9 @@ public: ...@@ -666,7 +668,9 @@ public:
{ {
collation.set(system_charset_info); collation.set(system_charset_info);
max_length= 64 * collation.collation->mbmaxlen; // should be enough max_length= 64 * collation.collation->mbmaxlen; // should be enough
maybe_null= 0;
}; };
table_map not_null_tables() const { return 0; }
}; };
class Item_func_crc32 :public Item_int_func class Item_func_crc32 :public Item_int_func
......
...@@ -8714,8 +8714,9 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, ...@@ -8714,8 +8714,9 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
*table= new_table; *table= new_table;
table->s= &table->share_not_to_be_used; table->s= &table->share_not_to_be_used;
table->file->change_table_ptr(table); table->file->change_table_ptr(table);
thd->proc_info= (!strcmp(save_proc_info,"Copying to tmp table") ? if (save_proc_info)
"Copying to tmp table on disk" : save_proc_info); thd->proc_info= (!strcmp(save_proc_info,"Copying to tmp table") ?
"Copying to tmp table on disk" : save_proc_info);
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
......
This diff is collapsed.
...@@ -322,6 +322,7 @@ typedef struct st_schema_table ...@@ -322,6 +322,7 @@ typedef struct st_schema_table
struct st_lex; struct st_lex;
class select_union; class select_union;
class TMP_TABLE_PARAM;
struct Field_translator struct Field_translator
{ {
...@@ -370,6 +371,7 @@ typedef struct st_table_list ...@@ -370,6 +371,7 @@ typedef struct st_table_list
ST_SCHEMA_TABLE *schema_table; /* Information_schema table */ ST_SCHEMA_TABLE *schema_table; /* Information_schema table */
st_select_lex *schema_select_lex; st_select_lex *schema_select_lex;
bool schema_table_reformed; bool schema_table_reformed;
TMP_TABLE_PARAM *schema_table_param;
/* link to select_lex where this table was used */ /* link to select_lex where this table was used */
st_select_lex *select_lex; st_select_lex *select_lex;
st_lex *view; /* link on VIEW lex for merging */ st_lex *view; /* link on VIEW lex for merging */
......
...@@ -6287,6 +6287,43 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), ...@@ -6287,6 +6287,43 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
return 2; return 2;
} }
/*
Returns a well formed length of a BIG5 string.
CP950 and HKSCS additional characters are also accepted.
*/
static
uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e, uint pos)
{
const char *b0= b;
const char *emb= e - 1; /* Last possible end of an MB character */
while (pos && b < e)
{
/*
Cast to int8 for extra safety. "char" can be unsigned
by default on some platforms.
*/
if (((int8)b[0]) >= 0)
{
/* Single byte ascii character */
b++;
}
else if ((b < emb) && isbig5code((uchar)*b, (uchar)b[1]))
{
/* Double byte character */
b+= 2;
}
else
{
/* Wrong byte sequence */
break;
}
}
return b - b0;
}
static MY_COLLATION_HANDLER my_collation_big5_chinese_ci_handler = static MY_COLLATION_HANDLER my_collation_big5_chinese_ci_handler =
{ {
NULL, /* init */ NULL, /* init */
...@@ -6308,7 +6345,7 @@ static MY_CHARSET_HANDLER my_charset_big5_handler= ...@@ -6308,7 +6345,7 @@ static MY_CHARSET_HANDLER my_charset_big5_handler=
mbcharlen_big5, mbcharlen_big5,
my_numchars_mb, my_numchars_mb,
my_charpos_mb, my_charpos_mb,
my_well_formed_len_mb, my_well_formed_len_big5,
my_lengthsp_8bit, my_lengthsp_8bit,
my_numcells_8bit, my_numcells_8bit,
my_mb_wc_big5, /* mb_wc */ my_mb_wc_big5, /* mb_wc */
......
...@@ -12704,6 +12704,7 @@ from t2);"); ...@@ -12704,6 +12704,7 @@ from t2);");
static void test_bug8378() static void test_bug8378()
{ {
#ifdef HAVE_CHARSET_gbk
MYSQL *lmysql; MYSQL *lmysql;
char out[9]; /* strlen(TEST_BUG8378)*2+1 */ char out[9]; /* strlen(TEST_BUG8378)*2+1 */
int len; int len;
...@@ -12738,6 +12739,7 @@ static void test_bug8378() ...@@ -12738,6 +12739,7 @@ static void test_bug8378()
DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0); DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0);
mysql_close(lmysql); mysql_close(lmysql);
#endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment