[jOOQ/jOOQ#11641] MySQL and MariaDB SPLIT_PART
This commit is contained in:
parent
5acd6374e1
commit
ed1167c84f
@ -299,6 +299,7 @@ final class Names {
|
||||
static final Name N_STRREVERSE = unquotedName("strreverse");
|
||||
static final Name N_SUBSTR = unquotedName("substr");
|
||||
static final Name N_SUBSTRING = unquotedName("substring");
|
||||
static final Name N_SUBSTRING_INDEX = unquotedName("substring_index");
|
||||
static final Name N_SYSTEM_RANGE = unquotedName("system_range");
|
||||
static final Name N_SYSTEM_TIME = unquotedName("system_time");
|
||||
static final Name N_SYS_CONNECT_BY_PATH = unquotedName("sys_connect_by_path");
|
||||
|
||||
@ -108,8 +108,21 @@ extends
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case MARIADB:
|
||||
case MYSQL: {
|
||||
case MYSQL:
|
||||
ctx.visit(DSL.substring(
|
||||
function(N_SUBSTRING_INDEX, VARCHAR, string, delimiter, n),
|
||||
case_((Field) n).when(one(), one()).else_(
|
||||
DSL.length(function(N_SUBSTRING_INDEX, VARCHAR, string, delimiter, n.minus(one())))
|
||||
.plus(DSL.length(delimiter))
|
||||
.plus(one())
|
||||
)
|
||||
));
|
||||
break;
|
||||
|
||||
case HSQLDB: {
|
||||
Field<String> rS = DSL.field(name("s"), String.class);
|
||||
Field<Integer> rN = DSL.field(name("n"), int.class);
|
||||
Field<String> rD = DSL.field(name("d"), String.class);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user