List:Internals« Previous MessageNext Message »
From:gluh Date:April 28 2005 1:05pm
Subject:bk commit into 4.1 tree (gluh:1.2210)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2210 05/04/28 16:05:36 gluh@stripped +9 -0
  WL993: LOAD DATA INFILE and character sets

  mysql-test/std_data/words-ru-koi8r.dat
    1.1 05/04/28 16:04:44 gluh@stripped +12 -0

  mysql-test/std_data/words-ru-cp1251.dat
    1.1 05/04/28 16:04:44 gluh@stripped +12 -0

  sql/sql_yacc.yy
    1.383 05/04/28 16:04:44 gluh@stripped +27 -16
    WL993: LOAD DATA INFILE and character sets

  sql/sql_parse.cc
    1.433 05/04/28 16:04:44 gluh@stripped +8 -0
    WL993: LOAD DATA INFILE and character sets

  sql/sql_class.h
    1.278 05/04/28 16:04:44 gluh@stripped +1 -1
    WL993: LOAD DATA INFILE and character sets

  sql/sql_class.cc
    1.196 05/04/28 16:04:44 gluh@stripped +1 -0
    WL993: LOAD DATA INFILE and character sets

  sql/log.cc
    1.163 05/04/28 16:04:44 gluh@stripped +2 -1
    WL993: LOAD DATA INFILE and character sets

  mysql-test/t/rpl_charset.test
    1.7 05/04/28 16:04:44 gluh@stripped +16 -0
    WL993: LOAD DATA INFILE and character sets

  mysql-test/std_data/words-ru-koi8r.dat
    1.0 05/04/28 16:04:44 gluh@stripped +0 -0
    BitKeeper file /home/gluh/MySQL/Devel/mysql-4.1/mysql-test/std_data/words-ru-koi8r.dat

  mysql-test/std_data/words-ru-cp1251.dat
    1.0 05/04/28 16:04:44 gluh@stripped +0 -0
    BitKeeper file
/home/gluh/MySQL/Devel/mysql-4.1/mysql-test/std_data/words-ru-cp1251.dat

  mysql-test/r/rpl_charset.result
    1.9 05/04/28 16:04:44 gluh@stripped +42 -0
    WL993: LOAD DATA INFILE and character sets

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Devel/mysql-4.1

