Fix select without from in old versions of MySQL and MariaDB
This commit is contained in:
parent
7b308d048f
commit
73da49626d
|
@ -221,6 +221,16 @@ public class MariaDBLegacySqlAstTranslator<T extends JdbcOperation> extends Abst
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFromDual() {
|
||||
return " from dual";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFromDualForSelectOnly() {
|
||||
return getDialect().getVersion().isBefore( 10, 4 ) ? getFromDual() : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public MariaDBLegacyDialect getDialect() {
|
||||
return this.dialect;
|
||||
|
|
|
@ -238,6 +238,11 @@ public class MySQLLegacySqlAstTranslator<T extends JdbcOperation> extends Abstra
|
|||
return " from dual";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFromDualForSelectOnly() {
|
||||
return getDialect().getVersion().isBefore( 5, 7 ) ? getFromDual() : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public MySQLDialect getDialect() {
|
||||
return (MySQLDialect) super.getDialect();
|
||||
|
|
|
@ -215,6 +215,16 @@ public class MariaDBSqlAstTranslator<T extends JdbcOperation> extends AbstractSq
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFromDual() {
|
||||
return " from dual";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFromDualForSelectOnly() {
|
||||
return getDialect().getVersion().isBefore( 10, 4 ) ? getFromDual() : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public MariaDBDialect getDialect() {
|
||||
return this.dialect;
|
||||
|
|
|
@ -274,6 +274,11 @@ public class MySQLSqlAstTranslator<T extends JdbcOperation> extends AbstractSqlA
|
|||
return " from dual";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFromDualForSelectOnly() {
|
||||
return getDialect().getVersion().isBefore( 5, 7 ) ? getFromDual() : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public MySQLDialect getDialect() {
|
||||
return (MySQLDialect) super.getDialect();
|
||||
|
|
Loading…
Reference in New Issue