kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 6170c129364dfdda0296e83dfe601365d8eefa6ea3ac589a38a344af198f092e |
|---|---|
| Author | Alexandre Dutra <alexandre.dutra@datastax.com> · 2016-09-07 11:52 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-09-16 10:45 -07:00 |
| Parents | 00fb99dbb797 |
4 files changed
modified driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java +2 −2
| @@ -135,12 +135,12 @@ | ||
| 135 | 135 | if (statement.hasValues()) |
| 136 | 136 | throw new IllegalArgumentException("A statement to prepare should not have values"); |
| 137 | 137 | |
| 138 | - ListenableFuture<PreparedStatement> prepared = prepareAsync(statement.getQueryString(), statement.getOutgoingPayload()); | |
| 138 | + final CodecRegistry codecRegistry = getCluster().getConfiguration().getCodecRegistry(); | |
| 139 | + ListenableFuture<PreparedStatement> prepared = prepareAsync(statement.getQueryString(codecRegistry), statement.getOutgoingPayload()); | |
| 139 | 140 | return Futures.transform(prepared, new Function<PreparedStatement, PreparedStatement>() { |
| 140 | 141 | @Override |
| 141 | 142 | public PreparedStatement apply(PreparedStatement prepared) { |
| 142 | 143 | ProtocolVersion protocolVersion = getCluster().getConfiguration().getProtocolOptions().getProtocolVersion(); |
| 143 | - CodecRegistry codecRegistry = getCluster().getConfiguration().getCodecRegistry(); | |
| 144 | 144 | ByteBuffer routingKey = statement.getRoutingKey(protocolVersion, codecRegistry); |
| 145 | 145 | if (routingKey != null) |
| 146 | 146 | prepared.setRoutingKey(routingKey); |
modified driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java +1 −1
| @@ -90,7 +90,7 @@ | ||
| 90 | 90 | if (statement instanceof RegularStatement) { |
| 91 | 91 | RegularStatement st = (RegularStatement) statement; |
| 92 | 92 | ByteBuffer[] vals = st.getValues(protocolVersion, codecRegistry); |
| 93 | - String query = st.getQueryString(); | |
| 93 | + String query = st.getQueryString(codecRegistry); | |
| 94 | 94 | idAndVals.ids.add(query); |
| 95 | 95 | idAndVals.values.add(vals == null ? Collections.<ByteBuffer>emptyList() : Arrays.asList(vals)); |
| 96 | 96 | } else { |
modified driver-core/src/main/java/com/datastax/driver/core/SessionManager.java +1 −1
| @@ -560,7 +560,7 @@ | ||
| 560 | 560 | List<ByteBuffer> positionalValues = rawPositionalValues == null ? Collections.<ByteBuffer>emptyList() : Arrays.asList(rawPositionalValues); |
| 561 | 561 | Map<String, ByteBuffer> namedValues = rawNamedValues == null ? Collections.<String, ByteBuffer>emptyMap() : rawNamedValues; |
| 562 | 562 | |
| 563 | - String qString = rs.getQueryString(); | |
| 563 | + String qString = rs.getQueryString(codecRegistry); | |
| 564 | 564 | |
| 565 | 565 | Requests.QueryProtocolOptions options = new Requests.QueryProtocolOptions(Message.Request.Type.QUERY, consistency, positionalValues, namedValues, |
| 566 | 566 | false, fetchSize, usedPagingState, serialConsistency, defaultTimestamp); |
modified driver-core/src/main/java/com/datastax/driver/core/querybuilder/Batch.java +1 −1
| @@ -66,7 +66,7 @@ | ||
| 66 | 66 | builder.append(maybeAddSemicolon(bst.buildQueryString(variables, codecRegistry))); |
| 67 | 67 | |
| 68 | 68 | } else { |
| 69 | - String str = stmt.getQueryString(); | |
| 69 | + String str = stmt.getQueryString(codecRegistry); | |
| 70 | 70 | builder.append(str); |
| 71 | 71 | if (!str.trim().endsWith(";")) |
| 72 | 72 | builder.append(';'); |