db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r528492 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/load/ engine/org/apache/derby/loc/ shared/org/apache/derby/shared/common/reference/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/f...
Date Fri, 13 Apr 2007 14:07:43 GMT
Author: rhillegas
Date: Fri Apr 13 07:07:41 2007
New Revision: 528492

URL: http://svn.apache.org/viewvc?view=rev&rev=528492
Log:
DERBY-2193: Add line numbers and file names to import error messages.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/derby-2193-linenumber.txt
  (with props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/load/Import.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportAbstract.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/load/Import.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/load/Import.java?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/load/Import.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/load/Import.java Fri Apr 13 07:07:41
2007
@@ -31,6 +31,10 @@
 import java.sql.DatabaseMetaData;
 import java.util.*;
 
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.error.PublicAPI;
+
 /**
  * This class implements import of data from a URL into a table.
  * Import functions provided here in this class shouble be called through
@@ -40,7 +44,10 @@
 
 public class Import extends ImportAbstract{
 
-	private String inputFileName;
+    private static  int                _importCounter;
+    private static  Hashtable   _importers = new Hashtable();
+
+    private String inputFileName;
 
 	/**
 	 * Constructior to Invoke Import from a select statement 
@@ -50,7 +57,8 @@
 	public Import(String inputFileName, String columnDelimiter,
                   String characterDelimiter,  String codeset, 
                   int noOfColumnsExpected,  String columnTypes, 
-                  boolean lobsInExtFile) throws SQLException 
+                  boolean lobsInExtFile,
+                  int importCounter ) throws SQLException 
 	{
 
 		try{
@@ -62,6 +70,8 @@
 												   columnDelimiter, codeset);
             this.lobsInExtFile = lobsInExtFile;
 
+            _importers.put( new Integer( importCounter ), this );
+            
 			doImport();
 
 		}catch(Exception e)
@@ -159,111 +169,130 @@
 	 * INTEGER)  from new org.apache.derby.impl.load.Import('extin/Tutor1.asc') as importvti;
 	 *
 	 */
-	private static void performImport(Connection connection, 
-                                      String schemaName, 
-                                      String insertColumnList, 
-                                      String columnIndexes,
-                                      String tableName, 
-                                      String inputFileName,  
-                                      String  columnDelimiter, 
-                                      String characterDelimiter, 
-                                      String codeset, 
-                                      short replace, 
-                                      boolean lobsInExtFile)
+    private static void performImport
+        (Connection connection, 
+         String schemaName, 
+         String insertColumnList, 
+         String columnIndexes,
+         String tableName, 
+         String inputFileName,  
+         String  columnDelimiter, 
+         String characterDelimiter, 
+         String codeset, 
+         short replace, 
+         boolean lobsInExtFile)
         throws SQLException 
-	{
-
-		if (connection == null)
-			throw LoadError.connectionNull();
-		
-	
-		
-		if (tableName == null)
-			throw LoadError.entityNameMissing();
-		
-
-		ColumnInfo columnInfo = new ColumnInfo(connection , schemaName ,
-											   tableName, insertColumnList, 
-											   columnIndexes, COLUMNNAMEPREFIX);
-
-		/* special handling of single quote delimiters
-		 * Single quote should be writeen with an extra quote otherwise sql will
-		 * throw syntac error.
-		 * i.e  to recognize a quote  it has to be appended with extra  quote ('')
-		 */
-		if(characterDelimiter!=null && characterDelimiter.equals("'"))
-			characterDelimiter = "''";
-		if(columnDelimiter !=null && columnDelimiter.equals("'"))
-			columnDelimiter = "''";
-		
-
-		StringBuffer sb = new StringBuffer("new ");
-		sb.append("org.apache.derby.impl.load.Import");
-		sb.append("(") ; 
-		sb.append(	(inputFileName !=null ? "'" + inputFileName + "'" : null));
-		sb.append(",") ;
-		sb.append(	(columnDelimiter !=null ? "'" + columnDelimiter + "'" : null));
-		sb.append(",") ;
-		sb.append(	(characterDelimiter !=null ? "'" + characterDelimiter + "'" : null));
-		sb.append(",") ;
-		sb.append(	(codeset !=null ? "'" + codeset + "'" : null));
-		sb.append(", ");
-        sb.append( columnInfo.getExpectedNumberOfColumnsInFile());
-        sb.append(", ");
-        sb.append( "'" + columnInfo.getExpectedVtiColumnTypesAsString() + "'");
-        sb.append(", ");
-        sb.append(lobsInExtFile);
-		sb.append(" )") ;
-
-		String importvti = sb.toString();
-
-		// delimit the table and schema names with quotes.
-		// because they might have been  created as quoted
-		// identifiers(for example when reserved words are used, names are quoted)
-		
-		// Import procedures are to be called with case-senisitive names. 
-		// Incase of delimited table names, they need to be passed as defined
-		// and when they are not delimited, they need to be passed in upper
-		// case, because all undelimited names are stored in the upper case 
-		// in the database. 
-
-		String entityName = (schemaName == null ? "\""+ tableName + "\"" : 
-							 "\"" + schemaName + "\"" + "." + "\"" + tableName + "\""); 
-
-		String insertModeValue;
-		if(replace > 0)
-			insertModeValue = "replace";
-		else
-			insertModeValue = "bulkInsert";
-
-		String cNamesWithCasts = columnInfo.getColumnNamesWithCasts();
-		String insertColumnNames = columnInfo.getInsertColumnNames();
-		if(insertColumnNames !=null)
-			insertColumnNames = "(" + insertColumnNames + ") " ;
-		else
-			insertColumnNames = "";
-		String insertSql = "INSERT INTO " + entityName +  insertColumnNames + 
-			" --DERBY-PROPERTIES insertMode=" + insertModeValue + "\n" +
-			" SELECT " + cNamesWithCasts + " from " + 
-			importvti + " AS importvti" ;
-
-		//prepare the import statement to hit any errors before locking the table
-		PreparedStatement ips = connection.prepareStatement(insertSql);
-		
-		//lock the table before perfoming import, because there may 
-		//huge number of lockes aquired that might have affect on performance 
-		//and some possible dead lock scenarios.
-		Statement statement = connection.createStatement();
-		String lockSql = "LOCK TABLE " + entityName + " IN EXCLUSIVE MODE";
-		statement.executeUpdate(lockSql);
-
-		//execute the import operaton.
-		ips.executeUpdate();
-		statement.close();
-		ips.close();
-
-	}
-
+    {
+        Integer     importCounter = new Integer( bumpImportCounter() );
+        
+        try {
+            if (connection == null)
+                throw LoadError.connectionNull();
+            
+            
+            
+            if (tableName == null)
+                throw LoadError.entityNameMissing();
+            
+            
+            ColumnInfo columnInfo = new ColumnInfo(connection , schemaName ,
+                                                   tableName, insertColumnList, 
+                                                   columnIndexes, COLUMNNAMEPREFIX);
+            
+            /* special handling of single quote delimiters
+             * Single quote should be writeen with an extra quote otherwise sql will
+             * throw syntac error.
+             * i.e  to recognize a quote  it has to be appended with extra  quote ('')
+             */
+            if(characterDelimiter!=null && characterDelimiter.equals("'"))
+                characterDelimiter = "''";
+            if(columnDelimiter !=null && columnDelimiter.equals("'"))
+                columnDelimiter = "''";
+            
+            
+            StringBuffer sb = new StringBuffer("new ");
+            sb.append("org.apache.derby.impl.load.Import");
+            sb.append("(") ; 
+            sb.append(	(inputFileName !=null ? "'" + inputFileName + "'" : null));
+            sb.append(",") ;
+            sb.append(	(columnDelimiter !=null ? "'" + columnDelimiter + "'" : null));
+            sb.append(",") ;
+            sb.append(	(characterDelimiter !=null ? "'" + characterDelimiter + "'" : null));
+            sb.append(",") ;
+            sb.append(	(codeset !=null ? "'" + codeset + "'" : null));
+            sb.append(", ");
+            sb.append( columnInfo.getExpectedNumberOfColumnsInFile());
+            sb.append(", ");
+            sb.append( "'" + columnInfo.getExpectedVtiColumnTypesAsString() + "'");
+            sb.append(", ");
+            sb.append(lobsInExtFile);
+            sb.append(", ");
+            sb.append( importCounter.intValue() );
+            sb.append(" )") ;
+            
+            String importvti = sb.toString();
+            
+            // delimit the table and schema names with quotes.
+            // because they might have been  created as quoted
+            // identifiers(for example when reserved words are used, names are quoted)
+            
+            // Import procedures are to be called with case-senisitive names. 
+            // Incase of delimited table names, they need to be passed as defined
+            // and when they are not delimited, they need to be passed in upper
+            // case, because all undelimited names are stored in the upper case 
+            // in the database. 
+            
+            String entityName = (schemaName == null ? "\""+ tableName + "\"" : 
+                                 "\"" + schemaName + "\"" + "." + "\"" + tableName + "\"");

+            
+            String insertModeValue;
+            if(replace > 0)
+                insertModeValue = "replace";
+            else
+                insertModeValue = "bulkInsert";
+            
+            String cNamesWithCasts = columnInfo.getColumnNamesWithCasts();
+            String insertColumnNames = columnInfo.getInsertColumnNames();
+            if(insertColumnNames !=null)
+                insertColumnNames = "(" + insertColumnNames + ") " ;
+            else
+                insertColumnNames = "";
+            String insertSql = "INSERT INTO " + entityName +  insertColumnNames + 
+                " --DERBY-PROPERTIES insertMode=" + insertModeValue + "\n" +
+                " SELECT " + cNamesWithCasts + " from " + 
+                importvti + " AS importvti" ;
+            
+            //prepare the import statement to hit any errors before locking the table
+            PreparedStatement ips = connection.prepareStatement(insertSql);
+            
+            //lock the table before perfoming import, because there may 
+            //huge number of lockes aquired that might have affect on performance 
+            //and some possible dead lock scenarios.
+            Statement statement = connection.createStatement();
+            String lockSql = "LOCK TABLE " + entityName + " IN EXCLUSIVE MODE";
+            statement.executeUpdate(lockSql);
+            
+            //execute the import operaton.
+            try {
+                ips.executeUpdate();
+            }
+            catch (Throwable t)
+            {
+                throw formatImportError( (Import) _importers.get( importCounter ), inputFileName,
t );
+            }
+            statement.close();
+            ips.close();
+        }
+        finally
+        {
+            //
+            // The importer was put into a hashtable so that we could look up
+            // line numbers for error messages. The Import constructor put
+            // the importer in the hashtable. Now garbage collect that entry.
+            //
+            _importers.remove( importCounter );
+        }
+    }
 
 	/** virtual method from the abstract class
 	 * @exception	Exception on error
@@ -271,23 +300,31 @@
 	ImportReadData getImportReadData() throws Exception {
 		return new ImportReadData(inputFileName, controlFileReader);
 	}
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
+    /*
+     * Bump the import counter.
+     *
+     */
+    private static  synchronized    int bumpImportCounter()
+    {
+        return ++_importCounter;
+    }
+    
+    /*
+     * Format a import error with line number
+     *
+     */
+    private static  SQLException    formatImportError( Import importer, String inputFile,
Throwable t )
+    {
+        int     lineNumber = -1;
+
+        if ( importer != null ) { lineNumber = importer.getCurrentLineNumber(); }
+        
+        StandardException se = StandardException.newException
+            ( SQLState.UNEXPECTED_IMPORT_ERROR, new Integer( lineNumber ), inputFile, t.getMessage()
);
+        se.setNestedException( t );
+
+        return PublicAPI.wrapStandardException(se);
+    }
+    
+}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportAbstract.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportAbstract.java?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportAbstract.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/load/ImportAbstract.java Fri Apr
13 07:07:41 2007
@@ -45,6 +45,7 @@
   int numberOfColumns;
   int[] columnWidths;
 
