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

Assorted Fixes #8 #1807

Merged
merged 123 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
747152a
Fixes #1684: Support CREATE MATERIALIZED VIEW with AUTO REFRESH
zaza Dec 11, 2022
9e09005
Merge branch 'master' into 1684-create-mv-auto-refresh
zaza Dec 22, 2022
ea4477b
Reduce cyclomatic complexity in CreateView.toString
zaza Jan 8, 2023
b5321d6
Enhanced Keywords
manticore-projects Oct 18, 2021
5fae2f5
Fix incorrect tests
manticore-projects Oct 18, 2021
f49e828
Define Reserved Keywords explicitly
manticore-projects Oct 24, 2021
86f337d
Fix test resources
manticore-projects Oct 24, 2021
2d51a82
Adjust Gradle to JUnit 5
manticore-projects Nov 22, 2021
232aff6
Do not mark SpeedTest for concurrent execution
manticore-projects Nov 24, 2021
3ba5410
Remove unused imports
manticore-projects Nov 28, 2021
e960a35
Adjust Gradle to JUnit 5
manticore-projects Nov 22, 2021
67f7951
Do not mark SpeedTest for concurrent execution
manticore-projects Nov 24, 2021
a016be0
Remove unused imports
manticore-projects Nov 28, 2021
2ef6637
Sphinx Documentation
manticore-projects Sep 2, 2022
57193b8
doc: request for `Conventional Commit` messages
manticore-projects Sep 6, 2022
b94b2cc
feat: make important Classes Serializable
manticore-projects Sep 15, 2022
02202c5
chore: Make Serializable
manticore-projects Oct 14, 2022
a3ca325
doc: Better integration of the RR diagrams
manticore-projects Jan 7, 2023
fcb5ab1
Merge
manticore-projects Jan 7, 2023
c57c427
feat: Oracle Alternative Quoting
manticore-projects Jan 29, 2023
2aec1f6
style: Appease PMD/Codacy
manticore-projects Jan 29, 2023
1c8d8da
feat: CREATE VIEW ... REFRESH AUTO...
manticore-projects Jan 30, 2023
b707b23
doc: fix the issue template
manticore-projects Feb 1, 2023
46314c4
Update issue templates
manticore-projects Feb 1, 2023
4aeafbc
Update issue templates
manticore-projects Feb 1, 2023
b081484
feat: Support more Statement Separators
manticore-projects Feb 2, 2023
5885e1c
Merge remote-tracking branch 'origin/master'
manticore-projects Feb 13, 2023
581d97a
Merge branch 'master' of https://github.com/JSQLParser/JSqlParser
manticore-projects Feb 24, 2023
0979b2e
feat: FETCH uses EXPRESSION
manticore-projects Mar 7, 2023
ed17f87
style: apply Spotless
manticore-projects Mar 7, 2023
96808d2
test: commit missing test
manticore-projects Mar 7, 2023
21c4550
Merge branch 'master' of https://github.com/JSQLParser/JSqlParser
manticore-projects Mar 12, 2023
e8a29de
Merge branch 'master' of https://github.com/JSQLParser/JSqlParser
manticore-projects Apr 29, 2023
8a1bdec
feat: Lateral View
manticore-projects Apr 29, 2023
4efb99f
feat: Oracle `HAVING` before `GROUP BY`
manticore-projects Apr 29, 2023
9da7a06
feat: Multi-Part Names for Variables and Parameters
manticore-projects Apr 29, 2023
4b7f21c
feat: ClickHouse `Select...` ``FINAL` modifier
manticore-projects Apr 29, 2023
6281b07
feat: Test if a JOIN is an INNER JOIN according to the SQL:2016
manticore-projects Apr 30, 2023
b6ea8b1
feat: Switch off contradicting `JOIN` qualifiers, when setting a qual…
manticore-projects Apr 30, 2023
3a27a9d
feat: implement SQL:2016 Convert() and Trim()
manticore-projects Apr 30, 2023
4d5e26d
feat: ClickHouse `LIMIT ... BY ...` clause
manticore-projects Apr 30, 2023
f0a6f37
test: add specific tests for closed issues
manticore-projects Apr 30, 2023
ff16faf
test: add specific tests for closed issues
manticore-projects Apr 30, 2023
b9057d2
refactor: remove `SelectExpressionItem` in favor of `SelectItem`
manticore-projects Apr 30, 2023
286834d
doc: Update examples
manticore-projects Apr 30, 2023
0be65a4
build: Add missing import
manticore-projects Apr 30, 2023
4ddc835
doc: Update the README.md
manticore-projects May 1, 2023
fc577ca
fix: assign Enum case insensitive
manticore-projects May 2, 2023
86d0ace
fix: assign Enum case insensitive
manticore-projects May 2, 2023
a5140c7
Revert "fix: assign Enum case insensitive"
manticore-projects May 2, 2023
288b177
feat: Consolidate the `ExpressionList`, removing many redundant List …
manticore-projects May 3, 2023
905ef65
fix: Remove tests for `()`, since `ParenthesedExpressionList` will ca…
manticore-projects May 3, 2023
85b3bc4
refactor: UpdateSets for `Update` and `InsertConflictTarget`
manticore-projects May 3, 2023
e16ba5d
build: Increase TimeOut for the GitHub CI
manticore-projects May 3, 2023
2eb8c80
style: Appease Codacy
manticore-projects May 3, 2023
f449263
style: Checkstyle
manticore-projects May 3, 2023
141708e
refactor: Remove `ItemsList`, `MultiExpressionList`, `Replace`
manticore-projects May 4, 2023
67b3804
style: Appease Codacy
manticore-projects May 4, 2023
f89df27
style: Rework all the ENUMs
manticore-projects May 5, 2023
a590036
doc: Better Sphinx Tabs
manticore-projects May 6, 2023
c81d60a
doc: RR chart colors cater for Dark Mode
manticore-projects May 6, 2023
3903a80
refactor: remove SimpleFunction
manticore-projects May 6, 2023
2d200b0
build: improve Gradle Build
manticore-projects May 7, 2023
89600d4
refactor: `Insert` uses `ExpressionList` and `UpdateSet`
manticore-projects May 7, 2023
a11febb
test: Disable API Sanitation for the moment
manticore-projects May 7, 2023
399e1d7
style: Appease Checkstyle
manticore-projects May 7, 2023
f5d35d0
style: Appease PMD
manticore-projects May 7, 2023
21389b7
fix: find the correct position when field belongs to an internal class
manticore-projects May 9, 2023
52df291
style: replace all List<Expression> with ExpressionList<> and enforce…
manticore-projects May 9, 2023
9fbdaae
refactor: generify `SelectItem` and remove `FunctionItem` and `Expres…
manticore-projects May 9, 2023
7cecd29
fix: Java Version 8
manticore-projects May 9, 2023
c07a43b
feat: JdbcNamedParameter allows "&" (instead of ":")
manticore-projects May 11, 2023
09a70a4
feat: access Elements of Array Columns
manticore-projects May 11, 2023
6e7a78d
feat: `MEMBER OF` condition as shown at https://dev.mysql.com/doc/ref…
manticore-projects May 11, 2023
8a75aa7
style: appease PMD/Codacy
manticore-projects May 11, 2023
ce2b18a
style: appease PMD/Codacy
manticore-projects May 11, 2023
c9dce62
Merge remote-tracking branch 'manticore/Lateral_View' into Lateral_View
manticore-projects May 11, 2023
decf662
test: add unit test for issue #1778
manticore-projects May 11, 2023
c53667f
feat: Write API documentation to the WebSite via XMLDoclet
manticore-projects May 14, 2023
1132338
Update sphinx.yml
manticore-projects May 14, 2023
f3e8952
build: Sphinx build fixes
manticore-projects May 14, 2023
f515cda
Merge branch 'master' of https://github.com/manticore-projects/JSqlPa…
manticore-projects May 14, 2023
11b563c
build: Sphinx build fixes
manticore-projects May 14, 2023
961378d
build: Sphinx build fixes
manticore-projects May 14, 2023
48d5340
Merge branch 'master' of https://github.com/manticore-projects/JSqlPa…
manticore-projects May 14, 2023
8fb9110
build: improve the GIT Snapshot detection
manticore-projects May 15, 2023
88d1b62
fix: issue #1791
manticore-projects May 15, 2023
d20c8e9
fix: issue #1789
manticore-projects May 16, 2023
32ec561
fix: issue #1789
manticore-projects May 16, 2023
9fa0f4b
Merge remote-tracking branch 'manticore/Lateral_View' into Lateral_View
manticore-projects May 16, 2023
01a5fb7
refactor: simplify production `CreateParameter()`
manticore-projects May 16, 2023
daa56ed
refactor: SHOW statement, supporting any RDBMS specific implementation
manticore-projects May 16, 2023
4fb1cfb
refactor: RETURNING clause
manticore-projects May 16, 2023
da32442
refactor: CREATE and ALTER productions
manticore-projects May 16, 2023
4f0488c
fix: Complex Parsing Approach
manticore-projects May 17, 2023
3ff9774
style: Quieten the logger
manticore-projects May 17, 2023
a7dfb94
style: Cosmetic improvements
manticore-projects May 17, 2023
6ef5e0b
feat: chaining JSON Expressions
manticore-projects May 17, 2023
4f91746
style: remove unused imports
manticore-projects May 17, 2023
9dafae8
refact: Statements extends List<Statement>
manticore-projects May 17, 2023
4bdabed
build: try to work around the Maven/JDK8 issue on GitHub
manticore-projects May 17, 2023
64b0331
feat: parse CREATE TRIGGER as UnsupportedStatement
manticore-projects May 17, 2023
e19dc0e
feat: functions blocks, parenthesed JSON Expressions
manticore-projects May 18, 2023
5263b91
feat: functions blocks, parenthesed JSON Expressions
manticore-projects May 18, 2023
be7fc53
Create gradle.yml
manticore-projects May 18, 2023
73c55fd
feat: Quoted Identifiers can contain double-quotes (PostgreSQL)
manticore-projects May 18, 2023
a558871
build: improve Upload task
manticore-projects May 19, 2023
5e7732c
doc: Website improvements
manticore-projects May 22, 2023
68ce27c
doc: Website, fix tabs
manticore-projects May 24, 2023
cb960a3
fix: throw the specific exception
manticore-projects May 29, 2023
2b4a929
doc: write migration guide
manticore-projects May 29, 2023
54b4303
Merge branch 'master' of https://github.com/manticore-projects/JSqlPa…
manticore-projects May 29, 2023
b6fab2a
fix: expose IntervalExpression attributes and use DeParser
manticore-projects Jun 1, 2023
6d2b421
doc: migration guide
manticore-projects Jun 2, 2023
8027dbf
feat: T-SQL `FOR ...` clause
manticore-projects Jun 2, 2023
94d00f0
Merge remote-tracking branch 'origin/master'
manticore-projects Jun 2, 2023
6f27765
fix: SPHINX modules and themes
manticore-projects Jun 2, 2023
f5e9f53
docs: write migration guide
manticore-projects Jun 11, 2023
996ebd9
Merge branch 'master' of github.com:manticore-projects/JSqlParser
manticore-projects Jun 11, 2023
75e4d30
feat: `QUALIFY` clause
manticore-projects Jun 15, 2023
386dc7a
feat: Postgres `NOTNULL` support
manticore-projects Jun 15, 2023
f132547
feat: MySQL `NOT RLIKE`, `NOT REGEXP` expressions
manticore-projects Jun 15, 2023
420d7d8
fix: `INSERT` must use simple Column Names only
manticore-projects Jun 15, 2023
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
34 changes: 34 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@v2.4.2
with:
arguments: check
2 changes: 1 addition & 1 deletion .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Install XSLT Processor
run: sudo apt-get install xsltproc sphinx-common
- name: Install dependencies
run: pip install furo sphinx_rtd_theme sphinx-book-theme myst_parser sphinx-prompt sphinx_substitution_extensions sphinx_issues sphinx_inline_tabs pygments
run: pip install furo myst_parser sphinx-prompt sphinx_substitution_extensions sphinx_issues sphinx_inline_tabs pygments
- name: Checkout project sources
uses: actions/checkout@v2
with:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ SELECT 1 FROM dual WHERE a = b
```

```text
SQL Text
└─Statements: net.sf.jsqlparser.statement.select.Select
├─selectItems -> Collection<SelectItem>
│ └─LongValue: 1
├─Table: dual
└─where: net.sf.jsqlparser.expression.operators.relational.EqualsTo
├─Column: a
└─Column: b
SQL Text
└─Statements: statement.select.PlainSelect
├─selectItems: statement.select.SelectItem
│ └─LongValue: 1
├─Table: dual
└─where: expression.operators.relational.EqualsTo
├─Column: a
└─Column: b
```

```java
Expand Down
28 changes: 7 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {

id "ca.coglinc2.javacc" version "latest.release"
id 'jacoco'
id 'com.github.kt3k.coveralls' version "latest.release"
id "com.github.spotbugs" version "latest.release"
id "com.diffplug.spotless" version "latest.release"
id 'pmd'
Expand Down Expand Up @@ -179,6 +180,10 @@ test {
maxHeapSize = "1G"
}

coveralls {
jacocoReportPath 'build/reports/jacoco/test/jacocoTestReport.xml'
}

jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
Expand Down Expand Up @@ -272,9 +277,7 @@ spotbugs {
}

pmd {
consoleOutput = false
//toolVersion = "6.46.0"

consoleOutput = true
sourceSets = [sourceSets.main]

// clear the ruleset in order to use configured rules only
Expand Down Expand Up @@ -436,23 +439,6 @@ xslt {
tasks.register('sphinx', Exec) {
dependsOn(gitChangelogTask, renderRR, xslt, updateKeywords, xmldoc)

// doFirst() {
// exec {
// args = [
// "install"
// , "sphinx_rtd_theme"
// , "sphinx-book-theme"
// , "myst_parser"
// , "sphinx-prompt"
// , "sphinx_substitution_extensions"
// , "sphinx_issues"
// , "sphinx_inline_tabs"
// , "pygments"
// ]
// executable "pip"
// }
// }

String PROLOG = """
.. |_| unicode:: U+00A0
:trim:
Expand Down Expand Up @@ -555,7 +541,7 @@ publishing {
maven {
name = "GitHubPackages"

url = uri("https://maven.pkg.github.com/manticore-projects/jsqlparser")
url = uri("https://maven.pkg.github.com/JSQLParser/jsqlparser")
credentials(PasswordCredentials)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import net.sf.jsqlparser.expression.operators.relational.MinorThanEquals;
import net.sf.jsqlparser.expression.operators.relational.NotEqualsTo;
import net.sf.jsqlparser.expression.operators.relational.RegExpMatchOperator;
import net.sf.jsqlparser.expression.operators.relational.RegExpMySQLOperator;
import net.sf.jsqlparser.expression.operators.relational.SimilarToExpression;
import net.sf.jsqlparser.schema.Column;
import net.sf.jsqlparser.statement.select.AllColumns;
Expand Down Expand Up @@ -168,8 +167,6 @@ public interface ExpressionVisitor {

void visit(JsonOperator jsonExpr);

void visit(RegExpMySQLOperator regExpMySQLOperator);

void visit(UserVariable var);

void visit(NumericBind bind);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import net.sf.jsqlparser.expression.operators.relational.MinorThanEquals;
import net.sf.jsqlparser.expression.operators.relational.NotEqualsTo;
import net.sf.jsqlparser.expression.operators.relational.RegExpMatchOperator;
import net.sf.jsqlparser.expression.operators.relational.RegExpMySQLOperator;
import net.sf.jsqlparser.expression.operators.relational.SimilarToExpression;
import net.sf.jsqlparser.schema.Column;
import net.sf.jsqlparser.statement.select.AllColumns;
Expand Down Expand Up @@ -433,11 +432,6 @@ public void visit(JsonOperator expr) {
visitBinaryExpression(expr);
}

@Override
public void visit(RegExpMySQLOperator expr) {
visitBinaryExpression(expr);
}

@Override
public void visit(UserVariable var) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
*/
package net.sf.jsqlparser.expression;

import java.util.Objects;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;

import java.util.Objects;

public class IntervalExpression extends ASTNodeAccessImpl implements Expression {

private String parameter = null;
Expand All @@ -27,6 +28,10 @@ public IntervalExpression(boolean intervalKeyword) {
this.intervalKeyword = intervalKeyword;
}

public boolean isUsingIntervalKeyword() {
return intervalKeyword;
}

public String getParameter() {
return parameter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}

StringBuilder appendTo(StringBuilder builder) {
public StringBuilder appendTo(StringBuilder builder) {
builder.append("Trim(");

if (trimSpecification != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public ExpressionList withExpressions(T... expressions) {
return addExpressions(expressions);
}

public ExpressionList withExpressions(Collection<T> expressions) {
public ExpressionList<?> withExpressions(Collection<T> expressions) {
this.clear();
return addExpressions(expressions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class IsNullExpression extends ASTNodeAccessImpl implements Expression {
private Expression leftExpression;
private boolean not = false;
private boolean useIsNull = false;
private boolean useNotNull = false;

public Expression getLeftExpression() {
return leftExpression;
Expand All @@ -43,14 +44,25 @@ public void setUseIsNull(boolean useIsNull) {
this.useIsNull = useIsNull;
}

public boolean isUseNotNull() {
return useNotNull;
}

public IsNullExpression setUseNotNull(boolean useNotNull) {
this.useNotNull = useNotNull;
return this;
}

@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}

@Override
public String toString() {
if (isUseIsNull()) {
if (useNotNull) {
return leftExpression + " NOTNULL";
} else if (useIsNull) {
return leftExpression + (not ? " NOT" : "") + " ISNULL";
} else {
return leftExpression + " IS " + (not ? "NOT " : "") + "NULL";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
import net.sf.jsqlparser.expression.ExpressionVisitor;

public class LikeExpression extends BinaryExpression {
public enum KeyWord {
LIKE, ILIKE, RLIKE, REGEXP;

public static KeyWord from(String keyword) {
return Enum.valueOf(KeyWord.class, keyword.toUpperCase());
}
}

private boolean not = false;
private boolean useBinary = false;
private Expression escapeExpression = null;
private boolean caseInsensitive = false;
private KeyWord likeKeyWord = KeyWord.LIKE;

public boolean isNot() {
return not;
Expand All @@ -27,23 +35,33 @@ public void setNot(boolean b) {
not = b;
}

public boolean isUseBinary() {
return useBinary;
}

public LikeExpression setUseBinary(boolean useBinary) {
this.useBinary = useBinary;
return this;
}

@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}

@Deprecated
@Override
public String getStringExpression() {
return caseInsensitive ? "ILIKE" : "LIKE";
return likeKeyWord.toString();
}

@Override
public String toString() {
String retval = getLeftExpression() + " " + (not ? "NOT " : "") + getStringExpression() + " " + getRightExpression();
String retval = getLeftExpression() + " " + (not ? "NOT " : "")
+ likeKeyWord + " " + (useBinary ? "BINARY " : "") + getRightExpression();
if (escapeExpression != null) {
retval += " ESCAPE " + escapeExpression ;
retval += " ESCAPE " + escapeExpression;
}

return retval;
}

Expand All @@ -55,19 +73,36 @@ public void setEscape(Expression escapeExpression) {
this.escapeExpression = escapeExpression;
}

@Deprecated
public boolean isCaseInsensitive() {
return caseInsensitive;
return likeKeyWord == KeyWord.ILIKE;
}

@Deprecated
public void setCaseInsensitive(boolean caseInsensitive) {
this.caseInsensitive = caseInsensitive;
this.likeKeyWord = KeyWord.ILIKE;
}

public KeyWord getLikeKeyWord() {
return likeKeyWord;
}

public LikeExpression setLikeKeyWord(KeyWord likeKeyWord) {
this.likeKeyWord = likeKeyWord;
return this;
}

public LikeExpression setLikeKeyWord(String likeKeyWord) {
this.likeKeyWord = KeyWord.from(likeKeyWord);
return this;
}

public LikeExpression withEscape(Expression escape) {
this.setEscape(escape);
return this;
}

@Deprecated
public LikeExpression withCaseInsensitive(boolean caseInsensitive) {
this.setCaseInsensitive(caseInsensitive);
return this;
Expand Down
Loading