Skip to content

Commit d4fae9b

Browse files
authored
Merge pull request #783 from daneshk/2201.12.x
[2201.12.X] Fix the Clob out parameter issue in stored procedure
2 parents ab9fc08 + 6455a16 commit d4fae9b

File tree

7 files changed

+69
-53
lines changed

7 files changed

+69
-53
lines changed

ballerina/Ballerina.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
org = "ballerina"
33
name = "sql"
4-
version = "1.17.0"
4+
version = "1.17.1"
55
authors = ["Ballerina"]
66
keywords = ["database", "client", "network", "SQL", "RDBMS"]
77
repository = "https://github.com/ballerina-platform/module-ballerina-sql"
@@ -15,11 +15,11 @@ graalvmCompatible = true
1515
[[platform.java21.dependency]]
1616
groupId = "io.ballerina.stdlib"
1717
artifactId = "sql-native"
18-
version = "1.17.0"
19-
path = "../native/build/libs/sql-native-1.17.0.jar"
18+
version = "1.17.1"
19+
path = "../native/build/libs/sql-native-1.17.1-SNAPSHOT.jar"
2020

2121
[[platform.java21.dependency]]
22-
path = "../test-utils/build/libs/sql-test-utils-1.17.0.jar"
22+
path = "../test-utils/build/libs/sql-test-utils-1.17.1-SNAPSHOT.jar"
2323
scope = "testOnly"
2424

2525
[[platform.java21.dependency]]

ballerina/CompilerPlugin.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ id = "sql-compiler-plugin"
33
class = "io.ballerina.stdlib.sql.compiler.SQLCompilerPlugin"
44

55
[[dependency]]
6-
path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.17.0.jar"
6+
path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.17.1-SNAPSHOT.jar"

