Skip to content

Commit

Permalink
Fixed an issue in the database system where the URL strings were not …
Browse files Browse the repository at this point in the history
…properly encoded for connections.
  • Loading branch information
Andreas Stefik committed Dec 8, 2022
1 parent f950d09 commit 7cc1de2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
10 changes: 10 additions & 0 deletions Quorum/Library/Standard/Libraries/Data/Database/Database.quorum
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Database
DatabaseStrategy strategy = undefined
DatabaseMetaData meta = undefined
boolean connected = false
text error = undefined

on create
//by default create a my sql database, but allow the user
//to override it if they wish.
Expand Down Expand Up @@ -64,10 +66,18 @@ class Database
strategy:Connect(connection)
connected = true
detect e
error = e:GetStackTraceMessage()
connected = false
end
end

/*
If the connection has an error, this action returns the stack trace for
the problem.
*/
action GetConnectionError returns text
return error
end
/*
Returns whether or not this database object is currently connected to a database

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use Libraries.Data.Database.EditTable
use Libraries.Data.Database.CreateView
use Libraries.Data.Database.QueryResult
use Libraries.Data.Database.DatabaseMetaData
use Libraries.Network.NetworkExchange

/*
This class implements a DatabaseStrategy and is the default strategy the Database class uses.
Expand All @@ -21,11 +22,12 @@ use Libraries.Data.Database.DatabaseMetaData
class DefaultDatabaseStrategy is DatabaseStrategy

action Connect(Connection connection)
NetworkExchange exchange
text connect = "jdbc:mysql://"
connect = connect + connection:GetLocation() + "/"
connect = connect + connection:GetLocation() + ":" + connection:GetPort() + "/"
+ connection:GetDatabase() + "?user="
+ connection:GetUsername() + "&password="
+ connection:GetPassword()
+ exchange:URLEncodeValue(connection:GetUsername()) + "&password="
+ exchange:URLEncodeValue(connection:GetPassword())

ConnectNative(connect)
end
Expand Down
2 changes: 1 addition & 1 deletion Quorum/build_image.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
docker buildx create --name quorum_builder --node quorum_builder0 --use
docker buildx build --no-cache -f Dockerfile.quorum.build -t andreasstefik/quorum:10.1.4 . --platform linux/amd64,linux/arm64 --push
docker buildx build --no-cache -f Dockerfile.quorum.build -t andreasstefik/quorum:10.5.0 . --platform linux/amd64,linux/arm64 --push

0 comments on commit 7cc1de2

Please sign in to comment.