+  int lineNumber = 0;
   String[] nextRow;
 
   ResultSetMetaData importResultSetMetaData;
@@ -114,8 +115,12 @@
     return (importReadData.getCurrentRowNumber());
   }
   
+    /** gets the current line number */
+    public    int getCurrentLineNumber() { return lineNumber; }
+    
   public boolean next() throws SQLException {
     try {
+      lineNumber++;
       return (importReadData.readNextRow(nextRow));
     } catch (Exception ex) {
 		throw LoadError.unexpectedError(ex);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Fri Apr 13 07:07:41
2007
@@ -3888,6 +3888,14 @@
                 <text>Lob data file name cannot be null. </text>
             </msg>
 
+            <msg>
+                <name>XIE0R.S</name>
+                <text>Import error on line {0} of file {1}: {2} </text>
+                <arg>lineNumber</arg>
+                <arg>fileName</arg>
+                <arg>details</arg>
+            </msg>
+
 
         </family>
 

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Fri Apr 13 07:07:41 2007
@@ -1712,6 +1712,7 @@
 	String IMPORTFILE_HAS_INVALID_HEXSTRING                        ="XIE0N.S";
 	String LOB_DATA_FILE_NOT_FOUND                                 ="XIE0P.S";
 	String LOB_DATA_FILE_NULL                                      ="XIE0Q.S";
+	String UNEXPECTED_IMPORT_ERROR                       ="XIE0R.S";
 
 
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ieptests.out
Fri Apr 13 07:07:41 2007
@@ -661,7 +661,7 @@
 Statement executed.
 ij> --replace should fail because of dependent table
 CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'PARENT', 'extinout/parent.del',null, null, null,1);
-ERROR 38000: The exception 'java.sql.SQLException: INSERT on table 'PARENT' caused a violation
of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled
back.' was thrown while evaluating an expression. SQLSTATE: 23503: INSERT on table 'PARENT'
caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement
has been rolled back.
+ERROR XIE0R: Import error on line 3 of file extinout/parent.del: INSERT on table 'PARENT'
caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement
has been rolled back.  SQLSTATE: 23503: INSERT on table 'PARENT' caused a violation of foreign
key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled back.
 ij> select * from parent;
 A          
 -----

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/ieptests.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/ieptests.out?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/ieptests.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/ieptests.out
Fri Apr 13 07:07:41 2007
@@ -661,7 +661,7 @@
 Statement executed.
 ij> --replace should fail because of dependent table
 CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'PARENT', 'extinout/parent.del',null, null, null,1);
