You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by mashengchen <gi...@git.apache.org> on 2017/05/18 10:34:29 UTC

[GitHub] incubator-trafodion pull request #1098: TRAFODION-2385 jdbcT4 support boolea...

GitHub user mashengchen opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1098

    TRAFODION-2385 jdbcT4 support boolean, tinyint, largeint

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mashengchen/incubator-trafodion jdbc_type_btl

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1098.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1098
    
----
commit e32f6b9b3bff11c7609f6a2f8676e387ccefcfa7
Author: mashengchen <ma...@gmail.com>
Date:   2017-05-18T10:29:56Z

    TRAFODION-2385 jdbcT4 support boolean, tinyint, largeint

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1098: TRAFODION-2385 jdbcT4 support boolea...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafodion/pull/1098


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1098: TRAFODION-2385 jdbcT4 support boolea...

Posted by selvaganesang <gi...@git.apache.org>.
Github user selvaganesang commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1098#discussion_r118051474
  
    --- Diff: core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PreparedStatement.java ---
    @@ -1051,10 +1054,29 @@ public void setLong(int parameterIndex, long x) throws SQLException {
     		}
     		validateSetInvocation(parameterIndex);
     		inputDesc_[parameterIndex - 1].checkValidNumericConversion(connection_.getLocale());
    -		Utility.checkLongBoundary(connection_.getLocale(), BigDecimal.valueOf(x));
     		addParamValue(parameterIndex, Long.toString(x));
     	}
     
    +	private void setLong(int parameterIndex, BigDecimal x) throws SQLException {
    +		if (connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
    +			Object p[] = T4LoggingUtilities.makeParams(connection_.props_, parameterIndex, x);
    +			connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4PreparedStatement", "setLong", "", p);
    +		}
    +		if (connection_.props_.getLogWriter() != null) {
    +			LogRecord lr = new LogRecord(Level.FINE, "");
    --- End diff --
    
    Looks like all these statements will be executed and the objects created, but thrown away because the level is not set to FINE. Or in other words when will be the getLogWriter() be NULL?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1098: TRAFODION-2385 jdbcT4 support boolea...

Posted by xwq <gi...@git.apache.org>.
Github user xwq commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1098#discussion_r117954467
  
    --- Diff: core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java ---
    @@ -671,6 +683,11 @@ void convertObjectToSQL2(Locale locale, TrafT4Statement pstmt, Object paramValue
     			byte[] b = InterfaceUtilities.convertBigDecimalToSQLBigNum(tmpbd, maxLength, scale);
     			System.arraycopy(b, 0, values, noNullValue, maxLength);
     			break;
    +		case InterfaceResultSet.SQLTYPECODE_BOOLEAN:
    +			tmpbd = Utility.getBigDecimalValue(locale, paramValue);
    +
    +			Bytes.insertShort(values, noNullValue, tmpbd.shortValue(), this.ic_.getByteSwap());
    --- End diff --
    
    Why we need 2 bytes for BOOLEAN, do you compare the maxlength_ with it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---