db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r348553 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/JapanCodeConversion.out tests/i18n/JapanCodeConversion.sql
Date Wed, 23 Nov 2005 20:37:40 GMT
Author: djd
Date: Wed Nov 23 12:37:37 2005
New Revision: 348553

URL: http://svn.apache.org/viewcvs?rev=348553&view=rev
Log:
Add addition tests to i18n/JapanCodeConversion.sql as a step to removing its use of the executable
native2ascii.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JapanCodeConversion.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/JapanCodeConversion.sql

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JapanCodeConversion.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JapanCodeConversion.out?rev=348553&r1=348552&r2=348553&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JapanCodeConversion.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JapanCodeConversion.out
Wed Nov 23 12:37:37 2005
@@ -10,6 +10,25 @@
  EnC:>9<   EnC:>9<  EnC:>9<           'extin/jap_EUC_JP.dat' , 
  EnC:>9<  EnC:>9<  EnC:>9<  EnC:>9<   null, null, 'EUC_JP', 0) ;
 0 rows inserted/updated/deleted
+ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP;
+JNUM       |JTIME   |JLEN       
+--------------------------------
+1          |15:32:06|14         
+2          |15:32:10|20         
+3          |15:32:28|38         
+4          |15:32:29|27         
+5          |15:32:29|29         
+6          |15:32:30|10         
+7          |15:32:31|24         
+8          |15:33:22|14         
+9          |15:33:23|117        
+10         |15:33:40|14         
+11         |15:33:41|117        
+12         |15:33:43|27         
+13         |15:34:29|14         
+14         |15:34:30|117        
+15         |15:35:35|26         
+16         |15:39:10|27         
 ij> -- export to file with EUC_JP encoding 
 call SYSCS_UTIL.SYSCS_EXPORT_TABLE('APP', 'T1_EUC_JP' ,
  EnC:>9<   EnC:>9<  EnC:>9<           'extinout/jap_EUC_JP.dump' , 
@@ -20,6 +39,134 @@
  EnC:>9<   EnC:>9<  EnC:>9<           'extinout/jap_SJIS.dump' , 
  EnC:>9<  EnC:>9<  EnC:>9<  EnC:>9<   null, null, 'SJIS') ;
 0 rows inserted/updated/deleted
+ij> -- import as EUC_JP and compare to original
+create table T1_EUC_JP_IMPORT_AS_EUC_JP(jnum int, jtime time, jstring char(200));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_EUC_JP',
+   'extinout/jap_EUC_JP.dump',
+   NULL, NULL,
+   'EUC_JP', 0);
+0 rows inserted/updated/deleted
+ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_EUC_JP;
+JNUM       |JTIME   |JLEN       
+--------------------------------
+1          |15:32:06|14         
+2          |15:32:10|20         
+3          |15:32:28|38         
+4          |15:32:29|27         
+5          |15:32:29|29         
+6          |15:32:30|10         
+7          |15:32:31|24         
+8          |15:33:22|14         
+9          |15:33:23|117        
+10         |15:33:40|14         
+11         |15:33:41|117        
+12         |15:33:43|27         
+13         |15:34:29|14         
+14         |15:34:30|117        
+15         |15:35:35|26         
+16         |15:39:10|27         
+ij> SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_EUC_JP IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;
+1          
+-----------
+16         
+ij> -- import as SJIS and compare to original
+create table T1_EUC_JP_IMPORT_AS_SJIS(jnum int, jtime time, jstring char(200));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_SJIS',
+   'extinout/jap_SJIS.dump',
+   NULL, NULL,
+   'SJIS', 0);
+0 rows inserted/updated/deleted
+ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_SJIS;
+JNUM       |JTIME   |JLEN       
+--------------------------------
+1          |15:32:06|14         
+2          |15:32:10|20         
+3          |15:32:28|38         
+4          |15:32:29|27         
+5          |15:32:29|29         
+6          |15:32:30|10         
+7          |15:32:31|24         
+8          |15:33:22|14         
+9          |15:33:23|117        
+10         |15:33:40|14         
+11         |15:33:41|117        
+12         |15:33:43|27         
+13         |15:34:29|14         
+14         |15:34:30|117        
+15         |15:35:35|26         
+16         |15:39:10|27         
+ij> SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_SJIS IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;
+1          
+-----------
+16         
+ij> delete from T1_EUC_JP_IMPORT_AS_EUC_JP;
+16 rows inserted/updated/deleted
+ij> delete from T1_EUC_JP_IMPORT_AS_SJIS;
+16 rows inserted/updated/deleted
+ij> -- now import using the wrong encoding file just to ensure that different
+-- encodings are being used.
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_EUC_JP',
+   'extinout/jap_SJIS.dump',
+   NULL, NULL,
+   'EUC_JP', 0);
+0 rows inserted/updated/deleted
+ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_EUC_JP;
+JNUM       |JTIME   |JLEN       
+--------------------------------
+1          |15:32:06|14         
+2          |15:32:10|20         
+3          |15:32:28|38         
+4          |15:32:29|27         
+5          |15:32:29|29         
+6          |15:32:30|10         
+7          |15:32:31|24         
+8          |15:33:22|14         
+9          |15:33:23|116        
+10         |15:33:40|14         
+11         |15:33:41|116        
+12         |15:33:43|27         
+13         |15:34:29|14         
+14         |15:34:30|116        
+15         |15:35:35|26         
+16         |15:39:10|27         
+ij> SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_EUC_JP IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;
+1          
+-----------
+0          
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_SJIS',
+   'extinout/jap_EUC_JP.dump',
+   NULL, NULL,
+   'SJIS', 0);
+0 rows inserted/updated/deleted
+ij> SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_SJIS;
+JNUM       |JTIME   |JLEN       
+--------------------------------
+1          |15:32:06|26         
+2          |15:32:10|24         
+3          |15:32:28|59         
+4          |15:32:29|51         
+5          |15:32:29|55         
+6          |15:32:30|12         
+7          |15:32:31|35         
+8          |15:33:22|26         
+9          |15:33:23|152        
+10         |15:33:40|26         
+11         |15:33:41|152        
+12         |15:33:43|51         
+13         |15:34:29|26         
+14         |15:34:30|152        
+15         |15:35:35|43         
+16         |15:39:10|51         
+ij> SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_SJIS IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;
+1          
+-----------
+0          
 ij> -- convert from EUC_JP to unicode with native2ascii
 ! 'native2ascii -encoding EUC_JP extinout/jap_EUC_JP.dump';
 1,"15:32:06","\u30a4\u30d9\u30f3\u30c8\u30a2\u30e9\u30fc\u30e0\u304c\u6709\u52b9\u3067\u3059\u3002
                                                                                         
                                                                                         
     "

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/JapanCodeConversion.sql
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/JapanCodeConversion.sql?rev=348553&r1=348552&r2=348553&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/JapanCodeConversion.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/JapanCodeConversion.sql
Wed Nov 23 12:37:37 2005
@@ -3,11 +3,14 @@
 create table T1_EUC_JP (	jnum int,
 				jtime time,
 				jstring char(200) );