-ERROR 38000: The exception 'java.sql.SQLException: INSERT on table 'PARENT' caused a violation
of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled
back.' was thrown while evaluating an expression.
+ERROR XIE0R: Import error on line 3 of file extinout/parent.del: INSERT on table 'PARENT'
caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement
has been rolled back. 
 ij> select * from parent;
 A          
 -----

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ieptests.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ieptests.out?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ieptests.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ieptests.out
Fri Apr 13 07:07:41 2007
@@ -661,7 +661,7 @@
 Statement executed.
 ij> --replace should fail because of dependent table
 CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'PARENT', 'extinout/parent.del',null, null, null,1);
-ERROR 38000: The exception 'java.sql.SQLException: INSERT on table 'PARENT' caused a violation
of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled
back.' was thrown while evaluating an expression. SQLSTATE: 23503: INSERT on table 'PARENT'
caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement
has been rolled back.
+ERROR XIE0R: Import error on line 3 of file extinout/parent.del: INSERT on table 'PARENT'
caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement
has been rolled back.  SQLSTATE: 23503: INSERT on table 'PARENT' caused a violation of foreign
key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled back.
 ij> select * from parent;
 A          
 -----

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/ieptests.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/ieptests.out?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/ieptests.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/ieptests.out
Fri Apr 13 07:07:41 2007
@@ -661,7 +661,7 @@
 Statement executed.
 ij> --replace should fail because of dependent table
 CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'PARENT', 'extinout/parent.del',null, null, null,1);
