Skip to content
Permalink
Browse files

Merge branch '2.4.3'

  • Loading branch information...
rusher committed Aug 2, 2019
2 parents 8b2f79c + 712d9d6 commit af9d9cc177e2b61a44f71be96476b2d8ab3cb03a
Showing with 4,404 additions and 2,551 deletions.
  1. +2 −2 README.md
  2. +226 −0 azure-pipelines.yml
  3. +7 −0 documentation/changelog.creole
  4. +1 −0 documentation/use-mariadb-connector-j-driver.creole
  5. +2 −2 pom.xml
  6. +458 −577 src/main/java/org/mariadb/jdbc/BasePrepareStatement.java
  7. +3 −3 src/main/java/org/mariadb/jdbc/MariaDbConnection.java
  8. +2,095 −1,203 src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java
  9. +42 −79 src/main/java/org/mariadb/jdbc/MariaDbResultSetMetaData.java
  10. +2 −2 src/main/java/org/mariadb/jdbc/MariaDbStatement.java
  11. +2 −34 src/main/java/org/mariadb/jdbc/ServerSidePreparedStatement.java
  12. +1 −1 src/main/java/org/mariadb/jdbc/internal/com/read/ErrorPacket.java
  13. +8 −39 src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java
  14. +72 −0 src/main/java/org/mariadb/jdbc/internal/com/send/parameters/BooleanParameter.java
  15. +14 −5 src/main/java/org/mariadb/jdbc/internal/com/send/parameters/ByteParameter.java
  16. +122 −0 src/main/java/org/mariadb/jdbc/internal/com/send/parameters/LocalTimeParameter.java
  17. +4 −0 src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java
  18. +3 −0 src/main/java/org/mariadb/jdbc/internal/failover/FailoverProxy.java
  19. +2 −0 src/main/java/org/mariadb/jdbc/internal/failover/Listener.java
  20. +6 −0 src/main/java/org/mariadb/jdbc/internal/failover/impl/MastersSlavesListener.java
  21. +3 −2 src/main/java/org/mariadb/jdbc/internal/logging/ProtocolLoggingProxy.java
  22. +1 −1 src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
  23. +1 −1 src/main/java/org/mariadb/jdbc/internal/protocol/Protocol.java
  24. +552 −257 src/main/java/org/mariadb/jdbc/internal/util/DefaultOptions.java
  25. +42 −80 src/main/java/org/mariadb/jdbc/internal/util/Options.java
  26. +245 −188 src/main/java/org/mariadb/jdbc/internal/util/Utils.java
  27. +2 −2 src/main/java/org/mariadb/jdbc/internal/util/constant/Version.java
  28. +24 −13 src/test/java/org/mariadb/jdbc/BaseTest.java
  29. +17 −0 src/test/java/org/mariadb/jdbc/BooleanTest.java
  30. +11 −5 src/test/java/org/mariadb/jdbc/ConnectionTest.java
  31. +8 −10 src/test/java/org/mariadb/jdbc/DriverTest.java
  32. +1 −5 src/test/java/org/mariadb/jdbc/ErrorMessageTest.java
  33. +205 −0 src/test/java/org/mariadb/jdbc/LocalTimeTest.java
  34. +22 −33 src/test/java/org/mariadb/jdbc/ResultSetMetaDataTest.java
  35. +190 −0 src/test/java/org/mariadb/jdbc/ScalarFunctionsTest.java
  36. +3 −2 src/test/java/org/mariadb/jdbc/SslTest.java
  37. +3 −3 src/test/java/org/mariadb/jdbc/StoredProcedureTest.java
  38. +1 −1 src/test/java/org/mariadb/jdbc/UtilTest.java
  39. +1 −1 src/test/resources/logback-test.xml
@@ -24,15 +24,15 @@ Tracker link <a href="https://jira.mariadb.org/projects/CONJ/issues/">https://ji
|:------------:|:-------------------------:|
| 6 | 1.7.4 |
| 7 | 1.7.4 |
| 8+ | 2.4.2 |
| 8+ | 2.4.3 |

