Skip to content

Fix#95: support host and port arguments configuration for different DBMSs in SQLancer #315

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

Merged
merged 22 commits into from Mar 25, 2021
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b7501c7
suuport host/port arguments for postgres
abcdabcd3899 Mar 9, 2021
5fac753
support host/port arguments for MySQL
abcdabcd3899 Mar 9, 2021
96f22a0
support host/port arguments for mariadb
abcdabcd3899 Mar 9, 2021
3051257
support host/port arguments for clickhouse
abcdabcd3899 Mar 9, 2021
33b9ef9
support host/port arguments for cockroachdb
abcdabcd3899 Mar 9, 2021
fceb0ac
support host/port arguments for TiDB
abcdabcd3899 Mar 9, 2021
decb8ff
format
abcdabcd3899 Mar 9, 2021
4618937
modify format
abcdabcd3899 Mar 9, 2021
1ca57bf
Update TiDBProvider.java
Mar 9, 2021
7a3ebf4
Update Main.java
Mar 12, 2021
03f8d6f
modify typo error
Mar 17, 2021
17e79ae
using String.format replace + in String
abcdabcd3899 Mar 18, 2021
4b45629
adding the help text and modifing the default values of host and port
abcdabcd3899 Mar 20, 2021
9a5370b
Merge remote-tracking branch 'upstream/master'
abcdabcd3899 Mar 20, 2021
f201549
constant representation for the default value of host and port
abcdabcd3899 Mar 20, 2021
dc2bc44
delete comments
abcdabcd3899 Mar 20, 2021
ba7d856
Merge remote-tracking branch 'upstream/master'
abcdabcd3899 Mar 25, 2021
c601f4f
add constant support for the different DBMSs
abcdabcd3899 Mar 25, 2021
ddd2d02
add constant support for the different DBMSs
abcdabcd3899 Mar 25, 2021
b931c73
Merge branch 'master' of https://github.com/EthanDBer/sqlancer
abcdabcd3899 Mar 25, 2021
c520480
add const support for the different DBMSs and use local variables
abcdabcd3899 Mar 25, 2021
318272f
Delete 1
Mar 25, 2021
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
Prev Previous commit
Next Next commit
support host/port arguments for clickhouse
  • Loading branch information
abcdabcd3899 committed Mar 9, 2021
commit 3051257cdeef232ef18edbb6fc2161212626d482
14 changes: 13 additions & 1 deletion src/sqlancer/clickhouse/ClickHouseProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import sqlancer.common.query.SQLQueryProvider;

public class ClickHouseProvider extends SQLProviderAdapter<ClickHouseGlobalState, ClickHouseOptions> {
protected String host;
protected String port;

public ClickHouseProvider() {
super(ClickHouseGlobalState.class, ClickHouseOptions.class);
Expand Down Expand Up @@ -102,9 +104,19 @@ public void generateDatabase(ClickHouseGlobalState globalState) throws Exception

@Override
public SQLConnection createDatabase(ClickHouseGlobalState globalState) throws SQLException {
host = globalState.getOptions().getHost();
port = globalState.getOptions().getPort();
if("sqlancer".equals(host)){
host = "localhost";
}
if("sqlancer".equals(port)){
port = "8123";
}

ClickHouseOptions clickHouseOptions = globalState.getDmbsSpecificOptions();
globalState.setClickHouseOptions(clickHouseOptions);
String url = "jdbc:clickhouse://localhost:8123/default";
//String url = "jdbc:clickhouse://localhost:8123/default";
String url = "jdbc:clickhouse://" + host + ":" + port + "/defult";
String databaseName = globalState.getDatabaseName();
Connection con = DriverManager.getConnection(url, globalState.getOptions().getUserName(),
globalState.getOptions().getPassword());
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy