Compare commits
13 Commits
209b55d310
...
3095542f1d
Author | SHA1 | Date | |
---|---|---|---|
3095542f1d | |||
d80fa4c0a4 | |||
9895893028 | |||
e2fe619c98 | |||
572a7a498d | |||
0e04f5729b | |||
ba28c04195 | |||
e86fb4760b | |||
6dc658d33b | |||
48da005ade | |||
b7ff2380af | |||
d760e172eb | |||
18eac11b99 |
3
build.sh
3
build.sh
@ -28,6 +28,7 @@ bit=$(getconf LONG_BIT)
|
|||||||
if [ "$bit" -eq 64 ]; then
|
if [ "$bit" -eq 64 ]; then
|
||||||
PLATFORM=64
|
PLATFORM=64
|
||||||
fi
|
fi
|
||||||
|
PKG_VERSION=6.0.0
|
||||||
#get OS distributed version.
|
#get OS distributed version.
|
||||||
kernel=""
|
kernel=""
|
||||||
version=""
|
version=""
|
||||||
@ -113,7 +114,7 @@ function install_jdbc()
|
|||||||
export COMMIT=$(git rev-parse --short HEAD)
|
export COMMIT=$(git rev-parse --short HEAD)
|
||||||
export OPENGAUSS_PACKAGE_NAME="org.opengauss";
|
export OPENGAUSS_PACKAGE_NAME="org.opengauss";
|
||||||
|
|
||||||
export GS_VERSION="compiled at $(date +%Y-%m-%d-%H:%M:%S) build ${COMMIT}"
|
export GS_VERSION="openGauss-JDBC ${PKG_VERSION} build ${COMMIT} compiled at $(date '+%Y-%m-%d %H:%M:%S')"
|
||||||
export OUTPUT_DIR="${JDBC_DIR}/output"
|
export OUTPUT_DIR="${JDBC_DIR}/output"
|
||||||
echo "Begin make jdbc..."
|
echo "Begin make jdbc..."
|
||||||
export CLASSPATH=".:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar"
|
export CLASSPATH=".:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<groupId>org.opengauss</groupId>
|
<groupId>org.opengauss</groupId>
|
||||||
<artifactId>opengauss-jdbc</artifactId>
|
<artifactId>opengauss-jdbc</artifactId>
|
||||||
<name>openGauss JDBC Driver</name>
|
<name>openGauss JDBC Driver</name>
|
||||||
<version>6.0.0-RC1</version>
|
<version>6.0.0</version>
|
||||||
<description>Java JDBC driver for openGauss</description>
|
<description>Java JDBC driver for openGauss</description>
|
||||||
<url>https://gitee.com/opengauss/openGauss-connector-jdbc</url>
|
<url>https://gitee.com/opengauss/openGauss-connector-jdbc</url>
|
||||||
|
|
||||||
|
@ -27,6 +27,14 @@ public class Oid {
|
|||||||
public static final int INT4 = 23;
|
public static final int INT4 = 23;
|
||||||
public static final int INT4_ARRAY = 1007;
|
public static final int INT4_ARRAY = 1007;
|
||||||
public static final int INT8 = 20;
|
public static final int INT8 = 20;
|
||||||
|
public static int UINT1 = 4401;
|
||||||
|
public static int UINT1_ARRAY = 3001;
|
||||||
|
public static int UINT2 = 4403;
|
||||||
|
public static int UINT2_ARRAY = 3002;
|
||||||
|
public static int UINT4 = 4405;
|
||||||
|
public static int UINT4_ARRAY = 3003;
|
||||||
|
public static int UINT8 = 4407;
|
||||||
|
public static int UINT8_ARRAY = 3004;
|
||||||
public static final int INT8_ARRAY = 1016;
|
public static final int INT8_ARRAY = 1016;
|
||||||
public static final int TEXT = 25;
|
public static final int TEXT = 25;
|
||||||
public static final int TEXT_ARRAY = 1009;
|
public static final int TEXT_ARRAY = 1009;
|
||||||
|
@ -42,6 +42,13 @@ public interface TypeInfo {
|
|||||||
*/
|
*/
|
||||||
void setPGTypes() throws SQLException;
|
void setPGTypes() throws SQLException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cache db type, A/B/C/PG
|
||||||
|
* cache b_compatibility_mode, on or off
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void setDBType() throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look up the oid for a given postgresql type name. This is the inverse of
|
* Look up the oid for a given postgresql type name. This is the inverse of
|
||||||
* {@link #getPGType(int)}.
|
* {@link #getPGType(int)}.
|
||||||
|
@ -332,6 +332,7 @@ public class PgConnection implements BaseConnection {
|
|||||||
// Initialize object handling
|
// Initialize object handling
|
||||||
_typeCache = createTypeInfo(this, unknownLength);
|
_typeCache = createTypeInfo(this, unknownLength);
|
||||||
_typeCache.setPGTypes();
|
_typeCache.setPGTypes();
|
||||||
|
_typeCache.setDBType();
|
||||||
initObjectTypes(info);
|
initObjectTypes(info);
|
||||||
|
|
||||||
if (PGProperty.LOG_UNCLOSED_CONNECTIONS.getBoolean(info)) {
|
if (PGProperty.LOG_UNCLOSED_CONNECTIONS.getBoolean(info)) {
|
||||||
|
@ -270,6 +270,8 @@ public class PgResultSet implements ResultSet, org.postgresql.PGRefCursorResultS
|
|||||||
return getInt(columnIndex);
|
return getInt(columnIndex);
|
||||||
case Types.BIGINT:
|
case Types.BIGINT:
|
||||||
return getLong(columnIndex);
|
return getLong(columnIndex);
|
||||||
|
case TypeInfoCache.bIntegerType:
|
||||||
|
return getBigInteger(columnIndex);
|
||||||
case Types.NUMERIC:
|
case Types.NUMERIC:
|
||||||
case Types.DECIMAL:
|
case Types.DECIMAL:
|
||||||
return getBigDecimal(columnIndex,
|
return getBigDecimal(columnIndex,
|
||||||
@ -2089,9 +2091,9 @@ public class PgResultSet implements ResultSet, org.postgresql.PGRefCursorResultS
|
|||||||
} else if (blobSet.contains(typeName)) {
|
} else if (blobSet.contains(typeName)) {
|
||||||
return new String(toBytes(result));
|
return new String(toBytes(result));
|
||||||
} else if ("time".equals(typeName)) {
|
} else if ("time".equals(typeName)) {
|
||||||
java.util.Calendar cal = getDefaultCalendar();
|
char[] cs = result.toCharArray();
|
||||||
Time time = connection.getTimestampUtils().toTime(cal, result);
|
int start = TimestampUtils.firstDigit(cs, 0);
|
||||||
return String.valueOf(time);
|
result = result.substring(start);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
@ -2337,6 +2339,19 @@ public class PgResultSet implements ResultSet, org.postgresql.PGRefCursorResultS
|
|||||||
return toLong(getFixedString(columnIndex));
|
return toLong(getFixedString(columnIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigInteger getBigInteger(int columnIndex) throws SQLException {
|
||||||
|
String stringVal = getString(columnIndex);
|
||||||
|
if (stringVal == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return new BigInteger(stringVal);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
connection.getLogger().trace("[" + connection.getSocketAddress() + "] " + "format BigInteger failed.");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A dummy exception thrown when fast byte[] to number parsing fails and no value can be returned.
|
* A dummy exception thrown when fast byte[] to number parsing fails and no value can be returned.
|
||||||
* The exact stack trace does not matter because the exception is always caught and is not visible
|
* The exact stack trace does not matter because the exception is always caught and is not visible
|
||||||
|
@ -954,7 +954,13 @@ public class TimestampUtils {
|
|||||||
return slen;
|
return slen;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int firstDigit(char[] s, int start) {
|
/**
|
||||||
|
* format timestamp
|
||||||
|
* @param s
|
||||||
|
* @param start
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int firstDigit(char[] s, int start) {
|
||||||
int slen = s.length;
|
int slen = s.length;
|
||||||
for (int i = start; i < slen; i++) {
|
for (int i = start; i < slen; i++) {
|
||||||
if (Character.isDigit(s[i])) {
|
if (Character.isDigit(s[i])) {
|
||||||
|
@ -68,6 +68,12 @@ public class TypeInfoCache implements TypeInfo {
|
|||||||
|
|
||||||
private static ConcurrentHashMap<Integer, String> pgTypes = new ConcurrentHashMap<>();
|
private static ConcurrentHashMap<Integer, String> pgTypes = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public static final int bIntegerType = 1324;
|
||||||
|
|
||||||
|
public static String sqlCompatibility = "A";
|
||||||
|
|
||||||
|
public static String dolphinMode = "off";
|
||||||
|
|
||||||
// basic pg types info:
|
// basic pg types info:
|
||||||
// 0 - type name
|
// 0 - type name
|
||||||
// 1 - type oid
|
// 1 - type oid
|
||||||
@ -80,6 +86,10 @@ public class TypeInfoCache implements TypeInfo {
|
|||||||
{"int4", Oid.INT4, Types.INTEGER, "java.lang.Integer", Oid.INT4_ARRAY},
|
{"int4", Oid.INT4, Types.INTEGER, "java.lang.Integer", Oid.INT4_ARRAY},
|
||||||
{"oid", Oid.OID, Types.BIGINT, "java.lang.Long", Oid.OID_ARRAY},
|
{"oid", Oid.OID, Types.BIGINT, "java.lang.Long", Oid.OID_ARRAY},
|
||||||
{"int8", Oid.INT8, Types.BIGINT, "java.lang.Long", Oid.INT8_ARRAY},
|
{"int8", Oid.INT8, Types.BIGINT, "java.lang.Long", Oid.INT8_ARRAY},
|
||||||
|
{"uint1", Oid.UINT1, Types.SMALLINT, "java.lang.Integer", Oid.UINT1_ARRAY},
|
||||||
|
{"uint2", Oid.UINT2, Types.INTEGER, "java.lang.Integer", Oid.UINT2_ARRAY},
|
||||||
|
{"uint4", Oid.UINT4, Types.BIGINT, "java.lang.Long", Oid.UINT4_ARRAY},
|
||||||
|
{"uint8", Oid.UINT8, bIntegerType, "java.math.BigInteger", Oid.UINT8_ARRAY},
|
||||||
{"money", Oid.MONEY, Types.DOUBLE, "java.lang.Double", Oid.MONEY_ARRAY},
|
{"money", Oid.MONEY, Types.DOUBLE, "java.lang.Double", Oid.MONEY_ARRAY},
|
||||||
{"numeric", Oid.NUMERIC, Types.NUMERIC, "java.math.BigDecimal", Oid.NUMERIC_ARRAY},
|
{"numeric", Oid.NUMERIC, Types.NUMERIC, "java.math.BigDecimal", Oid.NUMERIC_ARRAY},
|
||||||
{"float4", Oid.FLOAT4, Types.REAL, "java.lang.Float", Oid.FLOAT4_ARRAY},
|
{"float4", Oid.FLOAT4, Types.REAL, "java.lang.Float", Oid.FLOAT4_ARRAY},
|
||||||
@ -380,7 +390,17 @@ public class TypeInfoCache implements TypeInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void setPGTypes() throws SQLException {
|
public synchronized void setPGTypes() throws SQLException {
|
||||||
String sql = "SELECT t.oid, t.typname FROM pg_catalog.pg_type t where t.typname = 'year';";
|
String sql = "SELECT t.oid, t.typname FROM pg_catalog.pg_type t "
|
||||||
|
+ " where t.typname = 'year'"
|
||||||
|
+ " or t.typname = 'uint1'"
|
||||||
|
+ " or t.typname = 'uint2'"
|
||||||
|
+ " or t.typname = 'uint4'"
|
||||||
|
+ " or t.typname = 'uint8'"
|
||||||
|
+ " or t.typname = '_uint1'"
|
||||||
|
+ " or t.typname = '_uint2'"
|
||||||
|
+ " or t.typname = '_uint4'"
|
||||||
|
+ " or t.typname = '_uint8';";
|
||||||
|
|
||||||
PreparedStatement pgTypeStatement = _conn.prepareStatement(sql);
|
PreparedStatement pgTypeStatement = _conn.prepareStatement(sql);
|
||||||
// Go through BaseStatement to avoid transaction start.
|
// Go through BaseStatement to avoid transaction start.
|
||||||
if (!((BaseStatement) pgTypeStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN)) {
|
if (!((BaseStatement) pgTypeStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN)) {
|
||||||
@ -394,13 +414,61 @@ public class TypeInfoCache implements TypeInfo {
|
|||||||
Integer oid = (int) rs.getLong(1);
|
Integer oid = (int) rs.getLong(1);
|
||||||
String typeName = rs.getString(2);
|
String typeName = rs.getString(2);
|
||||||
pgTypes.put(oid, typeName);
|
pgTypes.put(oid, typeName);
|
||||||
|
_pgNameToOid.put(typeName, oid);
|
||||||
|
_oidToPgName.put(oid, typeName);
|
||||||
|
if (typeName.startsWith("_")) {
|
||||||
|
String arrType = typeName.substring(1) + "[]";
|
||||||
|
_pgNameToOid.put(arrType, oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Character delim = ',';
|
||||||
|
_arrayOidToDelimiter.put(oid, delim);
|
||||||
|
}
|
||||||
|
_pgArrayToPgType.put(_pgNameToOid.get("_uint1"), _pgNameToOid.get("uint1"));
|
||||||
|
_pgArrayToPgType.put(_pgNameToOid.get("_uint2"), _pgNameToOid.get("uint2"));
|
||||||
|
_pgArrayToPgType.put(_pgNameToOid.get("_uint4"), _pgNameToOid.get("uint4"));
|
||||||
|
_pgArrayToPgType.put(_pgNameToOid.get("_uint8"), _pgNameToOid.get("uint8"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<Integer, String> getPGTypes() {
|
public static Map<Integer, String> getPGTypes() {
|
||||||
return pgTypes;
|
return pgTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDBType() throws SQLException {
|
||||||
|
String compatibilitySql = "show sql_compatibility;";
|
||||||
|
String compatibility = getDBParam(compatibilitySql);
|
||||||
|
if (compatibility != null) {
|
||||||
|
sqlCompatibility = compatibility;
|
||||||
|
if ("B".equals(compatibility)) {
|
||||||
|
String dolphinSql = "show dolphin.b_compatibility_mode;";
|
||||||
|
String dolphin = getDBParam(dolphinSql);
|
||||||
|
if (dolphin != null) {
|
||||||
|
dolphinMode = dolphin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getDBParam(String sql) throws SQLException {
|
||||||
|
PreparedStatement dbStatement = _conn.prepareStatement(sql);
|
||||||
|
if (!((BaseStatement) dbStatement).executeWithFlags(QueryExecutor.QUERY_SUPPRESS_BEGIN)) {
|
||||||
|
throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA);
|
||||||
|
}
|
||||||
|
ResultSet rs = dbStatement.getResultSet();
|
||||||
|
if (rs != null && rs.next()) {
|
||||||
|
return rs.getString(1);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDolphinMode(){
|
||||||
|
return dolphinMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSqlCompatibility(){
|
||||||
|
return sqlCompatibility;
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized int getPGType(String pgTypeName) throws SQLException {
|
public synchronized int getPGType(String pgTypeName) throws SQLException {
|
||||||
Integer oid = _pgNameToOid.get(pgTypeName);
|
Integer oid = _pgNameToOid.get(pgTypeName);
|
||||||
if (oid != null) {
|
if (oid != null) {
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package org.postgresql.test.dolphintest;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.postgresql.test.TestUtil;
|
||||||
|
import org.postgresql.test.jdbc2.BaseTest4B;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
public class DolphinTest extends BaseTest4B {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test db type and dolphin mode
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testUint1() throws SQLException {
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
ResultSet rsDBType = stmt.executeQuery("show sql_compatibility;");
|
||||||
|
|
||||||
|
assertTrue(rsDBType.next());
|
||||||
|
String r1 = rsDBType.getString(1);
|
||||||
|
assertNotNull(r1);
|
||||||
|
assertEquals("B", r1);
|
||||||
|
|
||||||
|
ResultSet rsMode = stmt.executeQuery("show dolphin.b_compatibility_mode;");
|
||||||
|
|
||||||
|
assertTrue(rsMode.next());
|
||||||
|
String r2 = rsMode.getString(1);
|
||||||
|
assertNotNull(r2);
|
||||||
|
assertEquals("on", r2);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
package org.postgresql.test.dolphintest;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.junit.runners.Parameterized;
|
||||||
|
import org.postgresql.test.TestUtil;
|
||||||
|
import org.postgresql.test.jdbc2.BaseTest4B;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.sql.*;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
public class UnsignedTest extends BaseTest4B {
|
||||||
|
/**
|
||||||
|
* test uint1 type
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testUint1() throws SQLException {
|
||||||
|
TestUtil.createTable(con, "test_unit1", "id uint1");
|
||||||
|
|
||||||
|
PreparedStatement pstmt = con.prepareStatement("INSERT INTO test_unit1 VALUES (?)");
|
||||||
|
pstmt.setObject(1, 234, Types.SMALLINT);
|
||||||
|
pstmt.executeUpdate();
|
||||||
|
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT id FROM test_unit1");
|
||||||
|
|
||||||
|
assertTrue(rs.next());
|
||||||
|
Object r1 = rs.getObject(1);
|
||||||
|
assertNotNull(r1);
|
||||||
|
assertEquals(234, r1);
|
||||||
|
|
||||||
|
TestUtil.dropTable(con, "test_unit1");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test uint2 type
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testUint2() throws SQLException {
|
||||||
|
TestUtil.createTable(con, "test_unit2", "id uint2");
|
||||||
|
|
||||||
|
PreparedStatement pstmt = con.prepareStatement("INSERT INTO test_unit2 VALUES (?)");
|
||||||
|
pstmt.setObject(1, 65518, Types.INTEGER);
|
||||||
|
pstmt.executeUpdate();
|
||||||
|
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT id FROM test_unit2");
|
||||||
|
|
||||||
|
assertTrue(rs.next());
|
||||||
|
Object r1 = rs.getObject(1);
|
||||||
|
assertNotNull(r1);
|
||||||
|
assertEquals(65518, r1);
|
||||||
|
|
||||||
|
TestUtil.dropTable(con, "test_unit2");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test uint4 type
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testUint4() throws SQLException {
|
||||||
|
TestUtil.createTable(con, "test_unit4", "id uint4");
|
||||||
|
|
||||||
|
PreparedStatement pstmt = con.prepareStatement("INSERT INTO test_unit4 VALUES (?)");
|
||||||
|
long l = 4294967282L;
|
||||||
|
pstmt.setObject(1, l, Types.BIGINT);
|
||||||
|
pstmt.executeUpdate();
|
||||||
|
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT id FROM test_unit4");
|
||||||
|
|
||||||
|
assertTrue(rs.next());
|
||||||
|
Object r1 = rs.getObject(1);
|
||||||
|
assertNotNull(r1);
|
||||||
|
assertEquals(l, r1);
|
||||||
|
|
||||||
|
TestUtil.dropTable(con, "test_unit4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test uint8 type
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testUint8() throws SQLException {
|
||||||
|
TestUtil.createTable(con, "test_unit8", "id uint8");
|
||||||
|
|
||||||
|
PreparedStatement pstmt = con.prepareStatement("INSERT INTO test_unit8 VALUES (?)");
|
||||||
|
BigInteger b = new BigInteger("9223372036859999999");
|
||||||
|
pstmt.setObject(1, b, Types.NUMERIC);
|
||||||
|
pstmt.executeUpdate();
|
||||||
|
|
||||||
|
BigInteger b2 = new BigInteger("15223372036859999999");
|
||||||
|
pstmt.setObject(1, b2, Types.NUMERIC);
|
||||||
|
pstmt.executeUpdate();
|
||||||
|
|
||||||
|
Statement stmt = con.createStatement();
|
||||||
|
ResultSet rs = stmt.executeQuery("SELECT id FROM test_unit8");
|
||||||
|
|
||||||
|
assertTrue(rs.next());
|
||||||
|
Object r1 = rs.getObject(1);
|
||||||
|
assertNotNull(r1);
|
||||||
|
assertEquals(b, r1);
|
||||||
|
|
||||||
|
assertTrue(rs.next());
|
||||||
|
Object r2 = rs.getObject(1);
|
||||||
|
assertNotNull(r2);
|
||||||
|
assertEquals(b2, r2);
|
||||||
|
|
||||||
|
TestUtil.dropTable(con, "test_unit8");
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package org.postgresql.test.jdbc2;
|
|||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.postgresql.test.TestUtil;
|
import org.postgresql.test.TestUtil;
|
||||||
|
|
||||||
@ -19,6 +20,7 @@ import static org.junit.Assert.fail;
|
|||||||
/**
|
/**
|
||||||
* Adaptation overload function use case set.
|
* Adaptation overload function use case set.
|
||||||
*/
|
*/
|
||||||
|
@Ignore
|
||||||
public class ProcOutparamOverrideTest extends BaseTest4 {
|
public class ProcOutparamOverrideTest extends BaseTest4 {
|
||||||
/**
|
/**
|
||||||
* The sql of the create proc.
|
* The sql of the create proc.
|
||||||
|
@ -45,6 +45,7 @@ public class EncodingTest extends BaseTest4 {
|
|||||||
TestUtil.dropTable(con, "test_encode");
|
TestUtil.dropTable(con, "test_encode");
|
||||||
|
|
||||||
Properties properties2 = new Properties();
|
Properties properties2 = new Properties();
|
||||||
|
properties2.put("allowEncodingChanges", "true");
|
||||||
properties2.put("characterEncoding", "GBK");
|
properties2.put("characterEncoding", "GBK");
|
||||||
con = TestUtil.openDB(properties2);
|
con = TestUtil.openDB(properties2);
|
||||||
|
|
||||||
@ -57,6 +58,7 @@ public class EncodingTest extends BaseTest4 {
|
|||||||
assertEquals("GBK", e2);
|
assertEquals("GBK", e2);
|
||||||
|
|
||||||
Properties properties3 = new Properties();
|
Properties properties3 = new Properties();
|
||||||
|
properties3.put("allowEncodingChanges", "true");
|
||||||
properties3.put("characterEncoding", "LATIN2");
|
properties3.put("characterEncoding", "LATIN2");
|
||||||
con = TestUtil.openDB(properties3);
|
con = TestUtil.openDB(properties3);
|
||||||
|
|
||||||
|
@ -100,8 +100,6 @@ public class GetObject310Test extends BaseTest4 {
|
|||||||
* Test the behavior getObject for time columns.
|
* Test the behavior getObject for time columns.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
// TODO
|
|
||||||
public void testGetLocalTime() throws SQLException {
|
public void testGetLocalTime() throws SQLException {
|
||||||
Statement stmt = con.createStatement();
|
Statement stmt = con.createStatement();
|
||||||
stmt.executeUpdate(TestUtil.insertSQL("table1","time_without_time_zone_column","TIME '04:05:06.123456'"));
|
stmt.executeUpdate(TestUtil.insertSQL("table1","time_without_time_zone_column","TIME '04:05:06.123456'"));
|
||||||
|
@ -291,8 +291,6 @@ public class SetObject310Test extends BaseTest4PG {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
// TODO
|
|
||||||
public void testTimeStampRounding() throws SQLException {
|
public void testTimeStampRounding() throws SQLException {
|
||||||
LocalTime time = LocalTime.parse("23:59:59.999999500");
|
LocalTime time = LocalTime.parse("23:59:59.999999500");
|
||||||
Time actual = insertThenReadWithoutType(time, "time_without_time_zone_column", Time.class);
|
Time actual = insertThenReadWithoutType(time, "time_without_time_zone_column", Time.class);
|
||||||
@ -300,8 +298,6 @@ public class SetObject310Test extends BaseTest4PG {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
|
||||||
// TODO
|
|
||||||
public void testTimeStampRoundingWithType() throws SQLException {
|
public void testTimeStampRoundingWithType() throws SQLException {
|
||||||
LocalTime time = LocalTime.parse("23:59:59.999999500");
|
LocalTime time = LocalTime.parse("23:59:59.999999500");
|
||||||
Time actual =
|
Time actual =
|
||||||
|
Reference in New Issue
Block a user