--- 1.162/sql/log.cc	Wed Feb 23 23:58:56 2005
+++ 1.163/sql/log.cc	Thu Apr 28 16:04:44 2005
@@ -1310,7 +1310,8 @@
           (thd->variables.character_set_client->number !=
            thd->variables.collation_connection->number) ||
           (thd->variables.collation_server->number !=
-           thd->variables.collation_connection->number))
+           thd->variables.collation_connection->number)|| 
+          thd->load_data_one_shot)
       {
 	char buf[200];
         int written= my_snprintf(buf, sizeof(buf)-1,

--- 1.195/sql/sql_class.cc	Mon Feb 28 19:53:07 2005
+++ 1.196/sql/sql_class.cc	Thu Apr 28 16:04:44 2005
@@ -185,6 +185,7 @@
   slave_thread = 0;
   variables.pseudo_thread_id= 0;
   one_shot_set= 0;
+  load_data_one_shot= 0;
   file_id = 0;
   warn_id= 0;
   db_charset= global_system_variables.collation_database;

--- 1.277/sql/sql_class.h	Sat Feb 12 23:58:51 2005
+++ 1.278/sql/sql_class.h	Thu Apr 28 16:04:44 2005
@@ -906,7 +906,7 @@
   /* scramble - random string sent to client on handshake */
   char	     scramble[SCRAMBLE_LENGTH+1];
 
-  bool       slave_thread, one_shot_set;
+  bool       slave_thread, one_shot_set, load_data_one_shot;
   bool	     locked, some_tables_deleted;
   bool       last_cuted_field;
   bool	     no_errors, password, is_fatal_error;

--- 1.432/sql/sql_parse.cc	Sat Apr  2 08:00:11 2005
+++ 1.433/sql/sql_parse.cc	Thu Apr 28 16:04:44 2005
@@ -3119,6 +3119,7 @@
   {
     uint privilege= (lex->duplicates == DUP_REPLACE ?
 		     INSERT_ACL | DELETE_ACL : INSERT_ACL);
+    CHARSET_INFO *save_collation_database= thd->variables.collation_database;
 
     if (!lex->local_file)
     {
@@ -3136,8 +3137,15 @@
       if (check_one_table_access(thd, privilege, tables))
 	goto error;
     }
+    if (lex->create_info.default_table_charset)
+    {
+      thd->variables.collation_database= lex->create_info.default_table_charset;
+      thd->load_data_one_shot= 1;
+    }
     res=mysql_load(thd, lex->exchange, tables, lex->field_list,
 		   lex->duplicates, lex->ignore, (bool) lex->local_file, lex->lock_option);
+    thd->variables.collation_database= save_collation_database;
+    thd->load_data_one_shot= 0;
     break;
   }
 

--- 1.382/sql/sql_yacc.yy	Sat Apr 16 03:10:29 2005
+++ 1.383/sql/sql_yacc.yy	Thu Apr 28 16:04:44 2005
@@ -1210,21 +1210,8 @@
 	| INDEX_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys {
Lex->create_info.index_file_name= $4.str; };
 
 default_charset:
-        opt_default charset opt_equal charset_name_or_default
-        {
-          HA_CREATE_INFO *cinfo= &Lex->create_info;
-          if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
-               cinfo->default_table_charset && $4 &&
-               !my_charset_same(cinfo->default_table_charset,$4))
-          {
-            net_printf(YYTHD, ER_CONFLICTING_DECLARATIONS,
-                       "CHARACTER SET ", cinfo->default_table_charset->csname,
-                       "CHARACTER SET ", $4->csname);
-            YYABORT;
-          }
-	  Lex->create_info.default_table_charset= $4;
-          Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
-        };
+        opt_default simple_charset      {}
+        ;
 
 default_collation:
         opt_default COLLATE_SYM opt_equal collation_name_or_default
@@ -4722,11 +4709,12 @@
 	  lex->local_file=  $4;
 	  lex->duplicates= DUP_ERROR;
 	  lex->ignore= 0;
+	  bzero((char*) &lex->create_info,sizeof(lex->create_info));
 	  if (!(lex->exchange= new sql_exchange($6.str,0)))
 	    YYABORT;
 	  lex->field_list.empty();
 	}