ballerina/Dependencies.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies = [
4444
[[package]]
4545
org = "ballerina"
4646
name = "crypto"
47-
version = "2.9.0"
47+
version = "2.9.2"
4848
scope = "testOnly"
4949
dependencies = [
5050
{org = "ballerina", name = "jballerina.java"},
@@ -54,7 +54,7 @@ dependencies = [
5454
[[package]]
5555
org = "ballerina"
5656
name = "data.jsondata"
57-
version = "1.1.0"
57+
version = "1.1.3"
5858
scope = "testOnly"
5959
dependencies = [
6060
{org = "ballerina", name = "jballerina.java"},
@@ -79,7 +79,7 @@ modules = [
7979
[[package]]
8080
org = "ballerina"
8181
name = "http"
82-
version = "2.14.0"
82+
version = "2.14.6"
8383
scope = "testOnly"
8484
dependencies = [
8585
{org = "ballerina", name = "auth"},
@@ -129,7 +129,7 @@ modules = [
129129
[[package]]
130130
org = "ballerina"
131131
name = "jwt"
132-
version = "2.15.0"
132+
version = "2.15.1"
133133
scope = "testOnly"
134134
dependencies = [
135135
{org = "ballerina", name = "cache"},
@@ -280,7 +280,7 @@ dependencies = [
280280
[[package]]
281281
org = "ballerina"
282282
name = "oauth2"
283-
version = "2.14.0"
283+
version = "2.14.1"
284284
scope = "testOnly"
285285
dependencies = [
286286
{org = "ballerina", name = "cache"},
@@ -303,7 +303,7 @@ dependencies = [
303303
[[package]]
304304
org = "ballerina"
305305
name = "os"
306-
version = "1.10.0"
306+
version = "1.10.1"
307307
scope = "testOnly"
308308
dependencies = [
309309
{org = "ballerina", name = "io"},
@@ -316,7 +316,7 @@ modules = [
316316
[[package]]
317317
org = "ballerina"
318318
name = "sql"
319-
version = "1.17.0"
319+
version = "1.17.1"
320320
dependencies = [
321321
{org = "ballerina", name = "file"},
322322
{org = "ballerina", name = "io"},

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This file contains all the notable changes done to the Ballerina SQL package thr
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Changed
10+
- [Fix the CLOB retrieval issue as out parameter in OracleDB stored procedure calls](https://github.com/ballerina-platform/ballerina-library/issues/8386)
11+
712
## [1.17.0] 2025-09-19
813

914
### Added

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ stdlibUrlVersion=2.6.0
2222

2323
# Level 02
2424
stdlibConstraintVersion=1.7.0
25-
stdlibCryptoVersion=2.9.0
25+
stdlibCryptoVersion=2.9.1
2626
stdlibLogVersion=2.12.0
27-
stdlibOsVersion=1.10.0
27+
stdlibOsVersion=1.10.1
2828
stdlibTaskVersion=2.7.0
2929

3030
# Level 03
@@ -35,12 +35,12 @@ stdlibUuidVersion=1.10.0
3535

3636
# Level 04
3737
stdlibAuthVersion=2.14.0
38-
stdlibDataJsonDataVersion=1.1.0
39-
stdlibJwtVersion=2.15.0
40-
stdlibOAuth2Version=2.14.0
38+
stdlibDataJsonDataVersion=1.1.3
39+
stdlibJwtVersion=2.15.1
40+
stdlibOAuth2Version=2.14.1
4141

4242
# Level 05
43-
stdlibHttpVersion=2.14.0
43+
stdlibHttpVersion=2.14.6
4444

4545
# Level 06
4646
stdlibTransactionVersion=1.12.0

native/src/main/java/io/ballerina/stdlib/sql/nativeimpl/CallProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ private static int getOutParameterType(BObject typedValue,
310310
case Constants.OutParameterTypes.CLOB:
311311
case Constants.OutParameterTypes.NCLOB:
312312
if (typedValue instanceof BString) {
313-
sqlTypeValue = Types.CLOB;
314-
} else {
315313
sqlTypeValue = Types.LONGVARCHAR;
314+
} else {
315+
sqlTypeValue = Types.CLOB;
316316
}
317317
break;
318318
case Constants.OutParameterTypes.DATE:

native/src/test/java/io/ballerina/stdlib/sql/TestUtils.java

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import io.ballerina.runtime.api.types.PredefinedTypes;
2727
import io.ballerina.runtime.api.types.RecordType;
2828
import io.ballerina.runtime.api.types.Type;
29+
import io.ballerina.runtime.api.types.semtype.BasicTypeBitSet;
30+
import io.ballerina.runtime.api.types.semtype.Context;
31+
import io.ballerina.runtime.api.types.semtype.SemType;
2932
import io.ballerina.runtime.api.values.BArray;
3033
import io.ballerina.runtime.api.values.BFuture;
3134
import io.ballerina.runtime.api.values.BInitialValueEntry;
@@ -62,8 +65,8 @@
6265
import java.util.ArrayList;
6366
import java.util.Collection;
6467
import java.util.HashMap;
65-
import java.util.Iterator;
6668
import java.util.Map;
69+
import java.util.Optional;
6770
import java.util.Properties;
6871
import java.util.Set;
6972
import java.util.concurrent.Executor;
@@ -111,6 +114,26 @@ public ObjectType getType() {
111114
return TypeCreator.createObjectType(name, emptyModule, 0);
112115
}
113116

117+
@Override
118+
public SemType widenedType(Context cx) {
119+
return BObject.super.widenedType(cx);
120+
}
121+
122+
@Override
123+
public Optional<SemType> inherentTypeOf(Context cx) {
124+
return BObject.super.inherentTypeOf(cx);
125+
}
126+
127+
@Override
128+
public BasicTypeBitSet getBasicType() {
129+
return BObject.super.getBasicType();
130+
}
131+
132+
@Override
133+
public Type getOriginalType() {
134+
return BObject.super.getOriginalType();
135+
}
136+
114137
@Override
115138
public Object get(BString bString) {
116139
return null;
@@ -893,6 +916,11 @@ public String stringValue(BLink bLink) {
893916
return null;
894917
}
895918

919+
@Override
920+
public String informalStringValue(BLink parent) {
921+
return BTypedesc.super.informalStringValue(parent);
922+
}
923+
896924
@Override
897925
public String expressionStringValue(BLink bLink) {
898926
return null;
@@ -902,6 +930,21 @@ public String expressionStringValue(BLink bLink) {
902930
public Type getType() {
903931
return null;
904932
}
933+
934+
@Override
935+
public SemType widenedType(Context cx) {
936+
return BTypedesc.super.widenedType(cx);
937+
}
938+
939+
@Override
940+
public Optional<SemType> inherentTypeOf(Context cx) {
941+
return BTypedesc.super.inherentTypeOf(cx);
942+
}
943+
944+
@Override
945+
public BasicTypeBitSet getBasicType() {
946+
return BTypedesc.super.getBasicType();
947+
}
905948
};
906949
}
907950

@@ -1138,22 +1181,6 @@ public Type getType() {
11381181
return type;
11391182
}
11401183

1141-
@Override
1142-
public Iterator<?> getJavaIterator() {
1143-
BIterator<?> iterator = getIterator();
1144-
return new Iterator<>() {
1145-
1146-
@Override
1147-
public boolean hasNext() {
1148-
return false;
1149-
}
1150-
1151-
@Override
1152-
public Object next() {
1153-
return null;
1154-
}
1155-
};
1156-
}
11571184
};
11581185
}
11591186

@@ -1323,22 +1350,6 @@ public Type getType() {
13231350
return TestUtils.getBooleanStructRecord();
13241351
}
13251352

1326-
@Override
1327-
public Iterator<?> getJavaIterator() {
1328-
BIterator<?> iterator = getIterator();
1329-
return new Iterator<>() {
1330-
1331-
@Override
1332-
public boolean hasNext() {
1333-
return false;
1334-
}
1335-
1336-
@Override
1337-
public Object next() {
1338-
return null;
1339-
}
1340-
};
1341-
}
13421353
};
13431354
}
13441355
}

0 commit comments

Comments
 (0)