The driver (jar) can be downloaded from [mariadb connector download](https://mariadb.com/products/connectors-plugins)
or maven :
```script
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.4.0</version>
<version>2.4.3</version>
</dependency>
```

@@ -0,0 +1,226 @@
resources:
containers:

- container: ubuntu-1804
image: ubuntu:18.04
options: "--name ubuntu-1804 --add-host=mariadb.example.com:127.0.0.1 -v /usr/bin/docker:/tmp/docker:ro"

jobs:

- job: SSLFiles
displayName: 'Creating SSL Files'
pool:
vmImage: 'ubuntu-16.04'
container: $[ variables['containerImage'] ]
steps:
- script: |
java --version
mkdir tmp
chmod 777 .travis/gen-ssl.sh
.travis/gen-ssl.sh mariadb.example.com tmp
cp -R tmp $BUILD_ARTIFACTSTAGINGDIRECTORY
displayName: 'create SSL certificates'
- task: PublishPipelineArtifact@0
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: ssl_certs

- job: windowsTest
displayName: 'test windows'
pool:
vmImage: 'windows-2019'
dependsOn:
- SSLFiles
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download SSL files'
inputs:
artifactName: ssl_certs
targetPath: $(System.DefaultWorkingDirectory)

- task: DownloadPipelineArtifact@2
displayName: 'Download 10.4 server'
inputs:
source: 'specific'
project: '550599d3-6165-4abd-8c86-e3f7e53a1847'
artifact: 'Windows'
pipeline: 3
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/10.4-enterprise'
downloadPath: $(System.DefaultWorkingDirectory)

- script: |
choco install jdk8 -ia "INSTALLDIR=""c:\java"""
Get-EnvironmentVariable -Name 'JAVA_HOME' -Scope 'Machine'
choco install maven
rem type C:\ProgramData\chocolatey\logs\chocolatey.log
displayName: 'install java + maven'
- script: |
dir $(System.DefaultWorkingDirectory)\win_build\
for /f %%a in ('dir /B $(System.DefaultWorkingDirectory)\win_build\mariadb-enterprise-10.*-winx64.msi') do set servername=$(System.DefaultWorkingDirectory)\win_build\%%a
echo %servername%
msiexec /i %servername% INSTALLDIR=c:\projects\server SERVICENAME=mariadb ALLOWREMOTEROOTACCESS=true /qn
c:\projects\server\bin\mysql.exe -e "create database testj" --user=root
c:\projects\server\bin\mysql.exe -e "GRANT ALL on *.* to 'someUser'@'%' identified by 'Passw@rd2' with grant option;" --user=root
displayName: 'install server'
- script: |
echo 127.0.0.1 mariadb.example.com >> %WINDIR%\System32\Drivers\Etc\Hosts
displayName: 'set hostname'
- script: |
set JAVA_HOME=C:\java\
set PATH=%PATH%;%JAVA_HOME%\bin
java -version
rem search maven version
dir /B C:\ProgramData\chocolatey\lib\maven\apache-maven-*.*.* | findstr /x apache-maven-[0-9]\.[0-9]\.[0-9] > mavenversion.txt
set /p mavenversion= < mavenversion.txt
echo %mavenversion%
C:\ProgramData\chocolatey\lib\maven\%mavenversion%\bin\mvn clean test -DdbUrl="jdbc:mariadb://mariadb.example.com:3306/testj?user=someUser&password=Passw@rd2" -DkeystorePath="$(System.DefaultWorkingDirectory)/tmp/client-keystore.jks" -DkeystorePassword="kspass" -DserverCertificatePath="$(System.DefaultWorkingDirectory)/tmp/server.crt" -Dkeystore2Path="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.jks" -Dkeystore2Password="kspass" -DkeyPassword="kspasskey" -Dkeystore2PathP12="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.p12" -DrunLongTest=false
if %ERRORLEVEL% EQU 0 (
echo Success
) else (
echo exit code is %errorlevel%
exit /b %errorlevel%
)
displayName: 'run tests'
- job: RunInContainer
pool:
vmImage: 'ubuntu-16.04'
displayName: 'test ubuntu bionic'
dependsOn:
- SSLFiles
strategy:
matrix:
ubuntu-1804:
containerImage: ubuntu-1804
containerName: bionic

container: $[variables['containerImage']]

steps:

- task: DownloadPipelineArtifact@2
inputs:
artifactName: ssl_certs
targetPath: $(System.DefaultWorkingDirectory)

- script: /tmp/docker exec -t -u 0 $(containerImage) sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: 'Set up sudo'

- task: DownloadPipelineArtifact@2
displayName: 'Download 10.4 enterprise server artifact files'
inputs:
source: 'specific'
project: '550599d3-6165-4abd-8c86-e3f7e53a1847'
artifact: '$(containerImage)'
pipeline: 3
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/10.4-enterprise'
downloadPath: $(System.DefaultWorkingDirectory)

- task: DownloadPipelineArtifact@2
displayName: 'Download galera server artifact files'
inputs:
source: 'specific'
project: '550599d3-6165-4abd-8c86-e3f7e53a1847'
artifact: $(containerImage)
runVersion: 'latestFromBranch'
pipeline: 2
runBranch: 'refs/heads/es-mariadb-4.x'
downloadPath: $(System.DefaultWorkingDirectory)

- script: |
sudo apt install -y default-jdk
sudo apt install -y maven
mvn -version
java -version
displayName: 'Install java + maven'
- script: |
tar xf mariadb-enterprise*
sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
sudo apt-get update && sudo apt-get install -y --no-install-recommends apt-transport-https ca-certificates tzdata pwgen
export DEBIAN_FRONTEND="noninteractive"
sudo debconf-set-selections <<< "mariadb-server-10.4 mysql-server/root_password password P4ssw@rd"
sudo debconf-set-selections <<< "mariadb-server-10.4 mysql-server/root_password_again password P4ssw@rd"
sudo apt-get update -y
sudo apt-get install --allow-unauthenticated -f -y libaio1 libaio-dev libxml2 libcurl4 curl libc-dev linux-libc-dev libc-dev-bin libdbi-perl rsync socat libnuma1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 gawk lsof psmisc perl libreadline5
cd mariadb-enterprise*/
sudo groupadd mysql
sudo useradd -g mysql mysql
export PROJ_PATH=`pwd`
echo $PROJ_PATH
cat <<EOT >> my.cnf
[mysqld]
port=3306
max_allowed_packet=16M
datadir=$PROJ_PATH/data
socket=/tmp/mysql.sock
user=mysql
ssl-ca=$(System.DefaultWorkingDirectory)/tmp/ca.crt
ssl-cert=$(System.DefaultWorkingDirectory)/tmp/server.crt
ssl-key=$(System.DefaultWorkingDirectory)/tmp/server.key
EOT
sudo chown mysql $PROJ_PATH/my.cnf
sudo tail -n 5000 $PROJ_PATH/my.cnf
sudo chmod 777 $PROJ_PATH
sudo ln -s $PROJ_PATH /usr/local/mysql
sudo ./scripts/mysql_install_db --defaults-file=$PROJ_PATH/my.cnf --user=mysql
sudo chown -R root .
sudo chown -R mysql data
export PATH=$PATH:$PROJ_PATH/bin/
env:
WORKING_DIR: $(System.DefaultWorkingDirectory)
displayName: 'install server'
- script: |
cd mariadb-enterprise*/
sudo ./bin/mysqld --defaults-file=./my.cnf &
for i in {30..0}; do
if sudo ./bin/mysql -e "SELECT 1" &> /dev/null; then
echo 'MySQL connected...'
break
fi
echo 'MySQL init process in progress...'
sleep 1
done
if [ "$i" = 0 ]; then
echo >&2 'MySQL init process failed.'
sudo ./bin/mysql -e "SELECT 1"
exit 1
fi
sudo ./bin/mysql -e "CREATE USER 'someUser'@'%' identified by 'Passw@rd2';"
sudo ./bin/mysql -e "GRANT ALL on *.* to 'someUser'@'%' identified by 'Passw@rd2' with grant option;"
sudo ./bin/mysql -e "CREATE DATABASE testj;"
cd ..
/usr/share/maven/bin/mvn clean test -DdbUrl="jdbc:mariadb://mariadb.example.com:3306/testj?user=someUser&password=Passw@rd2" -DkeystorePath="$(System.DefaultWorkingDirectory)/tmp/client-keystore.jks" -DkeystorePassword="kspass" -DserverCertificatePath="$(System.DefaultWorkingDirectory)/tmp/server.crt" -Dkeystore2Path="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.jks" -Dkeystore2Password="kspass" -DkeyPassword="kspasskey" -Dkeystore2PathP12="$(System.DefaultWorkingDirectory)/tmp/fullclient-keystore.p12" -DrunLongTest=false
if [ $? -ne 0 ]; then
exit 1
fi
cd mariadb-enterprise*/
sudo ./bin/mysqladmin shutdown
env:
JAVA_HOME: "/usr/lib/jvm/default-java"
MAVEN_HOME: "/opt/maven"
displayName: 'run tests'
@@ -1,4 +1,11 @@

== 2.4.3 - Released on 02 Jul. 2019

* [CONJ-717] conversion function support for other data type than default MariaDB conversion type
* [CONJ-722] Permit suppression of result-set metadata getTableName for oracle compatibility
* [CONJ-719] Saving values using Java 8 LocalTime does not store fractional parts of seconds
* [CONJ-716] Correcting possible NPE on non thread safe NumberFormat (logging)
== 2.4.2 - Released on 17 Jun. 2019

Security
@@ -187,6 +187,7 @@ See [[use-mariadb-connector-j-driver.creole#using-pooling|using pooling]] for mo
|=useAffectedRows|default correspond to the JDBC standard, reporting real affected rows. if enable, will report "affected" rows. example : if enable, an update command that doesn't change a row value will still be "affected", then report.\\//Default: false. Since 2.2.6//
|=includeInnodbStatusInDeadlockExceptions|add "SHOW ENGINE INNODB STATUS" result to exception trace when having a deadlock exception\\//Default: false. Since 2.3.0//
|=includeThreadDumpInDeadlockExceptions|add thread dump to exception trace when having a deadlock exception\\//Default: false. Since 2.3.0//
|=blankTableNameMeta|Result-set metadata getTableName always return blank. This option is mainly for ORACLE db compatibility\\//Default: false. Since 2.4.3//

\\\\
== Failover/High availability URL parameters
@@ -58,7 +58,7 @@
<artifactId>mariadb-java-client</artifactId>
<packaging>jar</packaging>
<name>mariadb-java-client</name>
<version>2.4.2</version>
<version>2.4.3</version>
<description>JDBC driver for MariaDB and MySQL</description>
<url>https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/</url>

@@ -71,7 +71,7 @@
<checkstyle.plugin.version>2.17</checkstyle.plugin.version>
<driver.version.major>2</driver.version.major>
<driver.version.minor>4</driver.version.minor>
<driver.version.patch>2</driver.version.patch>
<driver.version.patch>3</driver.version.patch>
<driver.version.qualifier></driver.version.qualifier>
</properties>

0 comments on commit af9d9cc

Please sign in to comment.
You can’t perform that action at this time.