Skip to content

Commit

Permalink
Bump version to flyway-9.22.2
Browse files Browse the repository at this point in the history
Please see the GH release for the release notes

Closes #3741: update mariadb-java-client to 2.7.10

improve parsing of statements containing multiple sets of parentheses

add support for mariadb 10.11

Closes #3731, Closes #3730: Make SLF4J detection also work with SLF4J 2.0

Update readmes copyright dates. Closes #3739
  • Loading branch information
tjs145 committed Sep 21, 2023
1 parent bc8a10e commit ec476a7
Show file tree
Hide file tree
Showing 27 changed files with 102 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -30,7 +30,7 @@ Flyway is brought to you by [Redgate](https://www.red-gate.com/) with the help o
Please visit our [contribution page](https://documentation.red-gate.com/fd/contribute-184127449.html) to find out how you can contribute in various ways to the project.

## License
Copyright © [Red Gate Software Ltd](http://www.red-gate.com) 2010-2022
Copyright © [Red Gate Software Ltd](http://www.red-gate.com) 2010-2023

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Expand Up @@ -5,7 +5,7 @@ redirect_from: /documentation/upgradingToTeams/

# Upgrading to Flyway Teams or Enterprise

This article assumes you are a proud owner of a Flyway Teams / Enterprise license. If you are not, head over to [Redgate Products Trial](https://www.red-gate.com/products/flyway/trial) to start a free trial.
This article assumes you are a proud owner of a Flyway Teams / Enterprise license. If you are not, head over to [Redgate Products Trial](https://www.red-gate.com/products/flyway/enterprise/trial) to start a free trial.

## Upgrading from Community

Expand Down
Expand Up @@ -5,6 +5,7 @@ subtitle: MariaDB

## Supported Versions

- `10.11`
- `10.10`
- `10.6`
- `10.5`
Expand Down
Expand Up @@ -25,6 +25,40 @@
</div>
<div class="col-md-9">

<div class="release">
<h2 id="9.22.2">Flyway 9.22.2 (2023-09-21)</h2>

<h3>Bug fixes</h3>
<ul>
<li>Fixed configuration disclosure in extended debug output. CVE-2023-43564</li>
<li>improve parsing of 'ACCESSIBLE BY' clauses in Oracle</li>
<li>Fix parsing issue caused by statements containing multiple sets of parentheses.</li>
<li>
<a href="https://github.com/flyway/flyway/issues/3730">Issue 3730</a>
Make SLF4J detection also work with SLF4J 2.0
</li>
</ul>

<h3>Changes</h3>
<ul>
<li>Enhance Comparison engine error output</li>
</ul>

<h3>Database compatibility</h3>
<ul>
<li>Flyway now supports MariaDB version 10.11</li>
</ul>

<h3>Java compatibility</h3>
<ul>
<li>update mariadb-java-client to 2.7.10 to resolve CONJ-1091</li>
</ul>

<p>
Thanks to hho for reporting these issues.
</p>
</div>

<div class="release">
<h2 id="9.22.1">Flyway 9.22.1 (2023-09-12)</h2>

Expand Down
2 changes: 1 addition & 1 deletion documentation/_config.yml
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

flywayVersion: 9.22.1
flywayVersion: 9.22.2
enterpriseUrl: https://download.red-gate.com/maven/release/org/flywaydb/enterprise
kramdown:
smart_quotes: ["apos", "apos", "quot", "quot"]
Expand Down
4 changes: 2 additions & 2 deletions flyway-commandline/pom.xml
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<artifactId>flyway-commandline</artifactId>
<packaging>jar</packaging>
Expand All @@ -30,7 +30,7 @@



<flyway-gcp-spanner.version>9.22.1-beta</flyway-gcp-spanner.version>
<flyway-gcp-spanner.version>9.22.2-beta</flyway-gcp-spanner.version>
<jre.version>17.0.8.1</jre.version>
</properties>
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion flyway-community-db-support/pom.xml
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion flyway-core/pom.xml
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<artifactId>flyway-core</artifactId>
<packaging>jar</packaging>
Expand Down
Expand Up @@ -635,21 +635,27 @@ public static void dumpConfigurationModel(ConfigurationModel config) {
public static void dumpConfigurationMap(Map<String, String> config) {
if (LOG.isDebugEnabled()) {
LOG.debug("Using configuration:");
for (Map.Entry<String, String> entry : new TreeMap<>(config).entrySet()) {
String key = entry.getKey();
String value = entry.getValue();

if (key.toLowerCase().endsWith("password")) {
value = StringUtils.trimOrPad("", value.length(), '*');
} else if (ConfigUtils.LICENSE_KEY.equals(key)) {
value = value.substring(0, 8) + "******" + value.substring(value.length() - 4);
} else if (ConfigUtils.URL.equals(key) || (key.startsWith("environments.") && key.endsWith(".url"))) {
value = DatabaseTypeRegister.redactJdbcUrl(value);
}
LOG.debug(getConfigMapDump(config));
}
}

LOG.debug(key + " -> " + value);
static String getConfigMapDump(Map<String, String> config) {
StringBuilder dump = new StringBuilder();
for (Map.Entry<String, String> entry : new TreeMap<>(config).entrySet()) {
String key = entry.getKey();
String value = entry.getValue();

if (key.toLowerCase().endsWith("password") || key.toLowerCase().endsWith("token")) {
value = StringUtils.trimOrPad("", value.length(), '*');
} else if (ConfigUtils.LICENSE_KEY.equals(key)) {
value = value.substring(0, 8) + "******" + value.substring(value.length() - 4);
} else if (key.toLowerCase().endsWith("url")) {
value = DatabaseTypeRegister.redactJdbcUrl(value);
}

dump.append(key).append(" -> ").append(value).append("\n");
}
return dump.toString();
}

/**
Expand Down
Expand Up @@ -20,6 +20,7 @@
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.ExtensionMethod;
import org.flywaydb.core.internal.util.ClassUtils;
import org.flywaydb.core.internal.util.MergeUtils;
import org.flywaydb.core.internal.util.StringUtils;

Expand Down Expand Up @@ -94,6 +95,7 @@ public class FlywayModel {
private Map<String, PropertyResolver> propertyResolvers;
private Boolean reportEnabled;
@JsonAnySetter
@Getter(onMethod = @__(@ClassUtils.DoNotMapForLogging))
private Map<String,Object> pluginConfigurations = new HashMap<>();

public static FlywayModel defaults(){
Expand Down
Expand Up @@ -28,7 +28,7 @@ public class SnowflakeParser extends Parser {
private static final String ALTERNATIVE_QUOTE_SCRIPT = "DECLARE";
private static final List<String> CONDITIONALLY_CREATABLE_OBJECTS = Arrays.asList(
"COLUMN", "CONNECTION", "CONSTRAINT", "DATABASE", "FORMAT", "FUNCTION", "GROUP", "INDEX", "INTEGRATION", "PIPE", "POLICY", "PROCEDURE", "ROLE",
"SCHEMA", "SEQUENCE", "STAGE", "STREAM", "TABLE", "TAG", "TASK", "USER", "VIEW", "WAREHOUSE"
"SCHEMA", "SEQUENCE", "STAGE", "STREAM", "TABLE", "TAG", "TASK", "USER", "VIEW", "WAREHOUSE", "MONITOR"
);

public SnowflakeParser(Configuration configuration, ParsingContext parsingContext) {
Expand Down
Expand Up @@ -364,10 +364,13 @@ protected static Token getPreviousToken(List<Token> tokens, int parensDepth) {
for (int i = tokens.size() - 1; i >= 0; i--) {
Token previousToken = tokens.get(i);

// Only consider tokens at the same parenthesis depth
if (previousToken.getParensDepth() != parensDepth) {
// Only consider tokens at the same parenthesis depth in same parenthesis group
if (previousToken.getParensDepth() < parensDepth) {
break;
} else if (previousToken.getParensDepth() != parensDepth) {
continue;
}

// Skip over comments and blank lines
if (previousToken.getType() == TokenType.COMMENT || previousToken.getType() == TokenType.BLANK_LINES) {
continue;
Expand Down
Expand Up @@ -17,11 +17,14 @@

import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.Synchronized;
import org.flywaydb.core.api.FlywayException;

import java.beans.Expression;
import java.io.File;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
Expand Down Expand Up @@ -242,7 +245,7 @@ public static String getStaticFieldValue(String className, String fieldName, Cla

public static Map<String, String> getGettableFieldValues(Object obj, String prefix) {
Map<String, String> fieldValues = new TreeMap<>();
for (Method method : Arrays.stream(obj.getClass().getDeclaredMethods()).filter(m -> m.getName().startsWith("get")).collect(Collectors.toList())) {
for (Method method : Arrays.stream(obj.getClass().getDeclaredMethods()).filter(m -> m.getName().startsWith("get") && Arrays.stream(m.getAnnotations()).noneMatch(a -> a instanceof DoNotMapForLogging)).collect(Collectors.toList())) {
try {
method.setAccessible(true);
String name = method.getName().substring(3,4).toLowerCase() + method.getName().substring(4);
Expand All @@ -251,4 +254,9 @@ public static Map<String, String> getGettableFieldValues(Object obj, String pref
}
return fieldValues;
}

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface DoNotMapForLogging {
}
}
Expand Up @@ -58,13 +58,11 @@ public boolean isSlf4jAvailable() {
// provide any implementation, causing SLF4J to drop what we want to be console output on the floor.
// Versions up to 1.7 have a StaticLoggerBinder
slf4jAvailable = ClassUtils.isPresent("org.slf4j.Logger", classLoader)
&& ClassUtils.isPresent("org.slf4j.impl.StaticLoggerBinder", classLoader);
&& ClassUtils.isPresent("org.slf4j.impl.StaticLoggerBinder", classLoader)
&& !StreamSupport.stream(ServiceLoader.load(org.slf4j.Logger.class, classLoader)
.spliterator(), false).allMatch(logger -> logger instanceof org.slf4j.helpers.NOPLogger);
// Versions 1.8 and later use a ServiceLocator to bind to the implementation
slf4jAvailable |= ClassUtils.isImplementationPresent("org.slf4j.spi.SLF4JServiceProvider", classLoader);
if(slf4jAvailable) {
slf4jAvailable = !StreamSupport.stream(ServiceLoader.load(org.slf4j.Logger.class, classLoader).spliterator(),false)
.allMatch(logger -> logger instanceof org.slf4j.helpers.NOPLogger);
}
}

return slf4jAvailable;
Expand Down
Expand Up @@ -105,6 +105,10 @@ public static Object parseJsonArray(String json) {
return JsonParser.parseString(json).getAsJsonArray();
}

public static <T> T parseJson(String json, Class<T> clazz) {
return getGson().fromJson(json, clazz);
}

public static String prettyPrint(String json) {
String output;
try {
Expand All @@ -114,8 +118,8 @@ public static String prettyPrint(String json) {
} catch (Exception ignore) {
output = json;
}
output = output.replace("\\r\\n", "\n");
output = output.replace("\\n", "\n");
output = output.replace("\\r\\n", System.lineSeparator());
output = output.replace("\\n", System.lineSeparator());
return output;
}
}
2 changes: 1 addition & 1 deletion flyway-database-oracle/pom.xml
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>

<artifactId>flyway-database-oracle</artifactId>
Expand Down
Expand Up @@ -71,7 +71,7 @@ public class OracleParser extends Parser {


// accessible by ( keyword<space>optionalidentifier )
private static final String ACCESSIBLE_BY_REGEX = "ACCESSIBLE\\sBY\\s\\(?((FUNCTION|PROCEDURE|PACKAGE|TRIGGER|TYPE)\\s[^\\s]*\\s?+)*\\)?";
private static final String ACCESSIBLE_BY_REGEX = "ACCESSIBLE\\sBY\\s\\(?(((FUNCTION|PROCEDURE|PACKAGE|TRIGGER|TYPE)\\s)?[^\\s]*\\s?+)*\\)?";

private static final Pattern PLSQL_TYPE_BODY_REGEX = Pattern.compile(
"^CREATE(\\sOR\\sREPLACE)?(\\s(NON)?EDITIONABLE)?\\sTYPE\\sBODY\\s([^\\s]*\\s)?(IS|AS)");
Expand Down
2 changes: 1 addition & 1 deletion flyway-firebird/pom.xml
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>flyway-parent</artifactId>
<groupId>org.flywaydb</groupId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions flyway-gcp-bigquery/pom.xml
Expand Up @@ -21,14 +21,14 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>flyway-gcp-bigquery</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<version>9.22.1</version>
<version>9.22.2</version>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions flyway-gcp-spanner/pom.xml
Expand Up @@ -21,14 +21,14 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>flyway-gcp-spanner</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<version>9.22.1-beta</version>
<version>9.22.2-beta</version>

<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion flyway-gradle-plugin/pom.xml
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<artifactId>flyway-gradle-plugin</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion flyway-maven-plugin/pom.xml
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<artifactId>flyway-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion flyway-mysql/pom.xml
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>flyway-parent</artifactId>
<groupId>org.flywaydb</groupId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Expand Up @@ -276,7 +276,7 @@ public final void ensureSupported() {

ensureDatabaseNotOlderThanOtherwiseRecommendUpgradeToFlywayEdition("10.3", org.flywaydb.core.internal.license.Edition.ENTERPRISE);

recommendFlywayUpgradeIfNecessary("10.10");
recommendFlywayUpgradeIfNecessary("10.11");
} else {

ensureDatabaseNotOlderThanOtherwiseRecommendUpgradeToFlywayEdition("8.0", org.flywaydb.core.internal.license.Edition.ENTERPRISE);
Expand Down
2 changes: 1 addition & 1 deletion flyway-singlestore/pom.xml
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion flyway-sqlserver/pom.xml
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.22.1</version>
<version>9.22.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

0 comments on commit ec476a7

Please sign in to comment.