Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch release for SQL 1.2.1 #501

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
f5470de
[Gradle Release Plugin] - new version commit: 'v1.2.1-SNAPSHOT'.
Dec 13, 2021
ac6161d
Update changelog
niveathika Dec 13, 2021
02b3e92
Merge pull request #470 from ballerina-platform/release-1.2.0
niveathika Dec 13, 2021
bb3a4a2
[Automated] Update dependencies
Dec 20, 2021
f88d530
[Automated] Update native jar versions in toml files
niveathika Dec 20, 2021
905486a
Merge pull request #471 from ballerina-platform/automated/dependency_…
ballerina-bot Dec 20, 2021
5fede5c
Update version to be released on 2201.0.0
niveathika Dec 20, 2021
06fd681
[Automated] Update native jar versions in toml files
niveathika Dec 20, 2021
54b27f2
Merge pull request #472 from niveathika/master
daneshk Dec 21, 2021
9abfd7b
[Automated] Update dependencies
Dec 22, 2021
5edc06d
Merge pull request #473 from ballerina-platform/automated/dependency_…
ballerina-bot Dec 22, 2021
9b116b5
Fix plugin crash when variable is passed for `ConnectionPool`
niveathika Dec 22, 2021
ea6f821
Merge pull request #474 from niveathika/master
daneshk Dec 22, 2021
9f22824
[Automated] Update dependencies
Dec 22, 2021
1819d5f
Merge pull request #475 from ballerina-platform/automated/dependency_…
ballerina-bot Dec 22, 2021
bf61f0b
[Automated] Update dependencies
Dec 24, 2021
6fd5021
Merge pull request #476 from ballerina-platform/automated/dependency_…
ballerina-bot Dec 24, 2021
730dcd1
[Automated] Update dependencies
Jan 2, 2022
b9b6051
Merge pull request #477 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 2, 2022
538e90d
[Automated] Update dependencies
Jan 3, 2022
7952770
Merge pull request #478 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 3, 2022
da58455
[Automated] Update dependencies
Jan 4, 2022
4876e00
Merge pull request #479 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 4, 2022
7679d13
Add sql package icon
niveathika Jan 5, 2022
e6fc6a7
[Automated] Update native jar versions in toml files
niveathika Jan 5, 2022
7548d35
Move icon to root of ballerina project
niveathika Jan 5, 2022
e700996
[Automated] Update native jar versions in toml files
niveathika Jan 5, 2022
1eb72a3
Merge pull request #480 from niveathika/master
daneshk Jan 5, 2022
eaad0a3
[Automated] Update dependencies
Jan 6, 2022
b1b0184
Merge pull request #481 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 6, 2022
18b7001
[Automated] Update dependencies
Jan 11, 2022
a5289b8
Merge pull request #482 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 11, 2022
5cbdba6
[Automated] Update dependencies
Jan 11, 2022
17846ec
Merge pull request #483 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 11, 2022
8117356
[Automated] Update dependencies
Jan 11, 2022
5c5432c
Merge pull request #484 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 11, 2022
1b430b3
Fix API docs
niveathika Jan 12, 2022
0513f0b
Add specification
niveathika Jan 12, 2022
6a55ede
[Automated] Update dependencies
Jan 13, 2022
e72a8c0
Add separate observe dependency
niveathika Jan 13, 2022
82b5a6c
Merge pull request #486 from ballerina-platform/automated/dependency_…
daneshk Jan 13, 2022
6dd0d8f
[Automated] Update dependencies
Jan 13, 2022
b89e684
Merge pull request #487 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 13, 2022
1f67659
[Automated] Update dependencies
Jan 13, 2022
c2c4968
Merge pull request #488 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 13, 2022
94aa1a6
Improve API docs
kaneeldias Jan 18, 2022
10a4724
Refactor usage of foreach
kaneeldias Jan 18, 2022
d776f3c
Improve API docs
kaneeldias Jan 18, 2022
1090acf
Fix typo
kaneeldias Jan 18, 2022
b823447
Use query syntax instead of foreach in Module.md
kaneeldias Jan 18, 2022
980e1a7
Use query syntax instead of foreach in Module.md
kaneeldias Jan 18, 2022
90ef6b6
Use query syntax instead of foreach
kaneeldias Jan 18, 2022
723441c
Fix typos
kaneeldias Jan 18, 2022
3cd0aa3
Fix typos
kaneeldias Jan 18, 2022
f6cce50
Revert unnecessary changes
kaneeldias Jan 18, 2022
15e9375
Implement suggested changes
kaneeldias Jan 18, 2022
96f6de7
Implement suggested changes
kaneeldias Jan 18, 2022
83a2f43
[Automated] Update dependencies
Jan 18, 2022
1381258
Merge pull request #491 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 18, 2022
3c1e3f7
Implement suggested changes
kaneeldias Jan 19, 2022
6f98bc2
Implement suggested changes
kaneeldias Jan 19, 2022
a374472
Merge pull request #489 from kaneeldias/api-docs
daneshk Jan 19, 2022
0e6bcee
[Automated] Update dependencies
Jan 19, 2022
391fb68
Merge pull request #492 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 19, 2022
5eacd80
Remove unnecessary variable assignments
kaneeldias Jan 21, 2022
f43d719
Merge pull request #490 from kaneeldias/foreach
daneshk Jan 21, 2022
0627188
Merge branch 'master' into master
niveathika Jan 21, 2022
f0148aa
Merge pull request #485 from niveathika/master
daneshk Jan 21, 2022
282f040
Fix code snippet in api docs
niveathika Jan 21, 2022
2ef03b2
Improve description in the spec
niveathika Jan 21, 2022
0ef3a1c
Additional improvements to API docs
kaneeldias Jan 21, 2022
b056b82
Fix formatting
niveathika Jan 21, 2022
b0f3a06
Merge pull request #493 from niveathika/master
daneshk Jan 21, 2022
51d07c3
[Automated] Update dependencies
Jan 21, 2022
205d7da
Merge pull request #495 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 21, 2022
52d10af
Additional improvements to API docs
kaneeldias Jan 21, 2022
a8caee5
Merge remote-tracking branch 'upstream/master' into api-docs
kaneeldias Jan 21, 2022
3fcacd5
Merge pull request #494 from kaneeldias/api-docs
daneshk Jan 21, 2022
c2002ce
[Automated] Update dependencies
Jan 23, 2022
dff4e7b
Merge pull request #496 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 23, 2022
4e2c682
[Automated] Update dependencies
Jan 24, 2022
efda0a4
Merge pull request #497 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 24, 2022
d449f9b
[Automated] Update dependencies
Jan 27, 2022
86ebd2d
Merge pull request #498 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 27, 2022
f444375
[Automated] Update dependencies
Jan 27, 2022
31aa857
Merge pull request #499 from ballerina-platform/automated/dependency_…
ballerina-bot Jan 27, 2022
ec39073
Tag 1.2.0
kaneeldias Feb 1, 2022
4c65142
Fix plugin crash when variable is passed for ConnectionPool
niveathika Dec 22, 2021
dfc2364
[Automated] Update native jar versions in toml files
kaneeldias Feb 1, 2022
5293088
Update patch version
kaneeldias Feb 1, 2022
1ce3e03
Add removed files
kaneeldias Feb 1, 2022
9e6c2af
Update changelog
kaneeldias Feb 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[package]
org = "ballerina"
name = "sql"
version = "1.2.0"
version = "1.2.1"
authors = ["Ballerina"]
keywords = ["database", "client", "network", "SQL", "RDBMS"]
repository = "https://github.com/ballerina-platform/module-ballerina-sql"
license = ["Apache-2.0"]
distribution = "slbeta6"