-ERROR 38000: The exception 'java.sql.SQLException: INSERT on table 'PARENT' caused a violation
of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled
back.' was thrown while evaluating an expression.
+ERROR XIE0R: Import error on line 3 of file extinout/parent.del: INSERT on table 'PARENT'
caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement
has been rolled back. 
 ij> select * from parent;
 A          
 -----

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out
Fri Apr 13 07:07:41 2007
@@ -676,7 +676,7 @@
 0 rows inserted/updated/deleted
 ij> --replace should fail because of dependent table
 CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'PARENT', 'extinout/parent.del',null, null, null,1);
-ERROR 38000: The exception 'java.sql.SQLException: INSERT on table 'PARENT' caused a violation
of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled
back.' was thrown while evaluating an expression.
+ERROR XIE0R: Import error on line 3 of file extinout/parent.del: INSERT on table 'PARENT'
caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement
has been rolled back. 
 ERROR 23503: INSERT on table 'PARENT' caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx'
for key (3).  The statement has been rolled back.
 ij> select * from parent;
 A          

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out
Fri Apr 13 07:07:41 2007
@@ -38,7 +38,7 @@
 0 rows inserted/updated/deleted
 ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1' , 'extin/EndOfFile.txt' , 
                                     null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: Read endOfFile at unexpected place on
