Fix for SELECT_JSON_ARR generates incorrect order by, limit and offset clauses for mariadb.

This commit is contained in:
go-jet 2026-01-16 14:11:22 +01:00
parent adef2f9b1a
commit 7d4aa4cdab
4 changed files with 168 additions and 48 deletions

View file

@ -190,6 +190,10 @@ type ClauseOrderBy struct {
SkipNewLine bool
}
func (o *ClauseOrderBy) serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
o.Serialize(statementType, out, options...)
}
// Serialize serializes clause into SQLBuilder
func (o *ClauseOrderBy) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
if o.List == nil {
@ -219,6 +223,10 @@ type ClauseLimit struct {
Count int64
}
func (o *ClauseLimit) serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
o.Serialize(statementType, out, options...)
}
// Serialize serializes clause into SQLBuilder
func (l *ClauseLimit) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
if l.Count >= 0 {
@ -233,6 +241,10 @@ type ClauseOffset struct {
Count IntegerExpression
}
func (o *ClauseOffset) serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
o.Serialize(statementType, out, options...)
}
// Serialize serializes clause into SQLBuilder
func (o *ClauseOffset) Serialize(statementType StatementType, out *SQLBuilder, options ...SerializeOption) {
if is.Nil(o.Count) {