[[platform.java11.dependency]]
path = "../native/build/libs/sql-native-1.2.0.jar"
path = "../native/build/libs/sql-native-1.2.1.jar"

[[platform.java11.dependency]]
path = "../test-utils/build/libs/sql-test-utils-1.2.0.jar"
path = "../test-utils/build/libs/sql-test-utils-1.2.1.jar"
scope = "testOnly"

[[platform.java11.dependency]]
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "sql-compiler-plugin"
class = "io.ballerina.stdlib.sql.compiler.SQLCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.2.0.jar"
path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.2.1.jar"
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "sql"
version = "1.2.0"
version = "1.2.1"
dependencies = [
{org = "ballerina", name = "file"},
{org = "ballerina", name = "io"},
Expand Down
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

### Changed

## [1.2.1] - 2021-12-13

### Added

### Changed
- [Fix Compiler plugin crash when variable is passed for `sql:connectionPool`](https://github.com/ballerina-platform/ballerina-standard-library/issues/2536)

## [1.2.0] - 2021-12-13

### Changed
- [Fix queryRow method to use module's provided resultParameterProcessor](https://github.com/ballerina-platform/ballerina-standard-library/issues/2466)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,17 @@ public void testOutParameterHint() {
});

}

@Test
public void testConnectionPoolWithVariable() {
Package currentPackage = loadPackage("sample4");
PackageCompilation compilation = currentPackage.getCompilation();
DiagnosticResult diagnosticResult = compilation.diagnosticResult();
List<Diagnostic> errorDiagnosticsList = diagnosticResult.diagnostics().stream()
.filter(r -> r.diagnosticInfo().severity().equals(DiagnosticSeverity.ERROR))
.collect(Collectors.toList());
long availableErrors = errorDiagnosticsList.size();

Assert.assertEquals(availableErrors, 0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
org = "sql_test"
name = "sample4"
version = "0.1.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
//
// WSO2 Inc. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/sql;

public function main() {

int connectionNum = 5;
int connectionNumInvalid = -5;

int|sql:ConnectionPool pool = {
maxOpenConnections: connectionNum
};

sql:ConnectionPool|int poolInvalid = {
maxOpenConnections: connectionNumInvalid
};

}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void perform(SyntaxNodeAnalysisContext ctx) {
ExpressionNode valueNode = ((SpecificFieldNode) field).valueExpr().get();
switch (name) {
case Constants.ConnectionPool.MAX_OPEN_CONNECTIONS:
int maxOpenConnections = Integer.parseInt(getTerminalNodeValue(valueNode));
int maxOpenConnections = Integer.parseInt(getTerminalNodeValue(valueNode, "1"));
if (maxOpenConnections < 1) {
DiagnosticInfo diagnosticInfo = new DiagnosticInfo(SQL_101.getCode(), SQL_101.getMessage(),
SQL_101.getSeverity());
Expand All @@ -110,7 +110,7 @@ public void perform(SyntaxNodeAnalysisContext ctx) {
}
break;
case Constants.ConnectionPool.MIN_IDLE_CONNECTIONS:
int minIdleConnection = Integer.parseInt(getTerminalNodeValue(valueNode));
int minIdleConnection = Integer.parseInt(getTerminalNodeValue(valueNode, "0"));
if (minIdleConnection < 0) {
DiagnosticInfo diagnosticInfo = new DiagnosticInfo(SQL_102.getCode(), SQL_102.getMessage(),
SQL_102.getSeverity());
Expand All @@ -120,7 +120,7 @@ public void perform(SyntaxNodeAnalysisContext ctx) {
}
break;
case Constants.ConnectionPool.MAX_CONNECTION_LIFE_TIME:
float maxConnectionTime = Float.parseFloat(getTerminalNodeValue(valueNode));
float maxConnectionTime = Float.parseFloat(getTerminalNodeValue(valueNode, "30"));
if (maxConnectionTime < 30) {
DiagnosticInfo diagnosticInfo = new DiagnosticInfo(SQL_103.getCode(), SQL_103.getMessage(),
SQL_103.getSeverity());
Expand All @@ -137,15 +137,16 @@ public void perform(SyntaxNodeAnalysisContext ctx) {
}
}

private String getTerminalNodeValue(Node valueNode) {
String value;
private String getTerminalNodeValue(Node valueNode, String defaultValue) {
String value = defaultValue;
if (valueNode instanceof BasicLiteralNode) {
value = ((BasicLiteralNode) valueNode).literalToken().text();
} else {
} else if (valueNode instanceof UnaryExpressionNode) {
UnaryExpressionNode unaryExpressionNode = (UnaryExpressionNode) valueNode;
value = unaryExpressionNode.unaryOperator() +
((BasicLiteralNode) unaryExpressionNode.expression()).literalToken().text();
}
// Currently we cannot process values from variables, this needs code flow analysis
return value.replaceAll(UNNECESSARY_CHARS_REGEX, "");
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=io.ballerina.stdlib
version=1.2.0
version=1.2.1

puppycrawlCheckstyleVersion=8.18
hikkariLibVersion=3.3.1
Expand Down