-	opt_duplicate INTO TABLE_SYM table_ident opt_field_term opt_line_term
+	opt_duplicate INTO TABLE_SYM table_ident opt_charset opt_field_term opt_line_term
 	opt_ignore_lines opt_field_spec
 	{
 	  if (!Select->add_table_to_list(YYTHD, $11, NULL, TL_OPTION_UPDATING))
@@ -4745,6 +4733,29 @@
         {
 	  Lex->sql_command = SQLCOM_LOAD_MASTER_DATA;
         };
+
+opt_charset:
+	/* empty */	      {}
+	| simple_charset      {}
+        ;
+
+simple_charset:
+        charset opt_equal charset_name_or_default
+        {
+          HA_CREATE_INFO *cinfo= &Lex->create_info;
+          if ((cinfo->used_fields & HA_CREATE_USED_DEFAULT_CHARSET) &&
+               cinfo->default_table_charset && $3 &&
+               !my_charset_same(cinfo->default_table_charset,$3))
+          {
+            net_printf(YYTHD, ER_CONFLICTING_DECLARATIONS,
+                       "CHARACTER SET ", cinfo->default_table_charset->csname,
+                       "CHARACTER SET ", $3->csname);
+            YYABORT;
+          }
+	  Lex->create_info.default_table_charset= $3;
+          Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
+        }
+        ;
 
 opt_local:
 	/* empty */	{ $$=0;}
--- New file ---
+++ mysql-test/std_data/words-ru-cp1251.dat	05/04/28 16:04:44
¸þùèé
¸êàíüå
¸êàòü
¸êàâøèé
¸êíóòü
¸êíóâøèé
¸ëêà
¸ëî÷êà
¸ëî÷íûé
¸ìêèé
¸ìêîñòíûé
¸ìêîñòü

--- New file ---
+++ mysql-test/std_data/words-ru-koi8r.dat	05/04/28 16:04:44
£ËÁÀÝÉÊ
£ËÁÎØÅ
£ËÁÔØ
£ËÁ×ÛÉÊ
£ËÎÕÔØ
£ËÎÕ×ÛÉÊ
£ÌËÁ
£ÌÏÞËÁ
£ÌÏÞÎÙÊ
£ÍËÉÊ
£ÍËÏÓÔÎÙÊ
£ÍËÏÓÔØ


--- 1.8/mysql-test/r/rpl_charset.result	Mon Feb 21 19:23:25 2005
+++ 1.9/mysql-test/r/rpl_charset.result	Thu Apr 28 16:04:44 2005
@@ -214,3 +214,45 @@
 set @p=_latin1 'test';
 update t1 set pk='test' where pk=@p;
 drop table t1;
+create table t1 (a varchar(100) character set koi8r);
+load data infile '../../std_data/words-ru-cp1251.dat' into table t1 character set cp1251
(a);
+load data infile '../../std_data/words-ru-koi8r.dat' into table t1 character set koi8r
(a);
+select hex(a), count(*) from t1 group by a;
+hex(a)	count(*)
+A3CBC1D7DBC9CA	2
+A3CBC1CED8C5	2
+A3CBC1D4D8	2
+A3CBC1C0DDC9CA	2
+A3CBCED5D7DBC9CA	2
+A3CBCED5D4D8	2
+A3CCCBC1	2
+A3CCCFDECBC1	2
+A3CCCFDECED9CA	2
+A3CDCBC9CA	2
+A3CDCBCFD3D4CED9CA	2
+A3CDCBCFD3D4D8	2
+select hex(a), count(*) from t1 group by a;
+hex(a)	count(*)
+A3CBC1D7DBC9CA	2
+A3CBC1CED8C5	2
+A3CBC1D4D8	2
+A3CBC1C0DDC9CA	2
+A3CBCED5D7DBC9CA	2
+A3CBCED5D4D8	2
+A3CCCBC1	2
+A3CCCFDECBC1	2
+A3CCCFDECED9CA	2
+A3CDCBC9CA	2
+A3CDCBCFD3D4CED9CA	2
+A3CDCBCFD3D4D8	2
+show binlog events from 7206;
+Log_name	Pos	Event_type	Server_id	Orig_log_pos	Info
+master-bin.000001	7206	Query	1	7206	use `test`; SET ONE_SHOT
CHARACTER_SET_CLIENT=7,COLLATION_CONNECTION=51,COLLATION_DATABASE=51,COLLATION_SERVER=30
+master-bin.000001	7342	Create_file	1	7342	db=test;table=t1;file_id=2;block_len=89
+master-bin.000001	7527	Query	1	7527	use `test`; SET ONE_SHOT
CHARACTER_SET_CLIENT=7,COLLATION_CONNECTION=51,COLLATION_DATABASE=51,COLLATION_SERVER=30
+master-bin.000001	7663	Exec_load	1	7663	;file_id=2
+master-bin.000001	7686	Query	1	7686	use `test`; SET ONE_SHOT
CHARACTER_SET_CLIENT=7,COLLATION_CONNECTION=51,COLLATION_DATABASE=7,COLLATION_SERVER=30
+master-bin.000001	7821	Create_file	1	7821	db=test;table=t1;file_id=3;block_len=89
+master-bin.000001	8005	Query	1	8005	use `test`; SET ONE_SHOT
CHARACTER_SET_CLIENT=7,COLLATION_CONNECTION=51,COLLATION_DATABASE=7,COLLATION_SERVER=30
+master-bin.000001	8140	Exec_load	1	8140	;file_id=3
+drop table t1;

--- 1.6/mysql-test/t/rpl_charset.test	Mon Feb 21 19:23:25 2005
+++ 1.7/mysql-test/t/rpl_charset.test	Thu Apr 28 16:04:44 2005
@@ -182,3 +182,19 @@
 update t1 set pk='test' where pk=@p;
 drop table t1;
 sync_slave_with_master;
+
+#
+#
+#
+connection master;
+create table t1 (a varchar(100) character set koi8r);
+load data infile '../../std_data/words-ru-cp1251.dat' into table t1 character set cp1251
(a);
+load data infile '../../std_data/words-ru-koi8r.dat' into table t1 character set koi8r
(a);
+sync_slave_with_master;
+select hex(a), count(*) from t1 group by a;
+connection slave;
+select hex(a), count(*) from t1 group by a;
+connection master;
+show binlog events from 7206;
+drop table t1;
+sync_slave_with_master;
Thread
bk commit into 4.1 tree (gluh:1.2210)gluh28 Apr