You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metamodel.apache.org by "William Edmisten (Jira)" <ji...@apache.org> on 2021/01/04 22:45:00 UTC
[jira] [Created] (METAMODEL-1231) PostgreSQL integration test
errors with PostgresSQL 9 and 10 (Maybe more)
William Edmisten created METAMODEL-1231:
-------------------------------------------
Summary: PostgreSQL integration test errors with PostgresSQL 9 and 10 (Maybe more)
Key: METAMODEL-1231
URL: https://issues.apache.org/jira/browse/METAMODEL-1231
Project: Apache MetaModel
Issue Type: Bug
Affects Versions: 5.3.1
Environment: Ubuntu 18.04 LTS
Reporter: William Edmisten
PostgreSQL integration test results in errors for PostgreSQL 9 and 10 (and perhaps others).
Steps to reproduce:
{code:java}
# start a postgres instance on port 5432
docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=metamodel -e POSTGRES_DB=dellstore2 postgres:9
# in a separate tab or terminal, write and save the following file:
vim ~/metamodel-integrationtest-configuration.properties
jdbc.postgresql.driver=org.postgresql.Driver
jdbc.postgresql.url=jdbc:postgresql://localhost/dellstore2
jdbc.postgresql.username=postgres
jdbc.postgresql.password=metamodel
jdbc.postgresql.longrunningtests=false
# download and extract the dellstore2 SQL script used for the test
wget http://mirrors.dotsrc.org/postgresql/projects/pgFoundry/dbsamples/dellstore2/dellstore2-normal-1.0/dellstore2-normal-1.0.tar.gz
tar -xvf dellstore2-normal-1.0.tar.gz
cd dellstore2-normal-1.0
# run the script to add the dellstore2 data to our postgres instance
PGPASSWORD=metamodel psql -h localhost -U postgres -d dellstore2 -f dellstore2-normal-1.0.sql
# now run the integration test
cd jdbc
mvn -Dtest=PostgresqlTest test
{code}
The test technically passes, but results in what look to me like failing errors:
{noformat}
ERROR 17:38:56 JdbcUtils - Could not execute batch: INSERT INTO "public"."my_table" ("person name",age) VALUES ('John Doe','42'): Batch entry 0 INSERT INTO "public"."my_table" ("person name",age) VALUES ('John Doe','42') was aborted: ERROR: column
"age" is of type integer but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 64 Call getNextException to see other errors in the batch., Error code=0, SQL state=42804
java.sql.BatchUpdateException: Batch entry 0 INSERT INTO "public"."my_table" ("person name",age) VALUES ('John Doe','42') was aborted: ERROR: column "age" is of type integer but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 64 Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:154)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2314)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:528)
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:851)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:874)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1569)
at org.apache.metamodel.jdbc.JdbcBatchUpdateCallback.closePreparedStatement(JdbcBatchUpdateCallback.java:45)
at org.apache.metamodel.jdbc.JdbcUpdateCallback.close(JdbcUpdateCallback.java:116)
at org.apache.metamodel.jdbc.JdbcDataContext.executeUpdate(JdbcDataContext.java:920)
at org.apache.metamodel.jdbc.integrationtests.PostgresqlTest.testInsertFailureForStringValueForIntegerColumn(PostgresqlTest.java:722)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
Caused by: org.postgresql.util.PSQLException: ERROR: column "age" is of type integer but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 64
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2578)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2313)
... 29 more{noformat}
{noformat}
ERROR 17:38:56 JdbcUtils - Next SQL exception: ERROR: column "age" is of type integer but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 64
org.postgresql.util.PSQLException: ERROR: column "age" is of type integer but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 64
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2578)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2313)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:528)
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:851)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:874)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1569)
at org.apache.metamodel.jdbc.JdbcBatchUpdateCallback.closePreparedStatement(JdbcBatchUpdateCallback.java:45)
at org.apache.metamodel.jdbc.JdbcUpdateCallback.close(JdbcUpdateCallback.java:116)
at org.apache.metamodel.jdbc.JdbcDataContext.executeUpdate(JdbcDataContext.java:920)
at org.apache.metamodel.jdbc.integrationtests.PostgresqlTest.testInsertFailureForStringValueForIntegerColumn(PostgresqlTest.java:722)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417){noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)