line 2.' was thrown while evaluating an expression.
+ERROR XIE0R: Import error on line 2 of file extin/EndOfFile.txt: Read endOfFile at unexpected
place on line 2. 
 ERROR XIE0E: Read endOfFile at unexpected place on line 2.
 ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1' , 'extin/Tutor1.asc' , 
                                     null, null, null, 0) ;
@@ -382,7 +382,7 @@
 0 rows inserted/updated/deleted
 ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ALT1' , 'extin/Alt1.asc' , 
                                       null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: Invalid character string format for type
INTEGER.' was thrown while evaluating an expression.
+ERROR XIE0R: Import error on line 1 of file extin/Alt1.asc: Invalid character string format
for type INTEGER. 
 ERROR 22018: Invalid character string format for type INTEGER.
 ij> select * from Alt1 where State = 'CA';
 ACCOUNT    |FNAME                         |LNAME                         |COMPANY       
                    |ADDRESS                                 |CITY                |STATE|ZIP
      |PAYMENT   |BALANCE   
@@ -406,7 +406,7 @@
 0 rows inserted/updated/deleted
 ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ALT3' , 'extin/Alt3.asc' , 
                                       null, null, null, 0) ;
-ERROR 38000: The exception 'java.sql.SQLException: Invalid character string format for type
INTEGER.' was thrown while evaluating an expression.
+ERROR XIE0R: Import error on line 1 of file extin/Alt3.asc: Invalid character string format
for type INTEGER. 
 ERROR 22018: Invalid character string format for type INTEGER.
 ij> select * from Alt3 where State = 'CA' or State = 'TX';
 ACCOUNT    |FNAME                         |LNAME                         |COMPANY       
                    |ADDRESS                                 |CITY                |STATE|ZIP
      |PAYMENT   |BALANCE   
@@ -800,6 +800,22 @@
 in the bopshebop                                  |16         
 NULL                                              |NULL       
 boopdeedoo                                        |10         