+	
 
 -- import data in EUC_JP encoding 
 call SYSCS_UTIL.SYSCS_IMPORT_TABLE(null, 'T1_EUC_JP' ,
 	 		          'extin/jap_EUC_JP.dat' , 
 				  null, null, 'EUC_JP', 0) ;
+				  
+SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP;
 
 -- export to file with EUC_JP encoding 
 call SYSCS_UTIL.SYSCS_EXPORT_TABLE('APP', 'T1_EUC_JP' ,
@@ -18,6 +21,55 @@
 call SYSCS_UTIL.SYSCS_EXPORT_TABLE('APP', 'T1_EUC_JP' ,
 	 		          'extinout/jap_SJIS.dump' , 
 				  null, null, 'SJIS') ;
+
+-- import as EUC_JP and compare to original
+create table T1_EUC_JP_IMPORT_AS_EUC_JP(jnum int, jtime time, jstring char(200));
+						
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_EUC_JP',
+   'extinout/jap_EUC_JP.dump',
+   NULL, NULL,
+   'EUC_JP', 0);
+
+SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_EUC_JP;
+
+SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_EUC_JP IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;
+
+-- import as SJIS and compare to original
+create table T1_EUC_JP_IMPORT_AS_SJIS(jnum int, jtime time, jstring char(200));
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_SJIS',
+   'extinout/jap_SJIS.dump',
+   NULL, NULL,
+   'SJIS', 0);
+
+SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_SJIS;
+
+SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_SJIS IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;
+
+delete from T1_EUC_JP_IMPORT_AS_EUC_JP;
+delete from T1_EUC_JP_IMPORT_AS_SJIS;
+
+-- now import using the wrong encoding file just to ensure that different
+-- encodings are being used.
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_EUC_JP',
+   'extinout/jap_SJIS.dump',
+   NULL, NULL,
+   'EUC_JP', 0);
+SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_EUC_JP;
+SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_EUC_JP IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;   
+  
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1_EUC_JP_IMPORT_AS_SJIS',
+   'extinout/jap_EUC_JP.dump',
+   NULL, NULL,
+   'SJIS', 0);
+SELECT jnum, jtime, { fn length(jstring) } AS JLEN from T1_EUC_JP_IMPORT_AS_SJIS;
+SELECT count(*) FROM T1_EUC_JP OG, T1_EUC_JP_IMPORT_AS_SJIS IM
+  WHERE OG.jnum = IM.jnum AND OG.jtime = IM.jtime AND OG.jstring = IM.jstring;
+
 
 -- convert from EUC_JP to unicode with native2ascii
 ! 'native2ascii -encoding EUC_JP extinout/jap_EUC_JP.dump';



Mime
View raw message