+ij> --
+-- Errors should contain identifying line numbers
+--
+create table derby_2193_lineNumber
+(
+    a  int,
+    b  int
+);
+0 rows inserted/updated/deleted
+ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE 
+( null, 'DERBY_2193_LINENUMBER', 'extin/derby-2193-linenumber.txt', null, null, null, 0 );
+ERROR XIE0R: Import error on line 2 of file extin/derby-2193-linenumber.txt: Invalid character
string format for type INTEGER. 
+ERROR 22018: Invalid character string format for type INTEGER.
+ij> select * from derby_2193_lineNumber;
+A          |B          
+-----------------------
 ij> --
 -- end test case for derby-2193:
 --

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/derby-2193-linenumber.txt
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/derby-2193-linenumber.txt?view=auto&rev=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/derby-2193-linenumber.txt
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/derby-2193-linenumber.txt
Fri Apr 13 07:07:41 2007
@@ -0,0 +1,3 @@
+1, 2
+3, foo
+5, 6

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/derby-2193-linenumber.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql
Fri Apr 13 07:07:41 2007
@@ -321,6 +321,19 @@
 select b, length(b) from derby_2193_tab;
 
 --
+-- Errors should contain identifying line numbers
+--
+create table derby_2193_lineNumber
+(
+    a  int,
+    b  int
+);
+
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE 
+( null, 'DERBY_2193_LINENUMBER', 'extin/derby-2193-linenumber.txt', null, null, null, 0 );
+select * from derby_2193_lineNumber;
+
+--
 -- end test case for derby-2193:
 --
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties?view=diff&rev=528492&r1=528491&r2=528492
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties
Fri Apr 13 07:07:41 2007
@@ -1,4 +1,4 @@
-supportfiles=testData/ImportExport/sqlAnywhere1.utf,testData/ImportExport/sqlAnywhere2.utf,testData/ImportExport/Access1.txt,testData/ImportExport/Access2.txt,testData/ImportExport/Access3.txt,testData/ImportExport/Alt1.asc,testData/ImportExport/Alt2.asc,testData/ImportExport/Alt3.asc,testData/ImportExport/Alt4.asc,testData/ImportExport/Alt5.asc,testData/ImportExport/Alt6.asc,testData/ImportExport/Tutor1.asc,testData/ImportExport/Tutor2.asc,testData/ImportExport/Tutor3.asc,testData/ImportExport/EndOfFile.txt,testData/ImportExport/derby-2193.txt
+supportfiles=testData/ImportExport/sqlAnywhere1.utf,testData/ImportExport/sqlAnywhere2.utf,testData/ImportExport/Access1.txt,testData/ImportExport/Access2.txt,testData/ImportExport/Access3.txt,testData/ImportExport/Alt1.asc,testData/ImportExport/Alt2.asc,testData/ImportExport/Alt3.asc,testData/ImportExport/Alt4.asc,testData/ImportExport/Alt5.asc,testData/ImportExport/Alt6.asc,testData/ImportExport/Tutor1.asc,testData/ImportExport/Tutor2.asc,testData/ImportExport/Tutor3.asc,testData/ImportExport/EndOfFile.txt,testData/ImportExport/derby-2193.txt,testData/ImportExport/derby-2193-linenumber.txt
 # fails: supportfiles=testData/ImportExport/sqlAnywhere2.txt,testData/ImportExport/Access1.txt,testData/ImportExport/Access2.txt,testData/ImportExport/Access3.txt,testData/ImportExport/Alt1.asc,testData/ImportExport/Alt2.asc,testData/ImportExport/Alt3.asc,testData/ImportExport/Alt4.asc,testData/ImportExport/Alt5.asc,testData/ImportExport/Alt6.asc,testData/ImportExport/Tutor1.asc,testData/ImportExport/Tutor2.asc,testData/ImportExport/Tutor3.asc,testData/ImportExport/EndOfFile.txt
 #also fails: supportfiles=testData/ImportExport/sqlAnywhere1.txt,testData/ImportExport/Access1.txt,testData/ImportExport/Access2.txt,testData/ImportExport/Access3.txt,testData/ImportExport/Alt1.asc,testData/ImportExport/Alt2.asc,testData/ImportExport/Alt3.asc,testData/ImportExport/Alt4.asc,testData/ImportExport/Alt5.asc,testData/ImportExport/Alt6.asc,testData/ImportExport/Tutor1.asc,testData/ImportExport/Tutor2.asc,testData/ImportExport/Tutor3.asc,testData/ImportExport/EndOfFile.txt
 usedefaults=true



Mime
View raw message