diff --git a/pkg/frontend/mysql_cmd_executor.go b/pkg/frontend/mysql_cmd_executor.go index 1133dc620e4b9..fd61fa8d3f149 100644 --- a/pkg/frontend/mysql_cmd_executor.go +++ b/pkg/frontend/mysql_cmd_executor.go @@ -1224,7 +1224,19 @@ func doDeallocate(ses *Session, execCtx *ExecCtx, st *tree.Deallocate) error { return nil } -func doReset(_ context.Context, _ *Session, _ *tree.Reset) error { +func doReset(ctx context.Context, ses *Session, st *tree.Reset) error { + if ses == nil || st == nil { + return nil + } + stmtName := string(st.Name) + if stmtName == "" { + return nil + } + preStmt, ok := ses.prepareStmts[stmtName] + if !ok || preStmt == nil { + return nil + } + preStmt.resetBinaryParamState() return nil } @@ -3382,6 +3394,9 @@ func ExecRequest(ses *Session, execCtx *ExecCtx, req *Request) (resp *Response, var prepareStmt *PrepareStmt sql, prepareStmt, err = parseStmtExecute(execCtx.reqCtx, ses, req.GetData().([]byte)) if err != nil { + if prepareStmt != nil { + prepareStmt.clearBinaryParamState(ses.GetProc()) + } return NewGeneralErrorResponse(COM_STMT_EXECUTE, ses.GetTxnHandler().GetServerStatus(), err), nil } execCtx.prepareColDef = prepareStmt.ColDefData @@ -3389,12 +3404,7 @@ func ExecRequest(ses *Session, execCtx *ExecCtx, req *Request) (resp *Response, if err != nil { resp = NewGeneralErrorResponse(COM_STMT_EXECUTE, ses.GetTxnHandler().GetServerStatus(), err) } - if prepareStmt.params != nil { - prepareStmt.params.GetNulls().Reset() - for k := range prepareStmt.getFromSendLongData { - delete(prepareStmt.getFromSendLongData, k) - } - } + prepareStmt.clearBinaryParamState(ses.GetProc()) return resp, nil case COM_STMT_SEND_LONG_DATA: @@ -3414,6 +3424,7 @@ func ExecRequest(ses *Session, execCtx *ExecCtx, req *Request) (resp *Response, preStmt, err = ses.GetPrepareStmt(execCtx.reqCtx, stmtName) if err != nil { resp = NewGeneralErrorResponse(COM_STMT_CLOSE, ses.GetTxnHandler().GetServerStatus(), err) + return resp, nil } prefix := "" if preStmt.IsCloudNonuser { @@ -3435,7 +3446,8 @@ func ExecRequest(ses *Session, execCtx *ExecCtx, req *Request) (resp *Response, var preStmt *PrepareStmt preStmt, err = ses.GetPrepareStmt(execCtx.reqCtx, stmtName) if err != nil { - resp = NewGeneralErrorResponse(COM_STMT_CLOSE, ses.GetTxnHandler().GetServerStatus(), err) + resp = NewGeneralErrorResponse(COM_STMT_RESET, ses.GetTxnHandler().GetServerStatus(), err) + return resp, nil } prefix := "" if preStmt.IsCloudNonuser { @@ -3487,7 +3499,7 @@ func parseStmtExecute(reqCtx context.Context, ses *Session, data []byte) (string ses.Debug(reqCtx, "query trace", logutil.QueryField(sql)) err = ses.GetResponser().MysqlRrWr().ParseExecuteData(reqCtx, ses.GetProc(), preStmt, data, pos) if err != nil { - return "", nil, err + return "", preStmt, err } return sql, preStmt, nil } diff --git a/pkg/frontend/mysql_cmd_executor_test.go b/pkg/frontend/mysql_cmd_executor_test.go index 5584bb213e91b..a30bbd4cfa6d5 100644 --- a/pkg/frontend/mysql_cmd_executor_test.go +++ b/pkg/frontend/mysql_cmd_executor_test.go @@ -16,6 +16,7 @@ package frontend import ( "context" + "encoding/binary" "fmt" "io" "sync/atomic" @@ -857,6 +858,110 @@ func Test_HandleDeallocate(t *testing.T) { }) } +func Test_doResetClearsPreparedBinaryState(t *testing.T) { + ctx := context.TODO() + ses := &Session{ + prepareStmts: make(map[string]*PrepareStmt), + } + proc := testutil.NewProc(t) + params := vector.NewVec(types.T_text.ToType()) + require.NoError(t, vector.AppendBytes(params, []byte("long-data"), false, proc.Mp())) + params.GetNulls().Set(0) + + stmtName := "stmt1" + prepareStmt := &PrepareStmt{ + Name: stmtName, + proc: proc, + params: params, + getFromSendLongData: map[int]struct{}{0: {}}, + } + defer prepareStmt.Close() + ses.prepareStmts[stmtName] = prepareStmt + + require.NoError(t, doReset(ctx, ses, tree.NewReset(tree.Identifier(stmtName)))) + require.False(t, prepareStmt.params.GetNulls().Any()) + require.Empty(t, prepareStmt.getFromSendLongData) +} + +func Test_ExecRequestPrepareCommandMissingStmt(t *testing.T) { + ctx := context.TODO() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + for _, tc := range []struct { + name string + cmd CommandType + }{ + {name: "close", cmd: COM_STMT_CLOSE}, + {name: "reset", cmd: COM_STMT_RESET}, + } { + t.Run(tc.name, func(t *testing.T) { + ses := newTestSession(t, ctrl) + ec := newTestExecCtx(ctx, ctrl) + stmtID := uint32(123) + data := make([]byte, 4) + binary.LittleEndian.PutUint32(data, stmtID) + + resp, err := ExecRequest(ses, ec, &Request{cmd: tc.cmd, data: data}) + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, ErrorResponse, resp.category) + require.Equal(t, int(tc.cmd), resp.cmd) + require.Error(t, resp.GetData().(error)) + }) + } +} + +func Test_ExecRequestStmtExecuteErrorClearsPreparedBinaryState(t *testing.T) { + ctx := context.TODO() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + ses := newTestSession(t, ctrl) + ec := newTestExecCtx(ctx, ctrl) + stmtID := uint32(321) + stmtName := getPrepareStmtName(stmtID) + st := tree.NewPrepareString(tree.Identifier(stmtName), "select ?, ?") + stmts, err := mysql.Parse(ctx, st.Sql, 1) + require.NoError(t, err) + compCtx := plan.NewEmptyCompilerContext() + preparePlan, err := buildPlan(ctx, nil, compCtx, st) + require.NoError(t, err) + + proc := ses.GetProc() + params := vector.NewVec(types.T_text.ToType()) + require.NoError(t, vector.AppendBytes(params, []byte("leftover"), false, proc.Mp())) + require.NoError(t, vector.AppendBytes(params, []byte("leftover"), false, proc.Mp())) + params.GetNulls().Set(1) + + prepareStmt := &PrepareStmt{ + Name: stmtName, + PreparePlan: preparePlan, + PrepareStmt: stmts[0], + proc: proc, + params: params, + getFromSendLongData: map[int]struct{}{0: {}}, + } + defer prepareStmt.Close() + require.NoError(t, ses.SetPrepareStmt(ctx, stmtName, prepareStmt)) + + data := make([]byte, 0, 10) + buf := make([]byte, 4) + binary.LittleEndian.PutUint32(buf, stmtID) + data = append(data, buf...) + data = append(data, 0) // flag + data = append(data, 0, 0, 0, 0) // iteration-count + data = append(data, 0) // null bitmap + data = append(data, 0) // use existing ParamTypes, which are empty + + resp, err := ExecRequest(ses, ec, &Request{cmd: COM_STMT_EXECUTE, data: data}) + require.NoError(t, err) + require.NotNil(t, resp) + require.Equal(t, ErrorResponse, resp.category) + require.Nil(t, prepareStmt.params) + require.Empty(t, prepareStmt.getFromSendLongData) +} + func Test_CMD_FIELD_LIST(t *testing.T) { ctx := defines.AttachAccountId(context.TODO(), catalog.System_Account) convey.Convey("cmd field list", t, func() { @@ -1658,6 +1763,49 @@ func Test_unsupportedCommand(t *testing.T) { assert.Equal(t, "internal error: unsupported command. 0x0", respErr.Error()) } +func Test_ExecRequestStmtExecuteErrorClearsPreparedParamState(t *testing.T) { + ctx := context.TODO() + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + ses := newTestSession(t, ctrl) + execCtx := &ExecCtx{ + ses: ses, + reqCtx: ctx, + } + + st := tree.NewPrepareString(tree.Identifier(getPrepareStmtName(1)), "select ?") + stmts, err := mysql.Parse(ctx, st.Sql, 1) + require.NoError(t, err) + + compCtx := plan.NewEmptyCompilerContext() + preparePlan, err := buildPlan(ctx, nil, compCtx, st) + require.NoError(t, err) + + prepareStmt := &PrepareStmt{ + Name: preparePlan.GetDcl().GetPrepare().GetName(), + PreparePlan: preparePlan, + PrepareStmt: stmts[0], + getFromSendLongData: make(map[int]struct{}), + } + require.NoError(t, ses.SetPrepareStmt(ctx, prepareStmt.Name, prepareStmt)) + + payload := make([]byte, 4) + binary.LittleEndian.PutUint32(payload, 1) + payload = append(payload, 0) // flag + payload = append(payload, 0, 0, 0, 0) // iteration-count + payload = append(payload, 0) // null bitmap + payload = append(payload, 1) // new param bound flag + payload = append(payload, uint8(defines.MYSQL_TYPE_VAR_STRING), 0) + payload = append(payload, 5, 'a', 'b') // truncated lenenc string + + resp, err := ExecRequest(ses, execCtx, &Request{cmd: COM_STMT_EXECUTE, data: payload}) + require.NoError(t, err) + require.NotNil(t, resp) + require.Nil(t, prepareStmt.params) + require.Empty(t, prepareStmt.getFromSendLongData) +} + func Test_panic(t *testing.T) { fault.EnableDomain(fault.DomainFrontend) defer fault.DisableDomain(fault.DomainFrontend) diff --git a/pkg/frontend/mysql_protocol.go b/pkg/frontend/mysql_protocol.go index 5122636ea2972..1d4367194d662 100644 --- a/pkg/frontend/mysql_protocol.go +++ b/pkg/frontend/mysql_protocol.go @@ -77,7 +77,7 @@ const defaultSaltReadTimeout = time.Millisecond * 200 const charsetBinary = 0x3f const charsetVarchar = 0x21 -const boolColumnLength = 12 +const boolColumnLength = 1 func init() { serverVersion.Store("1.3.0") @@ -751,6 +751,7 @@ func (mp *MysqlProtocolImpl) SendPrepareResponse(ctx context.Context, stmt *Prep func (mp *MysqlProtocolImpl) ParseSendLongData(ctx context.Context, proc *process.Process, stmt *PrepareStmt, data []byte, pos int) error { var err error + stmt.proc = proc dcPrepare, ok := stmt.PreparePlan.GetDcl().Control.(*planPb.DataControl_Prepare) if !ok { return moerr.NewInternalError(ctx, "can not get Prepare plan in prepareStmt") @@ -781,12 +782,22 @@ func (mp *MysqlProtocolImpl) ParseSendLongData(ctx context.Context, proc *proces if !ok { return moerr.NewInvalidInput(ctx, "mysql protocol error, malformed packet") } + if stmt.getFromSendLongData == nil { + stmt.getFromSendLongData = make(map[int]struct{}) + } + if _, ok := stmt.getFromSendLongData[int(paramIdx)]; ok { + val = append(append([]byte(nil), stmt.params.GetBytesAt(int(paramIdx))...), val...) + } + if err = util.SetAnyToStringVector(proc, val, stmt.params, int(paramIdx)); err != nil { + return err + } stmt.getFromSendLongData[int(paramIdx)] = struct{}{} - return util.SetAnyToStringVector(proc, val, stmt.params, int(paramIdx)) + return nil } func (mp *MysqlProtocolImpl) ParseExecuteData(ctx context.Context, proc *process.Process, stmt *PrepareStmt, data []byte, pos int) error { var err error + stmt.proc = proc dcPrepare, ok := stmt.PreparePlan.GetDcl().Control.(*planPb.DataControl_Prepare) if !ok { return moerr.NewInternalError(ctx, "can not get Prepare plan in prepareStmt") @@ -826,8 +837,12 @@ func (mp *MysqlProtocolImpl) ParseExecuteData(ctx context.Context, proc *process } // new param bound flag - if data[pos] == 1 { - pos++ + var newParamBoundFlag uint8 + newParamBoundFlag, pos, ok = mp.io.ReadUint8(data, pos) + if !ok { + return moerr.NewInvalidInput(ctx, "mysql protocol error, malformed packet") + } + if newParamBoundFlag == 1 { // Just the first StmtExecute packet contain parameters type, // we need save it for further use. @@ -836,8 +851,6 @@ func (mp *MysqlProtocolImpl) ParseExecuteData(ctx context.Context, proc *process if !ok { return moerr.NewInvalidInput(ctx, "mysql protocol error, malformed packet") } - } else { - pos++ } // get paramters and set value to session variables @@ -958,7 +971,7 @@ func (mp *MysqlProtocolImpl) ParseExecuteData(ctx context.Context, proc *process pos = newPos err = util.SetAnyToStringVector(proc, val, stmt.params, i) - case defines.MYSQL_TYPE_BLOB, defines.MYSQL_TYPE_TINY_BLOB, defines.MYSQL_TYPE_MEDIUM_BLOB, defines.MYSQL_TYPE_LONG_BLOB, defines.MYSQL_TYPE_TEXT: + case defines.MYSQL_TYPE_BLOB, defines.MYSQL_TYPE_TINY_BLOB, defines.MYSQL_TYPE_MEDIUM_BLOB, defines.MYSQL_TYPE_LONG_BLOB, defines.MYSQL_TYPE_TEXT, defines.MYSQL_TYPE_JSON: val, newPos, ok := mp.readStringLenEnc(data, pos) if !ok { return moerr.NewInvalidInput(ctx, "mysql protocol error, malformed packet") @@ -2159,11 +2172,11 @@ func (mp *MysqlProtocolImpl) makeColumnDefinition41Payload(column *MysqlColumn, if column.ColumnType() == defines.MYSQL_TYPE_BOOL { //int<2> character set - pos = mp.io.WriteUint16(data, pos, charsetVarchar) + pos = mp.io.WriteUint16(data, pos, charsetBinary) //int<4> column length pos = mp.io.WriteUint32(data, pos, boolColumnLength) //int<1> type - pos = mp.io.WriteUint8(data, pos, uint8(defines.MYSQL_TYPE_VARCHAR)) + pos = mp.io.WriteUint8(data, pos, uint8(defines.MYSQL_TYPE_TINY)) } else { //int<2> character set pos = mp.io.WriteUint16(data, pos, column.Charset()) @@ -2334,10 +2347,10 @@ func (mp *MysqlProtocolImpl) appendResultSetBinaryRow(mrs *MysqlResultSet, rowId switch mysqlColumn.ColumnType() { case defines.MYSQL_TYPE_BOOL: - if value, err := mrs.GetString(mp.ctx, rowIdx, i); err != nil { + if value, err := mrs.GetInt64(mp.ctx, rowIdx, i); err != nil { return err } else { - err = mp.appendStringLenEnc(value) + err = mp.appendUint8(uint8(value)) if err != nil { return err } @@ -2558,10 +2571,10 @@ func (mp *MysqlProtocolImpl) appendResultSetTextRow(mrs *MysqlResultSet, r uint6 switch mysqlColumn.ColumnType() { case defines.MYSQL_TYPE_BOOL: - if value, err2 := mrs.GetString(mp.ctx, r, i); err2 != nil { + if value, err2 := mrs.GetInt64(mp.ctx, r, i); err2 != nil { return err2 } else { - err = mp.appendStringLenEnc(value) + err = mp.appendStringLenEncOfInt64(value) if err != nil { return err } @@ -2708,35 +2721,90 @@ func (mp *MysqlProtocolImpl) appendResultSetTextRow(mrs *MysqlResultSet, r uint6 if value, err2 := mrs.GetValue(mp.ctx, r, i); err2 != nil { return err2 } else { - mp.dateEncBuffer = value.(types.Date).ToBytes(mp.dateEncBuffer[:0]) - err = mp.appendCountOfBytesLenEnc(mp.dateEncBuffer[:types.DateToBytesLength]) - if err != nil { - return err + if d, ok := value.(types.Date); ok { + var date types.Date = d + mp.dateEncBuffer = date.ToBytes(mp.dateEncBuffer[:0]) + err = mp.appendCountOfBytesLenEnc(mp.dateEncBuffer[:types.DateToBytesLength]) + if err != nil { + return err + } + } else { + return moerr.NewInternalErrorf(mp.ctx, "unsupported type %T for MYSQL_TYPE_DATE", value) } } case defines.MYSQL_TYPE_DATETIME: - if value, err2 := mrs.GetString(mp.ctx, r, i); err2 != nil { + scale := int32(mysqlColumn.Decimal()) + if val, err2 := mrs.GetValue(mp.ctx, r, i); err2 != nil { return err2 + } else if val != nil { + if dt, ok := val.(types.Datetime); ok { + valueStr := dt.String2(scale) + err = AppendStringLenEnc(mp, valueStr) + if err != nil { + return err + } + } else { + value, err3 := mrs.GetString(mp.ctx, r, i) + if err3 != nil { + return err3 + } + err = AppendStringLenEnc(mp, value) + if err != nil { + return err + } + } } else { - err = mp.appendStringLenEnc(value) + value, err2 := mrs.GetString(mp.ctx, r, i) + if err2 != nil { + return err2 + } + err = AppendStringLenEnc(mp, value) if err != nil { return err } } case defines.MYSQL_TYPE_TIME: - if value, err2 := mrs.GetString(mp.ctx, r, i); err2 != nil { + scale := int32(mysqlColumn.Decimal()) + if val, err2 := mrs.GetValue(mp.ctx, r, i); err2 != nil { return err2 + } else if t, ok := val.(types.Time); ok { + value := t.String2(scale) + err = AppendStringLenEnc(mp, value) + if err != nil { + return err + } } else { - err = mp.appendStringLenEnc(value) + value, err2 := mrs.GetString(mp.ctx, r, i) + if err2 != nil { + return err2 + } + err = AppendStringLenEnc(mp, value) if err != nil { return err } } case defines.MYSQL_TYPE_TIMESTAMP: - if value, err2 := mrs.GetString(mp.ctx, r, i); err2 != nil { + scale := int32(mysqlColumn.Decimal()) + if val, err2 := mrs.GetValue(mp.ctx, r, i); err2 != nil { return err2 + } else if ts, ok := val.(types.Timestamp); ok { + value := ts.String2(mp.ses.GetTimeZone(), scale) + err = AppendStringLenEnc(mp, value) + if err != nil { + return err + } + } else if dt, ok := val.(types.Datetime); ok { + valueStr := dt.String2(scale) + err = AppendStringLenEnc(mp, valueStr) + if err != nil { + return err + } } else { - err = mp.appendStringLenEnc(value) + value, err2 := mrs.GetString(mp.ctx, r, i) + if err2 != nil { + return err2 + } + err = AppendStringLenEnc(mp, value) if err != nil { return err } @@ -2798,7 +2866,11 @@ func (mp *MysqlProtocolImpl) appendResultSetBinaryRow2(mrs *MysqlResultSet, colS if err != nil { return err } - err = AppendCountOfBytesLenEnc(mp, getBoolSlice(b)) + value := uint8(0) + if b { + value = 1 + } + err = mp.appendUint8(value) if err != nil { return err } @@ -2999,6 +3071,12 @@ func (mp *MysqlProtocolImpl) appendResultSetBinaryRow2(mrs *MysqlResultSet, colS if err != nil { return err } + case types.T_date: + d, err := GetDate(colSlices, rowIdx, i) + if err != nil { + return err + } + value = d.String() default: return moerr.NewInternalErrorf(mp.ctx, "unknown type %s in datetime or timestamp", typ.Oid) } @@ -3062,7 +3140,11 @@ func (mp *MysqlProtocolImpl) appendResultSetTextRow2(mrs *MysqlResultSet, colSli if err != nil { return err } - err = AppendCountOfBytesLenEnc(mp, getBoolSlice(b)) + value := int64(0) + if b { + value = 1 + } + err = mp.appendStringLenEncOfInt64(value) if err != nil { return err } diff --git a/pkg/frontend/mysql_protocol_test.go b/pkg/frontend/mysql_protocol_test.go index 77e95ed3550f3..10df343ab96e8 100644 --- a/pkg/frontend/mysql_protocol_test.go +++ b/pkg/frontend/mysql_protocol_test.go @@ -25,6 +25,7 @@ import ( "net" "reflect" "strconv" + "strings" "sync" "testing" "time" @@ -2441,6 +2442,133 @@ func FuzzParseExecuteData(f *testing.F) { }) } +func newBinaryPrepareProtocolTestCase(t *testing.T, sql string) (*MysqlProtocolImpl, *process.Process, *PrepareStmt) { + t.Helper() + ctx := context.TODO() + sv, err := getSystemVariables("test/system_vars_config.toml") + require.NoError(t, err) + + pu := config.NewParameterUnit(sv, nil, nil, nil) + pu.SV.SkipCheckUser = true + pu.SV.KillRountinesInterval = 0 + setSessionAlloc("", NewLeakCheckAllocator()) + setPu("", pu) + + ioses, err := NewIOSession(&testConn{}, pu, "") + require.NoError(t, err) + + proto := NewMysqlClientProtocol("", 0, ioses, 1024, sv) + proc := testutil.NewProcess(t) + + st := tree.NewPrepareString(tree.Identifier(getPrepareStmtName(1)), sql) + stmts, err := mysql.Parse(ctx, st.Sql, 1) + require.NoError(t, err) + compCtx := plan.NewEmptyCompilerContext() + preparePlan, err := buildPlan(ctx, nil, compCtx, st) + require.NoError(t, err) + + prepareStmt := &PrepareStmt{ + Name: preparePlan.GetDcl().GetPrepare().GetName(), + PreparePlan: preparePlan, + PrepareStmt: stmts[0], + getFromSendLongData: make(map[int]struct{}), + } + return proto, proc, prepareStmt +} + +func TestPrepareStmtCloseAfterBinaryParamParsing(t *testing.T) { + ctx := context.TODO() + proto, proc, prepareStmt := newBinaryPrepareProtocolTestCase(t, "select ?") + testData := []byte{0, 0, 0, 0, 0, 0, 1, uint8(defines.MYSQL_TYPE_TINY), 0, 10} + require.NoError(t, proto.ParseExecuteData(ctx, proc, prepareStmt, testData, 0)) + require.Same(t, proc, prepareStmt.proc) + require.NotPanics(t, func() { + prepareStmt.Close() + }) +} + +func TestParseExecuteDataWithJSONParam(t *testing.T) { + ctx := context.TODO() + proto, proc, prepareStmt := newBinaryPrepareProtocolTestCase(t, "select ?") + + jsonPayload := append([]byte(`{"k":"`), bytes.Repeat([]byte{'v'}, 300)...) + jsonPayload = append(jsonPayload, []byte(`"}`)...) + + testData := make([]byte, 8+2+9+len(jsonPayload)) + copy(testData, []byte{0, 0, 0, 0, 0, 0, 1, uint8(defines.MYSQL_TYPE_JSON), 0}) + pos := proto.writeStringLenEnc(testData, 9, string(jsonPayload)) + testData = testData[:pos] + + require.NoError(t, proto.ParseExecuteData(ctx, proc, prepareStmt, testData, 0)) + require.Equal(t, string(jsonPayload), prepareStmt.params.GetStringAt(0)) +} + +func buildStringExecutePacket(proto *MysqlProtocolImpl, tp defines.MysqlType, payload string) []byte { + data := make([]byte, 8+2+9+len(payload)) + copy(data, []byte{0, 0, 0, 0, 0, 0, 1, byte(tp), 0}) + pos := proto.writeStringLenEnc(data, 9, payload) + return data[:pos] +} + +func TestPrepareStmtClearBinaryParamStateReleasesParamArea(t *testing.T) { + ctx := context.TODO() + proto, proc, prepareStmt := newBinaryPrepareProtocolTestCase(t, "select ?") + + firstPayload := strings.Repeat("a", 300) + secondPayload := strings.Repeat("b", 300) + + require.NoError(t, proto.ParseExecuteData(ctx, proc, prepareStmt, buildStringExecutePacket(proto, defines.MYSQL_TYPE_VAR_STRING, firstPayload), 0)) + firstAreaLen := len(prepareStmt.params.GetArea()) + require.Greater(t, firstAreaLen, 0) + + prepareStmt.clearBinaryParamState(proc) + require.Nil(t, prepareStmt.params) + require.Empty(t, prepareStmt.getFromSendLongData) + + require.NoError(t, proto.ParseExecuteData(ctx, proc, prepareStmt, buildStringExecutePacket(proto, defines.MYSQL_TYPE_VAR_STRING, secondPayload), 0)) + require.Equal(t, secondPayload, prepareStmt.params.GetStringAt(0)) + require.Equal(t, firstAreaLen, len(prepareStmt.params.GetArea())) +} + +func TestParseExecuteDataRejectsTruncatedNewParamBoundFlag(t *testing.T) { + ctx := context.TODO() + proto, proc, prepareStmt := newBinaryPrepareProtocolTestCase(t, "select ?") + + testData := []byte{0, 0, 0, 0, 0, 0} + + var err error + require.NotPanics(t, func() { + err = proto.ParseExecuteData(ctx, proc, prepareStmt, testData, 0) + }) + require.Error(t, err) +} + +func TestParseSendLongDataAppendsRepeatedChunks(t *testing.T) { + ctx := context.TODO() + proto, proc, prepareStmt := newBinaryPrepareProtocolTestCase(t, "select ?") + + firstChunk := append(make([]byte, 2), []byte("hello ")...) + secondChunk := append(make([]byte, 2), []byte("world")...) + + require.NoError(t, proto.ParseSendLongData(ctx, proc, prepareStmt, firstChunk, 0)) + require.NoError(t, proto.ParseSendLongData(ctx, proc, prepareStmt, secondChunk, 0)) + require.Equal(t, "hello world", prepareStmt.params.GetStringAt(0)) + _, ok := prepareStmt.getFromSendLongData[0] + require.True(t, ok) +} + +func TestParseSendLongDataInitializesTrackingMap(t *testing.T) { + ctx := context.TODO() + proto, proc, prepareStmt := newBinaryPrepareProtocolTestCase(t, "select ?") + prepareStmt.getFromSendLongData = nil + + chunk := append(make([]byte, 2), []byte("hello")...) + require.NoError(t, proto.ParseSendLongData(ctx, proc, prepareStmt, chunk, 0)) + require.Equal(t, "hello", prepareStmt.params.GetStringAt(0)) + _, ok := prepareStmt.getFromSendLongData[0] + require.True(t, ok) +} + /* FIXME The prepare process has undergone some modifications, so the unit tests for prepare need to be refactored, and the subsequent pr I will resubmit a reasonable ut func TestParseExecuteData(t *testing.T) { @@ -4259,3 +4387,833 @@ func Test_appendResultSet5(t *testing.T) { } }) } + +// Test_appendResultSetTextRow_ScaleHandling tests that appendResultSetTextRow correctly handles scale +// for DATETIME, TIME, and TIMESTAMP types. This ensures the fix for scale handling in MySQL protocol. +func Test_appendResultSetTextRow_ScaleHandling(t *testing.T) { + ctx := context.TODO() + convey.Convey("appendResultSetTextRow scale handling", t, func() { + sv, err := getSystemVariables("test/system_vars_config.toml") + if err != nil { + t.Error(err) + } + pu := config.NewParameterUnit(sv, nil, nil, nil) + pu.SV.SkipCheckUser = true + pu.SV.KillRountinesInterval = 0 + setSessionAlloc("", NewLeakCheckAllocator()) + setPu("", pu) + ioses, err := NewIOSession(&testConn{}, pu, "") + convey.ShouldBeNil(err) + proto := NewMysqlClientProtocol("", 0, ioses, 1024, sv) + + ses := NewSession(ctx, "", proto, nil) + proto.ses = ses + + // Test DATETIME with different scales + convey.Convey("DATETIME scale handling", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(3) // Set scale to 3 + rs.AddColumn(mysqlCol) + + dt, _ := types.ParseDatetime("2024-01-15 10:20:30.123456", 6) + rs.AddRow([]interface{}{dt}) + + // Capture the output + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + // Should format with scale 3, not 6 + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30.123") + }) + + // Test TIME with different scales + convey.Convey("TIME scale handling", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("time_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIME) + mysqlCol.SetDecimal(2) // Set scale to 2 + rs.AddColumn(mysqlCol) + + t, _ := types.ParseTime("11:22:33.123456", 6) + rs.AddRow([]interface{}{t}) + + // Capture the output + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + // Should format with scale 2, not 6 + convey.So(capturedValue, convey.ShouldEqual, "11:22:33.12") + }) + + // Test TIMESTAMP with different scales + convey.Convey("TIMESTAMP scale handling", func() { + // Ensure session timezone is UTC for this test + proto.ses.SetTimeZone(time.UTC) + + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("timestamp_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIMESTAMP) + mysqlCol.SetDecimal(4) // Set scale to 4 + rs.AddColumn(mysqlCol) + + ts, _ := types.ParseTimestamp(time.UTC, "2024-01-15 10:20:30.123456", 6) + rs.AddRow([]interface{}{ts}) + + // Capture the output + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + // Should format with scale 4, not 6, using session timezone (UTC) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30.1234") + }) + + // Test TIMESTAMP timezone handling + convey.Convey("TIMESTAMP timezone handling", func() { + // Set session timezone to a different timezone + loc, _ := time.LoadLocation("America/New_York") // UTC-5 + proto.ses.SetTimeZone(loc) + + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("timestamp_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIMESTAMP) + mysqlCol.SetDecimal(0) // No fractional seconds + rs.AddColumn(mysqlCol) + + // Create a timestamp in UTC: 2024-01-15 15:00:00 UTC + // This should be 10:00:00 in New York (UTC-5) + ts, _ := types.ParseTimestamp(time.UTC, "2024-01-15 15:00:00", 0) + rs.AddRow([]interface{}{ts}) + + // Capture the output + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + // Should use session timezone (New York), not UTC + // 15:00:00 UTC = 10:00:00 EST (UTC-5) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:00:00") + }) + }) +} + +// Test_appendResultSetTextRow_DateTimeCoverage tests additional branches in appendResultSetTextRow +// for MYSQL_TYPE_DATE and MYSQL_TYPE_DATETIME types. +func Test_appendResultSetTextRow_DateTimeCoverage(t *testing.T) { + ctx := context.TODO() + convey.Convey("appendResultSetTextRow DATE/DATETIME coverage", t, func() { + sv, err := getSystemVariables("test/system_vars_config.toml") + if err != nil { + t.Error(err) + } + pu := config.NewParameterUnit(sv, nil, nil, nil) + pu.SV.SkipCheckUser = true + pu.SV.KillRountinesInterval = 0 + setSessionAlloc("", NewLeakCheckAllocator()) + setPu("", pu) + ioses, err := NewIOSession(&testConn{}, pu, "") + convey.ShouldBeNil(err) + proto := NewMysqlClientProtocol("", 0, ioses, 1024, sv) + + ses := NewSession(ctx, "", proto, nil) + proto.ses = ses + + // Test MYSQL_TYPE_DATE with types.Date value (normal case) + convey.Convey("MYSQL_TYPE_DATE normal case", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("date_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATE) + rs.AddColumn(mysqlCol) + + dt, _ := types.ParseDateCast("2024-01-15") + rs.AddRow([]interface{}{dt}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_DATE with wrong type (should return error) + convey.Convey("MYSQL_TYPE_DATE wrong type", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("date_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATE) + rs.AddColumn(mysqlCol) + + // Add a string instead of types.Date - should fail type assertion + rs.AddRow([]interface{}{"2024-01-15"}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldNotBeNil) + convey.So(err.Error(), convey.ShouldContainSubstring, "unsupported type") + }) + + // Test MYSQL_TYPE_DATETIME with types.Datetime value (normal case) + convey.Convey("MYSQL_TYPE_DATETIME normal case", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + dt, _ := types.ParseDatetime("2024-01-15 10:20:30", 0) + rs.AddRow([]interface{}{dt}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30") + }) + + // Test MYSQL_TYPE_DATETIME with wrong type (fallback to GetString) + convey.Convey("MYSQL_TYPE_DATETIME fallback to GetString", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Add a string instead of types.Datetime - should fallback to GetString + rs.AddRow([]interface{}{"2024-01-15 10:20:30"}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30") + }) + + // Test MYSQL_TYPE_DATETIME with nil value (fallback to GetString) + convey.Convey("MYSQL_TYPE_DATETIME nil value fallback", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Add nil value - should fallback to GetString which returns empty string + rs.AddRow([]interface{}{nil}) + + // When value is nil, ColumnIsNull returns true and we skip with 0xFB + // So this test actually tests the NULL path + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_DATETIME with scale > 0 + convey.Convey("MYSQL_TYPE_DATETIME with scale", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(6) // microsecond precision + rs.AddColumn(mysqlCol) + + dt, _ := types.ParseDatetime("2024-01-15 10:20:30.123456", 6) + rs.AddRow([]interface{}{dt}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30.123456") + }) + + // Test MYSQL_TYPE_TIME with types.Time value (normal case) + convey.Convey("MYSQL_TYPE_TIME normal case", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("time_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIME) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + t, _ := types.ParseTime("11:22:33", 0) + rs.AddRow([]interface{}{t}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "11:22:33") + }) + + // Test MYSQL_TYPE_TIME with wrong type (fallback to GetString) + convey.Convey("MYSQL_TYPE_TIME fallback to GetString", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("time_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIME) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Add a string instead of types.Time - should fallback to GetString + rs.AddRow([]interface{}{"11:22:33"}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "11:22:33") + }) + + // Test MYSQL_TYPE_TIMESTAMP with types.Timestamp value (normal case) + convey.Convey("MYSQL_TYPE_TIMESTAMP normal case", func() { + proto.ses.SetTimeZone(time.UTC) + + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("timestamp_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIMESTAMP) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + ts, _ := types.ParseTimestamp(time.UTC, "2024-01-15 10:20:30", 0) + rs.AddRow([]interface{}{ts}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30") + }) + + // Test MYSQL_TYPE_TIMESTAMP with types.Datetime value (fallback case) + convey.Convey("MYSQL_TYPE_TIMESTAMP with Datetime value", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("timestamp_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIMESTAMP) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Add a Datetime instead of Timestamp - should use Datetime branch + dt, _ := types.ParseDatetime("2024-01-15 10:20:30", 0) + rs.AddRow([]interface{}{dt}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30") + }) + + // Test MYSQL_TYPE_TIMESTAMP with wrong type (fallback to GetString) + convey.Convey("MYSQL_TYPE_TIMESTAMP fallback to GetString", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("timestamp_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIMESTAMP) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Add a string instead of Timestamp - should fallback to GetString + rs.AddRow([]interface{}{"2024-01-15 10:20:30"}) + + var capturedValue string + stub := gostub.Stub(&AppendStringLenEnc, func(mp *MysqlProtocolImpl, value string) error { + capturedValue = value + return nil + }) + defer stub.Reset() + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + convey.So(capturedValue, convey.ShouldEqual, "2024-01-15 10:20:30") + }) + + // Test MYSQL_TYPE_ENUM + convey.Convey("MYSQL_TYPE_ENUM", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("enum_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_ENUM) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{"value1"}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_BOOL + convey.Convey("MYSQL_TYPE_BOOL", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("bool_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_BOOL) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{true}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_BIT + convey.Convey("MYSQL_TYPE_BIT", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("bit_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_BIT) + mysqlCol.SetLength(8) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{uint64(255)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_DECIMAL + convey.Convey("MYSQL_TYPE_DECIMAL", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("decimal_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DECIMAL) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{"123.456"}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_UUID + convey.Convey("MYSQL_TYPE_UUID", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("uuid_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_UUID) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{"550e8400-e29b-41d4-a716-446655440000"}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_TINY + convey.Convey("MYSQL_TYPE_TINY", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("tiny_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TINY) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{int64(127)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_YEAR with zero value + convey.Convey("MYSQL_TYPE_YEAR zero", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("year_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_YEAR) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{int64(0)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_YEAR with non-zero value + convey.Convey("MYSQL_TYPE_YEAR non-zero", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("year_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_YEAR) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{int64(2024)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_FLOAT with float32 + convey.Convey("MYSQL_TYPE_FLOAT float32", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("float_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_FLOAT) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{float32(3.14)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_FLOAT with float64 + convey.Convey("MYSQL_TYPE_FLOAT float64", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("float_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_FLOAT) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{float64(3.14159)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_DOUBLE with float32 + convey.Convey("MYSQL_TYPE_DOUBLE float32", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("double_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DOUBLE) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{float32(3.14)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_DOUBLE with float64 + convey.Convey("MYSQL_TYPE_DOUBLE float64", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("double_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DOUBLE) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{float64(3.14159265358979)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_LONGLONG unsigned + convey.Convey("MYSQL_TYPE_LONGLONG unsigned", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("bigint_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_LONGLONG) + mysqlCol.SetSigned(false) // unsigned + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{uint64(18446744073709551615)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_LONGLONG signed + convey.Convey("MYSQL_TYPE_LONGLONG signed", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("bigint_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_LONGLONG) + mysqlCol.SetSigned(true) // signed + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{int64(-9223372036854775808)}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_VARCHAR with []byte + convey.Convey("MYSQL_TYPE_VARCHAR bytes", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("varchar_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_VARCHAR) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{[]byte("hello world")}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_VARCHAR with string + convey.Convey("MYSQL_TYPE_VARCHAR string", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("varchar_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_VARCHAR) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{"hello world"}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test MYSQL_TYPE_BLOB + convey.Convey("MYSQL_TYPE_BLOB", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("blob_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_BLOB) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{[]byte{0x01, 0x02, 0x03}}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test NULL value + convey.Convey("NULL value", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("nullable_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_VARCHAR) + rs.AddColumn(mysqlCol) + + rs.AddRow([]interface{}{nil}) + + err := proto.appendResultSetTextRow(rs, 0) + convey.So(err, convey.ShouldBeNil) + }) + }) +} + +// Test_appendResultSetBinaryRow2_DateTimeHandling tests that appendResultSetBinaryRow2 correctly handles +// DATE/DATETIME/TIMESTAMP types for TIMESTAMPADD function results in binary protocol. +// This ensures the fix for TIMESTAMPADD return type handling in binary protocol. +func Test_appendResultSetBinaryRow2_DateTimeHandling(t *testing.T) { + ctx := context.TODO() + convey.Convey("appendResultSetBinaryRow2 DATE/DATETIME/TIMESTAMP handling", t, func() { + sv, err := getSystemVariables("test/system_vars_config.toml") + if err != nil { + t.Error(err) + } + pu := config.NewParameterUnit(sv, nil, nil, nil) + pu.SV.SkipCheckUser = true + pu.SV.KillRountinesInterval = 0 + setSessionAlloc("", NewLeakCheckAllocator()) + setPu("", pu) + ioses, err := NewIOSession(&testConn{}, pu, "") + convey.ShouldBeNil(err) + proto := NewMysqlClientProtocol("", 0, ioses, 1024, sv) + + ses := NewSession(ctx, "", proto, nil) + proto.ses = ses + + proc := testutil.NewProcess(t) + + // Test DATETIME column with DATE type (TIMESTAMPADD with DATE input + date unit) + convey.Convey("MYSQL_TYPE_DATETIME with DATE type", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Create a batch with DATE type vector + bat := batch.NewWithSize(1) + bat.Vecs[0] = vector.NewVec(types.New(types.T_date, 0, 0)) + date := types.Date(types.DateFromCalendar(2024, 1, 15)) + vector.AppendFixed(bat.Vecs[0], date, false, proc.Mp()) + bat.SetRowCount(1) + + colSlices := &ColumnSlices{ + ctx: ctx, + colIdx2SliceIdx: make([]int, len(bat.Vecs)), + dataSet: bat, + } + defer colSlices.Close() + err = convertBatchToSlices(ctx, ses, bat, colSlices) + convey.So(err, convey.ShouldBeNil) + + err := proto.appendResultSetBinaryRow2(rs, colSlices, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test DATETIME column with DATETIME type (TIMESTAMPADD with DATE input + time unit) + convey.Convey("MYSQL_TYPE_DATETIME with DATETIME type", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Create a batch with DATETIME type vector + bat := batch.NewWithSize(1) + bat.Vecs[0] = vector.NewVec(types.New(types.T_datetime, 0, 0)) + dt, _ := types.ParseDatetime("2024-01-15 10:20:30", 0) + vector.AppendFixed(bat.Vecs[0], dt, false, proc.Mp()) + bat.SetRowCount(1) + + colSlices := &ColumnSlices{ + ctx: ctx, + colIdx2SliceIdx: make([]int, len(bat.Vecs)), + dataSet: bat, + } + defer colSlices.Close() + err = convertBatchToSlices(ctx, ses, bat, colSlices) + convey.So(err, convey.ShouldBeNil) + + err := proto.appendResultSetBinaryRow2(rs, colSlices, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test TIMESTAMP column with DATE type (TIMESTAMPADD with DATE input + date unit) + convey.Convey("MYSQL_TYPE_TIMESTAMP with DATE type", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("timestamp_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIMESTAMP) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Create a batch with DATE type vector + bat := batch.NewWithSize(1) + bat.Vecs[0] = vector.NewVec(types.New(types.T_date, 0, 0)) + date := types.Date(types.DateFromCalendar(2024, 1, 15)) + vector.AppendFixed(bat.Vecs[0], date, false, proc.Mp()) + bat.SetRowCount(1) + + colSlices := &ColumnSlices{ + ctx: ctx, + colIdx2SliceIdx: make([]int, len(bat.Vecs)), + dataSet: bat, + } + defer colSlices.Close() + err = convertBatchToSlices(ctx, ses, bat, colSlices) + convey.So(err, convey.ShouldBeNil) + + err := proto.appendResultSetBinaryRow2(rs, colSlices, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test TIMESTAMP column with TIMESTAMP type + convey.Convey("MYSQL_TYPE_TIMESTAMP with TIMESTAMP type", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("timestamp_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_TIMESTAMP) + mysqlCol.SetDecimal(0) + rs.AddColumn(mysqlCol) + + // Create a batch with TIMESTAMP type vector + bat := batch.NewWithSize(1) + bat.Vecs[0] = vector.NewVec(types.New(types.T_timestamp, 0, 0)) + ts, _ := types.ParseTimestamp(time.UTC, "2024-01-15 10:20:30", 0) + vector.AppendFixed(bat.Vecs[0], ts, false, proc.Mp()) + bat.SetRowCount(1) + + colSlices := &ColumnSlices{ + ctx: ctx, + colIdx2SliceIdx: make([]int, len(bat.Vecs)), + dataSet: bat, + } + defer colSlices.Close() + err = convertBatchToSlices(ctx, ses, bat, colSlices) + convey.So(err, convey.ShouldBeNil) + + err := proto.appendResultSetBinaryRow2(rs, colSlices, 0) + convey.So(err, convey.ShouldBeNil) + }) + + // Test DATETIME column with DATETIME type having fractional seconds + convey.Convey("MYSQL_TYPE_DATETIME with DATETIME type (with microseconds)", func() { + rs := &MysqlResultSet{} + mysqlCol := new(MysqlColumn) + mysqlCol.SetName("datetime_col") + mysqlCol.SetColumnType(defines.MYSQL_TYPE_DATETIME) + mysqlCol.SetDecimal(6) // Microsecond precision + rs.AddColumn(mysqlCol) + + // Create a batch with DATETIME type vector (with microseconds) + bat := batch.NewWithSize(1) + bat.Vecs[0] = vector.NewVec(types.New(types.T_datetime, 0, 6)) + dt, _ := types.ParseDatetime("2024-01-15 10:20:30.123456", 6) + vector.AppendFixed(bat.Vecs[0], dt, false, proc.Mp()) + bat.SetRowCount(1) + + colSlices := &ColumnSlices{ + ctx: ctx, + colIdx2SliceIdx: make([]int, len(bat.Vecs)), + dataSet: bat, + } + defer colSlices.Close() + err = convertBatchToSlices(ctx, ses, bat, colSlices) + convey.So(err, convey.ShouldBeNil) + + err := proto.appendResultSetBinaryRow2(rs, colSlices, 0) + convey.So(err, convey.ShouldBeNil) + }) + }) +} diff --git a/pkg/frontend/output.go b/pkg/frontend/output.go index 013050caf8378..f70a3da9f315a 100644 --- a/pkg/frontend/output.go +++ b/pkg/frontend/output.go @@ -649,19 +649,6 @@ func (slices *ColumnSlices) GetTimestamp(r uint64, i uint64, timeZone *time.Loca } } -var ( - trueSlice = []byte("true") - falseSlice = []byte("false") -) - -func getBoolSlice(v bool) []byte { - if v { - return trueSlice - } else { - return falseSlice - } -} - func convertBatchToSlices(ctx context.Context, ses FeSession, dataSet *batch.Batch, colSlices *ColumnSlices) error { for i, vec := range dataSet.Vecs { //col index if vec.IsConstNull() { diff --git a/pkg/frontend/session.go b/pkg/frontend/session.go index e7d506b982f49..2b99f8b1015b1 100644 --- a/pkg/frontend/session.go +++ b/pkg/frontend/session.go @@ -1041,6 +1041,9 @@ func (ses *Session) SetPrepareStmt(ctx context.Context, name string, prepareStmt stmt.Close() } + if prepareStmt != nil && prepareStmt.proc == nil { + prepareStmt.proc = ses.proc + } ses.prepareStmts[name] = prepareStmt return nil diff --git a/pkg/frontend/types.go b/pkg/frontend/types.go index 37e5c1d82d894..499c89c99d1c6 100644 --- a/pkg/frontend/types.go +++ b/pkg/frontend/types.go @@ -421,6 +421,31 @@ func (prepareStmt *PrepareStmt) Close() { } } +func (prepareStmt *PrepareStmt) resetBinaryParamState() { + if prepareStmt == nil { + return + } + if prepareStmt.params != nil { + prepareStmt.params.GetNulls().Reset() + } + for k := range prepareStmt.getFromSendLongData { + delete(prepareStmt.getFromSendLongData, k) + } +} + +func (prepareStmt *PrepareStmt) clearBinaryParamState(proc *process.Process) { + if prepareStmt == nil { + return + } + if prepareStmt.params != nil && proc != nil { + prepareStmt.params.Free(proc.Mp()) + prepareStmt.params = nil + } + for k := range prepareStmt.getFromSendLongData { + delete(prepareStmt.getFromSendLongData, k) + } +} + type Allocator interface { // Alloc allocate a []byte with len(data) >= size, and the returned []byte cannot // be expanded in use. diff --git a/pkg/frontend/variables.go b/pkg/frontend/variables.go index 8e9ce2a4a0774..b444139962ec9 100644 --- a/pkg/frontend/variables.go +++ b/pkg/frontend/variables.go @@ -967,6 +967,18 @@ func useTomlConfigOverOtherConfigs(CNServiceConfig *config.FrontendParameters, s sysVarsMp["version"] = verPrefix + verVal } +func resolveServerID(ses *Session) string { + if ses == nil { + return "" + } + rm := ses.getRoutineManager() + if rm == nil || rm.baseService == nil { + return "" + } + serviceID := rm.baseService.ID() + return serviceID +} + // Get return sys vars of accountId func (m *GlobalSysVarsMgr) Get(accountId uint32, ses *Session, ctx context.Context, bh BackgroundExec) (*SystemVariables, error) { sysVarsMp, err := ses.getGlobalSysVars(ctx, bh) @@ -976,6 +988,7 @@ func (m *GlobalSysVarsMgr) Get(accountId uint32, ses *Session, ctx context.Conte CNServiceConfig := getPu(ses.service).SV useTomlConfigOverOtherConfigs(CNServiceConfig, sysVarsMp) + sysVarsMp["server_id"] = resolveServerID(ses) m.Lock() defer m.Unlock() @@ -1066,6 +1079,14 @@ var gSysVarsDefs = map[string]SystemVariable{ Type: InitSystemVariableStringType("version_comment"), Default: "MatrixOne", }, + "server_id": { + Name: "server_id", + Scope: ScopeGlobal, + Dynamic: false, + SetVarHintApplies: false, + Type: InitSystemVariableStringType("server_id"), + Default: "", + }, "tx_isolation": { Name: "tx_isolation", Scope: ScopeBoth, diff --git a/pkg/sql/colexec/deletion/deletion_partition.go b/pkg/sql/colexec/deletion/deletion_partition.go index 3636a6b6fde3d..a630631c64c50 100644 --- a/pkg/sql/colexec/deletion/deletion_partition.go +++ b/pkg/sql/colexec/deletion/deletion_partition.go @@ -108,12 +108,10 @@ func (op *PartitionDelete) Call( panic("Prune result is empty") } - ref := op.raw.DeleteCtx.Ref + // Use a local copy of the ObjRef to avoid mutating the shared plan + // object that may be read concurrently by other operators. + localRef := *op.raw.DeleteCtx.Ref eng := op.raw.DeleteCtx.Engine - oldName := ref.ObjName - defer func() { - ref.ObjName = oldName - }() var rel engine.Relation res.Iter( @@ -121,12 +119,12 @@ func (op *PartitionDelete) Call( partition partition.Partition, bat *batch.Batch, ) bool { - ref.ObjName = partition.PartitionTableName + localRef.ObjName = partition.PartitionTableName rel, err = colexec.GetRelAndPartitionRelsByObjRef( proc.Ctx, proc, eng, - ref, + &localRef, ) if err != nil { return false diff --git a/pkg/sql/colexec/deletion/deletion_partition_test.go b/pkg/sql/colexec/deletion/deletion_partition_test.go new file mode 100644 index 0000000000000..2406875231ee9 --- /dev/null +++ b/pkg/sql/colexec/deletion/deletion_partition_test.go @@ -0,0 +1,83 @@ +// Copyright 2024 Matrix Origin +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package deletion + +import ( + "testing" + + "github.com/golang/mock/gomock" + "github.com/matrixorigin/matrixone/pkg/container/batch" + "github.com/matrixorigin/matrixone/pkg/container/types" + "github.com/matrixorigin/matrixone/pkg/pb/partition" + pbplan "github.com/matrixorigin/matrixone/pkg/pb/plan" + "github.com/matrixorigin/matrixone/pkg/sql/colexec" + "github.com/matrixorigin/matrixone/pkg/sql/plan" + "github.com/matrixorigin/matrixone/pkg/testutil" + "github.com/stretchr/testify/require" +) + +func TestPartitionDeleteCallDoesNotMutateSharedObjectRef(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + proc, eng := prepareDeletionTest(t, ctrl, false) + + raw := &Deletion{ + DeleteCtx: &DeleteCtx{ + Ref: &plan.ObjectRef{ + SchemaName: "testDb", + ObjName: "testTable", + }, + Engine: eng, + PrimaryKeyIdx: 1, + }, + } + require.NoError(t, raw.Prepare(proc)) + + op := &PartitionDelete{ + raw: raw, + meta: partition.PartitionMetadata{ + Partitions: []partition.Partition{ + { + PartitionID: 1, + PartitionTableName: "partition_table", + Expr: &pbplan.Expr{ + Typ: pbplan.Type{Id: int32(types.T_bool)}, + Expr: &pbplan.Expr_Lit{ + Lit: &pbplan.Literal{Value: &pbplan.Literal_Bval{Bval: true}}, + }, + }, + }, + }, + }, + } + bat := batch.NewWithSize(2) + bat.SetAttributes([]string{"row_id", "pk"}) + bat.Vecs[0] = testutil.MakeRowIdVector([]types.Rowid{types.BuildTestRowid(1, 1)}, nil) + bat.Vecs[1] = testutil.MakeInt64Vector([]int64{1}, nil) + bat.SetRowCount(1) + op.AppendChild( + colexec.NewMockOperator().WithBatchs([]*batch.Batch{ + bat, + }), + ) + + _, err := op.Call(proc) + require.NoError(t, err) + require.Equal(t, "testTable", raw.DeleteCtx.Ref.ObjName) + + raw.Free(proc, false, nil) + proc.Free() +} diff --git a/pkg/sql/colexec/insert/insert_partition.go b/pkg/sql/colexec/insert/insert_partition.go index 21b85d40d9164..29d3e31170514 100644 --- a/pkg/sql/colexec/insert/insert_partition.go +++ b/pkg/sql/colexec/insert/insert_partition.go @@ -106,12 +106,10 @@ func (op *PartitionInsert) Call( panic("Prune result is empty") } - ref := op.raw.InsertCtx.Ref + // Use a local copy of the ObjRef to avoid mutating the shared plan + // object that may be read concurrently by other operators. + localRef := *op.raw.InsertCtx.Ref eng := op.raw.InsertCtx.Engine - oldName := ref.ObjName - defer func() { - ref.ObjName = oldName - }() var rel engine.Relation res.Iter( @@ -119,12 +117,12 @@ func (op *PartitionInsert) Call( partition partition.Partition, bat *batch.Batch, ) bool { - ref.ObjName = partition.PartitionTableName + localRef.ObjName = partition.PartitionTableName rel, err = colexec.GetRelAndPartitionRelsByObjRef( proc.Ctx, proc, eng, - ref, + &localRef, ) if err != nil { return false diff --git a/pkg/sql/colexec/insert/insert_partition_test.go b/pkg/sql/colexec/insert/insert_partition_test.go index e7b312bcf1191..4d13c233d5ca9 100644 --- a/pkg/sql/colexec/insert/insert_partition_test.go +++ b/pkg/sql/colexec/insert/insert_partition_test.go @@ -16,8 +16,20 @@ package insert import ( "bytes" + "context" "testing" + "github.com/golang/mock/gomock" + "github.com/matrixorigin/matrixone/pkg/container/batch" + "github.com/matrixorigin/matrixone/pkg/container/types" + mock_frontend "github.com/matrixorigin/matrixone/pkg/frontend/test" + "github.com/matrixorigin/matrixone/pkg/pb/partition" + "github.com/matrixorigin/matrixone/pkg/pb/plan" + pbplan "github.com/matrixorigin/matrixone/pkg/pb/plan" + "github.com/matrixorigin/matrixone/pkg/sql/colexec" + "github.com/matrixorigin/matrixone/pkg/testutil" + "github.com/matrixorigin/matrixone/pkg/vm" + "github.com/matrixorigin/matrixone/pkg/vm/engine" "github.com/stretchr/testify/require" ) @@ -38,3 +50,86 @@ func TestNewPartitionInsertFrom(t *testing.T) { require.Equal(t, ps.raw.ToWriteS3, op.(*PartitionInsert).raw.ToWriteS3) require.Equal(t, ps.tableID, op.(*PartitionInsert).tableID) } + +func TestPartitionInsertCallDoesNotMutateSharedObjectRef(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + ctx := context.TODO() + txnOperator := mock_frontend.NewMockTxnOperator(ctrl) + txnOperator.EXPECT().Commit(gomock.Any()).Return(nil).AnyTimes() + txnOperator.EXPECT().Rollback(ctx).Return(nil).AnyTimes() + + txnClient := mock_frontend.NewMockTxnClient(ctrl) + txnClient.EXPECT().New(gomock.Any(), gomock.Any()).Return(txnOperator, nil).AnyTimes() + + eng := mock_frontend.NewMockEngine(ctrl) + database := mock_frontend.NewMockDatabase(ctrl) + relation := mock_frontend.NewMockRelation(ctrl) + var relationNames []string + + eng.EXPECT().Hints().Return(engine.Hints{}).AnyTimes() + eng.EXPECT().Database(gomock.Any(), "testDb", gomock.Any()).Return(database, nil).AnyTimes() + database.EXPECT().Relation(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn( + func(_ context.Context, name string, _ any) (engine.Relation, error) { + relationNames = append(relationNames, name) + return relation, nil + }, + ).AnyTimes() + relation.EXPECT().Write(gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + relation.EXPECT().Reset(gomock.Any()).Return(nil).AnyTimes() + + proc := testutil.NewProc(t) + proc.Base.TxnClient = txnClient + proc.Base.TxnOperator = txnOperator + proc.Ctx = ctx + + raw := &Insert{ + InsertCtx: &InsertCtx{ + Ref: &plan.ObjectRef{ + SchemaName: "testDb", + ObjName: "testTable", + }, + Engine: eng, + Attrs: []string{"a"}, + }, + OperatorBase: vm.OperatorBase{ + OperatorInfo: vm.OperatorInfo{Idx: 0}, + }, + ctr: container{state: vm.Build}, + } + require.NoError(t, raw.Prepare(proc)) + + bat := batch.NewWithSize(1) + bat.Attrs = []string{"a"} + bat.Vecs[0] = testutil.MakeInt64Vector([]int64{1}, nil) + bat.SetRowCount(1) + + op := &PartitionInsert{ + raw: raw, + meta: partition.PartitionMetadata{ + Partitions: []partition.Partition{ + { + PartitionID: 1, + PartitionTableName: "partition_table", + Expr: &pbplan.Expr{ + Typ: pbplan.Type{Id: int32(types.T_bool)}, + Expr: &pbplan.Expr_Lit{ + Lit: &pbplan.Literal{Value: &pbplan.Literal_Bval{Bval: true}}, + }, + }, + }, + }, + }, + } + op.AppendChild(colexec.NewMockOperator().WithBatchs([]*batch.Batch{bat})) + + _, err := op.Call(proc) + require.NoError(t, err) + require.Equal(t, "testTable", raw.InsertCtx.Ref.ObjName) + require.Contains(t, relationNames, "testTable") + require.Contains(t, relationNames, "partition_table") + + raw.Free(proc, false, nil) + proc.Free() +} diff --git a/pkg/sql/colexec/multi_update/multi_update_partition.go b/pkg/sql/colexec/multi_update/multi_update_partition.go index 13b3e62884d26..bcfa86ad806b2 100644 --- a/pkg/sql/colexec/multi_update/multi_update_partition.go +++ b/pkg/sql/colexec/multi_update/multi_update_partition.go @@ -182,6 +182,9 @@ func (op *PartitionMultiUpdate) writeTable( } // mapping all main table and index table to partition's. + // Clone each context to avoid mutating shared plan objects + // that may be read concurrently by other operators. + cloned := make([]*MultiUpdateCtx, len(op.raw.MultiUpdateCtx)) for i, c := range op.raw.MultiUpdateCtx { r := rel if features.IsIndexTable(op.rawTableFlags[i]) { @@ -196,9 +199,11 @@ func (op *PartitionMultiUpdate) writeTable( } } - c.ObjRef.ObjName = r.GetTableName() - c.TableDef = r.GetTableDef(proc.Ctx) + cloned[i] = c.clone() + cloned[i].ObjRef.ObjName = r.GetTableName() + cloned[i].TableDef = r.GetTableDef(proc.Ctx) } + op.raw.MultiUpdateCtx = cloned op.raw.resetMultiUpdateCtxs() if err = op.raw.resetMultiSources(proc); err != nil { return false @@ -413,3 +418,16 @@ func (op *PartitionMultiUpdate) GetAffectedRows() uint64 { func (op *PartitionMultiUpdate) SetAffectedRows(affectedRows uint64) { op.affectedRows = affectedRows } + +func (ctx *MultiUpdateCtx) clone() *MultiUpdateCtx { + v := &MultiUpdateCtx{ + InsertCols: ctx.InsertCols, + DeleteCols: ctx.DeleteCols, + PartitionCols: ctx.PartitionCols, + } + objRef := *ctx.ObjRef + def := *ctx.TableDef + v.ObjRef = &objRef + v.TableDef = &def + return v +} diff --git a/pkg/sql/colexec/preinsert/preinsert_test.go b/pkg/sql/colexec/preinsert/preinsert_test.go index d33ad1b56322a..ae24b41b49732 100644 --- a/pkg/sql/colexec/preinsert/preinsert_test.go +++ b/pkg/sql/colexec/preinsert/preinsert_test.go @@ -454,6 +454,7 @@ func TestGenAutoIncrColRefreshesStaleTableID(t *testing.T) { Attrs: []string{catalog.FakePrimaryKeyColName}, EstimatedRowCount: 1, } + preInsert.ctr.tblId = preInsert.TableDef.TblId bat := batch.NewWithSize(1) bat.Vecs[0] = testutil.MakeInt64Vector([]int64{0}, nil) @@ -512,6 +513,7 @@ func TestGenAutoIncrColReturnsRetryWhenDefinitionStillChanged(t *testing.T) { Attrs: []string{catalog.FakePrimaryKeyColName}, EstimatedRowCount: 1, } + preInsert.ctr.tblId = preInsert.TableDef.TblId bat := batch.NewWithSize(1) bat.Vecs[0] = testutil.MakeInt64Vector([]int64{0}, nil) @@ -560,6 +562,7 @@ func TestGenAutoIncrColKeepsTemporaryTableBehavior(t *testing.T) { Attrs: []string{catalog.FakePrimaryKeyColName}, EstimatedRowCount: 1, } + preInsert.ctr.tblId = preInsert.TableDef.TblId bat := batch.NewWithSize(1) bat.Vecs[0] = testutil.MakeInt64Vector([]int64{0}, nil) diff --git a/pkg/sql/colexec/preinsert/types.go b/pkg/sql/colexec/preinsert/types.go index 79faa8265bc5e..793121740b091 100644 --- a/pkg/sql/colexec/preinsert/types.go +++ b/pkg/sql/colexec/preinsert/types.go @@ -32,6 +32,10 @@ type container struct { canFreeVecIdx map[int]bool //auto incr & expand constant vecotr.need free clusterByExecutor colexec.ExpressionExecutor compPkExecutor colexec.ExpressionExecutor + // tblId is a local copy of TableDef.TblId, refreshed by + // refreshAutoIncrementTableID. Storing it here avoids mutating the + // shared *plan.TableDef that other operators may read concurrently. + tblId uint64 } type PreInsert struct { ctr container diff --git a/test/distributed/cases/ddl/alter_table.result b/test/distributed/cases/ddl/alter_table.result index 84eeced022289..43b1e60b407ed 100644 --- a/test/distributed/cases/ddl/alter_table.result +++ b/test/distributed/cases/ddl/alter_table.result @@ -460,13 +460,13 @@ a b c d e alter table t7 add column f bool not null; select * from t7; a b c d e f -1 0 0.0 0 0.00 false -2 0 0.0 0 0.00 false +1 0 0.0 0 0.00 0 +2 0 0.0 0 0.00 0 alter table t7 add column g double after a; select * from t7; a g b c d e f -1 null 0 0.0 0 0.00 false -2 null 0 0.0 0 0.00 false +1 null 0 0.0 0 0.00 0 +2 null 0 0.0 0 0.00 0 drop table t7; drop table if exists t8; create table t8(a int not null); diff --git a/test/distributed/cases/ddl/comprimary_key.result b/test/distributed/cases/ddl/comprimary_key.result index 1777e14c92ed0..3fba7a6c05ad9 100644 --- a/test/distributed/cases/ddl/comprimary_key.result +++ b/test/distributed/cases/ddl/comprimary_key.result @@ -73,10 +73,10 @@ create table cpk_table_6(col1 tinyint,col2 smallint,col3 int,col4 bigint,col5 insert into cpk_table_6 select * from ex_table_cpk; select * from cpk_table_6; col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 -1 11 1 2 15 600 700 56 3.4365 5.559 math 2020-04-30 1998-08-07 00:00:00 1975-09-09 23:59:59 true 602.53 abcdefg message s@126.com comment balabalabalabalabala -2 20 3 4 21 220 1 3 7.2914 6.5836 art 2020-02-22 1998-06-04 00:00:00 1985-01-12 23:59:59 false 878.09 abcdefg message r@sina.com aaaabbbbbbccccc -3 9 5 20 1 500 2 4 1.1559 6.5635 english 2020-02-16 1998-01-21 23:59:59 2034-02-10 00:00:00 true 439.95 EF,GHI,G;KL/MN?OPQR.STU-_+=VWXYZabcdefgh OPQR.STU-_+=VWXYZa U-_+=VWXYZabcdefghigklmno .STU-_+=VWXYZab -3 20 3 7 1 700 600 20 7.2914 1.1732 science 2020-05-08 1998-12-30 00:00:00 1985-01-12 23:59:59 false 428.14 U-_+=VWXYZabcdefghigklmnopqrstuvwxy L/MN?OPQR.STU-_+=VWXYZabcdefghigklmnopqrstuvwxyz012 r@sina.com bbbbbbccccc +1 11 1 2 15 600 700 56 3.4365 5.559 math 2020-04-30 1998-08-07 00:00:00 1975-09-09 23:59:59 1 602.53 abcdefg message s@126.com comment balabalabalabalabala +2 20 3 4 21 220 1 3 7.2914 6.5836 art 2020-02-22 1998-06-04 00:00:00 1985-01-12 23:59:59 0 878.09 abcdefg message r@sina.com aaaabbbbbbccccc +3 9 5 20 1 500 2 4 1.1559 6.5635 english 2020-02-16 1998-01-21 23:59:59 2034-02-10 00:00:00 1 439.95 EF,GHI,G;KL/MN?OPQR.STU-_+=VWXYZabcdefgh OPQR.STU-_+=VWXYZa U-_+=VWXYZabcdefghigklmno .STU-_+=VWXYZab +3 20 3 7 1 700 600 20 7.2914 1.1732 science 2020-05-08 1998-12-30 00:00:00 1985-01-12 23:59:59 0 428.14 U-_+=VWXYZabcdefghigklmnopqrstuvwxy L/MN?OPQR.STU-_+=VWXYZabcdefghigklmnopqrstuvwxyz012 r@sina.com bbbbbbccccc insert into cpk_table_6 select * from ex_table_cpk; Duplicate entry '(.*)' for key '(.*)' create table cpk_table_7(a int,b float,c char(20),primary key(a,d)); diff --git a/test/distributed/cases/ddl/create_table_as_select.result b/test/distributed/cases/ddl/create_table_as_select.result index 398ddefd3e6d0..df82c0b1b1b13 100644 --- a/test/distributed/cases/ddl/create_table_as_select.result +++ b/test/distributed/cases/ddl/create_table_as_select.result @@ -590,8 +590,8 @@ show create table string04; select * from string04; oct(col2) empty(col3) length(col1) -2 false 17 -1 false 17 +2 0 17 +1 0 17 0 null 27 drop table string04; drop table if exists string05; @@ -622,9 +622,9 @@ Table Create Table string07 CREATE TABLE `string07` (\n `startswith(col1, )` bool DEFAULT NULL,\n `endswith(col1, )` bool DEFAULT NULL\n) select * from string07; startswith(col1, ) endswith(col1, ) -true false -true true -false false +1 0 +1 1 +0 0 drop table string07; drop table if exists string08; create table string08 as select hex(col2) from string01; @@ -935,20 +935,20 @@ Table Create Table table02 CREATE TABLE `table02` (\n `id` int NOT NULL AUTO_INCREMENT,\n `col1` varchar(255) NOT NULL,\n `col2` int DEFAULT NULL,\n `col3` decimal(10,2) DEFAULT NULL,\n `col4` date DEFAULT NULL,\n `col5` bool DEFAULT NULL,\n `col6` enum('apple','banana','orange') DEFAULT NULL,\n `col7` text DEFAULT NULL,\n `col8` timestamp NULL DEFAULT NULL,\n `col9` blob DEFAULT NULL,\n `col10` char(1) DEFAULT NULL\n) select * from table02; id col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 -1 Value2 456 78.90 2023-10-24 false banana Another text 2022-01-01 01:01:01 More binary data D -2 Value3 789 12.34 2023-10-25 true orange Yet another text 1979-01-01 01:01:01 Even more binary data E +1 Value2 456 78.90 2023-10-24 0 banana Another text 2022-01-01 01:01:01 More binary data D +2 Value3 789 12.34 2023-10-25 1 orange Yet another text 1979-01-01 01:01:01 Even more binary data E insert into table02 values (12, 'Value1', 123, 45.67, '2023-10-23', TRUE, 'apple', 'This is a text', '2019-01-01 01:01:01.000', 'Some binary data', 'C'); select * from table02; id col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 -1 Value2 456 78.90 2023-10-24 false banana Another text 2022-01-01 01:01:01 More binary data D -2 Value3 789 12.34 2023-10-25 true orange Yet another text 1979-01-01 01:01:01 Even more binary data E -12 Value1 123 45.67 2023-10-23 true apple This is a text 2019-01-01 01:01:01 Some binary data C +1 Value2 456 78.90 2023-10-24 0 banana Another text 2022-01-01 01:01:01 More binary data D +2 Value3 789 12.34 2023-10-25 1 orange Yet another text 1979-01-01 01:01:01 Even more binary data E +12 Value1 123 45.67 2023-10-23 1 apple This is a text 2019-01-01 01:01:01 Some binary data C update table02 set col1 = 'newvalue' where col2 = 456; delete from table02 where col10 = 'D'; select * from table02; id col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 -2 Value3 789 12.34 2023-10-25 true orange Yet another text 1979-01-01 01:01:01 Even more binary data E -12 Value1 123 45.67 2023-10-23 true apple This is a text 2019-01-01 01:01:01 Some binary data C +2 Value3 789 12.34 2023-10-25 1 orange Yet another text 1979-01-01 01:01:01 Even more binary data E +12 Value1 123 45.67 2023-10-23 1 apple This is a text 2019-01-01 01:01:01 Some binary data C alter table table02 add column newcolumn int after col3, drop column col4; show create table table02; Table Create Table @@ -969,8 +969,8 @@ col9 BLOB(0) YES null col10 CHAR(1) YES null select * from table02; id col1 col2 col3 newcolumn col5 col6 col7 col8 col9 col10 -2 Value3 789 12.34 null true orange Yet another text 1979-01-01 01:01:01 Even more binary data E -12 Value1 123 45.67 null true apple This is a text 2019-01-01 01:01:01 Some binary data C +2 Value3 789 12.34 null 1 orange Yet another text 1979-01-01 01:01:01 Even more binary data E +12 Value1 123 45.67 null 1 apple This is a text 2019-01-01 01:01:01 Some binary data C truncate table02; select * from table02; id col1 col2 col3 newcolumn col5 col6 col7 col8 col9 col10 @@ -1416,24 +1416,24 @@ insert into time_window03 values ('2023-10-26 10:20:00.000', null); insert into time_window03 values ('2023-10-26 10:30:00.000', true); select * from time_window03; ts col2 -2023-10-26 10:00:00 false -2023-10-26 10:10:00 true +2023-10-26 10:00:00 0 +2023-10-26 10:10:00 1 2023-10-26 10:20:00 null -2023-10-26 10:30:00 true +2023-10-26 10:30:00 1 drop table if exists time_window04; create table time_window04 as select _wstart, _wend, max(col2), min(col2) from time_window03 where ts > '2020-01-11 12:00:12.000' and ts < '2024-01-13 00:00:00.000' interval(ts, 10, second) fill(prev); select * from time_window04; _wstart _wend max(col2) min(col2) -2023-10-26 10:00:00 2023-10-26 10:00:10 false false -2023-10-26 10:10:00 2023-10-26 10:10:10 true true -2023-10-26 10:20:00 2023-10-26 10:20:10 true true -2023-10-26 10:30:00 2023-10-26 10:30:10 true true +2023-10-26 10:00:00 2023-10-26 10:00:10 0 0 +2023-10-26 10:10:00 2023-10-26 10:10:10 1 1 +2023-10-26 10:20:00 2023-10-26 10:20:10 1 1 +2023-10-26 10:30:00 2023-10-26 10:30:10 1 1 select * from time_window03; ts col2 -2023-10-26 10:00:00 false -2023-10-26 10:10:00 true +2023-10-26 10:00:00 0 +2023-10-26 10:10:00 1 2023-10-26 10:20:00 null -2023-10-26 10:30:00 true +2023-10-26 10:30:00 1 drop table time_window03; drop table time_window04; drop table if exists test.window01; diff --git a/test/distributed/cases/ddl/drop_if_exists.result b/test/distributed/cases/ddl/drop_if_exists.result index 52338b23cdf04..8095e0c9cb3d6 100644 --- a/test/distributed/cases/ddl/drop_if_exists.result +++ b/test/distributed/cases/ddl/drop_if_exists.result @@ -51,10 +51,10 @@ begin; create table test.t1(a int, b varchar); select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'test.t1'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, test.t1) -true +1 insert into test.t1 select *,"just a test for clean files from the disk" from generate_series(1, 50*10000)g; select count(*) from test.t1; count(*) @@ -62,7 +62,7 @@ count(*) drop table test.t1; select disable_fault_injection(); disable_fault_injection() -true +1 commit; drop database test; diff --git a/test/distributed/cases/ddl/lowercase.result b/test/distributed/cases/ddl/lowercase.result index 821b3f173ba0e..eaf2baa8c4f80 100644 --- a/test/distributed/cases/ddl/lowercase.result +++ b/test/distributed/cases/ddl/lowercase.result @@ -324,7 +324,7 @@ CREATE SEQUENCE seq increment 100 start 30; table seq already exists SELECT * FROM SEQ; last_seq_num min_value max_value start_value increment_value cycle is_called -30 1 9223372036854775807 30 100 false false +30 1 9223372036854775807 30 100 0 0 SELECT laSt_seq_nuM,min_value,start_value FROM Seq; laSt_seq_nuM min_value start_value 30 1 30 @@ -491,7 +491,7 @@ CREATE SEQUENCE `seq` increment 100 start 30; table seq already exists SELECT * FROM `SEQ`; last_seq_num min_value max_value start_value increment_value cycle is_called -30 1 9223372036854775807 30 100 false false +30 1 9223372036854775807 30 100 0 0 SELECT `laSt_seq_nuM`,`min_value`,`start_value` FROM Seq; laSt_seq_nuM min_value start_value 30 1 30 diff --git a/test/distributed/cases/disttae/disttae_filters/ranges_filters/ranges_filters.result b/test/distributed/cases/disttae/disttae_filters/ranges_filters/ranges_filters.result index 98ff7198fa9b2..e292195eb61e2 100644 --- a/test/distributed/cases/disttae/disttae_filters/ranges_filters/ranges_filters.result +++ b/test/distributed/cases/disttae/disttae_filters/ranges_filters/ranges_filters.result @@ -9,11 +9,11 @@ a drop table hhh; select enable_fault_injection(); enable_fault_injection() -true +1 create table t2(a int primary key, b int); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t2'); add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t2'); -true +1 insert into t2 select *,* from generate_series(1,81920)g; select a from t2 where a in (1,2) or a in (10000,10001) or a in (20000,20001) or a in (40000,40001); a @@ -29,4 +29,4 @@ drop table t2; drop database testdb; select disable_fault_injection(); disable_fault_injection(); -true \ No newline at end of file +1 \ No newline at end of file diff --git a/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/between_filter.result b/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/between_filter.result index bc3681eefe296..cade7f23017cc 100644 --- a/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/between_filter.result +++ b/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/between_filter.result @@ -3,11 +3,11 @@ create database testdb; use testdb; select enable_fault_injection(); enable_fault_injection() -true +1 create table t1 (a int primary key, b int); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t1'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t1) -true +1 insert into t1 select *, * from generate_series(1,81920)g; select b from t1 where a between 8191 and 8193 order by b asc; b @@ -19,7 +19,7 @@ drop table t1; create table t2 (a varchar primary key, b varchar); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t2'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t2) -true +1 insert into t2 select *, * from generate_series(1,81920)g; select b from t2 where a between 1 and 3 order by b asc; b @@ -31,7 +31,7 @@ drop table t2; create table t3 (a decimal primary key, b decimal); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t3'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t3) -true +1 insert into t3 select *, * from generate_series(1,81920)g; select b from t3 where a between 10 and 13 order by b asc; b @@ -44,7 +44,7 @@ drop table t3; create table t4 (a int, b int, index(b)); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t4'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t4) -true +1 insert into t4 select *, * from generate_series(1,81920)g; select a from t4 where b between 8191 and 8193 order by a asc; a @@ -56,7 +56,7 @@ drop table t4; create table t5 (a varchar, b varchar, index(b)); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t5'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t5) -true +1 insert into t5 select *, * from generate_series(1,81920)g; select a from t5 where b between 1 and 3 order by a asc; a @@ -68,7 +68,7 @@ drop table t5; create table t6 (a decimal, b decimal, index(b)); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t6'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t6) -true +1 insert into t6 select *, * from generate_series(1,81920)g; select a from t6 where b between 10 and 13 order by a asc; a @@ -81,4 +81,4 @@ drop table t6; drop database testdb; select disable_fault_injection(); disable_fault_injection() -true \ No newline at end of file +1 \ No newline at end of file diff --git a/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/block_reader_filter.result b/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/block_reader_filter.result index 75b3db924c94c..636b5aa0cf463 100644 --- a/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/block_reader_filter.result +++ b/test/distributed/cases/disttae/disttae_filters/reader_filters/block_reader/block_reader_filter.result @@ -1,133 +1,133 @@ -drop database if exists testdb; -create database testdb; -use testdb; -select enable_fault_injection(); -enable_fault_injection() -true -create table t1(a int, b int, index(b)); -select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t1'); -add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t1) -true -insert into t1 select *, * from generate_series(1, 40960)g; -select a from t1 where b = 1; -a -1 -select a from t1 where b between 1 and 3; -a -1 -2 -3 -select a from t1 where b in (1,2,3); -a -1 -2 -3 -drop table t1; -create table t2(a varchar, b varchar, index(b)); -select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t2'); -add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, tesdb.t2) -true -insert into t2 values('1','2'),('3','4'),('5','6'),('7','8'),('a','b'),('c','d'),('e','f'),('g','h'); -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -insert into t2 select * from t2; -select count(*) from t2; -count(*) -65536 -select distinct a from t2 where b = '2'; -distinct a -1 -select distinct a from t2 where b between '2' and '6'; -distinct a -1 -3 -5 -select distinct a from t2 where b in ('2','4','6'); -distinct a -1 -3 -5 -drop table t2; -create table t3 (a float, b float, index(b)); -select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t3'); -add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t1) -true -insert into t3 select *, * from generate_series(1, 40960)g; -select a from t3 where b = 1; -a -1 -select a from t3 where b between 1 and 3; -a -1 -2 -3 -select a from t3 where b in (1,2,3); -a -1 -2 -3 -drop table t3; -create table t4(a int primary key, b int); -select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t4'); -add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t4) -true -insert into t4 select *, * from generate_series(1, 40960)g; -select b from t4 where a < 3; -b -1 -2 -select b from t4 where a <= 3; -b -1 -2 -3 -select b from t4 where a > 1 and a < 3; -b -2 -select b from t4 where a >= 1 and a < 3; -b -1 -2 -select b from t4 where a > 1 and a <= 3; -b -2 -3 -select b from t4 where a >= 1 and a <= 3; -b -1 -2 -3 -select b from t4 where a < 3 and a = 3; -b -select b from t4 where a < 1 or a < 3; -b -1 -2 -select b from t4 where a <= 1 or a <= 3; -b -1 -2 -3 -select b from t4 where a < 2 or a = 3; -b -1 -3 -select b from t4 where a < 3 or a = 2; -b -1 -2 -drop table t4; -drop database testdb; -select disable_fault_injection(); -disable_fault_injection() -true \ No newline at end of file +drop database if exists testdb; +create database testdb; +use testdb; +select enable_fault_injection(); +enable_fault_injection() +1 +create table t1(a int, b int, index(b)); +select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t1'); +add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t1) +1 +insert into t1 select *, * from generate_series(1, 40960)g; +select a from t1 where b = 1; +a +1 +select a from t1 where b between 1 and 3; +a +1 +2 +3 +select a from t1 where b in (1,2,3); +a +1 +2 +3 +drop table t1; +create table t2(a varchar, b varchar, index(b)); +select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t2'); +add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t2) +1 +insert into t2 values('1','2'),('3','4'),('5','6'),('7','8'),('a','b'),('c','d'),('e','f'),('g','h'); +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +insert into t2 select * from t2; +select count(*) from t2; +count(*) +65536 +select distinct a from t2 where b = '2'; +a +1 +select distinct a from t2 where b between '2' and '6'; +a +1 +3 +5 +select distinct a from t2 where b in ('2','4','6'); +a +1 +3 +5 +drop table t2; +create table t3 (a float, b float, index(b)); +select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t3'); +add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t3) +1 +insert into t3 select *, * from generate_series(1, 40960)g; +select a from t3 where b = 1; +a +1.0 +select a from t3 where b between 1 and 3; +a +1.0 +2.0 +3.0 +select a from t3 where b in (1,2,3); +a +1.0 +2.0 +3.0 +drop table t3; +create table t4(a int primary key, b int); +select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'testdb.t4'); +add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, testdb.t4) +1 +insert into t4 select *, * from generate_series(1, 40960)g; +select b from t4 where a < 3; +b +1 +2 +select b from t4 where a <= 3; +b +1 +2 +3 +select b from t4 where a > 1 and a < 3; +b +2 +select b from t4 where a >= 1 and a < 3; +b +1 +2 +select b from t4 where a > 1 and a <= 3; +b +2 +3 +select b from t4 where a >= 1 and a <= 3; +b +1 +2 +3 +select b from t4 where a < 3 and a = 3; +b +select b from t4 where a < 1 or a < 3; +b +1 +2 +select b from t4 where a <= 1 or a <= 3; +b +1 +2 +3 +select b from t4 where a < 2 or a = 3; +b +1 +3 +select b from t4 where a < 3 or a = 2; +b +1 +2 +drop table t4; +drop database testdb; +select disable_fault_injection(); +disable_fault_injection() +1 diff --git a/test/distributed/cases/dml/checkpoint/connectlogtail.result b/test/distributed/cases/dml/checkpoint/connectlogtail.result index a5295dca65f68..fc959c145817f 100644 --- a/test/distributed/cases/dml/checkpoint/connectlogtail.result +++ b/test/distributed/cases/dml/checkpoint/connectlogtail.result @@ -1,30 +1,30 @@ select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/recv/err', ':::', 'echo', 20, ''); add_fault_point(fj/cn/recv/err, :::, echo, 20, ) -true +1 select add_fault_point('fj/cn/recv/subsyserr', ':::', 'echo', 300, ''); add_fault_point(fj/cn/recv/subsyserr, :::, echo, 300, ) -true +1 select sleep(1); sleep(1) 0 select remove_fault_point('fj/cn/recv/subsyserr'); remove_fault_point(fj/cn/recv/subsyserr) -true +1 select add_fault_point('fj/cn/recv/rcacheerr', ':::', 'echo', 700, ''); add_fault_point(fj/cn/recv/rcacheerr, :::, echo, 700, ) -true +1 select sleep(1); sleep(1) 0 select remove_fault_point('fj/cn/recv/rcacheerr'); remove_fault_point(fj/cn/recv/rcacheerr) -true +1 select disable_fault_injection(); disable_fault_injection() -true +1 select sleep(1); sleep(1) 0 diff --git a/test/distributed/cases/dml/delete/delete_workspace.result b/test/distributed/cases/dml/delete/delete_workspace.result index c62445e4da745..f63d69b4cdc8b 100644 --- a/test/distributed/cases/dml/delete/delete_workspace.result +++ b/test/distributed/cases/dml/delete/delete_workspace.result @@ -11,10 +11,10 @@ count(*) + 1000 rollback; select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/log/workspace',':::','echo',40,'test.t'); add_fault_point(fj/log/workspace, :::, echo, 40, test.t) -true +1 begin; insert into t select *,*,"abcdefghijklmnopqrst" from generate_series(1, 8192000)g; delete from t where a mod 999 = 0 limit 1000; @@ -24,6 +24,6 @@ count(*) + 1000 rollback; select disable_fault_injection(); disable_fault_injection() -true +1 drop table if exists t; drop database if exists test; \ No newline at end of file diff --git a/test/distributed/cases/dml/insert/insert_duplicate.result b/test/distributed/cases/dml/insert/insert_duplicate.result index 6ad8736433d4b..6c8f1db894b94 100644 --- a/test/distributed/cases/dml/insert/insert_duplicate.result +++ b/test/distributed/cases/dml/insert/insert_duplicate.result @@ -1293,7 +1293,7 @@ update_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP INSERT INTO users (id, counter) VALUES (112, 1); SELECT id, counter, create_at = update_at AS timestamps_equal FROM users; id counter timestamps_equal -112 1 true +112 1 1 SELECT SLEEP(1); SLEEP(1) 0 @@ -1303,7 +1303,7 @@ counter = counter + VALUES(counter), create_at = CURRENT_TIMESTAMP(); SELECT id, counter, create_at = update_at AS timestamps_equal FROM users; id counter timestamps_equal -112 3 true +112 3 1 DROP TABLE users; DROP TABLE IF EXISTS auto_test; CREATE TABLE auto_test ( diff --git a/test/distributed/cases/dml/insert/not_null_check.result b/test/distributed/cases/dml/insert/not_null_check.result index 7554bf976590a..b7984db7769e8 100644 --- a/test/distributed/cases/dml/insert/not_null_check.result +++ b/test/distributed/cases/dml/insert/not_null_check.result @@ -34,14 +34,14 @@ drop table t1; create table t1 (a int primary key, b int); select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('inject_send_pipeline', ':::', 'echo', 1, 't1'); add_fault_point(inject_send_pipeline, :::, echo, 1, t1) -true +1 INSERT INTO t1 SELECT result,result FROM generate_series(1,3000000) g; select disable_fault_injection(); disable_fault_injection() -true +1 drop table if exists t1; create table t1(a int, b int, c int, primary key(a,b)); insert into t1 select result,result,result from generate_series(200000) g; diff --git a/test/distributed/cases/dml/insert/on_duplicate_key.result b/test/distributed/cases/dml/insert/on_duplicate_key.result index de5e915a5a4d1..db5a6016263ed 100644 --- a/test/distributed/cases/dml/insert/on_duplicate_key.result +++ b/test/distributed/cases/dml/insert/on_duplicate_key.result @@ -229,14 +229,14 @@ create table users (id int primary key auto_increment, counter int, create_at da insert into users (id, counter) values ('112',1); select id, counter, create_at = update_at from users; id counter create_at = update_at -112 1 true +112 1 1 select sleep(1); sleep(1) 0 insert into users (id, counter) values ('112',2) on duplicate key update counter=counter+values(counter), create_at=current_timestamp(); select id, counter, create_at = update_at from users; id counter create_at = update_at -112 3 true +112 3 1 drop table if exists t_null_dup; create table t_null_dup (id int primary key, a int, b int); insert into t_null_dup values (1, 100, 100), (3, 300, 300); diff --git a/test/distributed/cases/dml/select/select.result b/test/distributed/cases/dml/select/select.result index b78fd7ffde7b2..010b3cd1908dc 100755 --- a/test/distributed/cases/dml/select/select.result +++ b/test/distributed/cases/dml/select/select.result @@ -466,7 +466,7 @@ count(*) 0 select 1 > 0; 1 > 0 -true +1 SELECT TABLE_SCHEMA AS TABLE_CAT, NULL AS TABLE_SCHEM, TABLE_NAME, CASE WHEN TABLE_TYPE='BASE TABLE' THEN CASE WHEN TABLE_SCHEMA = 'mysql' OR TABLE_SCHEMA = 'performance_schema' THEN 'SYSTEM TABLE' ELSE 'TABLE' END WHEN TABLE_TYPE='TEMPORARY' THEN 'LOCAL_TEMPORARY' ELSE TABLE_TYPE END AS TABLE_TYPE, TABLE_COMMENT AS REMARKS, NULL AS TYPE_CAT, NULL AS TYPE_SCHEM, NULL AS TYPE_NAME, NULL AS SELF_REFERENCING_COL_NAME, NULL AS REF_GENERATION FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'abc' group by null HAVING TABLE_TYPE IN ('LOCAL TEMPORARY','TABLE','VIEW',null,null) ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME; SQL syntax error: non-integer constant in GROUP BY use db1; diff --git a/test/distributed/cases/dml/select/union_and_union_all.result b/test/distributed/cases/dml/select/union_and_union_all.result index f253383d49767..c04e5ecdd8116 100644 --- a/test/distributed/cases/dml/select/union_and_union_all.result +++ b/test/distributed/cases/dml/select/union_and_union_all.result @@ -183,8 +183,8 @@ a 127.44 select a from t3 union select col4 from t4; a -true -false +1 +0 drop table t3; drop table t4; drop table if exists t5; diff --git a/test/distributed/cases/dml/show/database_statistics.result b/test/distributed/cases/dml/show/database_statistics.result index e1accef23f104..42282dd3147ac 100644 --- a/test/distributed/cases/dml/show/database_statistics.result +++ b/test/distributed/cases/dml/show/database_statistics.result @@ -211,11 +211,11 @@ mo_table_rows(test_db, t1) mo_table_size(test_db, t1) insert into t1 values(100,10.34,"你好",'aaa','2011-10-10',0); show table_values from t1; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 false false +100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 0 0 insert into t1 values(10,1.34,"你",'aa','2011-10-11',1); show table_values from t1; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 true false +100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 1 0 set mo_table_stats.use_old_impl = yes; select mo_table_rows("test_db","t1"),mo_table_size("test_db","t1"); mo_table_rows(test_db, t1) mo_table_size(test_db, t1) @@ -242,11 +242,11 @@ mo_table_rows(test_db, t11) mo_table_size(test_db, t11) insert into t11 values(100,10.34,"你好",'aaa','2011-10-10',0); show table_values from t11; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 false false +100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 0 0 insert into t11 values(10,1.34,"你",'aa','2011-10-11',1); show table_values from t11; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 true false +100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 1 0 set mo_table_stats.use_old_impl = yes; select mo_table_rows("test_db","t11"),mo_table_size("test_db","t11"); mo_table_rows(test_db, t11) mo_table_size(test_db, t11) @@ -263,14 +263,14 @@ col7 bool select * from external_table; col1 col2 col3 col4 col6 col7 null null null null -100 10.34 你好 aaa 2011-10-10 false -10 1.34 你 aa 2011-10-11 true +100 10.34 你好 aaa 2011-10-10 0 +10 1.34 你 aa 2011-10-11 1 show table_number from test_db; Number of tables in test_db 3 show table_values from external_table; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 10 10.34 1.34 你好 aaa 2011-10-11 2011-10-10 true false +100 10 10.34 1.34 你好 aaa 2011-10-11 2011-10-10 1 0 DROP TABLE IF EXISTS partition_table; create table partition_table( empno int unsigned auto_increment, @@ -477,11 +477,11 @@ mo_table_rows(test_db, t1) mo_table_size(test_db, t1) insert into t1 values(100,10.34,"你好",'aaa','2011-10-10',0); show table_values from t1; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 false false +100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 0 0 insert into t1 values(10,1.34,"你",'aa','2011-10-11',1); show table_values from t1; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 true false +100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 1 0 set mo_table_stats.use_old_impl = yes; select mo_table_rows("test_db","t1"),mo_table_size("test_db","t1"); mo_table_rows(test_db, t1) mo_table_size(test_db, t1) @@ -508,11 +508,11 @@ mo_table_rows(test_db, t11) mo_table_size(test_db, t11) insert into t11 values(100,10.34,"你好",'aaa','2011-10-10',0); show table_values from t11; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 false false +100 100 10.34 10.34 你好 你好 aaa aaa 2011-10-10 2011-10-10 0 0 insert into t11 values(10,1.34,"你",'aa','2011-10-11',1); show table_values from t11; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 true false +100 10 10.34 1.34 你好 你 aaa aa 2011-10-11 2011-10-10 1 0 set mo_table_stats.use_old_impl = yes; select mo_table_rows("test_db","t11"),mo_table_size("test_db","t11"); mo_table_rows(test_db, t11) mo_table_size(test_db, t11) @@ -529,14 +529,14 @@ col7 bool select * from external_table; col1 col2 col3 col4 col6 col7 null null null null -100 10.34 你好 aaa 2011-10-10 false -10 1.34 你 aa 2011-10-11 true +100 10.34 你好 aaa 2011-10-10 0 +10 1.34 你 aa 2011-10-11 1 show table_number from test_db; Number of tables in test_db 3 show table_values from external_table; max(col1) min(col1) max(col2) min(col2) max(col3) min(col3) max(col4) min(col4) max(col6) min(col6) max(col7) min(col7) -100 10 10.34 1.34 你好 aaa 2011-10-11 2011-10-10 true false +100 10 10.34 1.34 你好 aaa 2011-10-11 2011-10-10 1 0 create table t2( col1 json ); diff --git a/test/distributed/cases/dml/update/update.result b/test/distributed/cases/dml/update/update.result index c850371a07674..e3496002580cb 100644 --- a/test/distributed/cases/dml/update/update.result +++ b/test/distributed/cases/dml/update/update.result @@ -239,11 +239,11 @@ b datetime NOT NULL DEFAULT CURRENT_TIMESTAMP insert into t1(id) values(1); select a is null from t1; a is null -true +1 update t1 set id = 2 where id = 1; select a is not null from t1; a is not null -true +1 update t1 set id = 3, a = '20121212' where id = 2; select id from t1 where a = '20121212'; id @@ -301,7 +301,7 @@ insert into t1(a) values(1); update t1 set a = 2 where a = 1; select c is not null from t1; c is not null -true +1 drop table if exists t1; create table t1 (a int primary key, b int); insert into t1 values (1,100); diff --git a/test/distributed/cases/dml/update/update_workspace.result b/test/distributed/cases/dml/update/update_workspace.result index 321d138edd596..5e472653ca800 100644 --- a/test/distributed/cases/dml/update/update_workspace.result +++ b/test/distributed/cases/dml/update/update_workspace.result @@ -46,6 +46,6 @@ min(a) 33 select max(a)=min(a)+81920-1 from hhh; max(a)=min(a)+81920-1 -true +1 drop table if exists hhh; drop database if exists test; diff --git a/test/distributed/cases/dtype/bigint.result b/test/distributed/cases/dtype/bigint.result index d64ddef2540cd..2f306c52c6d32 100644 --- a/test/distributed/cases/dtype/bigint.result +++ b/test/distributed/cases/dtype/bigint.result @@ -159,20 +159,20 @@ CREATE TABLE t_bigint(id BIGINT); insert INTO t_bigint VALUES (1), (2); SELECT id, id >= 1.1 FROM t_bigint; id id >= 1.1 -1 false -2 true +1 0 +2 1 SELECT id, 1.1 <= id FROM t_bigint; id 1.1 <= id -1 false -2 true +1 0 +2 1 SELECT id, id = 1.1 FROM t_bigint; id id = 1.1 -1 false -2 false +1 0 +2 0 SELECT id, 1.1 = id FROM t_bigint; id 1.1 = id -1 false -2 false +1 0 +2 0 SELECT * from t_bigint WHERE id = 1.1; id SELECT * from t_bigint WHERE id = 1.1e0; @@ -228,37 +228,37 @@ count(*) drop table t; SELECT (184467440737095 BETWEEN 0 AND 18446744073709551500); 184467440737095 between 0 and 18446744073709551500 -true +1 SELECT 184467440737095 >= 0; 184467440737095 >= 0 -true +1 SELECT CAST(100 AS UNSIGNED) BETWEEN 1 AND -1; cast(100 as unsigned) between 1 and -1 -false +0 SELECT CAST(100 AS UNSIGNED) NOT BETWEEN 1 AND -1; cast(100 as unsigned) not between 1 and -1 -true +1 SELECT CAST(0 AS UNSIGNED) BETWEEN 0 AND -1; cast(0 as unsigned) between 0 and -1 -false +0 SELECT CAST(0 AS UNSIGNED) NOT BETWEEN 0 AND -1; cast(0 as unsigned) not between 0 and -1 -true +1 SELECT ( 9223372036854775808 BETWEEN 9223372036854775808 AND 9223372036854775808 ); 9223372036854775808 between 9223372036854775808 and 9223372036854775808 -true +1 SELECT ( 9223372036854775807 BETWEEN 9223372036854775808 AND 1 ); 9223372036854775807 between 9223372036854775808 and 1 -false +0 SELECT ( -1 BETWEEN 9223372036854775808 AND 1 ); -1 between 9223372036854775808 and 1 -false +0 SELECT ( 0 BETWEEN 9223372036854775808 AND 1 ); 0 between 9223372036854775808 and 1 -false +0 SELECT ( 1 BETWEEN 9223372036854775808 AND 1 ); 1 between 9223372036854775808 and 1 -false +0 drop table if exists t1; drop table if exists t2; drop table if exists t3; diff --git a/test/distributed/cases/dtype/binary.result b/test/distributed/cases/dtype/binary.result index 8405840050487..9857b49bb6875 100644 Binary files a/test/distributed/cases/dtype/binary.result and b/test/distributed/cases/dtype/binary.result differ diff --git a/test/distributed/cases/dtype/bool.result b/test/distributed/cases/dtype/bool.result index c4e4c09c92ebc..48803e577b905 100644 --- a/test/distributed/cases/dtype/bool.result +++ b/test/distributed/cases/dtype/bool.result @@ -3,162 +3,162 @@ create table t1 (a boolean,b bool); insert into t1 values (0,1),(true,false),(true,1),(0,false),(NULL,NULL); select * from t1; a b -false true -true false -true true -false false +0 1 +1 0 +1 1 +0 0 null null SELECT * FROM t1 WHERE IF(a AND 1, 0, 1) order by a asc; a b -false true -false false +0 1 +0 0 null null SELECT * FROM t1 WHERE IF(1 AND a, 0, 1); a b -false true -false false +0 1 +0 0 null null SELECT * FROM t1 where NOT(a AND 1) order by a asc, b desc; a b -false true -false false +0 1 +0 0 SELECT * FROM t1 where NOT(1 AND a); a b -false true -false false +0 1 +0 0 SELECT * FROM t1 where (a AND 1)=0; a b -false true -false false +0 1 +0 0 SELECT * FROM t1 where (1 AND a)=0; a b -false true -false false +0 1 +0 0 SELECT * FROM t1 where (1 AND a)=1 order by a asc, 2 asc; a b -true false -true true +1 0 +1 1 SELECT * FROM t1 where (1 AND a) IS NULL order by 1 desc, 2 asc; a b null null select not a,a and b,a or b,a xor b from t1; not a a and b a or b a xor b -true false true true -false false true true -false true true false -true false false false +1 0 1 1 +0 0 1 1 +0 1 1 0 +1 0 0 0 null null null null select not a and not b from t1; not a and not b -false -false -false -true +0 +0 +0 +1 null select not a or b xor b from t1; not a or b xor b -true -false -false -true +1 +0 +0 +1 null drop table if exists t2; create table t2(a int,b int); insert into t2 values(1,2),(3,4); select a<2 from t2; a<2 -true -false +1 +0 select a<2 and b<3 from t2; a<2 and b<3 -true -false +1 +0 select a=1 or b=3 from t2; a=1 or b=3 -true -false +1 +0 select a,count(a) from t1 group by a; a count(a) -false 2 -true 2 +0 2 +1 2 null 0 select max(b) from t1; max(b) -true +1 select min(a) from t1; min(a) -false +0 select max(b)b order by a asc; a b -true false +1 0 select * from t2 where a<1 AND NOT b order by b desc; a b select b,max(b) from t1 where b is not NULL group by b order by b; b max(b) -false false -true true +0 0 +1 1 select * from t1 where a<=b and a is not NULL; a b -false true -true true -false false +0 1 +1 1 +0 0 select t1.a,t2.b from t1 join t2 on t1.a=t2.a order by t1.a desc, 2 desc; a b -true 2 -true 2 +1 2 +1 2 select a,count(a) from t1 group by a having count(a)>1; a count(a) -false 2 -true 2 +0 2 +1 2 select a,any_value(b) from t1 where isnotnull(a) group by a order by a asc; a any_value(b) -false true -true false +0 1 +1 0 select a,b from t1 where a in (0,1); a b -false true -true false -true true -false false +0 1 +1 0 +1 1 +0 0 select a,b from t1 where a not in (0,2); a b -true false -true true +1 0 +1 1 select distinct t.a from (select * from t1) t where a not in (2) order by t.a asc; a -false -true +0 +1 select a and b from t1 where exists (select a from t1 where a is null) order by a desc; a and b -false -true -false -false +0 +1 +0 +0 null update t1 set a=false where b is null; delete from t1 where a=false; select * from t1; a b -true false -true true +1 0 +1 1 delete from t1 where b=true; select * from t1; a b -true false \ No newline at end of file +1 0 \ No newline at end of file diff --git a/test/distributed/cases/dtype/char.result b/test/distributed/cases/dtype/char.result index 2fedfd9fcc7d0..f6946ffa8cb01 100644 --- a/test/distributed/cases/dtype/char.result +++ b/test/distributed/cases/dtype/char.result @@ -11,14 +11,14 @@ SELECT 38.8, CAST(38.8 AS CHAR); 38.8 CAST(38.8 AS CHAR) 38.8 38.8 SELECT '9223372036854775807' = 9223372036854775807; -'9223372036854775807' = 9223372036854775807 -true +9223372036854775807 = 9223372036854775807 +1 SELECT '9223372036854775807' = "9223372036854775807"; -'9223372036854775807' = "9223372036854775807" -true +9223372036854775807 = 9223372036854775807 +1 SELECT CAST('9223372036854775807' AS UNSIGNED) = 9223372036854775806; -CAST('9223372036854775807' AS UNSIGNED) = 9223372036854775806 -false +cast(9223372036854775807 as unsigned) = 9223372036854775806 +0 SELECT CAST("2017-08-29" AS DATE); CAST("2017-08-29" AS DATE) 2017-08-29 @@ -112,8 +112,8 @@ cage 29 select cast(Age as char) and Age as cAge from Demochar where Age>=50 order by cAge asc; cAge -true -true +1 +1 CREATE TABLE employees ( employeeNumber int(11) NOT NULL, lastName char(50) NOT NULL, diff --git a/test/distributed/cases/dtype/date.result b/test/distributed/cases/dtype/date.result index 996025289ec81..98cde28450e3f 100644 --- a/test/distributed/cases/dtype/date.result +++ b/test/distributed/cases/dtype/date.result @@ -122,18 +122,18 @@ CREATE TABLE t_date(id date); insert INTO t_date VALUES ('2020-01-01'), ('2022-01-02'); SELECT id, id >= 20200102 FROM t_date; id id >= 20200102 -2020-01-01 false -2022-01-02 false +2020-01-01 0 +2022-01-02 0 SELECT id, 1.1 <= '2020-01-01' FROM t_date; strconv.ParseFloat: parsing "2020-01-01": invalid syntax SELECT id, id = 202020101 FROM t_date; id id = 202020101 -2020-01-01 false -2022-01-02 false +2020-01-01 0 +2022-01-02 0 SELECT id, '20200101' = id FROM t_date; id 20200101 = id -2020-01-01 true -2022-01-02 false +2020-01-01 1 +2022-01-02 0 SELECT * from t_date WHERE id = 20200101; id SELECT * from t_date WHERE id = 2.0200101e7; diff --git a/test/distributed/cases/dtype/datetime.result b/test/distributed/cases/dtype/datetime.result index e8f465671518a..54dc96d6b5839 100644 --- a/test/distributed/cases/dtype/datetime.result +++ b/test/distributed/cases/dtype/datetime.result @@ -158,12 +158,12 @@ CREATE TABLE t_datetime(id datetime(6)); INSERT INTO t_datetime VALUES ('2020-01-01 23:59:59.999999'), ('2022-01-02 00:00:00'); SELECT id, id >= 20200102 FROM t_datetime; id id >= 20200102 -2020-01-01 23:59:59.999999000 true -2022-01-02 00:00:00 true +2020-01-01 23:59:59.999999000 1 +2022-01-02 00:00:00 1 SELECT id, id = 202020101 FROM t_datetime; id id = 202020101 -2020-01-01 23:59:59.999999000 false -2022-01-02 00:00:00 false +2020-01-01 23:59:59.999999000 0 +2022-01-02 00:00:00 0 SELECT * from t_datetime WHERE id = 20200102; id SELECT * from t_datetime WHERE id = 2.0200102e7; diff --git a/test/distributed/cases/dtype/datetime_precision_comprehensive.result b/test/distributed/cases/dtype/datetime_precision_comprehensive.result index 03639ab8b1a8c..19867a73804bc 100644 --- a/test/distributed/cases/dtype/datetime_precision_comprehensive.result +++ b/test/distributed/cases/dtype/datetime_precision_comprehensive.result @@ -84,10 +84,10 @@ match_with_original DROP TABLE t_datetime_where; SELECT CAST('2024-01-15 12:34:56' AS DATETIME(0)) = CAST('2024-01-15 12:34:56.000000' AS DATETIME(6)) AS datetime_0_eq_6_same; datetime_0_eq_6_same -true +1 SELECT CAST('2024-01-15 12:34:56' AS DATETIME(0)) = CAST('2024-01-15 12:34:56.123456' AS DATETIME(6)) AS datetime_0_eq_6_diff; datetime_0_eq_6_diff -false +0 DROP TABLE IF EXISTS t_datetime_half; CREATE TABLE t_datetime_half ( id INT, diff --git a/test/distributed/cases/dtype/decimal.result b/test/distributed/cases/dtype/decimal.result index 14fe7c158446e..14bfa8824ae93 100644 --- a/test/distributed/cases/dtype/decimal.result +++ b/test/distributed/cases/dtype/decimal.result @@ -132,28 +132,28 @@ id 2.20000 SELECT id, id >= 1.1 FROM t_decimal; id id >= 1.1 -1.00000 false -2.00000 true -1.10000 true -2.20000 true +1.00000 0 +2.00000 1 +1.10000 1 +2.20000 1 SELECT id, 1.1 <= id FROM t_decimal; id 1.1 <= id -1.00000 false -2.00000 true -1.10000 true -2.20000 true +1.00000 0 +2.00000 1 +1.10000 1 +2.20000 1 SELECT id, id = 1.1 FROM t_decimal; id id = 1.1 -1.00000 false -2.00000 false -1.10000 true -2.20000 false +1.00000 0 +2.00000 0 +1.10000 1 +2.20000 0 SELECT id, 1.1 = id FROM t_decimal; id 1.1 = id -1.00000 false -2.00000 false -1.10000 true -2.20000 false +1.00000 0 +2.00000 0 +1.10000 1 +2.20000 0 SELECT * from t_decimal WHERE id = 1.1; id 1.10000 @@ -229,16 +229,16 @@ drop table t; [unknown result because it is related to issue#3280] SELECT CAST(1.00 AS decimal) BETWEEN 1 AND -1; cast(1.00 as decimal(38)) between 1 and -1 -false +0 SELECT CAST(1.00 AS decimal) NOT BETWEEN 1 AND -1; cast(1.00 as decimal(38)) not between 1 and -1 -true +1 SELECT CAST(-0 AS decimal) BETWEEN 0 AND -1; cast(-0 as decimal(38)) between 0 and -1 -false +0 SELECT CAST(0 AS decimal) NOT BETWEEN 0 AND -1; cast(0 as decimal(38)) not between 0 and -1 -true +1 drop table if exists t1; drop table if exists t2; drop table if exists t3; diff --git a/test/distributed/cases/dtype/double.result b/test/distributed/cases/dtype/double.result index 3654a10db4dc2..237fd97cb136b 100644 --- a/test/distributed/cases/dtype/double.result +++ b/test/distributed/cases/dtype/double.result @@ -167,24 +167,24 @@ CREATE TABLE t_double(id double(30,1)); INSERT INTO t_double VALUES (1.19),(1.11), (2); SELECT id, id >= 1.1 FROM t_double; id id >= 1.1 -1.2 true -1.1 true -2.0 true +1.2 1 +1.1 1 +2.0 1 SELECT id, 1.1 <= id FROM t_double; id 1.1 <= id -1.2 true -1.1 true -2.0 true +1.2 1 +1.1 1 +2.0 1 SELECT id, id = 1.1 FROM t_double; id id = 1.1 -1.2 false -1.1 true -2.0 false +1.2 0 +1.1 1 +2.0 0 SELECT id, 1.1 = id FROM t_double; id 1.1 = id -1.2 false -1.1 true -2.0 false +1.2 0 +1.1 1 +2.0 0 SELECT * from t_double WHERE id = 1.1; id 1.1 diff --git a/test/distributed/cases/dtype/enum.result b/test/distributed/cases/dtype/enum.result index 2676ebc9a71f6..db28f5140a9f3 100644 --- a/test/distributed/cases/dtype/enum.result +++ b/test/distributed/cases/dtype/enum.result @@ -419,14 +419,14 @@ engine *** engine *** select startswith(col2,'eng') from builtin01; startswith(col2, eng) -false -true -true +0 +1 +1 select endswith(col1,'数据表') from builtin01; endswith(col1, 数据表) -false -false -false +0 +0 +0 select reverse(col1),reverse(col2) from builtin01; reverse(col1) reverse(col2) 库据数生原云 esabatad @@ -446,9 +446,9 @@ bit_length(col2) 56 select empty(col2) from builtin01; empty(col2) -false -false -false +0 +0 +0 select count(col1) as count_col1 from builtin01; count_col1 3 diff --git a/test/distributed/cases/dtype/enum_1.result b/test/distributed/cases/dtype/enum_1.result index 79d45d664d191..1d8a583a794ca 100644 --- a/test/distributed/cases/dtype/enum_1.result +++ b/test/distributed/cases/dtype/enum_1.result @@ -136,21 +136,21 @@ create table table02 as select * from table01; insert into table02 values (12, 'Value1', 123, 45.67, '2023-10-23', TRUE, 'apple', 'This is a text', '2019-01-01 01:01:01.000', 'Some binary data', 'C'); select * from table02; id col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 -1 Value2 456 78.90 2023-10-24 false banana Another text 2022-01-01 01:01:01 More binary data D -2 Value3 789 12.34 2023-10-25 true orange Yet another text 1979-01-01 01:01:01 Even more binary data E -12 Value1 123 45.67 2023-10-23 true apple This is a text 2019-01-01 01:01:01 Some binary data C +1 Value2 456 78.90 2023-10-24 0 banana Another text 2022-01-01 01:01:01 More binary data D +2 Value3 789 12.34 2023-10-25 1 orange Yet another text 1979-01-01 01:01:01 Even more binary data E +12 Value1 123 45.67 2023-10-23 1 apple This is a text 2019-01-01 01:01:01 Some binary data C update table02 set col1 = 'newvalue' where col2 = 456; select * from table02; id col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 -2 Value3 789 12.34 2023-10-25 true orange Yet another text 1979-01-01 01:01:01 Even more binary data E -12 Value1 123 45.67 2023-10-23 true apple This is a text 2019-01-01 01:01:01 Some binary data C -1 newvalue 456 78.90 2023-10-24 false banana Another text 2022-01-01 01:01:01 More binary data D +2 Value3 789 12.34 2023-10-25 1 orange Yet another text 1979-01-01 01:01:01 Even more binary data E +12 Value1 123 45.67 2023-10-23 1 apple This is a text 2019-01-01 01:01:01 Some binary data C +1 newvalue 456 78.90 2023-10-24 0 banana Another text 2022-01-01 01:01:01 More binary data D update table02 set col6 = 'apple' where col2 = 789; select * from table02; id col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 -12 Value1 123 45.67 2023-10-23 true apple This is a text 2019-01-01 01:01:01 Some binary data C -1 newvalue 456 78.90 2023-10-24 false banana Another text 2022-01-01 01:01:01 More binary data D -2 Value3 789 12.34 2023-10-25 true apple Yet another text 1979-01-01 01:01:01 Even more binary data E +12 Value1 123 45.67 2023-10-23 1 apple This is a text 2019-01-01 01:01:01 Some binary data C +1 newvalue 456 78.90 2023-10-24 0 banana Another text 2022-01-01 01:01:01 More binary data D +2 Value3 789 12.34 2023-10-25 1 apple Yet another text 1979-01-01 01:01:01 Even more binary data E drop table table01; drop table table02; drop table if exists table01; diff --git a/test/distributed/cases/dtype/float.result b/test/distributed/cases/dtype/float.result index f4ee6135bf50a..151dee2f37402 100644 --- a/test/distributed/cases/dtype/float.result +++ b/test/distributed/cases/dtype/float.result @@ -169,19 +169,19 @@ CREATE TABLE t_float(id float(2,1)); INSERT INTO t_float VALUES (1),(1.1), (2); SELECT id, id >= 1.1 FROM t_float; id id >= 1.1 -1.0 false -1.1 true -2.0 true +1.0 0 +1.1 1 +2.0 1 SELECT id, 1.1 <= id FROM t_float; id 1.1 <= id -1.0 false -1.1 true -2.0 true +1.0 0 +1.1 1 +2.0 1 SELECT id, id = 1.1 FROM t_float; id id = 1.1 -1.0 false -1.1 true -2.0 false +1.0 0 +1.1 1 +2.0 0 SELECT * from t_float WHERE id = 1.1; id 1.1 @@ -253,34 +253,34 @@ count(*) drop table t1; SELECT (1234.0 BETWEEN 0 AND 1234); (1234.0 BETWEEN 0 AND 1234) -true +1 SELECT 0.000 >= 0; 0.000 >= 0 -true +1 SELECT 00.000 <= 0.00001; 00.000 <= 0.00001 -true +1 SELECT CAST(1.00 AS UNSIGNED) BETWEEN 1 AND -1; CAST(1.00 AS UNSIGNED) BETWEEN 1 AND -1 -false +0 SELECT CAST(1.00 AS UNSIGNED) NOT BETWEEN 1 AND -1; CAST(1.00 AS UNSIGNED) NOT BETWEEN 1 AND -1 -true +1 SELECT CAST(0.00 AS UNSIGNED) BETWEEN 0 AND -1; CAST(0.00 AS UNSIGNED) BETWEEN 0 AND -1 -false +0 SELECT CAST(0.00 AS UNSIGNED) NOT BETWEEN 0 AND -1; CAST(0.00 AS UNSIGNED) NOT BETWEEN 0 AND -1 -true +1 SELECT ( -1 BETWEEN 0 AND 1 ); ( -1 BETWEEN 0 AND 1 ) -false +0 SELECT ( 0 BETWEEN 0.000000001 AND 1 ); ( 0 BETWEEN 0.000000001 AND 1 ) -false +0 SELECT ( 1 BETWEEN 1.0000001 and 0); ( 1 BETWEEN 1.0000001 and 0) -false +0 drop table if exists t1; drop table if exists t2; drop table if exists t3; diff --git a/test/distributed/cases/dtype/int.result b/test/distributed/cases/dtype/int.result index 3abc787613e14..3f37ee3a496af 100644 --- a/test/distributed/cases/dtype/int.result +++ b/test/distributed/cases/dtype/int.result @@ -145,20 +145,20 @@ CREATE TABLE t_int(id INT); INSERT INTO t_int VALUES (1), (2); SELECT id, id >= 1.1 FROM t_int; id id >= 1.1 -1 false -2 true +1 0 +2 1 SELECT id, 1.1 <= id FROM t_int; id 1.1 <= id -1 false -2 true +1 0 +2 1 SELECT id, id = 1.1 FROM t_int; id id = 1.1 -1 false -2 false +1 0 +2 0 SELECT id, 1.1 = id FROM t_int; id 1.1 = id -1 false -2 false +1 0 +2 0 SELECT * from t_int WHERE id = 1.1; id SELECT * from t_int WHERE id = 1.1e0; @@ -214,40 +214,40 @@ count(*) drop table t; SELECT (4294967294 BETWEEN 0 AND 4294967295); (4294967294 BETWEEN 0 AND 4294967295) -true +1 SELECT -2147483600 <= 0; -2147483600 <= 0 -true +1 SELECT 0 <= 2147483647; 0 <= 2147483647 -true +1 SELECT CAST(100 AS UNSIGNED) BETWEEN 1 AND -1; CAST(100 AS UNSIGNED) BETWEEN 1 AND -1 -false +0 SELECT CAST(100 AS UNSIGNED) NOT BETWEEN 1 AND -1; CAST(100 AS UNSIGNED) NOT BETWEEN 1 AND -1 -true +1 SELECT CAST(0 AS UNSIGNED) BETWEEN 0 AND -1; CAST(0 AS UNSIGNED) BETWEEN 0 AND -1 -false +0 SELECT CAST(0 AS UNSIGNED) NOT BETWEEN 0 AND -1; CAST(0 AS UNSIGNED) NOT BETWEEN 0 AND -1 -true +1 SELECT ( 4294967296 BETWEEN 4294967296 AND 4294967296 ); ( 4294967296 BETWEEN 4294967296 AND 4294967296 ) -true +1 SELECT ( 2147483647 BETWEEN 4294967296 AND 1 ); ( 2147483647 BETWEEN 4294967296 AND 1 ) -false +0 SELECT ( -1 BETWEEN 4294967296 AND 1 ); ( -1 BETWEEN 4294967296 AND 1 ) -false +0 SELECT ( 0 BETWEEN 4294967296 AND 1 ); ( 0 BETWEEN 4294967296 AND 1 ) -false +0 SELECT ( 1 BETWEEN 4294967296 AND 1 ); ( 1 BETWEEN 4294967296 AND 1 ) -false +0 drop table if exists t1; drop table if exists t2; drop table if exists t3; diff --git a/test/distributed/cases/dtype/jdbc-type-compatibility.result b/test/distributed/cases/dtype/jdbc-type-compatibility.result new file mode 100644 index 0000000000000..5618d3b021017 --- /dev/null +++ b/test/distributed/cases/dtype/jdbc-type-compatibility.result @@ -0,0 +1,7 @@ +create table t1(a BOOL, b bool, c boolean); +insert into t1 values(true, true, true); +insert into t1 values(false, false, false); +select * from t1; +a b c +1 1 1 +0 0 0 diff --git a/test/distributed/cases/dtype/jdbc-type-compatibility.sql b/test/distributed/cases/dtype/jdbc-type-compatibility.sql new file mode 100644 index 0000000000000..877ecde7a8b6c --- /dev/null +++ b/test/distributed/cases/dtype/jdbc-type-compatibility.sql @@ -0,0 +1,7 @@ + +create table t1(a BOOL, b bool, c boolean); +insert into t1 values(true, true, true); +insert into t1 values(false, false, false); + +-- @meta_cmp(true) +select * from t1; \ No newline at end of file diff --git a/test/distributed/cases/dtype/numeric.result b/test/distributed/cases/dtype/numeric.result index f77edb9f44799..2d24c8e8dda23 100644 --- a/test/distributed/cases/dtype/numeric.result +++ b/test/distributed/cases/dtype/numeric.result @@ -148,28 +148,28 @@ id 2.20000 SELECT id, id >= 1.1 FROM t_numeric; id id >= 1.1 -1.00000 false -2.00000 true -1.10000 true -2.20000 true +1.00000 0 +2.00000 1 +1.10000 1 +2.20000 1 SELECT id, 1.1 <= id FROM t_numeric; id 1.1 <= id -1.00000 false -2.00000 true -1.10000 true -2.20000 true +1.00000 0 +2.00000 1 +1.10000 1 +2.20000 1 SELECT id, id = 1.1 FROM t_numeric; id id = 1.1 -1.00000 false -2.00000 false -1.10000 true -2.20000 false +1.00000 0 +2.00000 0 +1.10000 1 +2.20000 0 SELECT id, 1.1 = id FROM t_numeric; id 1.1 = id -1.00000 false -2.00000 false -1.10000 true -2.20000 false +1.00000 0 +2.00000 0 +1.10000 1 +2.20000 0 SELECT * from t_numeric WHERE id = 1.1; id 1.10000 @@ -253,16 +253,16 @@ count(*) drop table t; SELECT CAST(1.00 AS numeric) BETWEEN 1 AND -1; cast(1.00 as numeric(38)) between 1 and -1 -false +0 SELECT CAST(1.00 AS numeric) NOT BETWEEN 1 AND -1; cast(1.00 as numeric(38)) not between 1 and -1 -true +1 SELECT CAST(-0 AS numeric) BETWEEN 0 AND -1; cast(-0 as numeric(38)) between 0 and -1 -false +0 SELECT CAST(0 AS numeric) NOT BETWEEN 0 AND -1; cast(0 as numeric(38)) not between 0 and -1 -true +1 drop table if exists t1; drop table if exists t2; drop table if exists t3; diff --git a/test/distributed/cases/dtype/smallint.result b/test/distributed/cases/dtype/smallint.result index 8723e6dcc3c39..4b51481121c37 100644 --- a/test/distributed/cases/dtype/smallint.result +++ b/test/distributed/cases/dtype/smallint.result @@ -145,20 +145,20 @@ CREATE TABLE t_smallint(id SMALLINT); INSERT INTO t_smallint VALUES (1), (2); SELECT id, id >= 1.1 FROM t_smallint; id id >= 1.1 -1 false -2 true +1 0 +2 1 SELECT id, 1.1 <= id FROM t_smallint; id 1.1 <= id -1 false -2 true +1 0 +2 1 SELECT id, id = 1.1 FROM t_smallint; id id = 1.1 -1 false -2 false +1 0 +2 0 SELECT id, 1.1 = id FROM t_smallint; id 1.1 = id -1 false -2 false +1 0 +2 0 SELECT * from t_smallint WHERE id = 1.1; id SELECT * from t_smallint WHERE id = 1.1e0; @@ -214,40 +214,40 @@ count(*) drop table t; SELECT (65534 BETWEEN 0 AND 65535); (65534 BETWEEN 0 AND 65535) -true +1 SELECT -32000 <= 0; -32000 <= 0 -true +1 SELECT 0 <= 32767; 0 <= 32767 -true +1 SELECT CAST(100 AS UNSIGNED) BETWEEN 1 AND -1; CAST(100 AS UNSIGNED) BETWEEN 1 AND -1 -false +0 SELECT CAST(100 AS UNSIGNED) NOT BETWEEN 1 AND -1; CAST(100 AS UNSIGNED) NOT BETWEEN 1 AND -1 -true +1 SELECT CAST(0 AS UNSIGNED) BETWEEN 0 AND -1; CAST(0 AS UNSIGNED) BETWEEN 0 AND -1 -false +0 SELECT CAST(0 AS UNSIGNED) NOT BETWEEN 0 AND -1; CAST(0 AS UNSIGNED) NOT BETWEEN 0 AND -1 -true +1 SELECT ( 65535 BETWEEN 65535 AND 65535 ); ( 65535 BETWEEN 65535 AND 65535 ) -true +1 SELECT ( 32767 BETWEEN 65535 AND 1 ); ( 32767 BETWEEN 65535 AND 1 ) -false +0 SELECT ( -1 BETWEEN 65535 AND 1 ); ( -1 BETWEEN 65535 AND 1 ) -false +0 SELECT ( 0 BETWEEN 65535 AND 1 ); ( 0 BETWEEN 65535 AND 1 ) -false +0 SELECT ( 1 BETWEEN 65535 AND 1 ); ( 1 BETWEEN 65535 AND 1 ) -false +0 drop table if exists t1; drop table if exists t2; drop table if exists t3; diff --git a/test/distributed/cases/dtype/text_1.result b/test/distributed/cases/dtype/text_1.result index 738d23202835a..1aca923edb378 100644 --- a/test/distributed/cases/dtype/text_1.result +++ b/test/distributed/cases/dtype/text_1.result @@ -297,19 +297,19 @@ insert into t8(col12) values (1); insert into t8(col12) values (0); select cast(col12 as bool) from t8; cast(col12 as bool) -true -false -true -false +1 +0 +1 +0 delete from t8 where col12 is not NULL; insert into t8(col12) values ('true'); insert into t8(col12) values ('trUe'); insert into t8(col12) values ('falSe'); select cast(col12 as bool) from t8; cast(col12 as bool) -true -true -false +1 +1 +0 insert into t8(col12) values ('hello'); select cast(col12 as bool) from t8; invalid input: 'hello' is not a valid bool expression @@ -317,7 +317,7 @@ delete from t8 where col12 is not NULL; insert into t8(col12) values ('2'); select cast(col12 as bool) from t8; cast(col12 as bool) -true +1 delete from t8 where col12 is not NULL; insert into t8(col13) values ('12345.123456789'); insert into t8(col13) values (12345.123456789); @@ -379,7 +379,7 @@ insert into t1 values ('1111', ''); no such table text_1.t1 select empty(a),empty(b) from t9; empty(a) empty(b) -true false +1 0 insert into t9 values ('a', 'b'); insert into t9 values ('aa', 'bb'); select a, length(a), b, length(b) from t9; @@ -430,14 +430,14 @@ delete from t9 where a is not NULL; insert into t9 values ('Ananya Majumdar', 'IX'),('Anushka Samanta', 'X'),('Sharma', 'XI'); select startswith(a,'An') from t9; startswith(a, An) -true -true -false +1 +1 +0 select endswith(b,'X') from t9; endswith(b, X) -true -true -false +1 +1 +0 delete from t9 where a is not NULL; insert into t9 values(' sdfad ','2022-02-02 22:22:22'); insert into t9 values('sdfad ','2022-02-02 22:22:22'); diff --git a/test/distributed/cases/dtype/time_precision_comprehensive.result b/test/distributed/cases/dtype/time_precision_comprehensive.result index b5e054435dcb1..0f28074d7379e 100644 --- a/test/distributed/cases/dtype/time_precision_comprehensive.result +++ b/test/distributed/cases/dtype/time_precision_comprehensive.result @@ -130,10 +130,10 @@ match_with_original DROP TABLE t_time_where; SELECT CAST('12:34:56' AS TIME(0)) = CAST('12:34:56.000000' AS TIME(6)) AS time_0_eq_6_same; time_0_eq_6_same -true +1 SELECT CAST('12:34:56' AS TIME(0)) = CAST('12:34:56.123456' AS TIME(6)) AS time_0_eq_6_diff; time_0_eq_6_diff -false +0 DROP TABLE IF EXISTS t_time_half; CREATE TABLE t_time_half ( id INT, diff --git a/test/distributed/cases/dtype/timestamp.result b/test/distributed/cases/dtype/timestamp.result index 1d8c7b23e2472..ad826f699fc7c 100644 --- a/test/distributed/cases/dtype/timestamp.result +++ b/test/distributed/cases/dtype/timestamp.result @@ -87,12 +87,12 @@ CREATE TABLE t_timestamp(id timestamp(6)); INSERT INTO t_timestamp VALUES ('2020-01-01 23:59:59.999999'), ('2022-01-02 00:00:00'); SELECT id, id = 202020101 FROM t_timestamp; id id = 202020101 -2020-01-01 23:59:59.999999000 false -2022-01-02 00:00:00 false +2020-01-01 23:59:59.999999000 0 +2022-01-02 00:00:00 0 SELECT id, 20200101 = id FROM t_timestamp; id 20200101 = id -2020-01-01 23:59:59.999999000 false -2022-01-02 00:00:00 false +2020-01-01 23:59:59.999999000 0 +2022-01-02 00:00:00 0 SELECT * from t_timestamp WHERE id = 20200102; id SELECT * from t_timestamp WHERE id = 2.0200102e7; diff --git a/test/distributed/cases/dtype/timestamp_precision_comprehensive.result b/test/distributed/cases/dtype/timestamp_precision_comprehensive.result index df1ec8472d06d..078ba11651ded 100644 --- a/test/distributed/cases/dtype/timestamp_precision_comprehensive.result +++ b/test/distributed/cases/dtype/timestamp_precision_comprehensive.result @@ -117,10 +117,10 @@ match_count DROP TABLE t_timestamp_distinct; SELECT CAST('2024-01-15 12:34:56' AS TIMESTAMP(0)) = CAST('2024-01-15 12:34:56.000000' AS TIMESTAMP(6)) AS ts_0_eq_6_same; ts_0_eq_6_same -true +1 SELECT CAST('2024-01-15 12:34:56' AS TIMESTAMP(0)) = CAST('2024-01-15 12:34:56.123456' AS TIMESTAMP(6)) AS ts_0_eq_6_diff; ts_0_eq_6_diff -false +0 DROP TABLE IF EXISTS t_timestamp_half; CREATE TABLE t_timestamp_half ( id INT, diff --git a/test/distributed/cases/dtype/tinyint.result b/test/distributed/cases/dtype/tinyint.result index 65edf9c6c34e9..d8d662c8ee43b 100644 --- a/test/distributed/cases/dtype/tinyint.result +++ b/test/distributed/cases/dtype/tinyint.result @@ -145,20 +145,20 @@ CREATE TABLE t_tinyint(id TINYINT); INSERT INTO t_tinyint VALUES (1), (2); SELECT id, id >= 1.1 FROM t_tinyint; id id >= 1.1 -1 false -2 true +1 0 +2 1 SELECT id, 1.1 <= id FROM t_tinyint; id 1.1 <= id -1 false -2 true +1 0 +2 1 SELECT id, id = 1.1 FROM t_tinyint; id id = 1.1 -1 false -2 false +1 0 +2 0 SELECT id, 1.1 = id FROM t_tinyint; id 1.1 = id -1 false -2 false +1 0 +2 0 SELECT * from t_tinyint WHERE id = 1.1; id SELECT * from t_tinyint WHERE id = 1.1e0; @@ -213,40 +213,40 @@ count(*) drop table t; SELECT (254 BETWEEN 0 AND 255); (254 BETWEEN 0 AND 255) -true +1 SELECT -32000 <= 0; -32000 <= 0 -true +1 SELECT 0 <= 127; 0 <= 127 -true +1 SELECT CAST(100 AS UNSIGNED) BETWEEN 1 AND -1; CAST(100 AS UNSIGNED) BETWEEN 1 AND -1 -false +0 SELECT CAST(100 AS UNSIGNED) NOT BETWEEN 1 AND -1; CAST(100 AS UNSIGNED) NOT BETWEEN 1 AND -1 -true +1 SELECT CAST(0 AS UNSIGNED) BETWEEN 0 AND -1; CAST(0 AS UNSIGNED) BETWEEN 0 AND -1 -false +0 SELECT CAST(0 AS UNSIGNED) NOT BETWEEN 0 AND -1; CAST(0 AS UNSIGNED) NOT BETWEEN 0 AND -1 -true +1 SELECT ( 255 BETWEEN 255 AND 255 ); ( 255 BETWEEN 255 AND 255 ) -true +1 SELECT ( 127 BETWEEN 255 AND 1 ); ( 127 BETWEEN 255 AND 1 ) -false +0 SELECT ( -1 BETWEEN 255 AND 1 ); ( -1 BETWEEN 255 AND 1 ) -false +0 SELECT ( 0 BETWEEN 255 AND 1 ); ( 0 BETWEEN 255 AND 1 ) -false +0 SELECT ( 1 BETWEEN 255 AND 1 ); ( 1 BETWEEN 255 AND 1 ) -false +0 drop table if exists t1; drop table if exists t2; drop table if exists t3; diff --git a/test/distributed/cases/dtype/varchar.result b/test/distributed/cases/dtype/varchar.result index 84f343df311fd..9e8c6e0869c43 100644 --- a/test/distributed/cases/dtype/varchar.result +++ b/test/distributed/cases/dtype/varchar.result @@ -96,8 +96,8 @@ Andrea F 45 Kelly F 54 select cast(Age as char) and Age as cAge from Demovarchar where Age>=50 order by cAge desc; cAge -true -true +1 +1 CREATE TABLE employees ( employeeNumber int(11) NOT NULL, lastName varchar(50) NOT NULL, diff --git a/test/distributed/cases/expression/case_when.result b/test/distributed/cases/expression/case_when.result index 7361a350af331..2577a1290b00f 100755 --- a/test/distributed/cases/expression/case_when.result +++ b/test/distributed/cases/expression/case_when.result @@ -175,7 +175,7 @@ Case When Count(*) < MAX_REQ Then 1 Else 0 End DROP TABLE if exists t1; select case when 1 in (1.0, 2.0, 3.0) then true else false end; case when 1 in (1.0, 2.0, 3.0) then true else false end -true +1 DROP TABLE if exists t1; CREATE TABLE t1 ( id int NOT NULL AUTO_INCREMENT, diff --git a/test/distributed/cases/expression/cte.result b/test/distributed/cases/expression/cte.result index e5de5c3f89b2f..688c2a94a770a 100755 --- a/test/distributed/cases/expression/cte.result +++ b/test/distributed/cases/expression/cte.result @@ -300,21 +300,21 @@ insert into t2 values ('a1'),('a2'); with qn as (SELECT s1 FROM t2) select s1, s1 = ANY (select * from qn) from t1; s1 s1 = ANY (select * from qn) -a1 true -a2 true -a3 false +a1 1 +a2 1 +a3 0 with qn as (SELECT s1 FROM t2) select s1, s1 < ANY (select * from qn) from t1; s1 s1 < ANY (select * from qn) -a1 true -a2 false -a3 false +a1 1 +a2 0 +a3 0 with qn as (SELECT s1 FROM t2) select s1, s1 = ANY (select * from qn) from t1; s1 s1 = ANY (select * from qn) -a1 true -a2 true -a3 false +a1 1 +a2 1 +a3 0 drop table if exists t1; drop table if exists t2; DROP TABLE IF EXISTS t3; diff --git a/test/distributed/cases/fulltext/fulltext2.result b/test/distributed/cases/fulltext/fulltext2.result index c334691a2ea03..edf176d2c6680 100644 --- a/test/distributed/cases/fulltext/fulltext2.result +++ b/test/distributed/cases/fulltext/fulltext2.result @@ -282,56 +282,56 @@ test_table CREATE TABLE `test_table` (\n `col1` int NOT NULL AUTO_INCREMENT, load data infile '$resources/load_data/test_1.csv' into table test_table fields terminated by ',' parallel 'true'; select * from test_table; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 drop table test_table; drop table if exists jsonline_t2; create table jsonline_t2( @@ -369,10 +369,10 @@ create fulltext index f06 on t1(col9); load data infile {'filepath'='$resources/load_data/jsonline_object01.jl','format'='jsonline','jsondata'='object'} into table t1; select * from t1; col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null -true 2 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null -true 3 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1az null null -true 4 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null +1 2 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null +1 3 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1az null null +1 4 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1qaz null null show create table t1; Table Create Table t1 CREATE TABLE `t1` (\n `col1` bool DEFAULT NULL,\n `col2` int NOT NULL,\n `col3` varchar(100) DEFAULT NULL,\n `col4` date DEFAULT NULL,\n `col5` datetime DEFAULT NULL,\n `col6` timestamp NULL DEFAULT NULL,\n `col7` decimal(38,0) DEFAULT NULL,\n `col8` float DEFAULT NULL,\n `col9` json DEFAULT NULL,\n `col10` text DEFAULT NULL,\n `col11` json DEFAULT NULL,\n `col12` bool DEFAULT NULL,\n PRIMARY KEY (`col2`),\n FULLTEXT `f06`(`col9`)\n) diff --git a/test/distributed/cases/function/builtin.result b/test/distributed/cases/function/builtin.result index e19726cfebfe0..687e2c38db3bb 100755 --- a/test/distributed/cases/function/builtin.result +++ b/test/distributed/cases/function/builtin.result @@ -254,12 +254,12 @@ VALUES (6,'Tapan Samanta', 'XI'); select a,endswith(b,'a') from t1; a endswith(b, a) -1 false -2 true -3 true -4 false -5 false -6 true +1 0 +2 1 +3 1 +4 0 +5 0 +6 1 select a,b,c from t1 where endswith(b,'a') and endswith(c,'I'); a b c 3 Aniket Sharma XI @@ -474,12 +474,12 @@ VALUES (6,'Tapan Samanta', 'X'); select a,startswith(b,'An') from t1; a startswith(b, An) -1 true -2 true -3 true -4 true -5 false -6 false +1 1 +2 1 +3 1 +4 1 +5 0 +6 0 select a,b,c from t1 where startswith(b,'An') and startswith(c,'I'); a b c 1 Ananya Majumdar IX diff --git a/test/distributed/cases/function/func_aggr_avg.result b/test/distributed/cases/function/func_aggr_avg.result index 9621ec35a490c..43c8a9e395561 100644 --- a/test/distributed/cases/function/func_aggr_avg.result +++ b/test/distributed/cases/function/func_aggr_avg.result @@ -96,7 +96,7 @@ TestComponent 1.0000 TestComponent2 3.5000 SELECT avg(t1.bug_id) >= avg(t2.id) from t1 join t2 on t1.bug_file_loc = t2.value; avg(t1.bug_id) >= avg(t2.id) -true +1 drop table t1; drop table t2; create table t1 (a int); diff --git a/test/distributed/cases/function/func_aggr_bitwise.result b/test/distributed/cases/function/func_aggr_bitwise.result index 99f3724cce876..7f75e9d478ac8 100644 --- a/test/distributed/cases/function/func_aggr_bitwise.result +++ b/test/distributed/cases/function/func_aggr_bitwise.result @@ -243,7 +243,7 @@ Fld1 BIT_AND(Fld2) BIT_OR(Fld2) BIT_XOR(Fld2) drop table t1; SELECT BIT_AND(1)BIT_OR(3), BIT_AND(3)>BIT_XOR(5); BIT_AND(1) < BIT_AND(2) BIT_AND(1) > BIT_OR(3) BIT_AND(3) > BIT_XOR(5) -true false false +1 0 0 SELECT BIT_AND(1 - 1), BIT_OR(1 - (-1)), BIT_XOR(1 / 0); Data truncation: division by zero drop table if exists t1; diff --git a/test/distributed/cases/function/func_aggr_count.result b/test/distributed/cases/function/func_aggr_count.result index 7d65af212f9ed..5f2f68b1a92a0 100644 --- a/test/distributed/cases/function/func_aggr_count.result +++ b/test/distributed/cases/function/func_aggr_count.result @@ -83,7 +83,7 @@ BBBBBBBBBBBBB - generic 0 TestComponent2 2 SELECT COUNT(t1.bug_id) >= COUNT(t2.value) from t1 join t2 on t1.bug_file_loc = t2.value; COUNT(t1.bug_id) >= COUNT(t2.value) -true +1 drop table t1; drop table t2; create table t1 (grp int, a bigint unsigned, c char(10) not null); diff --git a/test/distributed/cases/function/func_aggr_min.result b/test/distributed/cases/function/func_aggr_min.result index 680bb6df0a9f0..e166cd872cd72 100644 --- a/test/distributed/cases/function/func_aggr_min.result +++ b/test/distributed/cases/function/func_aggr_min.result @@ -131,7 +131,7 @@ Fld1 min(Fld2) drop table t1; SELECT min(1)sum(0); sum(1)>sum(0) -true +1 create table t1(a bigint, b float, c double, d double, e varchar(1000)); insert into t1 select 21474836471, 12412490231412.124124124124, 124141231249124124.1241241243124123, 12421512141241241241241241849912840129402.1241124124241241, space(1000); insert into t1 select 21474836471, 12412490231412.124124124124, 124141231249124124.1241241243124123, 12421512141241241241241241849912840129402.1241124124241241, space(1000); diff --git a/test/distributed/cases/function/func_aggr_var_pop.result b/test/distributed/cases/function/func_aggr_var_pop.result index dae4b4e661107..71456979053ea 100644 --- a/test/distributed/cases/function/func_aggr_var_pop.result +++ b/test/distributed/cases/function/func_aggr_var_pop.result @@ -122,7 +122,7 @@ fld1 var_pop(fld2) drop table t1; SELECT var_pop(1)= 0), b from t1 group by b having d >= 0; d any_value(a) - b >= 0 b -1 true 0 -0 true 1 +1 1 0 +0 1 1 select cast((a - b) as unsigned) from t1 order by 1; cast((a - b) as b unsigned) 0 diff --git a/test/distributed/cases/function/func_coalesce_1.result b/test/distributed/cases/function/func_coalesce_1.result index 89b4eed1a4003..bf08c6d556242 100644 --- a/test/distributed/cases/function/func_coalesce_1.result +++ b/test/distributed/cases/function/func_coalesce_1.result @@ -110,32 +110,32 @@ insert into t3 values (TRUE, NULL); insert into t3 values (NULL, NULL); select * from t3; a b -false a -true b +0 a +1 b null c -true null +1 null null null select coalesce(a, 1) from t3; coalesce(a, 1) -false -true -true -true -true +0 +1 +1 +1 +1 select coalesce(a, 0) from t3; coalesce(a, 0) -false -true -false -true -false +0 +1 +0 +1 +0 select coalesce(a, 200) from t3; coalesce(a, 200) -false -true -true -true -true +0 +1 +1 +1 +1 select coalesce(b, '1') from t3; coalesce(b, 1) a diff --git a/test/distributed/cases/function/func_datetime_curdate.result b/test/distributed/cases/function/func_datetime_curdate.result index 96f5de5329cfe..c2d5d745af046 100644 --- a/test/distributed/cases/function/func_datetime_curdate.result +++ b/test/distributed/cases/function/func_datetime_curdate.result @@ -1,10 +1,10 @@ select cast(now() as date)=curdate() q; q -true +1 create table t1 (a int); insert into t1 values (1),(2),(3); select cast(now() as date)=curdate() q from t1; q -true -true -true +1 +1 +1 diff --git a/test/distributed/cases/function/func_datetime_date.result b/test/distributed/cases/function/func_datetime_date.result index d60cdf83a34ac..e800f5c0216dc 100644 --- a/test/distributed/cases/function/func_datetime_date.result +++ b/test/distributed/cases/function/func_datetime_date.result @@ -72,7 +72,7 @@ DATE_ADD(coalesce(last_recharge, first_usage), INTERVAL life_time DAY ) as dt, DATE_ADD(coalesce(last_recharge, first_usage), INTERVAL life_time DAY ) < DATE('2011-04-28') as exp FROM t1; dt exp -2013-10-13 00:00:00 false +2013-10-13 00:00:00 0 DROP TABLE t1; SELECT DATE(20110512154559.616), DATE(FLOOR(20110512154559.616)); date(20110512154559.616) date(floor(20110512154559.616)) @@ -290,7 +290,7 @@ YEAR(c1) DROP TABLE t3; SELECT date("2022-12-22 02:34:23") = date("2022-12-22 03:34:23"); date("2022-12-22 02:34:23") = date("2022-12-22 03:34:23") -true +1 drop table if exists t1; create table t1(a date); insert into t1 SELECT DATE("2017-06-15 09:34:21"); diff --git a/test/distributed/cases/function/func_datetime_dayofweek.result b/test/distributed/cases/function/func_datetime_dayofweek.result index 7b57ffd6f12ef..7c25dc1fc01db 100644 --- a/test/distributed/cases/function/func_datetime_dayofweek.result +++ b/test/distributed/cases/function/func_datetime_dayofweek.result @@ -1,8 +1,8 @@ SELECT dayofweek(date('2007-02-03 03:42:24')); -dayofweek(date('2007-02-03 03:42:24')) +dayofweek(date(2007-02-03 03:42:24)) 7 SELECT dayofweek(NULL); -dayofweek(NULL) +dayofweek(null) null create table t1(i DATE, k datetime, l TIMESTAMP); insert into t1 values("2012-03-10", "2012-03-12 10:03:12", "2022-03-12 13:03:12"); @@ -11,12 +11,12 @@ insert into t1 values("2011-03-12", "2015-03-12 10:03:12", "2002-03-12 13:03:12" insert into t1 values("2012-01-12", "2019-03-12 10:03:12", "2013-03-12 13:03:12"); insert into t1 values("2023-11-08", "2023-11-08 15:03", "2023-11-08 15:03"); select dayofweek(i),dayofweek(k),dayofweek(l) from t1; -dayofweek(i) dayofweek(k) dayofweek(l) -7 2 7 -5 3 6 -7 5 3 -5 3 3 -4 4 4 +dayofweek(i) dayofweek(k) dayofweek(l) +7 2 7 +5 3 6 +7 5 3 +5 3 3 +4 4 4 drop table t1; SELECT dayofweek("2015-09-03") as dayofweek; dayofweek @@ -28,56 +28,56 @@ SELECT dayofweek('2015-09-26 08:09:22') AS dayofweek; dayofweek 7 select dayofweek("2020-08-01"); -dayofweek("2020-08-01") +dayofweek(2020-08-01) 7 select dayofweek("2000-01-01"); -dayofweek("2000-01-01") +dayofweek(2000-01-01) 7 select dayofweek("1999-12-31"); -dayofweek("1999-12-31") +dayofweek(1999-12-31) 6 select dayofweek("2006-12-25"); -dayofweek("2006-12-25") +dayofweek(2006-12-25) 2 select dayofweek("2008-02-29"); -dayofweek("2008-02-29") +dayofweek(2008-02-29) 6 SELECT dayofweek("2015-09-10")- dayofweek("2016-04-24"); -dayofweek("2015-09-10")- dayofweek("2016-04-24") --1 +dayofweek(2015-09-10) - dayofweek(2016-04-24) +4 SELECT dayofweek("2015-09-10")+ dayofweek("2016-04-24"); -dayofweek("2015-09-10")+ dayofweek("2016-04-24") +dayofweek(2015-09-10) + dayofweek(2016-04-24) 6 SELECT dayofweek("2015-09-10")*dayofweek("2016-04-24"); -dayofweek("2015-09-10")*dayofweek("2016-04-24") +dayofweek(2015-09-10) * dayofweek(2016-04-24) 5 SELECT dayofweek("2015-09-10")/dayofweek("2016-04-24"); -dayofweek("2015-09-10")/dayofweek("2016-04-24") +dayofweek(2015-09-10) / dayofweek(2016-04-24) 5.0 SELECT dayofweek("2015-09-10")>dayofweek("2016-04-24"); -dayofweek("2015-09-10")>dayofweek("2016-04-24") -true +dayofweek(2015-09-10) > dayofweek(2016-04-24) +1 SELECT dayofweek("2015-09-10")dayofweek("2016-04-24"); -dayofweek("2015-09-10")<>dayofweek("2016-04-24") -true +dayofweek(2015-09-10) != dayofweek(2016-04-24) +1 SELECT dayofweek("2015-09-10")!=dayofweek("2016-04-24"); -dayofweek("2015-09-10")!=dayofweek("2016-04-24") -true +dayofweek(2015-09-10) != dayofweek(2016-04-24) +1 CREATE TABLE Product(Product_id INT AUTO_INCREMENT, Product_name VARCHAR(100) NOT NULL,Buying_price DECIMAL(13, 2) NOT NULL,Selling_price DECIMAL(13, 2) NOT NULL,Selling_Date Date NOT NULL,PRIMARY KEY(Product_id)); INSERT INTO Product(Product_name, Buying_price, Selling_price, Selling_Date) VALUES ('Audi Q8', 10000000.00, 15000000.00, '2018-01-26' ),('Volvo XC40', 2000000.00, 3000000.00, '2018-04-20' ),('Audi A6', 4000000.00, 5000000.00, '2018-07-25' ),('BMW X5', 5000500.00, 7006500.00, '2018-10-18' ),('Jaguar XF', 5000000, 7507000.00, '2019-01-27' ),('Mercedes-Benz C-Class', 4000000.00, 6000000.00, '2019-04-01' ),('Jaguar F-PACE', 5000000.00, 7000000.00, '2019-12-26' ),('Porsche Macan', 6500000.00, 8000000.00, '2020-04-16' ) ; SELECT dayofweek (Selling_Date) dayofweek, COUNT(Product_id) Product_Sold FROM Product GROUP BY dayofweek (Selling_Date) ORDER BY dayofweek (Selling_Date); -dayofweek Product_Sold -1 1 -2 1 -4 1 -5 3 -6 2 +dayofweek Product_Sold +1 1 +2 1 +4 1 +5 3 +6 2 DROP TABLE Product; drop table if exists t1; create table t1(a INT, b date); @@ -85,20 +85,20 @@ insert into t1 select dayofweek("2012-10-12"), "2012-10-12"; insert into t1 select dayofweek("2004-04-24"), "2004-04-24"; insert into t1 select dayofweek("2008-12-04"), "2008-12-04"; select * from t1; -a b -6 2012-10-12 -7 2004-04-24 -5 2008-12-04 +a b +6 2012-10-12 +7 2004-04-24 +5 2008-12-04 drop table t1; drop table if exists t1; create table t1(a INT, b date); insert into t1 values(1, "2012-10-12"),(2, "2004-04-24"),(3, "2008-12-04"),(4, "2012-03-23"); select * from t1 where dayofweek(b)<>0; -a b -1 2012-10-12 -2 2004-04-24 -3 2008-12-04 -4 2012-03-23 +a b +1 2012-10-12 +2 2004-04-24 +3 2008-12-04 +4 2012-03-23 drop table t1; drop table if exists t1; drop table if exists t2; @@ -107,23 +107,23 @@ create table t2(a INT, b date); insert into t1 values(1, "2012-10-12"),(2, "2004-04-24"),(3, "2008-12-04"),(4, "2012-03-23"); insert into t2 values(1, "2013-04-30"),(2, "1994-10-04"),(3, "2018-06-04"),(4, "2012-08-12"); SELECT t1.a, t2.a FROM t1 JOIN t2 ON (dayofweek(t1.b) <> dayofweek(t2.b)); -t1.a t2.a -1 1 -1 2 -1 3 -1 4 -2 1 -2 2 -2 3 -2 4 -3 1 -3 2 -3 3 -3 4 -4 1 -4 2 -4 3 -4 4 +a a +1 1 +1 2 +1 3 +1 4 +2 1 +2 2 +2 3 +2 4 +3 1 +3 2 +3 3 +3 4 +4 1 +4 2 +4 3 +4 4 drop table t1; drop table t2; drop table if exists t1; @@ -142,8 +142,8 @@ create table t1(a INT, b date); insert into t1 values(1, "2012-10-12"),(1, "2012-07-12"),(2, "2004-04-24"),(3, "2004-04-24"),(3, "2008-12-04"),(4, "2012-03-23"); select distinct dayofweek(b) from t1; dayofweek(b) -5 6 +5 7 drop table t1; CREATE TABLE t3(c1 DATE NOT NULL); @@ -191,11 +191,11 @@ DROP TABLE t3; CREATE TABLE ci_store_sales_order (id INT, store_id INT, order_date DATETIME, status CHAR(1), is_paid INT, total_amount DECIMAL(10,2)); INSERT INTO ci_store_sales_order VALUES (1, 1, '2023-11-08 10:30:00', 'C', 1, 100.50), (2, 1, '2023-11-08 14:20:00', 'C', 1, 200.75), (3, 1, '2023-11-09 09:15:00', 'C', 1, 150.00), (4, 2, '2023-11-08 11:00:00', 'C', 1, 300.25), (5, 2, '2023-11-09 16:45:00', 'C', 1, 250.50), (6, 1, '2023-11-10 08:00:00', 'C', 1, 180.00); SELECT store_id, HOUR(order_date) as hour_of_day, DAYOFWEEK(order_date) as day_of_week, COUNT(id) as order_count, SUM(total_amount) as total_sales, AVG(total_amount) as avg_order_value FROM ci_store_sales_order WHERE status = 'C' AND is_paid = 1 GROUP BY store_id, HOUR(order_date), DAYOFWEEK(order_date) ORDER BY store_id, day_of_week, hour_of_day; -store_id hour_of_day day_of_week order_count total_sales avg_order_value -1 8 6 1 180.00 180.00 -1 9 5 1 150.00 150.00 -1 10 4 1 100.50 100.50 -1 14 4 1 200.75 200.75 -2 11 4 1 300.25 300.25 -2 16 5 1 250.50 250.50 +store_id hour_of_day day_of_week order_count total_sales avg_order_value +1 10 4 1 100.50 100.50000000 +1 14 4 1 200.75 200.75000000 +1 9 5 1 150.00 150.00000000 +1 8 6 1 180.00 180.00000000 +2 11 4 1 300.25 300.25000000 +2 16 5 1 250.50 250.50000000 DROP TABLE ci_store_sales_order; diff --git a/test/distributed/cases/function/func_datetime_dayofyear.result b/test/distributed/cases/function/func_datetime_dayofyear.result index efa3f2be35b51..195dad4e1910b 100644 --- a/test/distributed/cases/function/func_datetime_dayofyear.result +++ b/test/distributed/cases/function/func_datetime_dayofyear.result @@ -63,20 +63,20 @@ SELECT dayofyear("2015-09-10")/dayofyear("2016-04-24"); dayofyear("2015-09-10")/dayofyear("2016-04-24") 2.2000 SELECT dayofyear("2015-09-10")>dayofyear("2016-04-24"); -dayofyear("2015-09-10")>dayofyear("2016-04-24") -true +dayofyear(2015-09-10) > dayofyear(2016-04-24) +1 SELECT dayofyear("2015-09-10")dayofyear("2016-04-24"); -dayofyear("2015-09-10")<>dayofyear("2016-04-24") -true +dayofyear(2015-09-10) != dayofyear(2016-04-24) +1 SELECT dayofyear("2015-09-10")!=dayofyear("2016-04-24"); -dayofyear("2015-09-10")!=dayofyear("2016-04-24") -true +dayofyear(2015-09-10) != dayofyear(2016-04-24) +1 CREATE TABLE Product(Product_id INT, Product_name VARCHAR(100) NOT NULL,Buying_price DECIMAL(13, 2) NOT NULL,Selling_price DECIMAL(13, 2) NOT NULL,Selling_Date Date NOT NULL,PRIMARY KEY(Product_id)); INSERT INTO Product(Product_name, Buying_price, Selling_price, Selling_Date) VALUES ('Audi Q8', 10000000.00, 15000000.00, '2018-01-26' ),('Volvo XC40', 2000000.00, 3000000.00, '2018-04-20' ),('Audi A6', 4000000.00, 5000000.00, '2018-07-25' ),('BMW X5', 5000500.00, 7006500.00, '2018-10-18' ),('Jaguar XF', 5000000, 7507000.00, '2019-01-27' ),('Mercedes-Benz C-Class', 4000000.00, 6000000.00, '2019-04-01' ),('Jaguar F-PACE', 5000000.00, 7000000.00, '2019-12-26' ),('Porsche Macan', 6500000.00, 8000000.00, '2020-04-16' ) ; invalid input: invalid default value for column 'product_id' diff --git a/test/distributed/cases/function/func_datetime_month.result b/test/distributed/cases/function/func_datetime_month.result index 43877645c6cc4..f7f65bafa88dd 100644 --- a/test/distributed/cases/function/func_datetime_month.result +++ b/test/distributed/cases/function/func_datetime_month.result @@ -63,19 +63,19 @@ MONTH("2015-09-10")/MONTH("2016-04-24") 2.2500 SELECT MONTH("2015-09-10")>MONTH("2016-04-24"); month(2015-09-10) > month(2016-04-24) -true +1 SELECT MONTH("2015-09-10")MONTH("2016-04-24"); month(2015-09-10) != month(2016-04-24) -true +1 SELECT MONTH("2015-09-10")!=MONTH("2016-04-24"); month(2015-09-10) != month(2016-04-24) -true +1 SELECT MONTH(NULL) AS Month ; Month null diff --git a/test/distributed/cases/function/func_datetime_now.result b/test/distributed/cases/function/func_datetime_now.result index eda08234d2dd2..335b65bcb950b 100644 --- a/test/distributed/cases/function/func_datetime_now.result +++ b/test/distributed/cases/function/func_datetime_now.result @@ -1,6 +1,6 @@ select now()=now(); now() = now() -true +1 create table t1(a timestamp(6),b int auto_increment); prepare s1 from 'insert into t1(a) select now(6)'; execute s1; @@ -10,7 +10,7 @@ sleep(0.001) execute s1; select t1.a=t2.a from t1,(select a from t1 where b=2)as t2 where b=1; t1.a = t2.a -false +0 delete from t1; deallocate prepare s1; alter table t1 modify column a timestamp; @@ -18,7 +18,7 @@ insert into t1(a,b) values (cast('2024-10-30 10:20:30.123456' as timestamp), 1); insert into t1(a,b) values (cast('2024-10-30 10:20:30.222222' as timestamp), 2); select t1.a=t2.a from t1,(select a from t1 where b=2)as t2 where b=1; t1.a = t2.a -true +1 delete from t1; prepare s1 from 'insert into t1(a,b) values(cast(? as timestamp(6)),?)'; set @a='2024-10-30 10:20:30.123456'; @@ -29,12 +29,12 @@ set @b=2; execute s1 using @a, @b; select t1.a=t2.a from t1,(select a from t1 where b=2)as t2 where b=1; t1.a = t2.a -true +1 deallocate prepare s1; drop table t1; select a=b,c from (select now(6) as a, sleep(1) as c, now(6) as b) t1; a = b c -true 0 +1 0 set @ts=now(); select sleep(1); sleep(1) @@ -42,7 +42,7 @@ sleep(1) set @ts_after=now(); select timestampdiff(microsecond, @ts, @ts_after) >= 1000000 checked; checked -true +1 drop table if exists t1; create table t1(a timestamp,b int auto_increment); insert into t1(a) select current_timestamp () from mo_catalog.mo_sessions limit 1; @@ -52,7 +52,7 @@ sleep(1) insert into t1(a) select current_timestamp () from mo_catalog.mo_sessions limit 1; select t1.a=t2.a from t1,(select a from t1 where b=2)as t2 where b=1; t1.a = t2.a -false +0 drop table t1; select timestampdiff(second, t1, t2), a from (select sysdate() as t1, sleep(2) as a, sysdate() as t2); timestampdiff(second, t1, t2) a @@ -83,4 +83,4 @@ minute(now()) 55 select second(now()); second(now()) -57 +48 diff --git a/test/distributed/cases/function/func_datetime_weekday.result b/test/distributed/cases/function/func_datetime_weekday.result index 4c2fa305f4c35..1da4ad81c3a89 100644 --- a/test/distributed/cases/function/func_datetime_weekday.result +++ b/test/distributed/cases/function/func_datetime_weekday.result @@ -66,20 +66,20 @@ SELECT weekday("2015-09-10")/weekday("2016-04-24"); weekday("2015-09-10")/weekday("2016-04-24") 0.5000 SELECT weekday("2015-09-10")>weekday("2016-04-24"); -weekday("2015-09-10")>weekday("2016-04-24") -false +weekday(2015-09-10) > weekday(2016-04-24) +0 SELECT weekday("2015-09-10")weekday("2016-04-24"); -weekday("2015-09-10")<>weekday("2016-04-24") -true +weekday(2015-09-10) != weekday(2016-04-24) +1 SELECT weekday("2015-09-10")!=weekday("2016-04-24"); -weekday("2015-09-10")!=weekday("2016-04-24") -true +weekday(2015-09-10) != weekday(2016-04-24) +1 CREATE TABLE Product(Product_id INT, Product_name VARCHAR(100) NOT NULL,Buying_price DECIMAL(13, 2) NOT NULL,Selling_price DECIMAL(13, 2) NOT NULL,Selling_Date Date NOT NULL,PRIMARY KEY(Product_id)); INSERT INTO Product(Product_name, Buying_price, Selling_price, Selling_Date) VALUES ('Audi Q8', 10000000.00, 15000000.00, '2018-01-26' ),('Volvo XC40', 2000000.00, 3000000.00, '2018-04-20' ),('Audi A6', 4000000.00, 5000000.00, '2018-07-25' ),('BMW X5', 5000500.00, 7006500.00, '2018-10-18' ),('Jaguar XF', 5000000, 7507000.00, '2019-01-27' ),('Mercedes-Benz C-Class', 4000000.00, 6000000.00, '2019-04-01' ),('Jaguar F-PACE', 5000000.00, 7000000.00, '2019-12-26' ),('Porsche Macan', 6500000.00, 8000000.00, '2020-04-16' ) ; invalid input: invalid default value for column 'product_id' diff --git a/test/distributed/cases/function/func_datetime_year.result b/test/distributed/cases/function/func_datetime_year.result index 700c83a0ebe29..e712fd8208ce2 100644 --- a/test/distributed/cases/function/func_datetime_year.result +++ b/test/distributed/cases/function/func_datetime_year.result @@ -48,19 +48,19 @@ YEAR("2015-09-10")/YEAR("2016-04-24") 0.9995 SELECT YEAR("2015-09-10")>YEAR("2016-04-24"); YEAR("2015-09-10")>YEAR("2016-04-24") -false +0 SELECT YEAR("2015-09-10")YEAR("2016-04-24"); YEAR("2015-09-10")<>YEAR("2016-04-24") -true +1 SELECT YEAR("2015-09-10")!=YEAR("2016-04-24"); YEAR("2015-09-10")!=YEAR("2016-04-24") -true +1 SELECT YEAR(NULL) AS Year ; Year null diff --git a/test/distributed/cases/function/func_json_row.result b/test/distributed/cases/function/func_json_row.result index 773169d7ff604..5492742b57fd5 100644 --- a/test/distributed/cases/function/func_json_row.result +++ b/test/distributed/cases/function/func_json_row.result @@ -172,22 +172,22 @@ count(*) cast(concat(concat([, group_concat(json_row(id, bi, d, d128, t, js), 20 [[1, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [2, 11111111111111, 0.2222222, 3.1415926536, "ttt\"ttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [3, 11111111111111, 0.2222222, 3.1415926536, "tttt\"\"tttt", {"foo": "bar", "zoo": [1, 2, 3]}], [4, 11111111111111, 0.2222222, 3.1415926536, "tttt\"\"\"tttt", {"foo": "bar", "zoo": [1, 2, 3]}], [5, 11111111111111, 0.2222222, 3.1415926536, "tttt\"\"\"\"tttt", {"foo": "bar", "zoo": [1, 2, 3]}], [6, 11111111111111, 0.2222222, 3.1415926536, "tttt'tttt", {"foo": "bar", "zoo": [1, 2, 3]}], [7, 11111111111111, 0.2222222, 3.1415926536, "tttt''tttt", {"foo": "bar", "zoo": [1, 2, 3]}], [8, 11111111111111, 0.2222222, 3.1415926536, "tttt}tttt", {"foo": "bar", "zoo": [1, 2, 3]}], [9, 11111111111111, 0.2222222, 3.1415926536, "ttt}ttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [10, 11111111111111, 0.2222222, 3.1415926536, "tttttttt[[[[", {"foo": "bar", "zoo": [1, 2, 3]}], [11, 11111111111111, 0.2222222, 3.1415926536, "tttttttt]]]]", {"foo": "bar", "zoo": [1, 2, 3]}], [12, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [13, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [14, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [15, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [16, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [17, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [18, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [19, 11111111111111, 0.2222222, 3.1415926536, "tttttttt", {"foo": "bar", "zoo": [1, 2, 3]}], [1000, null, null, null, null, null]] select b, count(*), '[' || group_concat(json_row(id)) || ']' as js from jrt group by b; b count(*) js -true 17 [[1],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[15],[16],[17],[18],[19]] -false 2 [[2],[14]] +1 17 [[1],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[15],[16],[17],[18],[19]] +0 2 [[2],[14]] null 1 [[1000]] select b, '[' || json_row(id, bi, d, d128, t, js) || ']' as js from jrt where b = false; b js -false [[2,11111111111111,0.2222222,3.1415926536,"ttt\"ttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] -false [[14,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] +0 [[2,11111111111111,0.2222222,3.1415926536,"ttt\"ttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] +0 [[14,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] select b, count(*), '[' || group_concat(json_row(id, bi, d, d128, t, js)) || ']' as js from jrt group by b; b count(*) js -true 17 [[1,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[3,11111111111111,0.2222222,3.1415926536,"tttt\"\"tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[4,11111111111111,0.2222222,3.1415926536,"tttt\"\"\"tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[5,11111111111111,0.2222222,3.1415926536,"tttt\"\"\"\"tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[6,11111111111111,0.2222222,3.1415926536,"tttt'tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[7,11111111111111,0.2222222,3.1415926536,"tttt''tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[8,11111111111111,0.2222222,3.1415926536,"tttt}tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[9,11111111111111,0.2222222,3.1415926536,"ttt}ttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[10,11111111111111,0.2222222,3.1415926536,"tttttttt[[[[",{"foo": "bar", "zoo": [1, 2, 3]}],[11,11111111111111,0.2222222,3.1415926536,"tttttttt]]]]",{"foo": "bar", "zoo": [1, 2, 3]}],[12,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[13,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[15,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[16,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[17,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[18,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[19,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] -false 2 [[2,11111111111111,0.2222222,3.1415926536,"ttt\"ttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[14,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] +1 17 [[1,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[3,11111111111111,0.2222222,3.1415926536,"tttt\"\"tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[4,11111111111111,0.2222222,3.1415926536,"tttt\"\"\"tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[5,11111111111111,0.2222222,3.1415926536,"tttt\"\"\"\"tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[6,11111111111111,0.2222222,3.1415926536,"tttt'tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[7,11111111111111,0.2222222,3.1415926536,"tttt''tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[8,11111111111111,0.2222222,3.1415926536,"tttt}tttt",{"foo": "bar", "zoo": [1, 2, 3]}],[9,11111111111111,0.2222222,3.1415926536,"ttt}ttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[10,11111111111111,0.2222222,3.1415926536,"tttttttt[[[[",{"foo": "bar", "zoo": [1, 2, 3]}],[11,11111111111111,0.2222222,3.1415926536,"tttttttt]]]]",{"foo": "bar", "zoo": [1, 2, 3]}],[12,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[13,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[15,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[16,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[17,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[18,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[19,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] +0 2 [[2,11111111111111,0.2222222,3.1415926536,"ttt\"ttttt",{"foo": "bar", "zoo": [1, 2, 3]}],[14,11111111111111,0.2222222,3.1415926536,"tttttttt",{"foo": "bar", "zoo": [1, 2, 3]}]] null 1 [[1000,null,null,null,null,null]] select b, '[' || group_concat(t, t, t, t, t) || ']' as js from jrt group by b; b js -true [tttttttttttttttttttttttttttttttttttttttt,tttt""tttttttt""tttttttt""tttttttt""tttttttt""tttt,tttt"""tttttttt"""tttttttt"""tttttttt"""tttttttt"""tttt,tttt""""tttttttt""""tttttttt""""tttttttt""""tttttttt""""tttt,tttt'tttttttt'tttttttt'tttttttt'tttttttt'tttt,tttt''tttttttt''tttttttt''tttttttt''tttttttt''tttt,tttt}tttttttt}tttttttt}tttttttt}tttttttt}tttt,ttt}tttttttt}tttttttt}tttttttt}tttttttt}ttttt,tttttttt[[[[tttttttt[[[[tttttttt[[[[tttttttt[[[[tttttttt[[[[,tttttttt]]]]tttttttt]]]]tttttttt]]]]tttttttt]]]]tttttttt]]]],tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt] -false [ttt"tttttttt"tttttttt"tttttttt"tttttttt"ttttt,tttttttttttttttttttttttttttttttttttttttt] +1 [tttttttttttttttttttttttttttttttttttttttt,tttt""tttttttt""tttttttt""tttttttt""tttttttt""tttt,tttt"""tttttttt"""tttttttt"""tttttttt"""tttttttt"""tttt,tttt""""tttttttt""""tttttttt""""tttttttt""""tttttttt""""tttt,tttt'tttttttt'tttttttt'tttttttt'tttttttt'tttt,tttt''tttttttt''tttttttt''tttttttt''tttttttt''tttt,tttt}tttttttt}tttttttt}tttttttt}tttttttt}tttt,ttt}tttttttt}tttttttt}tttttttt}tttttttt}ttttt,tttttttt[[[[tttttttt[[[[tttttttt[[[[tttttttt[[[[tttttttt[[[[,tttttttt]]]]tttttttt]]]]tttttttt]]]]tttttttt]]]]tttttttt]]]],tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt,tttttttttttttttttttttttttttttttttttttttt] +0 [ttt"tttttttt"tttttttt"tttttttt"tttttttt"ttttt,tttttttttttttttttttttttttttttttttttttttt] null null select json_row(id, cast(vc as varbinary)) from jrt; invalid input: binary data not supported json_row: VARBINARY diff --git a/test/distributed/cases/function/func_like.result b/test/distributed/cases/function/func_like.result index 9e3ecc42a838e..b2dbff81dbf67 100644 --- a/test/distributed/cases/function/func_like.result +++ b/test/distributed/cases/function/func_like.result @@ -1,39 +1,39 @@ select 'ab' like '__' as result; result -true +1 select 'ab' like '_%' as result; result -true +1 select 'ab' like '%' as result; result -true +1 select 'ab' like 'a_' as result; result -true +1 select 'ab' like '_b' as result; result -true +1 select 'ab' like '%' as result; result -true +1 select 'ab' like '*' as result; result -false +0 select '*' like '*' as result; result -true +1 select '**' like '**' as result; result -true +1 select '**' like '*_' as result; result -true +1 select '**' like '*^' as result; result -false +0 select '(_a)' like '(_a)'; result -true +1 drop table if exists t1; create table t1(a int, b varchar(100)); insert into t1 values(1 , "PowerSlave"); @@ -73,22 +73,22 @@ str1 str2 %str1% %str2% select json_extract('{"a":1}', '$.a') like '1' as result; result -true +1 select json_extract('{"a":1}', '$.a') like 1 as result; result -true +1 select json_extract('{"a":"1"}', '$.a') like '1' as result; result -false +0 select json_extract('{"a":"1"}', '$.a') like 1 as result; result -false +0 select json_extract('{"a":"1"}', '$.a') like '%1%' as result; result -true +1 select json_unquote(json_extract('{"a":"1"}', '$.a')) like '1' as result; result -true +1 select json_unquote(json_extract('{"a":"1"}', '$.a')) like 1 as result; result -true +1 diff --git a/test/distributed/cases/function/func_locate.result b/test/distributed/cases/function/func_locate.result index 7ed1747388502..aa8beea97542c 100644 --- a/test/distributed/cases/function/func_locate.result +++ b/test/distributed/cases/function/func_locate.result @@ -175,22 +175,22 @@ locate(null, null) null select locate('foo', null) is null; locate(foo, null) is null -true +1 select locate(null, 'o') is null; locate(null, o) is null -true +1 select locate(null, null) is null; locate(null, null) is null -true +1 select isnull(locate('foo', null)); isnull(locate(foo, null)) -true +1 select isnull(locate(null, 'o')); isnull(locate(null, o)) -true +1 select isnull(locate(null, null)); isnull(locate(null, null)) -true +1 select locate('lo','hello',3) as result; result 4 @@ -238,9 +238,9 @@ null prepare s2 from 'select isnull(locate(col1, col2)) from locate01'; execute s2; isnull(locate(col1, col2)) -false -true -false +0 +1 +0 drop table locate01; drop table if exists locate02; create table locate02 (col1 tinytext, col2 text); @@ -290,10 +290,10 @@ null prepare s2 from 'select isnull(locate(col1, col2)) from locate03'; execute s2; isnull(locate(col1, col2)) -false -true -false -false -false +0 +1 +0 +0 +0 drop table locate03; drop database testx; diff --git a/test/distributed/cases/function/func_math_abs.result b/test/distributed/cases/function/func_math_abs.result index 37bd565f5059c..45269621b4285 100644 --- a/test/distributed/cases/function/func_math_abs.result +++ b/test/distributed/cases/function/func_math_abs.result @@ -84,7 +84,7 @@ abs(1241) * abs(-0.4141) 513.8981 SELECT abs(-100)>abs(-102); abs(-100) > abs(-102) -false +0 SELECT abs(-100)<>abs(100); abs(-100)<>abs(100) -false +0 diff --git a/test/distributed/cases/function/func_math_power.result b/test/distributed/cases/function/func_math_power.result index e9837d2607e22..22c16d6b7e5ee 100644 --- a/test/distributed/cases/function/func_math_power.result +++ b/test/distributed/cases/function/func_math_power.result @@ -1,44 +1,44 @@ select power(exp(10), log(100)),exp(power(2,2)),power(-1,1),power(NULL,0),power(1,1),power(3,9),power(-1,2),power(NULL,2); -power(exp(10), log(100)) exp(power(2,2)) power(-1,1) power(NULL,0) power(1,1) power(3,9) power(-1,2) power(NULL,2) -1.0000000000000046E20 54.598150033144236 -1.0 null 1.0 19683.0 1.0 null +power(exp(10), log(100)) exp(power(2, 2)) power(-1, 1) power(null, 0) power(1, 1) power(3, 9) power(-1, 2) power(null, 2) +1.0000000000000046E20 54.598150033144236 -1.0 null 1.0 19683.0 1.0 null SELECT power(2,13); -power(2,13) +power(2, 13) 8192.0 SELECT power(-2,-3); -power(-2,-3) +power(-2, -3) -0.125 SELECT power(2,100); -power(2,100) +power(2, 100) 1.2676506002282294E30 SELECT power(10,100); power(10, 100) 1.0000000000000002E100 SELECT power(1,100); -power(1,100) +power(1, 100) 1.0 select power(2,-1); -power(2,-1) +power(2, -1) 0.5 select power(-2,1); -power(-2,1) +power(-2, 1) -2.0 select power(0.00000000000000001,123413); -power(0.00000000000000001,123413) +power(0.00000000000000001, 123413) 0.0 select power(10e100,-39413312); -power(10e100,-39413312) +power(10e100, -39413312) 0.0 select power(0.141241241241313, 124314124124.12412341); power(0.141241241241313, 124314124124.12412341) 0.0 select power(null,2); -power(null,2) +power(null, 2) null select power(2, null); power(2, null) null select power(null,null); -power(null,null) +power(null, null) null CREATE TABLE t1(a DOUBLE); INSERT INTO t1 select (power(56,124)); @@ -47,42 +47,42 @@ INSERT INTO t1 select (power(2,234)); SELECT * FROM t1 ORDER BY a; a 2.7606985387162255E70 -1.0E100 +1.0000000000000002E100 5.96094821228998E216 drop table t1; create table t1(a tinyint, b SMALLINT, c bigint, d INT, e BIGINT, f FLOAT, g DOUBLE, h decimal(38,19)); insert into t1 values(1, 1, 2, 4, 5, 5.5, 31.13, 14.314); select power(a,b),power(b,c),power(c,d),power(d,e),power(e,f),power(f,g),power(g,h) from t1; -power(a,b) power(b,c) power(c,d) power(d,e) power(e,f) power(f,g) power(g,h) -1.0 1.0 16.0 1024.0 6987.712429686842 1.1155538103726188E23 2.362467993555655E21 +power(a, b) power(b, c) power(c, d) power(d, e) power(e, f) power(f, g) power(g, h) +1.0 1.0 16.0 1024.0 6987.712429686843 1.1155538103726188E23 2.362467993555654E21 drop table t1; select power(123.54-123.03, 12-34); -power(123.54-123.03, 12-34) -2713039.5562672606 +power(123.54 - 123.03, 12 - 34) +2713039.5562672615 select power(123.54*0.34, 1203-1200); -power(123.54*0.34, 1203-1200) +power(123.54 * 0.34, 1203 - 1200) 74107.05283300664 select power(134,34)-power(194,44); -power(134,34)-power(194,44) +power(134, 34) - power(194, 44) -4.605492898028417E100 drop table if exists t1; create table t1(a float, b float); insert into t1 values(10, 100), (2, 5); select distinct * from t1 where power(a, b)>0; -a b -10.0 100.0 -2.0 5.0 +a b +10.0 100.0 +2.0 5.0 drop table t1; create table t1(a INT, b int); create table t2(a INT, b int); insert into t1 values(2,4), (100,23); insert into t2 values(10,100), (4,41); SELECT t1.a, t2.a FROM t1 JOIN t2 ON (power(t1.a, t1.b) <> power(t2.a, t2.b)); -a a -100 10 -2 10 -100 4 -2 4 +a a +2 10 +2 4 +100 10 +100 4 drop table t1; drop table t2; drop table if exists t1; diff --git a/test/distributed/cases/function/func_mo_log_date.result b/test/distributed/cases/function/func_mo_log_date.result index ccb440c2abc0b..2ecc1b44b93f1 100644 --- a/test/distributed/cases/function/func_mo_log_date.result +++ b/test/distributed/cases/function/func_mo_log_date.result @@ -3,13 +3,13 @@ date 2021-01-01 SELECT mo_log_date('2021/01/01') between '2021-01-01' and '2021-01-02' as val; val -true +1 SELECT mo_log_date('2021/01/01') > '2021-01-01' as val; val -false +0 SELECT mo_log_date('2021/01/01') < '2021-01-02' as val; val -true +1 SELECT mo_log_date('2021-01-01') as date; date null diff --git a/test/distributed/cases/function/func_regular_like.result b/test/distributed/cases/function/func_regular_like.result index 8fc87e35ef14c..95e6687c52f72 100644 --- a/test/distributed/cases/function/func_regular_like.result +++ b/test/distributed/cases/function/func_regular_like.result @@ -1,15 +1,15 @@ SELECT REGEXP_LIKE('Cat', '.*') Result; result -true +1 SELECT REGEXP_LIKE('Cat', 'b+') Result; result -false +0 SELECT REGEXP_LIKE('Cat', '^Ca') Result; result -true +1 SELECT REGEXP_LIKE('Cat', '^Da') Result; result -false +0 SELECT REGEXP_LIKE(NULL, '.*'); regexp_like(null, .*) NULL @@ -60,15 +60,15 @@ insert into t1 values(8 , "Piece of Mind"); insert into t1 values( 9 , "Killers"); SELECT a, REGEXP_LIKE(b, '^P') from t1; a regexp_like(b, ^P) -1 true -2 true -3 false -4 false -5 false -6 false -7 false -8 true -9 false +1 1 +2 1 +3 0 +4 0 +5 0 +6 0 +7 0 +8 1 +9 0 drop table t1; create table t1(a int, b varchar(100)); insert into t1 values(1 , "PowerSlave"); @@ -82,27 +82,27 @@ insert into t1 values(8 , NULL); insert into t1 values( 9 , "Killers"); SELECT a, REGEXP_LIKE(b, '^P') from t1; a regexp_like(b, ^P) -1 true -2 true -3 false +1 1 +2 1 +3 0 4 null -5 false -6 false -7 false +5 0 +6 0 +7 0 8 null -9 false +9 0 drop table t1; select regexp_like('Cat', '*'); error parsing regexp: missing argument to repetition operator: `*` select regexp_like('CAT','cat','i') r; r -true +1 select regexp_like('\n','.','n') r; r -true +1 select regexp_like('abc\ndef','^def','m') r; r -true +1 select regexp_like('CAT','cat','iiiiiiic') r; r -false \ No newline at end of file +0 \ No newline at end of file diff --git a/test/distributed/cases/function/func_string_empty.result b/test/distributed/cases/function/func_string_empty.result index 2fa883d68d785..34d3ee089ffbb 100644 --- a/test/distributed/cases/function/func_string_empty.result +++ b/test/distributed/cases/function/func_string_empty.result @@ -4,8 +4,8 @@ insert into t1 values('', 'abcd'); insert into t1 values('1111', ''); select empty(a),empty(b) from t1; empty(a) empty(b) -true false -false true +1 0 +0 1 drop table t1; drop table if exists t1; create table t1(a varchar(255),b char(255)); diff --git a/test/distributed/cases/function/func_string_format.result b/test/distributed/cases/function/func_string_format.result index 9dedeb7029e00..5bd13933f67f1 100644 --- a/test/distributed/cases/function/func_string_format.result +++ b/test/distributed/cases/function/func_string_format.result @@ -487,10 +487,10 @@ format(d2, 3) 3,923,404.213 SELECT startswith(format(d2,1),'47823') from format_02 WHERE id = 1; startswith(format(d2, 1), 47823) -false +0 SELECT endswith(format(d2,1),'32.4') from format_02 WHERE id = 1; endswith(format(d2, 1), 32.4) -true +1 SELECT substring(format(d1,3),3,5) from format_02; substring(format(d1, 3), 3, 5) 200 diff --git a/test/distributed/cases/function/func_string_lpad_rpad.result b/test/distributed/cases/function/func_string_lpad_rpad.result index bc99ede9eb82b..1995765590458 100644 --- a/test/distributed/cases/function/func_string_lpad_rpad.result +++ b/test/distributed/cases/function/func_string_lpad_rpad.result @@ -185,7 +185,7 @@ RPAD('a', -1, 'x') null SELECT (rpad(1.0,2048,1)) IS NOT FALSE; (rpad(1.0, 2048, 1)) != false -true +1 SELECT ((+0) IN ((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)), (32767.1))); diff --git a/test/distributed/cases/function/func_string_mid.result b/test/distributed/cases/function/func_string_mid.result index 23ca23851b611..8a4091ea61fdd 100644 --- a/test/distributed/cases/function/func_string_mid.result +++ b/test/distributed/cases/function/func_string_mid.result @@ -173,7 +173,7 @@ mid(f1, 1, 1) drop table t1; SELECT '1' IN ('1', MID(-9223372036854775809, 1)); 1 in (1, mid(-9223372036854775809, 1)) -true +1 SELECT MID('1', year(FROM_UNIXTIME(-1))); mid(1, year(from_unixtime(-1))) null diff --git a/test/distributed/cases/function/func_string_oct.result b/test/distributed/cases/function/func_string_oct.result index 82ced0f9044cb..114fc3ef607e6 100644 --- a/test/distributed/cases/function/func_string_oct.result +++ b/test/distributed/cases/function/func_string_oct.result @@ -85,5 +85,5 @@ drop table t1; drop table t2; SELECT OCT(NULL) IS UNKNOWN; -oct(null) is unknown -true \ No newline at end of file +OCT(null) is unknown +1 diff --git a/test/distributed/cases/function/func_string_startsWith_endsWith.result b/test/distributed/cases/function/func_string_startsWith_endsWith.result index b2e4f61725316..3c931b9372c89 100644 --- a/test/distributed/cases/function/func_string_startsWith_endsWith.result +++ b/test/distributed/cases/function/func_string_startsWith_endsWith.result @@ -9,12 +9,12 @@ insert into t1 values (6,'Tapan Samanta', 'X'); select a,startswith(b,'An') from t1; a startswith(b, An) -1 true -2 true -3 true -4 true -5 false -6 false +1 1 +2 1 +3 1 +4 1 +5 0 +6 0 select a,b,c from t1 where startswith(b,'An')=1 and startswith(c,'I')=1; a b c 1 Ananya Majumdar IX @@ -30,12 +30,12 @@ insert into t1 values (6,'Tapan Samanta', 'XI'); select a,endsWith(b,'a') from t1; a endswith(b, a) -1 false -2 true -3 true -4 false -5 false -6 true +1 0 +2 1 +3 1 +4 0 +5 0 +6 1 select a,b,c from t1 where endswith(b,'a')=1 and endswith(c,'I')=1; a b c 3 Aniket Sharma XI @@ -65,16 +65,16 @@ null drop table t1; select endsWith('a', 'a') from dual; endswith(a, a) -true +1 select endsWith('a', 'b') from dual; endswith(a, b) -false +0 select endsWith('aaaa', 'a') from dual; endswith(aaaa, a) -true +1 select endsWith('xsdfsdf', 'fsdf') from dual; endswith(xsdfsdf, fsdf) -true +1 select endsWith('xsdfsdf', 'fsdfx') from dual; endswith(xsdfsdf, fsdfx) -false +0 diff --git a/test/distributed/cases/function/func_string_substring.result b/test/distributed/cases/function/func_string_substring.result index ca3910ff47cb8..10eff3760a374 100644 --- a/test/distributed/cases/function/func_string_substring.result +++ b/test/distributed/cases/function/func_string_substring.result @@ -173,7 +173,7 @@ substirng(f1, 1, 1) drop table t1; SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1)); 1 in (1, substring(-9223372036854775809, 1)) -true +1 SELECT SUBSTRING('1', year(FROM_UNIXTIME(-1))); substring(1, year(from_unixtime(-1))) null diff --git a/test/distributed/cases/function/func_substr.result b/test/distributed/cases/function/func_substr.result index e4ebc71083ccc..37e2e44bdf0d7 100755 --- a/test/distributed/cases/function/func_substr.result +++ b/test/distributed/cases/function/func_substr.result @@ -200,32 +200,32 @@ ol.Berkly.the.book ucklife select endswith(c,'a'),endswith(vc,'a') from t1; endswith(c, a) endswith(vc, a) -false false -false false -false false -false false -false false -false false -false false -false false -false false -false false +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 null null -false false +0 0 select endswith(c,'y'),endswith(vc,'e') from t1; endswith(c, y) endswith(vc, e) -true true -true true -false true -true true -false false -false false -false false -false false -false true -false false +1 1 +1 1 +0 1 +1 1 +0 0 +0 0 +0 0 +0 0 +0 1 +0 0 null null -false false +0 0 select * from t1 where endswith(c,'y'); id c vc 1 Daffy Aducklife @@ -236,32 +236,32 @@ id c vc 3 Cowboy Lifeontherange select startswith(c,'B'),startswith(vc,'A') from t1; startswith(c, B) startswith(vc, A) -false true -false true -true true -false false -false false -true false -true false -false false -false false -true false +0 1 +0 1 +1 1 +0 0 +0 0 +1 0 +1 0 +0 0 +0 0 +1 0 null null -false false +0 0 select startswith(c,'y'),startswith(vc,'e') from t1; startswith(c, y) startswith(vc, e) -false false -false false -false false -false false -false false -false false -false false -false false -false false -false false +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 +0 0 null null -false false +0 0 select * from t1 where startswith(c,'B'); id c vc 2 Bugs Arabbitlife diff --git a/test/distributed/cases/function/function_instr.result b/test/distributed/cases/function/function_instr.result index 32340bc21ee17..da26a2e79969c 100644 --- a/test/distributed/cases/function/function_instr.result +++ b/test/distributed/cases/function/function_instr.result @@ -134,11 +134,11 @@ oct(instr(str2, str1)) 22 SELECT empty(instr(str2,str1)) FROM instr_01; empty(instr(str2, str1)) -false -false -false -false -false +0 +0 +0 +0 +0 null null null @@ -260,12 +260,12 @@ oct(instr(str2, str1)) 1 SELECT empty(instr(str2,str1)) FROM instr_02; empty(instr(str2, str1)) -false -false -false -false +0 +0 +0 +0 null -false +0 SELECT LENGTH(INSTR(str2,str1)) FROM instr_02; length(instr(str2, str1)) 1 diff --git a/test/distributed/cases/function/function_mid.result b/test/distributed/cases/function/function_mid.result index 252d50ae5b116..e47df7e01b3a2 100644 --- a/test/distributed/cases/function/function_mid.result +++ b/test/distributed/cases/function/function_mid.result @@ -185,13 +185,13 @@ find_in_set(mid(s, 1 + 2, 9), woshishei) 0 SELECT empty(mid(s,1,2)) FROM mid_02; empty(mid(s, 1, 2)) -false -true -false +0 +1 +0 null null -false -false +0 +0 SELECT LENGTH(mid(s, -1, 7281979 % 2)) FROM mid_02; length(mid(s, -1, 7281979 % 2)) 1 @@ -238,7 +238,7 @@ SELECT startswith(mid(s, 1, 6), 'ehwq') FROM mid_02 WHERE d2 = NULL; startswith(mid(s, 1, 6), ehwq) SELECT endswith(mid(s,-1,1),' ') FROM mid_02 WHERE id = 6; endswith(mid(s, -1, 1), ) -true +1 SELECT substring(mid(s, 3, 19),3, 10) FROM mid_02 WHERE id + 1 = 4; substring(mid(s, 3, 19), 3, 10) 284o 329&* diff --git a/test/distributed/cases/function/function_split_part.result b/test/distributed/cases/function/function_split_part.result index b97bdd6fccf31..a7ce87d482b46 100644 --- a/test/distributed/cases/function/function_split_part.result +++ b/test/distributed/cases/function/function_split_part.result @@ -161,7 +161,7 @@ startswith(split_part(s1, *., 3), 123) null null null -false +0 null null null @@ -177,7 +177,7 @@ null null null null -true +1 SELECT * FROM split_part_01 WHERE find_in_set(split_part(s1,delim,count1),NULL) = NULL; id s1 delim count1 SELECT CONCAT_WS(split_part(s1,delim,count1),'hehaha32789','ABCNSLK') FROM split_part_01 WHERE id = 2; @@ -185,10 +185,10 @@ concat_ws(split_part(s1, delim, count1), hehaha32789, ABCNSLK) null SELECT empty(split_part(s1,delim,count1)) FROM split_part_01; empty(split_part(s1, delim, count1)) -false +0 null null -false +0 null null null @@ -295,17 +295,17 @@ id s1 delim count1 count2 SELECT startswith(split_part(s1,delim,3),'SUB') FROM split_part_02; startswith(split_part(s1, delim, 3), SUB) null -false +0 null null -false +0 SELECT endswith(split_part(s1,delim,6),'h)') FROM split_part_02; endswith(split_part(s1, delim, 6), h)) null -false +0 null null -false +0 SELECT find_in_set(split_part(s1,delim,count1),'SUBSTRING函数的功能:用于从字符串的指定位置开始截取指定长度的字符串substring语法:SUBSTRING(string, start, length),dvuewinviecfjds439432094ie3jiHHDIUWH*&*(UIJCSijfje3iu2j9032^&(*&()(*)I)A&^%^*&') FROM split_part_02; find_in_set(split_part(s1, delim, count1), SUBSTRING函数的功能:用于从字符串的指定位置开始截取指定长度的字符串substring语法:SUBSTRING(string, start, length),dvuewinviecfjds439432094ie3jiHHDIUWH*&*(UIJCSijfje3iu2j9032^&(*&()(*)I)A&^%^*&) null diff --git a/test/distributed/cases/function/function_substring_index.result b/test/distributed/cases/function/function_substring_index.result index 65e9e8db69dd5..3e2d7c9bdd30c 100644 --- a/test/distributed/cases/function/function_substring_index.result +++ b/test/distributed/cases/function/function_substring_index.result @@ -139,28 +139,28 @@ rpad(substring_index(s1, *., 3), 20, *) 123abc&*.jjkmm&*.732 SELECT startswith(substring_index(s1,'*.',3),'123') FROM substring_index_01; startswith(substring_index(s1, *., 3), 123) -false -false -false -true -false -false -false -false +0 +0 +0 +1 +0 +0 +0 +0 null -false +0 SELECT endswith(substring_index(s1,'+',2),'62') FROM substring_index_01; endswith(substring_index(s1, +, 2), 62) -false -false -false -false -false -false -false -false +0 +0 +0 +0 +0 +0 +0 +0 null -true +1 SELECT * FROM substring_index_01 WHERE find_in_set(substring_index(s1,delim,count1),NULL) = NULL; id s1 delim count1 SELECT CONCAT_WS(substring_index(s1,delim,count1),'hehaha32789','ABCNSLK') FROM substring_index_01 WHERE id = 2; @@ -168,13 +168,13 @@ concat_ws(substring_index(s1, delim, count1), hehaha32789, ABCNSLK) hehaha32789新年快乐,身体健康,万事如意ABCNSLK SELECT empty(substring_index(s1,delim,count1)) FROM substring_index_01; empty(substring_index(s1, delim, count1)) -false -false -false -false -false -false -true +0 +0 +0 +0 +0 +0 +1 null null null @@ -256,18 +256,18 @@ SELECT * FROM substring_index_02 WHERE LPAD(substring_index(LTRIM(s1),'e',3),20, id s1 delim count1 count2 SELECT startswith(substring_index(s1,delim,3),'SUB') FROM substring_index_02; startswith(substring_index(s1, delim, 3), SUB) -true -false +1 +0 null null -false +0 SELECT endswith(substring_index(s1,delim,-2),'h)') FROM substring_index_02; endswith(substring_index(s1, delim, -2), h)) -true -false +1 +0 null null -false +0 SELECT find_in_set(substring_index(s1,delim,count1),'SUBSTRING函数的功能:用于从字符串的指定位置开始截取指定长度的字符串substring语法:SUBSTRING(string, start, length),dvuewinviecfjds439432094ie3jiHHDIUWH*&*(UIJCSijfje3iu2j9032^&(*&()(*)I)A&^%^*&') FROM substring_index_02; find_in_set(substring_index(s1, delim, count1), SUBSTRING函数的功能:用于从字符串的指定位置开始截取指定长度的字符串substring语法:SUBSTRING(string, start, length),dvuewinviecfjds439432094ie3jiHHDIUWH*&*(UIJCSijfje3iu2j9032^&(*&()(*)I)A&^%^*&) 0 diff --git a/test/distributed/cases/function/mo_log_date.result b/test/distributed/cases/function/mo_log_date.result index 69c64c72653e4..1aa25bbcc56fc 100644 --- a/test/distributed/cases/function/mo_log_date.result +++ b/test/distributed/cases/function/mo_log_date.result @@ -60,34 +60,34 @@ mo_log_date(2022-12-{}) null select mo_log_date('2021/01/01') between '2021-01-01' and '2021-01-02' as val; val -true +1 select mo_log_date('1998/01/01') between '2021-01-01' and '2021-01-02' as val; val -false +0 select mo_log_date('1999/01/13') between '1970-01-01' and '2020-12-13' as val; val -true +1 select mo_log_date('2023/1/13') between '2023-01-13' and '2023-12-13' as val; val -true +1 select mo_log_date('2023/11/9') between '2023-1-9' and '2025-12-19' as val; val -true +1 select mo_log_date('2023/01/03') > '2023-01-01' as val; val -true +1 select mo_log_date('1997/12/12') < '2023-12-12' as val; val -true +1 select mo_log_date('1995/12/30') > '1996-12-30' as val; val -false +0 select mo_log_date('2001/05/06') < '1997-07-03' as val; val -false +0 select mo_log_date('2020/01/06') > '2020-01-05' and mo_log_date('2020/01/06') < '2021-01-05'; mo_log_date(2020/01/06) > 2020-01-05 and mo_log_date(2020/01/06) < 2021-01-05 -true +1 select mo_log_date('2021-01-13') between '2020-01-13' and '2022-11-12'; mo_log_date(2021-01-13) between 2020-01-13 and 2022-11-12 null diff --git a/test/distributed/cases/git4data/branch/merge/merge_7.result b/test/distributed/cases/git4data/branch/merge/merge_7.result index faf33490b4022..424a3acbda3c9 100644 --- a/test/distributed/cases/git4data/branch/merge/merge_7.result +++ b/test/distributed/cases/git4data/branch/merge/merge_7.result @@ -21,16 +21,16 @@ delete from t2 where org_id = 2 and event_id = 1; insert into t2 values (3, 3, 'path\\dir', 99.99, '', true); data branch diff t2 against t1; diff t2 against t1 flag org_id event_id name amount note active -t2 UPDATE 1 1 ALPHA 11.00 seed true -t2 UPDATE 1 2 beta 20.00 null false -t2 DELETE 2 1 Gamma 30.30 null true -t2 INSERT 3 3 path\dir 99.99 true +t2 UPDATE 1 1 ALPHA 11.00 seed 1 +t2 UPDATE 1 2 beta 20.00 null 0 +t2 DELETE 2 1 Gamma 30.30 null 1 +t2 INSERT 3 3 path\dir 99.99 1 data branch merge t2 into t1; select * from t1 order by org_id, event_id; org_id event_id name amount note active -1 1 ALPHA 11.00 seed true -1 2 beta 20.00 null false -3 3 path\dir 99.99 true +1 1 ALPHA 11.00 seed 1 +1 2 beta 20.00 null 0 +3 3 path\dir 99.99 1 data branch diff t2 against t1; diff t2 against t1 flag org_id event_id name amount note active drop table t1; diff --git a/test/distributed/cases/git4data/branch/metadata/branch_metadata.result b/test/distributed/cases/git4data/branch/metadata/branch_metadata.result index 227da2df14f51..f80818a9f5dc8 100644 --- a/test/distributed/cases/git4data/branch/metadata/branch_metadata.result +++ b/test/distributed/cases/git4data/branch/metadata/branch_metadata.result @@ -14,11 +14,11 @@ where reldatabase = 'br_meta_db' and relname = 'branch_tbl' ); select table_deleted from mo_catalog.mo_branch_metadata where table_id = @branch_tbl_id; table_deleted -false +0 data branch delete table br_meta_db.branch_tbl; select table_deleted from mo_catalog.mo_branch_metadata where table_id = @branch_tbl_id; table_deleted -true +1 drop snapshot sp_base_tbl; drop database br_meta_db; drop database if exists src_db; @@ -42,13 +42,13 @@ select table_deleted from mo_catalog.mo_branch_metadata where table_id in (@dst_t1_id, @dst_t2_id) order by table_id; table_deleted -false -false +0 +0 data branch delete database dst_db; select table_deleted from mo_catalog.mo_branch_metadata where table_id in (@dst_t1_id, @dst_t2_id) order by table_id; table_deleted -true -true +1 +1 drop database if exists src_db; diff --git a/test/distributed/cases/git4data/branch/metadata/branch_metadata_tenant.result b/test/distributed/cases/git4data/branch/metadata/branch_metadata_tenant.result index 8d9910d625016..d66bd2abde8a7 100644 --- a/test/distributed/cases/git4data/branch/metadata/branch_metadata_tenant.result +++ b/test/distributed/cases/git4data/branch/metadata/branch_metadata_tenant.result @@ -20,11 +20,11 @@ where account_id = @acc_id and reldatabase = 'br_meta_db' and relname = 'branch_ ); select table_deleted from mo_catalog.mo_branch_metadata where table_id = @branch_tbl_id; table_deleted -false +0 data branch delete table br_meta_db.branch_tbl; select table_deleted from mo_catalog.mo_branch_metadata where table_id = @branch_tbl_id; table_deleted -true +1 drop snapshot if exists sp_base_tbl; drop database if exists br_meta_db; drop database if exists src_db; @@ -48,15 +48,15 @@ select table_deleted from mo_catalog.mo_branch_metadata where table_id in (@dst_t1_id, @dst_t2_id) order by table_id; table_deleted -false -false +0 +0 data branch delete database dst_db; select table_deleted from mo_catalog.mo_branch_metadata where table_id in (@dst_t1_id, @dst_t2_id) order by table_id; table_deleted -true -true +1 +1 drop database if exists src_db; drop database if exists dst_db; drop account if exists acc_branch_meta; diff --git a/test/distributed/cases/git4data/branch/pick/pick_4.result b/test/distributed/cases/git4data/branch/pick/pick_4.result index e7773de03c4d1..3ae20c2fce259 100644 --- a/test/distributed/cases/git4data/branch/pick/pick_4.result +++ b/test/distributed/cases/git4data/branch/pick/pick_4.result @@ -56,10 +56,10 @@ insert into t2 values (1,'alice',95.5,true),(3,'charlie',92.0,false),(4,'dave',7 data branch pick t2 into t1 keys(3,4); select * from t1 order by id asc; id name score active -1 alice 95.5 true -2 bob 88.0 true -3 charlie 92.0 false -4 dave 78.5 true +1 alice 95.5 1 +2 bob 88.0 1 +3 charlie 92.0 0 +4 dave 78.5 1 drop table t1; drop table t2; create table t1 (a int, b int, primary key(a)); diff --git a/test/distributed/cases/git4data/clone/clone.result b/test/distributed/cases/git4data/clone/clone.result index 2f7bcc9de9c45..7defdfb577836 100644 --- a/test/distributed/cases/git4data/clone/clone.result +++ b/test/distributed/cases/git4data/clone/clone.result @@ -452,8 +452,8 @@ set time_zone = 'SYSTEM'; load data infile '$resources/load_data/time_date_1.csv' into table t1 fields terminated by ','; select * from t1; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 drop database if exists test08; create database test08; use test08; @@ -516,8 +516,8 @@ col1 use test07; select * from t1; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 use test08; select * from vtab32; id vecf32_3 vecf32_5 @@ -650,8 +650,8 @@ use test06_new; use test07_new; select * from t1; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 use test08_new; select * from vtab32; id vecf32_3 vecf32_5 diff --git a/test/distributed/cases/git4data/clone/clone_can_rollback.result b/test/distributed/cases/git4data/clone/clone_can_rollback.result index 015b8d8f48197..75febcb29fe4d 100644 --- a/test/distributed/cases/git4data/clone/clone_can_rollback.result +++ b/test/distributed/cases/git4data/clone/clone_can_rollback.result @@ -1,17 +1,17 @@ select enable_fault_injection(); enable_fault_injection() -true +1 drop database if exists test; drop database if exists srcdb; create database srcdb; create table srcdb.t1(a int); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'srcdb.t1'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, srcdb.t1) -true +1 insert into srcdb.t1 select * from generate_series(200000)g; select disable_fault_injection(); disable_fault_injection() -true +1 begin; create database test clone srcdb; show create database test; @@ -32,17 +32,17 @@ show create database test; Unknown database test select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/clone_fails',':::','echo',40,'test.t1'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, test.t1) -true +1 create database test clone srcdb; internal error: injected table clone error show create database test; Unknown database test select disable_fault_injection(); disable_fault_injection() -true +1 create database test; begin; create table test.t1 clone srcdb.t1; @@ -58,15 +58,15 @@ show tables from test; Tables_in_test select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/clone_fails',':::','echo',40,'test.t1'); add_fault_point(fj/cn/clone_fails, :::, echo, 40, test.t1) -true +1 create table test.t1 clone srcdb.t1; internal error: injected table clone error select disable_fault_injection(); disable_fault_injection() -true +1 show tables from test; Tables_in_test select count(*) from srcdb.t1 where a mod 100 = 0; diff --git a/test/distributed/cases/git4data/clone/table_clone.result b/test/distributed/cases/git4data/clone/table_clone.result index e4b42d0ee3b37..d05a445804582 100644 --- a/test/distributed/cases/git4data/clone/table_clone.result +++ b/test/distributed/cases/git4data/clone/table_clone.result @@ -9,15 +9,15 @@ insert into t1(a,b) values(40000, 40000); create table t2 clone t1; select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/subscribe_table_fail',':::','echo',40,'db1.t2'); add_fault_point(fj/cn/subscribe_table_fail, :::, echo, 40, db1.t2) -true +1 select * from t2 order by a asc; internal error: injected subscribe table err select disable_fault_injection(); disable_fault_injection() -true +1 select * from t2 order by a asc; a b 1 1 diff --git a/test/distributed/cases/join/apply.result b/test/distributed/cases/join/apply.result index d63fa72d86861..bf560995c6173 100644 --- a/test/distributed/cases/join/apply.result +++ b/test/distributed/cases/join/apply.result @@ -294,15 +294,15 @@ create table t_apply_prepare_fault(a int, b int); insert into t_apply_prepare_fault values(1,3); select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/generate_series_partial_prepare', ':::', 'echo', 0, 'apply teardown repro'); add_fault_point(fj/cn/generate_series_partial_prepare, :::, echo, 0, apply teardown repro) -true +1 prepare s_apply_fault from select * from t_apply_prepare_fault cross apply generate_series(t_apply_prepare_fault.a, t_apply_prepare_fault.b) g; execute s_apply_fault; invalid state generate_series partial prepare fault: apply teardown repro deallocate prepare s_apply_fault; select disable_fault_injection(); disable_fault_injection() -true +1 drop table t_apply_prepare_fault; diff --git a/test/distributed/cases/load_data/load_data.result b/test/distributed/cases/load_data/load_data.result index d88c2c37c203d..4fe41fc4dadcf 100644 --- a/test/distributed/cases/load_data/load_data.result +++ b/test/distributed/cases/load_data/load_data.result @@ -223,23 +223,23 @@ set time_zone = 'SYSTEM'; load data infile '$resources/load_data/time_date_1.csv' into table t4 fields terminated by ','; select * from t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 delete from t4; load data infile '$resources/load_data/time_date_2.csv' into table t4 fields terminated by ','; select * from t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null false -9999-12-31 9999-12-31 00:00:00 null true -9999-12-31 9999-12-31 00:00:00 null true -9999-12-31 9999-12-31 23:59:59 null true -null null null true -null null null true -null null null false -null null null true +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 0 +9999-12-31 9999-12-31 00:00:00 null 1 +9999-12-31 9999-12-31 00:00:00 null 1 +9999-12-31 9999-12-31 23:59:59 null 1 +null null null 1 +null null null 1 +null null null 0 +null null null 1 null null null null null null null null select * from t4 into outfile '$resources/into_outfile/outfile_time_date_2.csv'; @@ -247,17 +247,17 @@ delete from t4; load data infile '$resources/into_outfile/outfile_time_date_2.csv' into table t4 fields terminated by ',' ignore 1 lines; select * from t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null false -9999-12-31 9999-12-31 00:00:00 null true -9999-12-31 9999-12-31 00:00:00 null true -9999-12-31 9999-12-31 23:59:59 null true -null null null true -null null null true -null null null false -null null null true +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 0 +9999-12-31 9999-12-31 00:00:00 null 1 +9999-12-31 9999-12-31 00:00:00 null 1 +9999-12-31 9999-12-31 23:59:59 null 1 +null null null 1 +null null null 1 +null null null 0 +null null null 1 null null null null null null null null delete from t4; @@ -266,14 +266,14 @@ delete from t4; load data infile '$resources/load_data/time_date_4.csv' into table t4 fields terminated by';'; select * from t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null false -9999-12-31 9999-12-31 00:00:00 null true -9999-12-31 9999-12-31 00:00:00 null true -null null null true -null null null true -null null null false -null null null true +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 0 +9999-12-31 9999-12-31 00:00:00 null 1 +9999-12-31 9999-12-31 00:00:00 null 1 +null null null 1 +null null null 1 +null null null 0 +null null null 1 null null null null null null null null delete from t4; @@ -345,56 +345,56 @@ PRIMARY KEY (`col1`) load data infile '$resources/load_data/test_1.csv' into table test_table fields terminated by ',' parallel 'true'; select * from test_table; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 drop table test_table; drop database ssb; drop account `abc2`; diff --git a/test/distributed/cases/load_data/load_data_csv_values.result b/test/distributed/cases/load_data/load_data_csv_values.result index a5093bf6a36da..8f78f8bb8c2dc 100644 --- a/test/distributed/cases/load_data/load_data_csv_values.result +++ b/test/distributed/cases/load_data/load_data_csv_values.result @@ -36,8 +36,8 @@ load data inline format='csv', data='1000-01-01,0001-01-01,1970-01-01 00:00:01,0 ' into table t4; select * from t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 create table t5( col1 text ); diff --git a/test/distributed/cases/load_data/load_data_jsonline.result b/test/distributed/cases/load_data/load_data_jsonline.result index 6438b4cb98c2e..da2b1f3083ccc 100644 --- a/test/distributed/cases/load_data/load_data_jsonline.result +++ b/test/distributed/cases/load_data/load_data_jsonline.result @@ -4,10 +4,10 @@ create table t1(col1 bool,col2 int,col3 varchar(100), col4 date,col5 datetime,co load data infile {'filepath'='$resources/load_data/jsonline_object.jl','format'='jsonline','jsondata'='object'} into table t1; select * from t1; col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1az null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1az null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1qaz null null delete from t1; load data infile {'filepath'='$resources/load_data/jsonline_array.jl','format'='jsonline','jsondata'='array'} into table t1; load data infile {'filepath'='$resources/load_data/jsonline_array.jl.bz2','format'='jsonline','jsondata'='array','compression'='bzip2'} into table t1; @@ -16,16 +16,16 @@ load data infile {'filepath'='$resources/load_data/jsonline_array.jl.bz2','jsond load data infile {'filepath'='$resources/load_data/jsonline_array.jl.gz','jsondata'='array'} into table t1; select * from t1; col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null -true 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 ["1", 2, null, false, true, {"q": 1}] 1qaz null null +1 1 var 2020-09-07 2020-09-07 00:00:00 2020-09-07 00:00:00 18 121.11 {"b": ["a", "b", {"q": 4}], "c": 1} 1aza null null drop table if exists jsonline_t1; create table jsonline_t1( col1 tinyint, @@ -154,42 +154,42 @@ set time_zone = 'SYSTEM'; load data infile{'filepath'='$resources/load_data/time_date_1.jl','format'='jsonline','jsondata'='object'}into table jsonline_t4; select * from jsonline_t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null true -1000-01-01 0001-01-01 00:00:00.000001000 null false +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 1 +1000-01-01 0001-01-01 00:00:00.000001000 null 0 null null null null null null null null -9999-12-31 9999-12-30 23:59:59.999999000 null false +9999-12-31 9999-12-30 23:59:59.999999000 null 0 select * from jsonline_t4 into outfile '$resources/into_outfile/json_outfile_time_date_1.csv'; load data infile '$resources/into_outfile/json_outfile_time_date_1.csv' into table jsonline_t4 fields terminated by ',' ignore 1 lines; select * from jsonline_t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null true -1000-01-01 0001-01-01 00:00:00.000001000 null false +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 1 +1000-01-01 0001-01-01 00:00:00.000001000 null 0 null null null null null null null null -9999-12-31 9999-12-30 23:59:59.999999000 null false -1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 false -9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 true -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 null true -1000-01-01 0001-01-01 00:00:00.000001000 null false +9999-12-31 9999-12-30 23:59:59.999999000 null 0 +1000-01-01 0001-01-01 00:00:00 1970-01-01 00:00:01 0 +9999-12-31 9999-12-31 00:00:00 2038-01-19 00:00:00 1 +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 null 1 +1000-01-01 0001-01-01 00:00:00.000001000 null 0 null null null null null null null null -9999-12-31 9999-12-30 23:59:59.999999000 null false +9999-12-31 9999-12-30 23:59:59.999999000 null 0 truncate table jsonline_t4; load data infile{'filepath'='$resources/load_data/time_date_1_array.jl','format'='jsonline','jsondata'='array'}into table jsonline_t4; select * from jsonline_t4; col1 col2 col3 col4 -1000-01-01 0001-01-01 00:00:00 null false -1000-01-01 0001-01-01 00:00:00 2023-01-12 10:02:34 true -1000-01-01 0001-01-01 00:00:00 2022-09-10 00:00:00 true -9999-12-31 9999-12-30 23:59:59.999999000 2023-01-12 10:02:34.093000000 false +1000-01-01 0001-01-01 00:00:00 null 0 +1000-01-01 0001-01-01 00:00:00 2023-01-12 10:02:34 1 +1000-01-01 0001-01-01 00:00:00 2022-09-10 00:00:00 1 +9999-12-31 9999-12-30 23:59:59.999999000 2023-01-12 10:02:34.093000000 0 null null null null create table jsonline_t5 (a char(225),b varchar(225),c text,d varchar(225)); load data infile{'filepath'='$resources/load_data/char_varchar_1.jl','format'='jsonline','jsondata'='object'}into table jsonline_t5; diff --git a/test/distributed/cases/load_data/load_data_parquet.result b/test/distributed/cases/load_data/load_data_parquet.result index 63aed13389694..9473f23a30099 100644 --- a/test/distributed/cases/load_data/load_data_parquet.result +++ b/test/distributed/cases/load_data/load_data_parquet.result @@ -17,14 +17,14 @@ create table t2(id bigint not null, name varchar not null, sex bool, f32 float(5 load data infile {'filepath'='$resources/load_data/simple2.parq', 'format'='parquet'} into table t2; select * from t2; id name sex f32 -1 user1 false 1.0 -2 user2 false null -7 user7 false 7.0 -8 user8 true null -10 user10 false 10.0 -12 user12 false null -15 user15 false null -16 user16 true null +1 user1 0 1.0 +2 user2 0 null +7 user7 0 7.0 +8 user8 1 null +10 user10 0 10.0 +12 user12 0 null +15 user15 0 null +16 user16 1 null create table t3(c varchar); load data infile {'filepath'='$resources/load_data/indexed_str.parq', 'format'='parquet'} into table t3; select * from t3; @@ -47,14 +47,14 @@ create stage parqstage URL='file:///$resources/load_data/'; load data infile {'filepath'='stage://parqstage/simple2.parq', 'format'='parquet'} into table t4; select * from t4; id name sex f32 -1 user1 false 1.0 -2 user2 false null -7 user7 false 7.0 -8 user8 true null -10 user10 false 10.0 -12 user12 false null -15 user15 false null -16 user16 true null +1 user1 0 1.0 +2 user2 0 null +7 user7 0 7.0 +8 user8 1 null +10 user10 0 10.0 +12 user12 0 null +15 user15 0 null +16 user16 1 null drop stage parqstage; create table t5(id bigint, name varchar, int8column tinyint, int16column smallint, binarycolumn binary, varbinarycolumn varbinary(32), blobcolumn blob); load data infile {'filepath'='$resources/load_data/int8_int16_binary_varbinary_blob.parq', 'format'='parquet'} into table t5; diff --git a/test/distributed/cases/log/column_metric.result b/test/distributed/cases/log/column_metric.result index 4e07591f8eeb0..49d027c504f49 100644 --- a/test/distributed/cases/log/column_metric.result +++ b/test/distributed/cases/log/column_metric.result @@ -4,4 +4,4 @@ select count(1) cnt, metric_name, collecttime, `node`, role, account, type from cnt metric_name collecttime node role account type select count(1) > 0 exist from system_metrics.metric where collecttime > date_sub(now(), interval 5 minute) and metric_name = 'server_storage_usage'; exist -true +1 diff --git a/test/distributed/cases/log/query_sql_statement_hotspot.result b/test/distributed/cases/log/query_sql_statement_hotspot.result index 8f70f8ac8398e..3b5faa5cd033c 100644 --- a/test/distributed/cases/log/query_sql_statement_hotspot.result +++ b/test/distributed/cases/log/query_sql_statement_hotspot.result @@ -14,5 +14,5 @@ user VARCHAR(1024) NO null type VARCHAR(1024) NO null select count(1) >= 0 as checked from system.sql_statement_hotspot; checked -true +1 drop account `sql_statement_hotspot`; diff --git a/test/distributed/cases/operator/between_and_operator.result b/test/distributed/cases/operator/between_and_operator.result index 915204ad3cdc5..a8a728f6d76d9 100644 --- a/test/distributed/cases/operator/between_and_operator.result +++ b/test/distributed/cases/operator/between_and_operator.result @@ -1,15 +1,15 @@ SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1; 2 between 1 and 3 2 between 3 and 1 -true false +1 0 SELECT 1 BETWEEN 2 AND 3; 1 between 2 and 3 -false +0 SELECT 'b' BETWEEN 'a' AND 'c'; b between a and c -true +1 SELECT 2 BETWEEN 2 AND '3'; 2 between 2 and 3 -true +1 DROP TABLE IF EXISTS between_and_test; CREATE TABLE between_and_test( int_test_max INT, @@ -241,11 +241,11 @@ INSERT INTO t1(b) VALUES(TRUE), (FALSE), (NULL); SELECT * FROM t1 WHERE SUBSTRING(str1,LENGTH(str1)) BETWEEN 'A' AND 'z'; str1 b &^%$#@ has some error null -many years age, joe smith always true +many years age, joe smith always 1 SELECT * FROM t1 WHERE SUBSTRING(str1,LENGTH(str1) - (LENGTH(str1)-1)) BETWEEN 'A' AND 'z'; str1 b This product is merged some high tech. null -many years age, joe smith always true +many years age, joe smith always 1 SELECT * FROM t1 WHERE SUBSTRING(str1,LENGTH(str1) - (LENGTH(str1)-1)) NOT BETWEEN 'A' AND 'z'; str1 b &^%$#@ has some error null @@ -253,22 +253,22 @@ SELECT * FROM t1 WHERE str1 NOT BETWEEN 'm' AND 'T'; str1 b This product is merged some high tech. null &^%$#@ has some error null -many years age, joe smith always true +many years age, joe smith always 1 SELECT * FROM t1 WHERE b BETWEEN TRUE AND FALSE; str1 b SELECT * FROM t1 WHERE b NOT BETWEEN TRUE AND FALSE; str1 b -many years age, joe smith always true -null true -null false +many years age, joe smith always 1 +null 1 +null 0 SELECT * FROM t1 WHERE LENGTH(str1) BETWEEN 25 AND 50; str1 b This product is merged some high tech. null -many years age, joe smith always true +many years age, joe smith always 1 SELECT * FROM t1 WHERE LENGTH(str1) BETWEEN '25'+5 AND 50; str1 b This product is merged some high tech. null -many years age, joe smith always true +many years age, joe smith always 1 SELECT * FROM t1 WHERE LENGTH(str1) NOT BETWEEN 25 AND 50; str1 b &^%$#@ has some error null diff --git a/test/distributed/cases/operator/is_not_operator.result b/test/distributed/cases/operator/is_not_operator.result index b9d1c586d4fe5..ca1d12b1a506b 100644 --- a/test/distributed/cases/operator/is_not_operator.result +++ b/test/distributed/cases/operator/is_not_operator.result @@ -1,15 +1,15 @@ SELECT 1 IS TRUE, 0 IS FALSE; 1 is true 0 is false -true true +1 1 SELECT NULL IS TRUE; null is true -false +0 SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL; 1 is null 0 is null null is null -false false true +0 0 1 SELECT '' IS NULL, ' ' IS NULL; is null is null -false false +0 0 DROP TABLE IF EXISTS is_test; CREATE TABLE is_test( str1 CHAR(20), @@ -65,22 +65,22 @@ INSERT INTO is_test(float_32, float_64) VALUES(1.0, 0.4999999999999); INSERT INTO is_test(float_32, float_64) VALUES(0.51, -0.00000000000000000000001); SELECT -1 IS TRUE; -1 is true -true +1 SELECT 0 IS TRUE; 0 is true -false +0 SELECT -1 IS TRUE; -1 is true -true +1 SELECT 1 IS TRUE; 1 is true -true +1 SELECT 2 IS TRUE; 2 is true -true +1 SELECT -2 IS TRUE; -2 is true -true +1 SELECT * FROM is_test WHERE big IS TRUE; tiny small int_test big tiny_un small_un int_test_un big_un float_32 float_64 SELECT small_un FROM is_test WHERE small_un IS TRUE; @@ -109,25 +109,25 @@ INSERT INTO is_test VALUES(1, NULL); INSERT INTO is_test VALUES(NULL, 0); SELECT * FROM is_test WHERE b1 IS TRUE; b1 b2 -true false -true false -true null +1 0 +1 0 +1 null SELECT * FROM is_test WHERE b1 IS NOT FALSE; b1 b2 -true false -true false -true null -null false +1 0 +1 0 +1 null +null 0 SELECT * FROM is_test WHERE b2 IS FALSE; b1 b2 -true false -true false -null false +1 0 +1 0 +null 0 SELECT * FROM is_test WHERE b2 IS NOT FALSE; b1 b2 -false true -false true -true null +0 1 +0 1 +1 null DELETE FROM is_test; DROP TABLE IF EXISTS is_test; DROP TABLE IF EXISTS t1; @@ -228,15 +228,15 @@ user_id user_name 7324 SELECT * FROM (SELECT * FROM t1 WHERE pay_status IS FALSE) AS t WHERE LENGTH(user_name) IS TRUE; user_id user_name order_time pay_status -7324 2022-12-06 09:22:19 false +7324 2022-12-06 09:22:19 0 SELECT t1.user_id, user_name, pay_status FROM t1 INNER JOIN t2 ON t1.user_id = t2.user_id WHERE pay_status IS TRUE AND number IS NOT FALSE; user_id user_name pay_status -7321 小明 true -7323 小刘 true +7321 小明 1 +7323 小刘 1 SELECT t1.user_name, order_time, product_id FROM @@ -268,16 +268,16 @@ INSERT INTO temp VALUES(-1, '0', TRUE, 0); INSERT INTO temp VALUES(-1, '1', 0, 0); SELECT * FROM temp WHERE int_test IS FALSE; tiny str b int_test --1 0 true 0 --1 1 false 0 +-1 0 1 0 +-1 1 0 0 SELECT * FROM temp WHERE str IS FALSE AND int_test IS FALSE; tiny str b int_test --1 0 true 0 +-1 0 1 0 SELECT * FROM (SELECT * FROM temp WHERE str IS TRUE) AS t WHERE int_test IS TRUE; tiny str b int_test -null 1 false 1 +null 1 0 1 SELECT * FROM (SELECT * FROM temp WHERE tiny IS FALSE) AS t WHERE b IS NOT TRUE; tiny str b int_test SELECT * FROM (SELECT * FROM temp WHERE tiny IS TRUE) AS t WHERE str IS TRUE; tiny str b int_test --1 1 false 0 +-1 1 0 0 diff --git a/test/distributed/cases/operator/is_operator.result b/test/distributed/cases/operator/is_operator.result index 8e837a7173555..5d38d8850a800 100755 --- a/test/distributed/cases/operator/is_operator.result +++ b/test/distributed/cases/operator/is_operator.result @@ -359,52 +359,52 @@ null not found null not found select (null) is unknown; (null) -true +1 select null is unknown; null -true +1 select true is unknown; -true -false +1 +0 select false is unknown; -false -false +0 +0 drop table if exists t1; CREATE TABLE t1 (a bool); insert into t1 values (false), (null), (true), (null); select a is unknown from t1 order by a; a -true -true -false -false +1 +1 +0 +0 select null is false; null -false +0 select null is true; null -false +0 select null is not false; null -true +1 select null is not true; null -true +1 select 1 is true; 1 -true +1 select 1 is false; 1 -false +0 select 1 is not true; 1 -false +0 select 1 is not false; 1 -true +1 select a is true from t1 order by a; a -false -false -false -true \ No newline at end of file +0 +0 +0 +1 \ No newline at end of file diff --git a/test/distributed/cases/operator/like_operator.result b/test/distributed/cases/operator/like_operator.result index 0a5f1baaa61a9..63fc51216ef9b 100644 --- a/test/distributed/cases/operator/like_operator.result +++ b/test/distributed/cases/operator/like_operator.result @@ -1,24 +1,24 @@ SELECT 'a' LIKE 'ae'; a like ae -false +0 SELECT 'ae' LIKE 'a'; ae like a -false +0 SELECT 'MYSQL' LIKE 'mysql'; MYSQL like mysql -false +0 SELECT 'David!' LIKE 'David_'; David! like David_ -true +1 SELECT 'David!' LIKE '%D%v%'; David! like %D%v% -true +1 SELECT 'David!' LIKE 'David\_'; David! like David\_ -false +0 SELECT 'David_' LIKE 'David\_'; David_ like David\_ -false +0 DROP TABLE IF EXISTS like_test; CREATE TABLE like_test( str1 VARCHAR(50) @@ -152,14 +152,14 @@ count(*) 8 SELECT str1, str1 LIKE '%\\' FROM like_test; str1 str1 like %\\ -D: false -D:\ true -D:\System_files false -D:\System_files\ true +D: 0 +D:\ 1 +D:\System_files 0 +D:\System_files\ 1 null null -NULL false - A false -s _ false +NULL 0 + A 0 +s _ 0 SELECT str1, str1 LIKE '%\\\\' FROM like_test; [unknown result because it is related to issue#5078] DELETE FROM like_test; diff --git a/test/distributed/cases/operator/not_regexp_operator.result b/test/distributed/cases/operator/not_regexp_operator.result index 20aaaa4dda590..cce036841d62f 100644 --- a/test/distributed/cases/operator/not_regexp_operator.result +++ b/test/distributed/cases/operator/not_regexp_operator.result @@ -1,192 +1,192 @@ SELECT 'Corn' NOT REGEXP 'Corn' AS 'Corn'; Corn -false +0 SELECT 'Acorn' NOT REGEXP 'Corn' AS 'Acorn'; Acorn -true +1 SELECT 'Corner' NOT REGEXP 'Corn' AS 'Corner'; Corner -false +0 SELECT 'Cheese' NOT REGEXP 'Corn' AS 'Cheese'; Cheese -true +1 SELECT 'Corn' NOT REGEXP '^Co' AS 'Corn'; Corn -false +0 SELECT 'Acorn' NOT REGEXP '^Co' AS 'Acorn'; Acorn -true +1 SELECT 'Cheese' NOT REGEXP '^Co' AS 'Cheese'; Cheese -true +1 SELECT 'Corn' NOT REGEXP 'rn$' AS 'Corn'; Corn -false +0 SELECT 'Acorn' NOT REGEXP 'rn$' AS 'Acorn'; Acorn -false +0 SELECT 'Cheese' NOT REGEXP 'rn$' AS 'Cheese'; Cheese -true +1 SELECT 'Corn' NOT REGEXP '.' AS 'Corn'; Corn -false +0 SELECT 'Cheese' NOT REGEXP '.' AS 'Cheese'; Cheese -false +0 SELECT 'Corn' NOT REGEXP '^C.rn$' AS 'Corn'; Corn -false +0 SELECT 'Crn' NOT REGEXP '^C.rn$' AS 'Crn'; Crn -true +1 SELECT 'Tweet' NOT REGEXP '^Tw..t$' AS 'Tweet'; Tweet -false +0 SELECT 'Tweat' NOT REGEXP '^Tw..t$' AS 'Tweat'; Tweat -false +0 SELECT 'Tweet' NOT REGEXP '^Tw.t$' AS 'Tweet'; Tweet -true +1 SELECT 'Twit' NOT REGEXP '^Tw..t$' AS 'Twit'; Twit -true +1 SELECT 'Tweet' NOT REGEXP '^Tw.{2}t$' AS 'Tweet'; Tweet -false +0 SELECT 'Tweat' NOT REGEXP '^Tw.{2}t$' AS 'Tweat'; Tweat -false +0 SELECT 'Tweet' NOT REGEXP '^Tw.{1}t$' AS 'Tweet'; Tweet -true +1 SELECT 'Twit' NOT REGEXP '^Tw.{2}t$' AS 'Twit'; Twit -true +1 SELECT 'Twet' NOT REGEXP '^Twe*t$' AS 'Twet'; Twet -false +0 SELECT 'Tweet' NOT REGEXP '^Twe*t$' AS 'Tweet'; Tweet -false +0 SELECT 'Tweeet' NOT REGEXP '^Twe*t$' AS 'Tweeet'; Tweet -false +0 SELECT 'Twt' NOT REGEXP '^Twe*t$' AS 'Twt'; Twt -false +0 SELECT 'Twit' NOT REGEXP '^Twe*t$' AS 'Twit'; Twit -true +1 SELECT 'Twiet' NOT REGEXP '^Twe*t$' AS 'Twiet'; Twiet -true +1 SELECT 'Tweit' NOT REGEXP '^Twe*t$' AS 'Tweit'; Tweit -true +1 SELECT 'Twet' NOT REGEXP '^Twe+t$' AS 'Twet'; Twet -false +0 SELECT 'Tweet' NOT REGEXP '^Twe+t$' AS 'Tweet'; Tweet -false +0 SELECT 'Tweeet' NOT REGEXP '^Twe+t$' AS 'Tweeet'; Tweeet -false +0 SELECT 'Twt' NOT REGEXP '^Twe+t$' AS 'Twt'; Twt -true +1 SELECT 'Twit' NOT REGEXP '^Twe+t$' AS 'Twit'; Twit -true +1 SELECT 'Twiet' NOT REGEXP '^Twe+t$' AS 'Twiet'; Twiet -true +1 SELECT 'Tweit' NOT REGEXP '^Twe+t$' AS 'Tweit'; Tweit -true +1 SELECT 'Tweet' NOT REGEXP 'Tw|et' AS 'Tweet'; Tweet -false +0 SELECT 'For Let' NOT REGEXP 'Tw|et' AS 'For Let'; For Let -false +0 SELECT 'Banana' NOT REGEXP 'Tw|et' AS 'Banana'; Banana -true +1 SELECT 'Cat' NOT REGEXP 'Cat|Dog' AS 'Cat'; Cat -false +0 SELECT 'Dog' NOT REGEXP 'Cat|Dog' AS 'Dog'; Dog -false +0 SELECT 'Doggone' NOT REGEXP 'Cat|Dog' AS 'Doggone'; Doggone -false +0 SELECT 'Banana' NOT REGEXP 'Cat|Dog' AS 'Banana'; Banana -true +1 SELECT 'Banana' NOT REGEXP '(an)*' AS 'Banana'; Banana -false +0 SELECT 'Land' NOT REGEXP '(an)*' AS 'Land'; Land -false +0 SELECT 'Cheese' NOT REGEXP '(an)*' AS 'Cheese'; Cheese -false +0 SELECT 'Banana' NOT REGEXP '^B(an)*d$' AS 'Banana'; Banana -true +1 SELECT 'Band' NOT REGEXP '^B(an)*d$' AS 'Band'; Band -false +0 SELECT 'Bald' NOT REGEXP '^B(an)*d$' AS 'Bald'; Bald -true +1 SELECT 'Bad' NOT REGEXP '^B(an)*d$' AS 'Bad'; Bad -true +1 SELECT 'Tweeet' NOT REGEXP 'e{3}' AS 'Tweeet'; Tweeet -false +0 SELECT 'Tweet' NOT REGEXP 'e{3}' AS 'Tweet'; Tweet -true +1 SELECT 'Tweet 123' NOT REGEXP '[0-9]' AS 'Tweet123'; Tweet123 -false +0 SELECT 'Tweet ABC' NOT REGEXP '[0-9]' AS 'TweetABC'; TweetABC -true +1 SELECT 'Tweet 123' NOT REGEXP '[A-Z]' AS 'Tweet123'; Tweet123 -false +0 SELECT 'ABC' NOT REGEXP '[A-Z]' AS 'ABC'; ABC -false +0 SELECT '123' NOT REGEXP '[A-Z]' AS '123'; 123 -true +1 SELECT '123' NOT REGEXP '[1-3]' AS '123'; 123 -false +0 SELECT '012' NOT REGEXP '[1-3]' AS '012'; 012 -false +0 SELECT '045' NOT REGEXP '[1-3]' AS '045'; 045 -true +1 SELECT '123' NOT REGEXP '[^1-3]' AS '123'; 123 -true +1 SELECT '012' NOT REGEXP '[^1-3]' AS '012'; 012 -false +0 SELECT '045' NOT REGEXP '[^1-3]' AS '045'; 045 -false +0 create table t1(a int, b varchar(100)); insert into t1 values(1 , "PowerSlave"); insert into t1 values(2 , "Powerage"); diff --git a/test/distributed/cases/operator/operator.result b/test/distributed/cases/operator/operator.result index b9bca3d90ce1e..cf911f5a260a2 100755 --- a/test/distributed/cases/operator/operator.result +++ b/test/distributed/cases/operator/operator.result @@ -352,4 +352,4 @@ a << 20 2097152 select !true; !true -false +0 diff --git a/test/distributed/cases/operator/regexp_operator.result b/test/distributed/cases/operator/regexp_operator.result index 6782b7881c05d..dfb4beb7fa2b6 100644 --- a/test/distributed/cases/operator/regexp_operator.result +++ b/test/distributed/cases/operator/regexp_operator.result @@ -1,192 +1,192 @@ SELECT 'Corn' REGEXP 'Corn' AS 'Corn'; Corn -true +1 SELECT 'Acorn' REGEXP 'Corn' AS 'Acorn'; Acorn -false +0 SELECT 'Corner' REGEXP 'Corn' AS 'Corner'; Corner -true +1 SELECT 'Cheese' REGEXP 'Corn' AS 'Cheese'; Cheese -false +0 SELECT 'Corn' REGEXP '^Co' AS 'Corn'; Corn -true +1 SELECT 'Acorn' REGEXP '^Co' AS 'Acorn'; Acorn -false +0 SELECT 'Cheese' REGEXP '^Co' AS 'Cheese'; Cheese -false +0 SELECT 'Corn' REGEXP 'rn$' AS 'Corn'; Corn -true +1 SELECT 'Acorn' REGEXP 'rn$' AS 'Acorn'; Acorn -true +1 SELECT 'Cheese' REGEXP 'rn$' AS 'Cheese'; Cheese -false +0 SELECT 'Corn' REGEXP '.' AS 'Corn'; Corn -true +1 SELECT 'Cheese' REGEXP '.' AS 'Cheese'; Cheese -true +1 SELECT 'Corn' REGEXP '^C.rn$' AS 'Corn'; Corn -true +1 SELECT 'Crn' REGEXP '^C.rn$' AS 'Crn'; Crn -false +0 SELECT 'Tweet' REGEXP '^Tw..t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweat' REGEXP '^Tw..t$' AS 'Tweat'; Tweat -true +1 SELECT 'Tweet' REGEXP '^Tw.t$' AS 'Tweet'; Tweet -false +0 SELECT 'Twit' REGEXP '^Tw..t$' AS 'Twit'; Twit -false +0 SELECT 'Tweet' REGEXP '^Tw.{2}t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweat' REGEXP '^Tw.{2}t$' AS 'Tweat'; Tweat -true +1 SELECT 'Tweet' REGEXP '^Tw.{1}t$' AS 'Tweet'; Tweet -false +0 SELECT 'Twit' REGEXP '^Tw.{2}t$' AS 'Twit'; Twit -false +0 SELECT 'Twet' REGEXP '^Twe*t$' AS 'Twet'; Twet -true +1 SELECT 'Tweet' REGEXP '^Twe*t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweeet' REGEXP '^Twe*t$' AS 'Tweeet'; Tweet -true +1 SELECT 'Twt' REGEXP '^Twe*t$' AS 'Twt'; Twt -true +1 SELECT 'Twit' REGEXP '^Twe*t$' AS 'Twit'; Twit -false +0 SELECT 'Twiet' REGEXP '^Twe*t$' AS 'Twiet'; Twiet -false +0 SELECT 'Tweit' REGEXP '^Twe*t$' AS 'Tweit'; Tweit -false +0 SELECT 'Twet' REGEXP '^Twe+t$' AS 'Twet'; Twet -true +1 SELECT 'Tweet' REGEXP '^Twe+t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweeet' REGEXP '^Twe+t$' AS 'Tweeet'; Tweeet -true +1 SELECT 'Twt' REGEXP '^Twe+t$' AS 'Twt'; Twt -false +0 SELECT 'Twit' REGEXP '^Twe+t$' AS 'Twit'; Twit -false +0 SELECT 'Twiet' REGEXP '^Twe+t$' AS 'Twiet'; Twiet -false +0 SELECT 'Tweit' REGEXP '^Twe+t$' AS 'Tweit'; Tweit -false +0 SELECT 'Tweet' REGEXP 'Tw|et' AS 'Tweet'; Tweet -true +1 SELECT 'For Let' REGEXP 'Tw|et' AS 'For Let'; For Let -true +1 SELECT 'Banana' REGEXP 'Tw|et' AS 'Banana'; Banana -false +0 SELECT 'Cat' REGEXP 'Cat|Dog' AS 'Cat'; Cat -true +1 SELECT 'Dog' REGEXP 'Cat|Dog' AS 'Dog'; Dog -true +1 SELECT 'Doggone' REGEXP 'Cat|Dog' AS 'Doggone'; Doggone -true +1 SELECT 'Banana' REGEXP 'Cat|Dog' AS 'Banana'; Banana -false +0 SELECT 'Banana' REGEXP '(an)*' AS 'Banana'; Banana -true +1 SELECT 'Land' REGEXP '(an)*' AS 'Land'; Land -true +1 SELECT 'Cheese' REGEXP '(an)*' AS 'Cheese'; Cheese -true +1 SELECT 'Banana' REGEXP '^B(an)*d$' AS 'Banana'; Banana -false +0 SELECT 'Band' REGEXP '^B(an)*d$' AS 'Band'; Band -true +1 SELECT 'Bald' REGEXP '^B(an)*d$' AS 'Bald'; Bald -false +0 SELECT 'Bad' REGEXP '^B(an)*d$' AS 'Bad'; Bad -false +0 SELECT 'Tweeet' REGEXP 'e{3}' AS 'Tweeet'; Tweeet -true +1 SELECT 'Tweet' REGEXP 'e{3}' AS 'Tweet'; Tweet -false +0 SELECT 'Tweet 123' REGEXP '[0-9]' AS 'Tweet123'; Tweet123 -true +1 SELECT 'Tweet ABC' REGEXP '[0-9]' AS 'TweetABC'; TweetABC -false +0 SELECT 'Tweet 123' REGEXP '[A-Z]' AS 'Tweet123'; Tweet123 -true +1 SELECT 'ABC' REGEXP '[A-Z]' AS 'ABC'; ABC -true +1 SELECT '123' REGEXP '[A-Z]' AS '123'; 123 -false +0 SELECT '123' REGEXP '[1-3]' AS '123'; 123 -true +1 SELECT '012' REGEXP '[1-3]' AS '012'; 012 -true +1 SELECT '045' REGEXP '[1-3]' AS '045'; 045 -false +0 SELECT '123' REGEXP '[^1-3]' AS '123'; 123 -false +0 SELECT '012' REGEXP '[^1-3]' AS '012'; 012 -true +1 SELECT '045' REGEXP '[^1-3]' AS '045'; 045 -true +1 create table t1(a int, b varchar(100)); insert into t1 values(1 , "PowerSlave"); insert into t1 values(2 , "Powerage"); diff --git a/test/distributed/cases/operator/rlike_operator.result b/test/distributed/cases/operator/rlike_operator.result index 8b2788ec680f7..b4f276a1b1315 100644 --- a/test/distributed/cases/operator/rlike_operator.result +++ b/test/distributed/cases/operator/rlike_operator.result @@ -1,192 +1,192 @@ SELECT 'Corn' RLIKE 'Corn' AS 'Corn'; Corn -true +1 SELECT 'Acorn' RLIKE 'Corn' AS 'Acorn'; Acorn -false +0 SELECT 'Corner' RLIKE 'Corn' AS 'Corner'; Corner -true +1 SELECT 'Cheese' RLIKE 'Corn' AS 'Cheese'; Cheese -false +0 SELECT 'Corn' RLIKE '^Co' AS 'Corn'; Corn -true +1 SELECT 'Acorn' RLIKE '^Co' AS 'Acorn'; Acorn -false +0 SELECT 'Cheese' RLIKE '^Co' AS 'Cheese'; Cheese -false +0 SELECT 'Corn' RLIKE 'rn$' AS 'Corn'; Corn -true +1 SELECT 'Acorn' RLIKE 'rn$' AS 'Acorn'; Acorn -true +1 SELECT 'Cheese' RLIKE 'rn$' AS 'Cheese'; Cheese -false +0 SELECT 'Corn' RLIKE '.' AS 'Corn'; Corn -true +1 SELECT 'Cheese' RLIKE '.' AS 'Cheese'; Cheese -true +1 SELECT 'Corn' RLIKE '^C.rn$' AS 'Corn'; Corn -true +1 SELECT 'Crn' RLIKE '^C.rn$' AS 'Crn'; Crn -false +0 SELECT 'Tweet' RLIKE '^Tw..t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweat' RLIKE '^Tw..t$' AS 'Tweat'; Tweat -true +1 SELECT 'Tweet' RLIKE '^Tw.t$' AS 'Tweet'; Tweet -false +0 SELECT 'Twit' RLIKE '^Tw..t$' AS 'Twit'; Twit -false +0 SELECT 'Tweet' RLIKE '^Tw.{2}t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweat' RLIKE '^Tw.{2}t$' AS 'Tweat'; Tweat -true +1 SELECT 'Tweet' RLIKE '^Tw.{1}t$' AS 'Tweet'; Tweet -false +0 SELECT 'Twit' RLIKE '^Tw.{2}t$' AS 'Twit'; Twit -false +0 SELECT 'Twet' RLIKE '^Twe*t$' AS 'Twet'; Twet -true +1 SELECT 'Tweet' RLIKE '^Twe*t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweeet' RLIKE '^Twe*t$' AS 'Tweeet'; Tweet -true +1 SELECT 'Twt' RLIKE '^Twe*t$' AS 'Twt'; Twt -true +1 SELECT 'Twit' RLIKE '^Twe*t$' AS 'Twit'; Twit -false +0 SELECT 'Twiet' RLIKE '^Twe*t$' AS 'Twiet'; Twiet -false +0 SELECT 'Tweit' RLIKE '^Twe*t$' AS 'Tweit'; Tweit -false +0 SELECT 'Twet' RLIKE '^Twe+t$' AS 'Twet'; Twet -true +1 SELECT 'Tweet' RLIKE '^Twe+t$' AS 'Tweet'; Tweet -true +1 SELECT 'Tweeet' RLIKE '^Twe+t$' AS 'Tweeet'; Tweeet -true +1 SELECT 'Twt' RLIKE '^Twe+t$' AS 'Twt'; Twt -false +0 SELECT 'Twit' RLIKE '^Twe+t$' AS 'Twit'; Twit -false +0 SELECT 'Twiet' RLIKE '^Twe+t$' AS 'Twiet'; Twiet -false +0 SELECT 'Tweit' RLIKE '^Twe+t$' AS 'Tweit'; Tweit -false +0 SELECT 'Tweet' RLIKE 'Tw|et' AS 'Tweet'; Tweet -true +1 SELECT 'For Let' RLIKE 'Tw|et' AS 'For Let'; For Let -true +1 SELECT 'Banana' RLIKE 'Tw|et' AS 'Banana'; Banana -false +0 SELECT 'Cat' RLIKE 'Cat|Dog' AS 'Cat'; Cat -true +1 SELECT 'Dog' RLIKE 'Cat|Dog' AS 'Dog'; Dog -true +1 SELECT 'Doggone' RLIKE 'Cat|Dog' AS 'Doggone'; Doggone -true +1 SELECT 'Banana' RLIKE 'Cat|Dog' AS 'Banana'; Banana -false +0 SELECT 'Banana' RLIKE '(an)*' AS 'Banana'; Banana -true +1 SELECT 'Land' RLIKE '(an)*' AS 'Land'; Land -true +1 SELECT 'Cheese' RLIKE '(an)*' AS 'Cheese'; Cheese -true +1 SELECT 'Banana' RLIKE '^B(an)*d$' AS 'Banana'; Banana -false +0 SELECT 'Band' RLIKE '^B(an)*d$' AS 'Band'; Band -true +1 SELECT 'Bald' RLIKE '^B(an)*d$' AS 'Bald'; Bald -false +0 SELECT 'Bad' RLIKE '^B(an)*d$' AS 'Bad'; Bad -false +0 SELECT 'Tweeet' RLIKE 'e{3}' AS 'Tweeet'; Tweeet -true +1 SELECT 'Tweet' RLIKE 'e{3}' AS 'Tweet'; Tweet -false +0 SELECT 'Tweet 123' RLIKE '[0-9]' AS 'Tweet123'; Tweet123 -true +1 SELECT 'Tweet ABC' RLIKE '[0-9]' AS 'TweetABC'; TweetABC -false +0 SELECT 'Tweet 123' RLIKE '[A-Z]' AS 'Tweet123'; Tweet123 -true +1 SELECT 'ABC' RLIKE '[A-Z]' AS 'ABC'; ABC -true +1 SELECT '123' RLIKE '[A-Z]' AS '123'; 123 -false +0 SELECT '123' RLIKE '[1-3]' AS '123'; 123 -true +1 SELECT '012' RLIKE '[1-3]' AS '012'; 012 -true +1 SELECT '045' RLIKE '[1-3]' AS '045'; 045 -false +0 SELECT '123' RLIKE '[^1-3]' AS '123'; 123 -false +0 SELECT '012' RLIKE '[^1-3]' AS '012'; 012 -true +1 SELECT '045' RLIKE '[^1-3]' AS '045'; 045 -true +1 create table t1(a int, b varchar(100)); insert into t1 values(1 , "PowerSlave"); insert into t1 values(2 , "Powerage"); diff --git a/test/distributed/cases/operator/row_constructor.result b/test/distributed/cases/operator/row_constructor.result index ef01291caa718..93c61fa928121 100644 --- a/test/distributed/cases/operator/row_constructor.result +++ b/test/distributed/cases/operator/row_constructor.result @@ -2,85 +2,85 @@ create database test; use test; select (1,2,3)=(0,null,3); (1, 2, 3) = (0, null, 3) -false +0 select (1,2,3)=(1,null,3); (1, 2, 3) = (1, null, 3) null select (1,2,3)=(1,null,0); (1, 2, 3) = (1, null, 0) -false +0 select (1,2,3) = (1,null,3); (1, 2, 3) = (1, null, 3) null select (1,2,3) = (1+1, null, 3); (1, 2, 3) = (1 + 1, null, 3) -false +0 select (1,2,3) = (1,null,3+1); (1, 2, 3) = (1, null, 3 + 1) -false +0 select (1,2,3) <> (1,null,3); (1, 2, 3) != (1, null, 3) null select (1,2,3) <> (1+1,null,3); (1, 2, 3) != (1 + 1, null, 3) -true +1 select (1,2,3) <> (1,null,3+1); (1, 2, 3) != (1, null, 3 + 1) -true +1 select (1,2) > (2,3); (1, 2) > (2, 3) -false +0 select (1.000, 2.323200) = (1,2.3232); (1.000, 2.323200) = (1, 2.3232) -true +1 select (-10, 200) < (100,200); (-10, 200) < (100, 200) -true +1 select (null,null) = (null,null); (null, null) = (null, null) null select (1,2,2,3) > (2,3,4,5); (1, 2, 2, 3) > (2, 3, 4, 5) -false +0 select (78415614.7894,789854.0) = (78415614.7894,789854.0); (78415614.7894, 789854.0) = (78415614.7894, 789854.0) -true +1 select (1,null) < (2,null); (1, null) < (2, null) -true +1 select (2,3) >= (1,3); (2, 3) >= (1, 3) -true +1 select (-2,1,3) >= (-1,2,3); (-2, 1, 3) >= (-1, 2, 3) -false +0 select (-387293.324321,32190391.34134,000) <= (-387293.324321, -123, -1); (-387293.324321, 32190391.34134, 0) <= (-387293.324321, -123, -1) -false +0 select (1,2,3) > (-1,-3+2,2*3); (1, 2, 3) > (-1, -3 + 2, 2 * 3) -true +1 select (128093,341231431,0) < (999*22,328932/0.3,null); (128093, 341231431, 0) < (999 * 22, 328932 / 0.3, null) -false +0 select (100 % 3,100) >= (30,100); (100 % 3, 100) >= (30, 100) -false +0 select (2739,32,-328392,329) <= (23920000 mod 9999,32,-328392,329); (2739, 32, -328392, 329) <= (23920000 % 9999, 32, -328392, 329) -false +0 select ('abc','def') = ('abc','def'); (abc, def) = (abc, def) -true +1 select ('a', null) < ('b', null); (a, null) < (b, null) -true +1 select ('1234dhyecufjwqv','38293r243f') >= ('1211111','38092i4((('); (1234dhyecufjwqv, 38293r243f) >= (1211111, 38092i4((() -true +1 select ('&') > ('1'); (&) > (1) -false +0 drop table if exists row01; create table row01(a int, b int, c int); insert into row01 values (1, 2, 3), @@ -92,10 +92,10 @@ select (1,2,3) = (1, null, 3); null select (1,2,3) = (1+1, null, 3); (1, 2, 3) = (1 + 1, null, 3) -false +0 select (1,2,3) = (1, null, 3+1); (1, 2, 3) = (1, null, 3 + 1) -false +0 select * from row01 where (a,b,c) = (1,2,3); a b c 1 2 3 @@ -104,10 +104,10 @@ select (1,2,3) <> (1,null,3); null select (1,2,3) <> (1+1,null,3); (1, 2, 3) != (1 + 1, null, 3) -true +1 select (1,2,3) <> (1,null,3+1); (1, 2, 3) != (1, null, 3 + 1) -true +1 select * from row01 where (a,b,c) <> (1,2,3); a b c null 2 4 @@ -126,7 +126,7 @@ select (1,2,3) < (1*1,null,3); null select (1,2,3) < (1+1,null,3); (1, 2, 3) < (1 + 1, null, 3) -true +1 select * from row01 where (a,b,c) < (1,2,3); a b c select (1,2,3) <= (null,2,3); @@ -137,10 +137,10 @@ select (1,2,3) <= (1,null,3); null select (1,2,3) <= (1-1,null,3); (1, 2, 3) <= (1 - 1, null, 3) -false +0 select (1,2,3) <= (1+1,null,3); (1, 2, 3) <= (1 + 1, null, 3) -true +1 select * from row01 where (a,b,c) <= (1,2,3); a b c 1 2 3 @@ -152,10 +152,10 @@ select (1,2,3) > (1,null,3); null select (1,2,3) > (1-1,null,3); (1, 2, 3) > (1 - 1, null, 3) -true +1 select (1,2,3) > (1+1,null,3); (1, 2, 3) > (1 + 1, null, 3) -false +0 select * from row01 where (a,b,c) > (1,2,3); a b c 1 3 null @@ -167,10 +167,10 @@ select (1,2,3) >= (1,null,3); null select (1,2,3) >= (1-1,null,3); (1, 2, 3) >= (1 - 1, null, 3) -true +1 select (1,2,3) >= (100/11,null,3); (1, 2, 3) >= (100 / 11, null, 3) -false +0 select * from row01 where (a,b,c) >= (1,2,3); a b c 1 2 3 @@ -197,15 +197,15 @@ c 3ru82q ijf null e&*(& && select (col1,col2) >= (col1,col2) from row01; (col1, col2) >= (col1, col2) -true -true -true +1 +1 +1 null select (col1,col2) <= (col1,col2) from row01; (col1, col2) <= (col1, col2) -true -true -true +1 +1 +1 null select (col1,col2) < (col1,0) from row01; invalid argument cast to int, bad value uc32qr3 @@ -213,9 +213,9 @@ select (col1,col2,0) > (col1,col2,col1) from row01; invalid argument cast to int, bad value a select (col1,col2) = (col1,col2) from row01; (col1, col2) = (col1, col2) -true -true -true +1 +1 +1 null select * from row01 where (col1,col2) between ('a','uc32qr3') and ('c','3ru82qijf'); col1 col2 @@ -227,40 +227,40 @@ select col1,(col1,col2) != (col1,0) from row01; invalid argument cast to int, bad value uc32qr3 select (concat_ws(col1,col2),col2) >= (col1,col2) from row01; (concat_ws(col1, col2), col2) >= (col1, col2) -false -false -false +0 +0 +0 null select (col1,ltrim(col2)) <= (col1,col2) from row01; (col1, ltrim(col2)) <= (col1, col2) -false -false -true +0 +0 +1 null select (col1,rtrim(col2)) < (col1,'382039i2jfie') from row01; (col1, rtrim(col2)) < (col1, 382039i2jfie) -true -true -false +1 +1 +0 null select (col1,trim(col2)) < (col1,'382039i2jfie') from row01; (col1, trim(col2)) < (col1, 382039i2jfie) -false -true -false +0 +1 +0 null select (col1,substring(col2,1,3),col1) > (col1,col2,col1) from row01; (col1, substring(col2, 1, 3), col1) > (col1, col2, col1) -false -false -false +0 +0 +0 null select (col1,lpad(col2,30,'abc')) = (col1,col2) from row01; (col1, lpad(col2, 30, abc)) = (col1, col2) -false -false -false -false +0 +0 +0 +0 select * from row01 where (col1,col2) between ('a','uc32qr3') and ('c','3ru82qijf'); col1 col2 b 09920011 @@ -278,28 +278,28 @@ insert into row02 values(3,3,832,-39203.83280932,null); insert into row02 values(null,0,0,1.2,3801432.3213); select (col1,col2,col3) > (0,0,0) from row02; (col1, col2, col3) > (0, 0, 0) -true -true -true +1 +1 +1 null select (col1,col2,col3,col4,col5) < (100,100,100,378217493,3218941031) from row02; (col1, col2, col3, col4, col5) < (100, 100, 100, 378217493, 3218941031) -true -true -true +1 +1 +1 null select (col1,col2) >= (col2,col1) from row02; (col1, col2) >= (col2, col1) -false +0 null -true +1 null select (col3,col4) <= (372913412.2143,col4) from row02; (col3, col4) <= (372913412.2143, col4) -true -true -true -true +1 +1 +1 +1 select * from row02 where (col1,col2) between (0,10000) and (10,20000); col1 col2 col3 col4 col5 1 32 38 3829342.3224141000 -0.9883283 @@ -307,40 +307,40 @@ col1 col2 col3 col4 col5 3 3 832 -39203.8328093200 null select (col1,col2) <> (col1,col2) from row02; (col1, col2) != (col1, col2) -false +0 null -false +0 null select (col1,col2) != (col4,col5) from row02; (col1, col2) != (col4, col5) -true -true -true -true +1 +1 +1 +1 select (col1 * col2,col2,col3) > (0,0,0) from row02; (col1 * col2, col2, col3) > (0, 0, 0) -true +1 null -true +1 null select (col1,col2 / 2,col3,col4,col5) < (100,100,100,378217493,3218941031) from row02; (col1, col2 / 2, col3, col4, col5) < (100, 100, 100, 378217493, 3218941031) -true -true -true +1 +1 +1 null select (col1,col2 + col3) >= (col2,col1) from row02; (col1, col2 + col3) >= (col2, col1) -false +0 null -true +1 null select (col3,col4 - 329302.32) <= (372913412.2143,col4) from row02; (col3, col4 - 329302.32) <= (372913412.2143, col4) -true -true -true -true +1 +1 +1 +1 select * from row02 where (col1 % 100,col2) between (0,10000) and (10,20000); col1 col2 col3 col4 col5 1 32 38 3829342.3224141000 -0.9883283 @@ -348,16 +348,16 @@ col1 col2 col3 col4 col5 3 3 832 -39203.8328093200 null select (col1,col2) <> (col1 mod 10,col2) from row02; (col1, col2) != (col1 % 10, col2) -false +0 null -false +0 null select (col1,col2 + 10000) != (col4,col5) from row02; (col1, col2 + 10000) != (col4, col5) -true -true -true -true +1 +1 +1 +1 drop table row02; drop table if exists row03; create table row03(col1 int unsigned,col2 bigint,col3 decimal(20,10),col4 double); @@ -366,64 +366,64 @@ insert into row03 values(2,37394,-93298439024,4830403434.4329043); insert into row03 values(3,null,null,null); select (col1,col2,col3) > (-1,32893,32932) from row03; (col1, col2, col3) > (-1, 32893, 32932) -true -true -true +1 +1 +1 select (col1,col2,col3) < (col1,col2,12345678989) from row03; (col1, col2, col3) < (col1, col2, 12345678989) -true -true +1 +1 null select (col1,col2,100) >= (col1,col2,50) from row03; (col1, col2, 100) >= (col1, col2, 50) -true -true +1 +1 null select (col1,col2,col3) <= (col1,col2,col3) from row03; (col1, col2, col3) <= (col1, col2, col3) -true -true +1 +1 null select (col1,col2,col3) <> (1,39438432094940434,838209302.34094043234) from row03; (col1, col2, col3) != (1, 39438432094940434, 838209302.34094043234) -true -true -true +1 +1 +1 select (col1,col2,col3) != (1,39438432094940434,838209302.34094043234) from row03; (col1, col2, col3) != (1, 39438432094940434, 838209302.34094043234) -true -true -true +1 +1 +1 select (col1 * col2,col2,col3) > (-1,32893,32932) from row03; (col1 * col2, col2, col3) > (-1, 32893, 32932) -true -true +1 +1 null select (col1,col2 - 10000,col3) < (col1,col2,12345678989) from row03; (col1, col2 - 10000, col3) < (col1, col2, 12345678989) -true -true +1 +1 null select (col1,col2 + 182901.213123,100) >= (col1,col2,50) from row03; (col1, col2 + 182901.213123, 100) >= (col1, col2, 50) -true -true +1 +1 null select (col1,col2,col3 / 45) <= (col1,col2,col3) from row03; (col1, col2, col3 / 45) <= (col1, col2, col3) -true -false +1 +0 null select (col1,col2,col3) <> (1,39438432094940434 + col1,838209302.34094043234) from row03; (col1, col2, col3) != (1, 39438432094940434 + col1, 838209302.34094043234) -true -true -true +1 +1 +1 select (col1,col2,col3) != (1,39438432094940434 % 20,838209302.34094043234) from row03; (col1, col2, col3) != (1, 39438432094940434 % 20, 838209302.34094043234) -true -true -true +1 +1 +1 drop table row03; drop table if exists row04; create table row04(col1 date,col2 datetime,col3 timestamp); @@ -432,23 +432,23 @@ insert into row04 values('2023-04-06','2023-04-06 12:12:00','1999-01-02 00:00:09 insert into row04 values(null,null,null); select (col1,col2,col3) >= ('2017-06-15','2000-01-01 00:00:00','2022-01-02 00:00:01.512345') from row04; (col1, col2, col3) >= (2017-06-15, 2000-01-01 00:00:00, 2022-01-02 00:00:01.512345) -true -true +1 +1 null select (col1,col2,col3) <= (col1,col2,'2023-01-02 00:00:01.512345')from row04; (col1, col2, col3) <= (col1, col2, 2023-01-02 00:00:01.512345) -true -true +1 +1 null select (col1,col2) > ('1999-01-01','1999-01-04 00:00:09') from row04; (col1, col2) > (1999-01-01, 1999-01-04 00:00:09) -true -true +1 +1 null select (col1,col3) < ('1970-01-01','2055-01-01 10:10:10') from row04; (col1, col3) < (1970-01-01, 2055-01-01 10:10:10) -false -false +0 +0 null select * from row04 where (col1,col2) between ('2017-06-15','1000-01-01 00:00:00') and('2025-06-15','2300-01-01 00:00:00'); col1 col2 col3 @@ -456,53 +456,53 @@ col1 col2 col3 2023-04-06 2023-04-06 12:12:00 1999-01-02 00:00:09 select (col1,col3) <> ('2017-06-15','2022-01-02 00:00:01.512345') from row04; (col1, col3) != (2017-06-15, 2022-01-02 00:00:01.512345) -false -true +0 +1 null select (col1,col3) != ('2017-06-15','2022-01-02 00:00:01.5123-5') from row04; (col1, col3) != (2017-06-15, 2022-01-02 00:00:01.5123-5) -false -true +0 +1 null select (col1,col2,date(col3)) >= ('2017-06-15','2000-01-01 00:00:00','2022-01-02') from row04; (col1, col2, date(col3)) >= (2017-06-15, 2000-01-01 00:00:00, 2022-01-02) -true -true +1 +1 null select (col1,col2,to_date(col3,'%Y-%m-%d %H:%i:%s')) <= (col1,col2,'2023-01-02 00:00:01.512345')from row04; (col1, col2, to_date(col3, %Y-%m-%d %H:%i:%s)) <= (col1, col2, 2023-01-02 00:00:01.512345) -true -true +1 +1 null select (date_add(col1,interval 45 day),col2) > ('1999-01-01','1999-01-04 00:00:09') from row04; (date_add(col1, interval(45, day)), col2) > (1999-01-01, 1999-01-04 00:00:09) -true -true +1 +1 null select (date_sub(col1,interval 45 day),col3) < ('1970-01-01','2055-01-01 10:10:10') from row04; (date_sub(col1, interval(45, day)), col3) < (1970-01-01, 2055-01-01 10:10:10) -false -false +0 +0 null select (year(col1),year(col2)) > (1999,2003) from row04; (year(col1), year(col2)) > (1999, 2003) -true -true +1 +1 null select (month(col1),month(col2)) <= (12,12) from row04; (month(col1), month(col2)) <= (12, 12) -true -true +1 +1 null select (day(col1),day(col2)) <> (30,30) from row04; (day(col1), day(col2)) != (30, 30) -true -true +1 +1 null select (weekday(col1),weekday(col2)) != (12,34) from row04; (weekday(col1), weekday(col2)) != (12, 34) -true -true +1 +1 null drop table row04; drop table if exists row05; @@ -512,13 +512,13 @@ insert into row05 values('_bcdef','{"t1":"c"}',100000); insert into row05 values('__cdef',null,0); select (col1,col2) = ('abcdef','{"t1":"a"}') from row05; (col1, col2) = (abcdef, {"t1":"a"}) -true -false -false +1 +0 +0 select (col1,col2) != ('abcdef','{"ehyiuwqnve":"ashyiujewv"}') from row05; (col1, col2) != (abcdef, {"ehyiuwqnve":"ashyiujewv"}) -true -true -true +1 +1 +1 drop table row05; drop database test; diff --git a/test/distributed/cases/optimistic/unique_secondary_index.result b/test/distributed/cases/optimistic/unique_secondary_index.result index 51f670b94bcf2..11fbcf83ec3bf 100644 --- a/test/distributed/cases/optimistic/unique_secondary_index.result +++ b/test/distributed/cases/optimistic/unique_secondary_index.result @@ -142,8 +142,8 @@ insert into index_15 values (1,TRUE),(2,FALSE),(3,TRUE); insert into index_15 values (1,TRUE),(2,FALSE),(3,NULL); select * from index_15; col1 col2 -1 true -2 false +1 1 +2 0 3 null create table index_16 (col1 bigint primary key,col2 blob,col3 blob,unique key d1(col2),key d2(col3)); not supported: BLOB column 'col2' cannot be in index @@ -492,8 +492,8 @@ insert into create_index_15 values (1,TRUE),(2,FALSE),(3,TRUE); insert into create_index_15 values (1,TRUE),(2,FALSE),(3,NULL); select * from create_index_15; col1 col2 -1 true -2 false +1 1 +2 0 3 null create table create_index_16 (col1 bigint primary key,col2 blob,col3 blob); create unique index blob_index on create_index_16(col2); @@ -785,9 +785,9 @@ create index bool_index on create_secondary_15(col2); insert into create_secondary_15 values (1,TRUE),(2,FALSE),(3,TRUE); select * from create_secondary_15; col1 col2 -1 true -2 false -3 true +1 1 +2 0 +3 1 create table create_secondary_16 (col1 bigint primary key,col2 blob,col3 blob); create index blob_index on create_secondary_16(col2); not supported: BLOB column 'col2' cannot be in index diff --git a/test/distributed/cases/optimizer/insert.result b/test/distributed/cases/optimizer/insert.result index f058ccff94f9d..fa1f1fc331add 100644 --- a/test/distributed/cases/optimizer/insert.result +++ b/test/distributed/cases/optimizer/insert.result @@ -32,12 +32,12 @@ create table insert_t5(col1 bool); insert into insert_t5 values("true"); select * from insert_t5; col1 -true +1 delete from insert_t5;; insert into insert_t5 values("false"); select * from insert_t5; col1 -false +0 drop table insert_t5; drop table if exists insert_t6; create table insert_t6(col1 timestamp); diff --git a/test/distributed/cases/optimizer/runtimefilter.result b/test/distributed/cases/optimizer/runtimefilter.result index 5b891c3f96a5a..a4dafbbbabb2e 100644 --- a/test/distributed/cases/optimizer/runtimefilter.result +++ b/test/distributed/cases/optimizer/runtimefilter.result @@ -3,17 +3,17 @@ create database d1; use d1; select enable_fault_injection(); enable_fault_injection() -true +1 drop table if exists t1; drop table if exists t2; create table t1(c1 int primary key, c2 int, c3 int, key(c3)); create table t2(c1 int primary key, c2 int, c3 int); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'d1.t1'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, d1.t1) -true +1 select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'d1.t2'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, d1.t2) -true +1 insert into t1 select *,*,* from generate_series(300000) g; insert into t2 select *,*,* from generate_series(30000) g; explain select * from t1 where t1.c2 in( select c1 from t2 where t2.c2=1); @@ -121,4 +121,4 @@ count(*) drop database if exists d1; select disable_fault_injection(); disable_fault_injection() -true \ No newline at end of file +1 \ No newline at end of file diff --git a/test/distributed/cases/optimizer/shuffle.result b/test/distributed/cases/optimizer/shuffle.result index e7ccdd1f1ef86..2108e9aea1dd5 100644 --- a/test/distributed/cases/optimizer/shuffle.result +++ b/test/distributed/cases/optimizer/shuffle.result @@ -326,10 +326,10 @@ use test; create table t1(a int primary key, b int); select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'test.t1'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, test.t1) -true +1 insert into t1 select *, 1 from generate_series(1, 1000*1000*10)g; select sum(b) from t1; sum(b) @@ -340,5 +340,5 @@ sum(b) 10100000 select disable_fault_injection(); disable_fault_injection() -true +1 drop database if exists test; \ No newline at end of file diff --git a/test/distributed/cases/optimizer/top.result b/test/distributed/cases/optimizer/top.result index 1bf633613375c..ac9a596ad9528 100644 --- a/test/distributed/cases/optimizer/top.result +++ b/test/distributed/cases/optimizer/top.result @@ -3,17 +3,17 @@ create database d1; use d1; select enable_fault_injection(); enable_fault_injection() -true +1 drop table if exists t1; drop table if exists t2; create table t1(c1 int primary key, c2 int, c3 int); create table t2(c1 int primary key, c2 int, c3 int); select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'d1.t1'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, d1.t1) -true +1 select add_fault_point('fj/cn/flush_small_objs',':::','echo',40,'d1.t2'); add_fault_point(fj/cn/flush_small_objs, :::, echo, 40, d1.t2) -true +1 insert into t1 select *,*,* from generate_series(100000) g; insert into t2 select *,*,* from generate_series(90000) g; explain select * from t1 order by c1 limit 100 offset 200; @@ -204,4 +204,4 @@ a drop database if exists d1; select disable_fault_injection(); disable_fault_injection() -true \ No newline at end of file +1 \ No newline at end of file diff --git a/test/distributed/cases/pessimistic_transaction/ddl_atomicity.result b/test/distributed/cases/pessimistic_transaction/ddl_atomicity.result index a3ecd49bd476f..8aec5fa24f9bd 100644 --- a/test/distributed/cases/pessimistic_transaction/ddl_atomicity.result +++ b/test/distributed/cases/pessimistic_transaction/ddl_atomicity.result @@ -1,9 +1,9 @@ select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/cn/recv/err', ':::', 'echo', 5, 'mo_tables'); add_fault_point(fj/cn/recv/err, :::, echo, 5, mo_tables) -true +1 create database db1; use db1; begin; @@ -105,4 +105,4 @@ alter table t2 drop foreign key fk_t2_t1; commit; select disable_fault_injection(); disable_fault_injection() -true +1 diff --git a/test/distributed/cases/pessimistic_transaction/ddl_retry.result b/test/distributed/cases/pessimistic_transaction/ddl_retry.result index 39d908f9da355..ef413b4aa48c8 100644 --- a/test/distributed/cases/pessimistic_transaction/ddl_retry.result +++ b/test/distributed/cases/pessimistic_transaction/ddl_retry.result @@ -1,40 +1,40 @@ select enable_fault_injection(); enable_fault_injection() -true +1 begin; select add_fault_point('runOnce_fail', ':::', 'echo', 0, 'create table xx'); add_fault_point(runOnce_fail, :::, echo, 0, create table xx) -true +1 create table xx (a int); select remove_fault_point('runOnce_fail'); remove_fault_point(runOnce_fail) -true +1 select add_fault_point('runOnce_fail', ':::', 'echo', 0, 'drop table xx'); add_fault_point(runOnce_fail, :::, echo, 0, drop table xx) -true +1 drop table xx; select remove_fault_point('runOnce_fail'); remove_fault_point(runOnce_fail) -true +1 create table bb (a int); insert into bb values (1); select add_fault_point('runOnce_fail', ':::', 'echo', 0, 'alter table bb'); add_fault_point(runOnce_fail, :::, echo, 0, alter table bb) -true +1 alter table bb rename to xx; select remove_fault_point('runOnce_fail'); remove_fault_point(runOnce_fail) -true +1 show tables; Tables_in_ddl_retry xx select add_fault_point('runOnce_fail', ':::', 'echo', 0, 'alter table xx'); add_fault_point(runOnce_fail, :::, echo, 0, alter table xx) -true +1 alter table xx add primary key (a); select remove_fault_point('runOnce_fail'); remove_fault_point(runOnce_fail) -true +1 select * from xx; a 1 @@ -63,18 +63,18 @@ insert into foreign02 values(2,2,2); begin; select add_fault_point('runOnce_fail', ':::', 'echo', 0, 'insert into foreign01'); add_fault_point(runOnce_fail, :::, echo, 0, insert into foreign01) -true +1 insert into foreign01 values(3,'anykind',3,3); select remove_fault_point('runOnce_fail'); remove_fault_point(runOnce_fail) -true +1 select add_fault_point('runOnce_fail', ':::', 'echo', 0, 'alter table foreign01'); add_fault_point(runOnce_fail, :::, echo, 0, alter table foreign01) -true +1 alter table foreign01 drop column col2; select remove_fault_point('runOnce_fail'); remove_fault_point(runOnce_fail) -true +1 select * from foreign01; col1 col3 col4 3 3 3 @@ -95,4 +95,4 @@ drop table foreign02; drop table foreign01; select disable_fault_injection(); disable_fault_injection() -true +1 diff --git a/test/distributed/cases/pessimistic_transaction/system_view.result b/test/distributed/cases/pessimistic_transaction/system_view.result index d4a006a56d45d..a0d4b97c6c683 100644 --- a/test/distributed/cases/pessimistic_transaction/system_view.result +++ b/test/distributed/cases/pessimistic_transaction/system_view.result @@ -10,9 +10,9 @@ sleep(10) 0 select count(*) > 0 from mo_locks() l; count(*) > 0 -true +1 select count(*) > 0 from mo_transactions() t join mo_locks() l where t.txn_id = l.txn_id; count(*) > 0 -true +1 commit; drop database if exists sv_db1; diff --git a/test/distributed/cases/pessimistic_transaction/unique_secondary_index.result b/test/distributed/cases/pessimistic_transaction/unique_secondary_index.result index e968dcb179a59..46304b73a2431 100644 --- a/test/distributed/cases/pessimistic_transaction/unique_secondary_index.result +++ b/test/distributed/cases/pessimistic_transaction/unique_secondary_index.result @@ -142,8 +142,8 @@ Duplicate entry 'true' for key 'col2' insert into index_15 values (1,TRUE),(2,FALSE),(3,NULL); select * from index_15; col1 col2 -1 true -2 false +1 1 +2 0 3 null create table index_16 (col1 bigint primary key,col2 blob,col3 blob,unique key d1(col2),key d2(col3)); not supported: BLOB column 'col2' cannot be in index @@ -492,8 +492,8 @@ Duplicate entry 'true' for key 'col2' insert into create_index_15 values (1,TRUE),(2,FALSE),(3,NULL); select * from create_index_15; col1 col2 -1 true -2 false +1 1 +2 0 3 null create table create_index_16 (col1 bigint primary key,col2 blob,col3 blob); create unique index blob_index on create_index_16(col2); @@ -780,9 +780,9 @@ create index bool_index on create_secondary_15(col2); insert into create_secondary_15 values (1,TRUE),(2,FALSE),(3,TRUE); select * from create_secondary_15; col1 col2 -1 true -2 false -3 true +1 1 +2 0 +3 1 create table create_secondary_16 (col1 bigint primary key,col2 blob,col3 blob); create index blob_index on create_secondary_16(col2); not supported: BLOB column 'col2' cannot be in index diff --git a/test/distributed/cases/prepare/prepare.result b/test/distributed/cases/prepare/prepare.result index 1c9e3c2affb03..278a17fed3c79 100644 --- a/test/distributed/cases/prepare/prepare.result +++ b/test/distributed/cases/prepare/prepare.result @@ -730,6 +730,25 @@ create user prepare_user1 identified by '123456' default role prepare_role1; drop user prepare_user1; drop role prepare_role1; drop account prepare_account_01; +create database db1; +use db1; +drop table if exists t_tuple_in; +create table t_tuple_in (s_w_id int, s_i_id int, s_qty int, primary key (s_w_id, s_i_id)); +insert into t_tuple_in values (1,1,10),(1,2,20),(2,1,30); +prepare stmt_tuple_in from "select s_i_id, s_qty from t_tuple_in where (s_w_id, s_i_id) in ((?,?),(?,?)) order by s_i_id for update"; +set @w1=1; +set @i1=1; +set @w2=1; +set @i2=2; +begin; +execute stmt_tuple_in using @w1, @i1, @w2, @i2; +s_i_id s_qty +1 10 +2 20 +commit; +deallocate prepare stmt_tuple_in; +drop table t_tuple_in; +drop database db1; drop database if exists db_ps_null_json; create database db_ps_null_json; use db_ps_null_json; diff --git a/test/distributed/cases/prepare/prepare.test b/test/distributed/cases/prepare/prepare.test index aae0c3882f977..ef07de9ec700b 100644 --- a/test/distributed/cases/prepare/prepare.test +++ b/test/distributed/cases/prepare/prepare.test @@ -567,6 +567,22 @@ drop role prepare_role1; -- @session drop account prepare_account_01; +create database db1; +use db1; +drop table if exists t_tuple_in; +create table t_tuple_in (s_w_id int, s_i_id int, s_qty int, primary key (s_w_id, s_i_id)); +insert into t_tuple_in values (1,1,10),(1,2,20),(2,1,30); +prepare stmt_tuple_in from "select s_i_id, s_qty from t_tuple_in where (s_w_id, s_i_id) in ((?,?),(?,?)) order by s_i_id for update"; +set @w1=1; +set @i1=1; +set @w2=1; +set @i2=2; +begin; +execute stmt_tuple_in using @w1, @i1, @w2, @i2; +commit; +deallocate prepare stmt_tuple_in; +drop table t_tuple_in; +drop database db1; -- prepare insert null json multiple times drop database if exists db_ps_null_json; diff --git a/test/distributed/cases/query_result/query_result.result b/test/distributed/cases/query_result/query_result.result index 13c973d0c0686..51a94e5ae7229 100644 --- a/test/distributed/cases/query_result/query_result.result +++ b/test/distributed/cases/query_result/query_result.result @@ -106,7 +106,7 @@ a 2 select result_size = 0 from meta_scan(last_query_id()) as u; result_size = 0 -true +1 set save_query_result = off; set save_query_result = on; set query_result_maxsize = 100; @@ -408,10 +408,10 @@ _wstart _wend max(col2) min(col2) create view v1 as SELECT 1 IN (SELECT 1); /* save_result */select * from v1; 1 in (select 1) -true +1 select * from result_scan(last_query_id()) as u; 1 in (select 1) -true +1 drop table time_window01; drop account abc; create account abc ADMIN_NAME 'admin' IDENTIFIED BY '123456'; @@ -600,7 +600,7 @@ no configure: save query result create view v1 as SELECT 1 IN (SELECT 1); /* save_result */select * from v1; 1 in (select 1) -true +1 select * from result_scan(last_query_id()) as u; no configure: save query result drop table time_window01; diff --git a/test/distributed/cases/query_result/query_result_cloud.result b/test/distributed/cases/query_result/query_result_cloud.result index 3236a55ab027d..474e90cd444f3 100644 --- a/test/distributed/cases/query_result/query_result_cloud.result +++ b/test/distributed/cases/query_result/query_result_cloud.result @@ -88,7 +88,7 @@ a 2 select result_size = 0 from meta_scan(last_query_id()) as u; result_size = 0 -true +1 set save_query_result = off; set save_query_result = on; set query_result_maxsize = 100; @@ -392,10 +392,10 @@ _wstart _wend max(col2) min(col2) create view v1 as SELECT 1 IN (SELECT 1); /* cloud_user */select * from v1; 1 in (select 1) -true +1 select * from result_scan(last_query_id()) as u; 1 in (select 1) -true +1 drop table time_window01; drop account abc; create account abc ADMIN_NAME 'admin' IDENTIFIED BY '123456'; @@ -584,7 +584,7 @@ no configure: save query result create view v1 as SELECT 1 IN (SELECT 1); /* cloud_user */select * from v1; 1 in (select 1) -true +1 select * from result_scan(last_query_id()) as u; no configure: save query result drop table time_window01; diff --git a/test/distributed/cases/sample/sample.result b/test/distributed/cases/sample/sample.result index e475f74320db0..2d7e638374819 100644 --- a/test/distributed/cases/sample/sample.result +++ b/test/distributed/cases/sample/sample.result @@ -64,14 +64,14 @@ esabatad metsys tnemeganam esabatad select col1, sample (startswith(col3, 'database'), 3 rows) from sample01; col1 startswith(col3, database) -1 true -2 true -3 true +1 1 +2 1 +3 1 select col1, sample (endswith(col3, 'system'), 3 rows) from sample01; col1 endswith(col3, system) -1 false -2 false -3 true +1 0 +2 0 +3 1 drop table sample01; drop table if exists sample02; create table sample02 (col1 int, col2 datetime); diff --git a/test/distributed/cases/save_query_result/save_query_result.result b/test/distributed/cases/save_query_result/save_query_result.result index 374a85426714a..337dafe11b239 100644 --- a/test/distributed/cases/save_query_result/save_query_result.result +++ b/test/distributed/cases/save_query_result/save_query_result.result @@ -29,108 +29,108 @@ mysql load data infile '$resources/load_data/test_1.csv' into table test_table fields terminated by ','; /* save_result */select * from test_table; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select col1 from test_table; col1 0 @@ -237,186 +237,186 @@ col1 49 /* save_result */select * from test_table where col1 > 30; col1 col2 col3 col4 col5 col6 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select * from test_table where col1 < 10; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 /* save_result */select * from test_table where col1 = 10; col1 col2 col3 col4 col5 col6 -10 10.1 true 2003-09-28 varchar_10 text_10 +10 10.1 1 2003-09-28 varchar_10 text_10 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -10 10.1 true 2003-09-28 varchar_10 text_10 +10 10.1 1 2003-09-28 varchar_10 text_10 /* save_result */select * from test_table limit 1; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 +0 0.1 1 1982-03-24 varchar_0 text_0 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 +0 0.1 1 1982-03-24 varchar_0 text_0 /* save_result */select * from test_table order by col1 asc; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select t1.col1,t2.col1 from test_table t1 left join test_table t2 on t1.col1=t2.col1; col1 col1 0 0 @@ -627,108 +627,108 @@ col1_0 col1_1 49 49 /* save_result */select * from test_table union select * from test_table; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */SELECT col1 FROM test_table where col1 < 30 MINUS SELECT col1 FROM test_table where col1 < 20; col1 20 @@ -770,108 +770,108 @@ view create view character_set_client collation_connection test_view create view test_view as select * from test_table; utf8mb4 utf8mb4_general_ci /* save_result */select * from test_view; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select col1 from test_view; col1 0 @@ -978,186 +978,186 @@ col1 49 /* save_result */select * from test_view where col1 > 30; col1 col2 col3 col4 col5 col6 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select * from test_view where col1 < 10; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 /* save_result */select * from test_view where col1 = 10; col1 col2 col3 col4 col5 col6 -10 10.1 true 2003-09-28 varchar_10 text_10 +10 10.1 1 2003-09-28 varchar_10 text_10 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -10 10.1 true 2003-09-28 varchar_10 text_10 +10 10.1 1 2003-09-28 varchar_10 text_10 /* save_result */select * from test_view limit 1; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 +0 0.1 1 1982-03-24 varchar_0 text_0 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 +0 0.1 1 1982-03-24 varchar_0 text_0 /* save_result */select * from test_view order by col1 asc; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select t1.col1,t2.col1 from test_view t1 left join test_view t2 on t1.col1=t2.col1; col1 col1 0 0 @@ -1368,108 +1368,108 @@ col1_0 col1_1 49 49 /* save_result */select * from test_view union select * from test_view; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */SELECT col1 FROM test_view where col1 < 30 MINUS SELECT col1 FROM test_view where col1 < 20; col1 20 @@ -1497,108 +1497,108 @@ col1 begin; /* save_result */select * from test_table; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select col1 from test_table; col1 0 @@ -1705,186 +1705,186 @@ col1 49 /* save_result */select * from test_table where col1 > 30; col1 col2 col3 col4 col5 col6 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select * from test_table where col1 < 10; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 /* save_result */select * from test_table where col1 = 10; col1 col2 col3 col4 col5 col6 -10 10.1 true 2003-09-28 varchar_10 text_10 +10 10.1 1 2003-09-28 varchar_10 text_10 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -10 10.1 true 2003-09-28 varchar_10 text_10 +10 10.1 1 2003-09-28 varchar_10 text_10 /* save_result */select * from test_table limit 1; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 +0 0.1 1 1982-03-24 varchar_0 text_0 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 +0 0.1 1 1982-03-24 varchar_0 text_0 /* save_result */select * from test_table order by col1 asc; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */select t1.col1,t2.col1 from test_table t1 left join test_table t2 on t1.col1=t2.col1; col1 col1 0 0 @@ -2095,108 +2095,108 @@ col1_0 col1_1 49 49 /* save_result */select * from test_table union select * from test_table; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 select * from result_scan(last_query_id()) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 /* save_result */SELECT col1 FROM test_view where col1 < 30 MINUS SELECT col1 FROM test_view where col1 < 20; col1 20 @@ -2225,189 +2225,189 @@ rollback; begin; /* save_result */select * from test_table; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 rollback; select * from result_scan(last_query_id(-2)) as u; col1 col2 col3 col4 col5 col6 -0 0.1 true 1982-03-24 varchar_0 text_0 -1 1.1 false 1982-07-31 varchar_1 text_1 -2 2.1 true 2002-04-13 varchar_2 text_2 -3 3.1 false 2019-09-29 varchar_3 text_3 -4 4.1 true 1996-08-20 varchar_4 text_4 -5 5.1 false 2008-10-13 varchar_5 text_5 -6 6.1 true 2002-03-05 varchar_6 text_6 -7 7.1 false 1993-11-07 varchar_7 text_7 -8 8.1 true 1994-01-08 varchar_8 text_8 -9 9.1 false 1999-09-17 varchar_9 text_9 -10 10.1 true 2003-09-28 varchar_10 text_10 -11 11.1 false 1984-01-22 varchar_11 text_11 -12 12.1 true 1994-02-10 varchar_12 text_12 -13 13.1 false 1994-12-02 varchar_13 text_13 -14 14.1 true 2013-01-19 varchar_14 text_14 -15 15.1 false 2002-09-29 varchar_15 text_15 -16 16.1 true 2001-12-07 varchar_16 text_16 -17 17.1 false 1989-03-11 varchar_17 text_17 -18 18.1 true 2019-11-04 varchar_18 text_18 -19 19.1 false 2002-08-15 varchar_19 text_19 -20 20.1 true 1995-12-20 varchar_20 text_20 -21 21.1 false 2018-08-03 varchar_21 text_21 -22 22.1 true 1998-03-10 varchar_22 text_22 -23 23.1 false 2022-04-08 varchar_23 text_23 -24 24.1 true 1989-04-27 varchar_24 text_24 -25 25.1 false 2009-03-14 varchar_25 text_25 -26 26.1 true 2019-03-27 varchar_26 text_26 -27 27.1 false 1983-10-28 varchar_27 text_27 -28 28.1 true 1993-07-19 varchar_28 text_28 -29 29.1 false 1986-09-11 varchar_29 text_29 -30 30.1 true 1992-08-19 varchar_30 text_30 -31 31.1 false 1981-08-07 varchar_31 text_31 -32 32.1 true 1984-03-25 varchar_32 text_32 -33 33.1 false 2001-09-05 varchar_33 text_33 -34 34.1 true 2022-03-17 varchar_34 text_34 -35 35.1 false 2008-06-24 varchar_35 text_35 -36 36.1 true 1987-11-23 varchar_36 text_36 -37 37.1 false 2008-11-10 varchar_37 text_37 -38 38.1 true 1986-01-29 varchar_38 text_38 -39 39.1 false 1985-02-27 varchar_39 text_39 -40 40.1 true 2016-11-28 varchar_40 text_40 -41 41.1 false 1991-02-11 varchar_41 text_41 -42 42.1 true 2019-01-08 varchar_42 text_42 -43 43.1 false 2009-05-01 varchar_43 text_43 -44 44.1 true 1986-11-15 varchar_44 text_44 -45 45.1 false 2000-07-22 varchar_45 text_45 -46 46.1 true 2002-09-07 varchar_46 text_46 -47 47.1 false 1987-09-23 varchar_47 text_47 -48 48.1 true 1985-10-25 varchar_48 text_48 -49 49.1 false 1988-10-06 varchar_49 text_49 +0 0.1 1 1982-03-24 varchar_0 text_0 +1 1.1 0 1982-07-31 varchar_1 text_1 +2 2.1 1 2002-04-13 varchar_2 text_2 +3 3.1 0 2019-09-29 varchar_3 text_3 +4 4.1 1 1996-08-20 varchar_4 text_4 +5 5.1 0 2008-10-13 varchar_5 text_5 +6 6.1 1 2002-03-05 varchar_6 text_6 +7 7.1 0 1993-11-07 varchar_7 text_7 +8 8.1 1 1994-01-08 varchar_8 text_8 +9 9.1 0 1999-09-17 varchar_9 text_9 +10 10.1 1 2003-09-28 varchar_10 text_10 +11 11.1 0 1984-01-22 varchar_11 text_11 +12 12.1 1 1994-02-10 varchar_12 text_12 +13 13.1 0 1994-12-02 varchar_13 text_13 +14 14.1 1 2013-01-19 varchar_14 text_14 +15 15.1 0 2002-09-29 varchar_15 text_15 +16 16.1 1 2001-12-07 varchar_16 text_16 +17 17.1 0 1989-03-11 varchar_17 text_17 +18 18.1 1 2019-11-04 varchar_18 text_18 +19 19.1 0 2002-08-15 varchar_19 text_19 +20 20.1 1 1995-12-20 varchar_20 text_20 +21 21.1 0 2018-08-03 varchar_21 text_21 +22 22.1 1 1998-03-10 varchar_22 text_22 +23 23.1 0 2022-04-08 varchar_23 text_23 +24 24.1 1 1989-04-27 varchar_24 text_24 +25 25.1 0 2009-03-14 varchar_25 text_25 +26 26.1 1 2019-03-27 varchar_26 text_26 +27 27.1 0 1983-10-28 varchar_27 text_27 +28 28.1 1 1993-07-19 varchar_28 text_28 +29 29.1 0 1986-09-11 varchar_29 text_29 +30 30.1 1 1992-08-19 varchar_30 text_30 +31 31.1 0 1981-08-07 varchar_31 text_31 +32 32.1 1 1984-03-25 varchar_32 text_32 +33 33.1 0 2001-09-05 varchar_33 text_33 +34 34.1 1 2022-03-17 varchar_34 text_34 +35 35.1 0 2008-06-24 varchar_35 text_35 +36 36.1 1 1987-11-23 varchar_36 text_36 +37 37.1 0 2008-11-10 varchar_37 text_37 +38 38.1 1 1986-01-29 varchar_38 text_38 +39 39.1 0 1985-02-27 varchar_39 text_39 +40 40.1 1 2016-11-28 varchar_40 text_40 +41 41.1 0 1991-02-11 varchar_41 text_41 +42 42.1 1 2019-01-08 varchar_42 text_42 +43 43.1 0 2009-05-01 varchar_43 text_43 +44 44.1 1 1986-11-15 varchar_44 text_44 +45 45.1 0 2000-07-22 varchar_45 text_45 +46 46.1 1 2002-09-07 varchar_46 text_46 +47 47.1 0 1987-09-23 varchar_47 text_47 +48 48.1 1 1985-10-25 varchar_48 text_48 +49 49.1 0 1988-10-06 varchar_49 text_49 set @xxx=10; prepare s1 from select * from test_table where col1 ANY (SELECT * from t1); null select 10 > ANY (SELECT * from t1); 10 > ANY (SELECT * from t1) -true +1 DROP TABLE IF EXISTS t1; create table t1 (a varchar(20)); insert into t1 values ('A'),('BC'),('DEF'); @@ -450,7 +450,7 @@ select 'A' > ANY (SELECT * from t1); null select 'XYZS' > ANY (SELECT * from t1); 'XYZS' > ANY (SELECT * from t1) -true +1 DROP TABLE IF EXISTS t1; create table t1 (a float); insert into t1 values (1.5),(2.5),(3.5); @@ -460,7 +460,7 @@ select 1.5 > ANY (SELECT * from t1); null select 10.5 > ANY (SELECT * from t1); 10.5 > ANY (SELECT * from t1) -true +1 DROP TABLE IF EXISTS t1; create table t1 (s1 int); insert into t1 values (1),(null); @@ -468,7 +468,7 @@ select * from t1 where s1 < all (select s1 from t1); s1 select s1, s1 < all (select s1 from t1) from t1; s1 s1 < all (select s1 from t1) -1 false +1 0 null null DROP TABLE IF EXISTS t1; CREATE TABLE t1( a INT ); diff --git a/test/distributed/cases/subquery/subquery-with-exists.result b/test/distributed/cases/subquery/subquery-with-exists.result index 0f955d047da5b..dffc0725bf20c 100755 --- a/test/distributed/cases/subquery/subquery-with-exists.result +++ b/test/distributed/cases/subquery/subquery-with-exists.result @@ -1,6 +1,6 @@ SELECT EXISTS(SELECT 1+1); EXISTS(SELECT 1+1) -true +1 drop table if exists t1; drop table if exists t2; drop table if exists t3; @@ -367,19 +367,19 @@ CREATE TABLE t1 ( a int, b int ); INSERT INTO t1 VALUES (1,1),(2,2),(3,3); SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a) IS NULL from t1 a; EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a) IS NULL -false -false -false +0 +0 +0 SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a) IS NOT NULL from t1 a; EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a) IS NOT NULL -true -true -true +1 +1 +1 SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a) IS NULL from t1 a; EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a) IS NULL -false -false -false +0 +0 +0 drop table if exists t1; drop table if exists t1; create table t1 (df decimal(5,1)); diff --git a/test/distributed/cases/subquery/subquery-with-in.result b/test/distributed/cases/subquery/subquery-with-in.result index f42c078819e19..148031d9502b3 100755 --- a/test/distributed/cases/subquery/subquery-with-in.result +++ b/test/distributed/cases/subquery/subquery-with-in.result @@ -1,6 +1,6 @@ SELECT 1 IN (SELECT 1); 1 IN (SELECT 1) -true +1 SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); 1 1 @@ -15,7 +15,7 @@ SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *); SQL parser error: No tables used SELECT ((0,1) NOT IN (SELECT NULL,1)) IS NULL; ((0,1) NOT IN (SELECT NULL,1)) IS NULL -true +1 drop table if exists t1; drop table if exists t2; drop table if exists t3; @@ -35,7 +35,7 @@ select * from t3 where a not in (select b from t2); a SELECT 0 IN (SELECT 1 FROM t1 a); 0 IN (SELECT 1 FROM t1 a) -false +0 select * from t3 where a in (select a,b from t2); invalid input: subquery returns more than 1 column select * from t3 where a in (select * from t2); @@ -49,14 +49,14 @@ insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; s1 s1 NOT IN (SELECT s1 FROM t2) -a1 false -a2 false -a3 true +a1 0 +a2 0 +a3 1 select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; s1 s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') -a1 false -a2 true -a3 true +a1 0 +a2 1 +a3 1 drop table if exists t1; drop table if exists t2; create table t1(val varchar(10)); @@ -106,9 +106,9 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); SELECT a, a IN (SELECT a FROM t1) FROM t2; a a IN (SELECT a FROM t1) -1 true +1 1 2 null -3 true +3 1 drop table if exists t1; drop table if exists t2; drop table if exists t3; @@ -229,10 +229,10 @@ create table t3 (a int); insert into t3 values (NULL), (NULL); select a, oref, a in (select max(ie) from t1 where oref=t2.oref group by grp) Z from t2; a oref Z -1 1 true -2 2 false +1 1 1 +2 2 0 3 3 null -null 4 false +null 4 0 null 2 null select a, oref from t2 where a in (select max(ie) from t1 where oref=t2.oref group by grp); a oref @@ -242,15 +242,15 @@ select max(ie) from t1 where oref=t2.oref group by grp union select max(ie) from t1 where oref=t2.oref group by grp ) Z from t2; a oref z -1 1 true -2 2 false +1 1 1 +2 2 0 3 3 null -null 4 false +null 4 0 null 2 null select a in (select max(ie) from t1 where oref=4 group by grp) from t3; a in (select max(ie) from t1 where oref=4 group by grp) -false -false +0 +0 drop table if exists t1; drop table if exists t2; drop table if exists t3; @@ -260,10 +260,10 @@ create table t2 (a int, oref int); insert into t2 values (1, 1), (2,2), (NULL, 3), (NULL, 4); select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2; oref a Z -1 1 true -2 2 false +1 1 1 +2 2 0 3 null null -4 null false +4 null 0 select oref, a from t2 where a in (select a from t1 where oref=t2.oref); oref a 1 1 @@ -271,10 +271,10 @@ delete from t2; insert into t2 values (NULL, 0),(NULL, 0), (NULL, 0), (NULL, 0); select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2; oref a Z -0 null false -0 null false -0 null false -0 null false +0 null 0 +0 null 0 +0 null 0 +0 null 0 drop table if exists t1; drop table if exists t2; drop table if exists t1; @@ -304,20 +304,20 @@ create table t1 (a int); insert into t1 values (1),(2),(3); select 1 IN (SELECT * from t1); 1 IN (SELECT * from t1) -true +1 select 10 IN (SELECT * from t1); 10 IN (SELECT * from t1) -false +0 select NULL IN (SELECT * from t1); NULL IN (SELECT * from t1) null update t1 set a=NULL where a=2; select 1 IN (SELECT * from t1); 1 IN (SELECT * from t1) -true +1 select 3 IN (SELECT * from t1); 3 IN (SELECT * from t1) -true +1 select 10 IN (SELECT * from t1); 10 IN (SELECT * from t1) null @@ -326,20 +326,20 @@ create table t1 (a varchar(20)); insert into t1 values ('A'),('BC'),('DEF'); select 'A' IN (SELECT * from t1); 'A' IN (SELECT * from t1) -true +1 select 'XYZS' IN (SELECT * from t1); 'XYZS' IN (SELECT * from t1) -false +0 select NULL IN (SELECT * from t1); NULL IN (SELECT * from t1) null update t1 set a=NULL where a='BC'; select 'A' IN (SELECT * from t1); 'A' IN (SELECT * from t1) -true +1 select 'DEF' IN (SELECT * from t1); 'DEF' IN (SELECT * from t1) -true +1 select 'XYZS' IN (SELECT * from t1); 'XYZS' IN (SELECT * from t1) null @@ -348,20 +348,20 @@ create table t1 (a float); insert into t1 values (1.5),(2.5),(3.5); select 1.5 IN (SELECT * from t1); 1.5 IN (SELECT * from t1) -true +1 select 10.5 IN (SELECT * from t1); 10.5 IN (SELECT * from t1) -false +0 select NULL IN (SELECT * from t1); NULL IN (SELECT * from t1) null update t1 set a=NULL where a=2.5; select 1.5 IN (SELECT * from t1); 1.5 IN (SELECT * from t1) -true +1 select 3.5 IN (SELECT * from t1); 3.5 IN (SELECT * from t1) -true +1 select 10.5 IN (SELECT * from t1); 10.5 IN (SELECT * from t1) null @@ -375,16 +375,16 @@ INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; a t1.a in (select t2.a from t2) -1 true -2 true -3 true -4 false +1 1 +2 1 +3 1 +4 0 SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) -1 true -2 true -3 true -4 false +1 1 +2 1 +3 1 +4 0 drop table if exists t1; drop table if exists t2; drop table if exists t3; @@ -397,45 +397,45 @@ DROP TABLE IF EXISTS t1; create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); 10.5 in (select * from t1 limit 1) -false +0 select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 46 near " UNION SELECT 1.5);"; select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); 10.5 in (select * from t1 union select 1.5 limit 1) -false +0 DROP TABLE IF EXISTS t1; create table t1 (a int, b real, c varchar(10)); insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); select (1, 1, 'a') IN (select a,b,c from t1); (1, 1, 'a') IN (select a,b,c from t1) -true +1 select (1, 2, 'a') IN (select a,b,c from t1); (1, 2, 'a') IN (select a,b,c from t1) -false +0 select (1, 1, 'a') IN (select b,a,c from t1); (1, 1, 'a') IN (select b,a,c from t1) -true +1 select (1, 1, 'a') IN (select a,b,c from t1 where a is not null); (1, 1, 'a') IN (select a,b,c from t1 where a is not null) -true +1 select (1, 2, 'a') IN (select a,b,c from t1 where a is not null); (1, 2, 'a') IN (select a,b,c from t1 where a is not null) -false +0 select (1, 1, 'a') IN (select b,a,c from t1 where a is not null); (1, 1, 'a') IN (select b,a,c from t1 where a is not null) -true +1 select (1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a'); (1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a') -true +1 select (1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a'); (1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a') -false +0 select (1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a'); (1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a') -true +1 select (1, 1, 'a') IN (select b,a,c from t1 limit 2); (1, 1, a) in (select b, a, c from t1 limit 2) -true +1 DROP TABLE IF EXISTS t1; create table t1 (a integer, b integer); select (1,(2,2)) in (select * from t1 ); @@ -454,8 +454,8 @@ INSERT INTO t2 VALUES (101, 201); INSERT INTO t2 VALUES (103, 203); SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1; ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL -false -false +0 +0 DROP TABLE IF EXISTS t1; drop table if exists t2; CREATE TABLE t1 ( @@ -481,15 +481,15 @@ create table t2 (a int, b int); insert into t2 values (1,1), (3,3); select a, b, (a,b) in (select a, min(b) from t2 group by a) Z from t1; a b Z -0 0 false -2 2 false -3 3 true +0 0 0 +2 2 0 +3 3 1 insert into t2 values (NULL,4); select a, b, (a,b) in (select a, min(b) from t2 group by a) Z from t1; a b Z -0 0 false -2 2 false -3 3 true +0 0 0 +2 2 0 +3 3 1 DROP TABLE IF EXISTS t1; drop table if exists t2; DROP TABLE IF EXISTS t1; @@ -497,24 +497,24 @@ CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1), (2), (11); SELECT a, (11, 12) = (SELECT a, 22), (11, 12) IN (SELECT a, 22) FROM t1 GROUP BY t1.a; a (11, 12) = (SELECT a, 22) (11, 12) IN (SELECT a, 22) -1 0 false -2 0 false -11 0 false +1 0 0 +2 0 0 +11 0 0 SELECT a, (11, 12) = (SELECT a, 12), (11, 12) IN (SELECT a, 12) FROM t1 GROUP BY t1.a; a (11, 12) = (SELECT a, 12) (11, 12) IN (SELECT a, 12) -1 0 false -2 0 false -11 1 true +1 0 0 +2 0 0 +11 1 1 SELECT a, (11, 12) = (SELECT a, 22), (11, 12) IN (SELECT a, 22) FROM t1; a (11, 12) = (SELECT a, 22) (11, 12) IN (SELECT a, 22) -1 0 false -2 0 false -11 0 false +1 0 0 +2 0 0 +11 0 0 SELECT a, (11, 12) = (SELECT a, 12), (11, 12) IN (SELECT a, 12) FROM t1; a (11, 12) = (SELECT a, 12) (11, 12) IN (SELECT a, 12) -1 0 false -2 0 false -11 1 true +1 0 0 +2 0 0 +11 1 1 SELECT a AS x, (11, 12) = (SELECT MAX(x), 22), (11, 12) IN (SELECT MAX(x), 22) FROM t1; invalid input: column x does not exist SELECT a AS x, (11, 12) = (SELECT MAX(x), 12), (11, 12) IN (SELECT MAX(x), 12) FROM t1; @@ -531,13 +531,13 @@ SELECT (1,2) = (SELECT NULL, 2), (1,2) IN (SELECT NULL, 2); null null SELECT (1,2) = (SELECT NULL, 1), (1,2) IN (SELECT NULL, 1); (1,2) = (SELECT NULL, 1) (1,2) IN (SELECT NULL, 1) -false false +0 0 SELECT (1,2) = (SELECT 1, 1), (1,2) IN (SELECT 1, 1); (1,2) = (SELECT 1, 1) (1,2) IN (SELECT 1, 1) -false false +0 0 SELECT (1,2) = (SELECT 1, 2), (1,2) IN (SELECT 1, 2); (1,2) = (SELECT 1, 2) (1,2) IN (SELECT 1, 2) -true true +1 1 create table t_out (subcase char(3),a1 char(2), b1 char(2), c1 char(2)); create table t_in (a2 char(2), b2 char(2), c2 char(2)); insert into t_out values ('A.1','2a', NULL, '2a'); @@ -556,7 +556,7 @@ select subcase, (a1, b1, c1) NOT IN (select * from t_in where a2 = 'no_match') pred_not_in from t_out where subcase = 'A.1'; subcase pred_in pred_not_in -A.1 false true +A.1 0 1 select subcase, (a1, b1, c1) IN (select * from t_in) pred_in, (a1, b1, c1) NOT IN (select * from t_in) pred_not_in @@ -568,19 +568,19 @@ select subcase, (a1, b1, c1) NOT IN (select * from t_in) pred_not_in from t_out where subcase = 'A.4'; subcase pred_in pred_not_in -A.4 false true +A.4 0 1 select subcase, (a1, b1, c1) IN (select * from t_in where a2 = 'no_match') pred_in, (a1, b1, c1) NOT IN (select * from t_in where a2 = 'no_match') pred_not_in from t_out where subcase = 'B.1'; subcase pred_in pred_not_in -B.1 false true +B.1 0 1 select subcase, (a1, b1, c1) IN (select * from t_in) pred_in, (a1, b1, c1) NOT IN (select * from t_in) pred_not_in from t_out where subcase = 'B.2'; subcase pred_in pred_not_in -B.2 true false +B.2 1 0 select subcase, (a1, b1, c1) IN (select * from t_in) pred_in, (a1, b1, c1) NOT IN (select * from t_in) pred_not_in @@ -592,7 +592,7 @@ select subcase, (a1, b1, c1) NOT IN (select * from t_in) pred_not_in from t_out where subcase = 'B.4'; subcase pred_in pred_not_in -B.4 false true +B.4 0 1 select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out where subcase = 'A.1' and (a1, b1, c1) IN (select * from t_in where a1 = 'no_match'); @@ -929,10 +929,10 @@ CREATE TABLE t2 (placeholder CHAR(11)); INSERT INTO t2 VALUES("placeholder"); SELECT (1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a; (1, 2) IN (SELECT t1.a, 2) -true +1 SELECT (1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a; (1, 2) IN (SELECT t1.a, 2 FROM t2) -true +1 DROP TABLE IF EXISTS t1; drop table if exists t2; CREATE TABLE t1 (a INT); @@ -988,9 +988,9 @@ create table t3 (a int, oref int); insert into t3 values (1, 1), (NULL,1), (NULL,0); select a, oref,t3.a in (select t1.a from t1, t2 where t1.b=t2.a and t2.b=t3.oref) Z from t3; a oref Z -1 1 true +1 1 1 null 1 null -null 0 false +null 0 0 DROP TABLE IF EXISTS t1; drop table if exists t2; drop table if exists t3; @@ -1003,9 +1003,9 @@ create table t3 (a int, oref int); insert into t3 values (1, 1), (NULL,1), (NULL,0); select a, oref,t3.a in (select t1.a from t1, t2 where t1.b=t2.a and t2.b=t3.oref) Z from t3; a oref Z -1 1 true +1 1 1 null 1 null -null 0 false +null 0 0 DROP TABLE IF EXISTS t1; drop table if exists t2; drop table if exists t3; @@ -1023,16 +1023,16 @@ create table t2 (a int, b int); insert into t2 values (1,1),(2,1),(NULL,1),(NULL,0); select a,b, a in (select a from t1 where t1.b = t2.b union select a from t1 where t1.b = t2.b) Z from t2 ; a b z -1 1 true -2 1 false +1 1 1 +2 1 0 null 1 null -null 0 false +null 0 0 select a,b, a in (select a from t1 where t1.b = t2.b) Z from t2 ; a b Z -1 1 true -2 1 false +1 1 1 +2 1 0 null 1 null -null 0 false +null 0 0 DROP TABLE IF EXISTS t1; drop table if exists t2; drop table if exists t3; @@ -1047,7 +1047,7 @@ create table t4 (x int); insert into t4 select A.a + 10*B.a from t1 A, t1 B; select a,b, oref, (a,b) in (select a,b from t1 where c=t2.oref) z from t2; a b oref z -null 1 100 false +null 1 100 0 null 2 100 null DROP TABLE IF EXISTS t1; drop table if exists t2; @@ -1074,11 +1074,11 @@ insert into t2 values('ee', NULL),('bb', 2),('ff', 2),('cc', 3),('aa', 1),('dd', select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2; oref a Z ee null null -bb 2 false -ff 2 true +bb 2 0 +ff 2 1 cc 3 null -aa 1 true -dd null false +aa 1 1 +dd null 0 bb null null select oref, a from t2 where a in (select ie from t1 where oref=t2.oref); oref a @@ -1091,11 +1091,11 @@ dd null select oref, a, a in (select min(ie) from t1 where oref=t2.oref group by grp) Z from t2; oref a Z ee null null -bb 2 false -ff 2 false +bb 2 0 +ff 2 0 cc 3 null -aa 1 true -dd null false +aa 1 1 +dd null 0 bb null null select oref, a from t2 where a in (select min(ie) from t1 where oref=t2.oref group by grp); oref a @@ -1109,11 +1109,11 @@ update t1 set ie=3 where oref='ff' and ie=1; select oref, a, a in (select min(ie) from t1 where oref=t2.oref group by grp) Z from t2; oref a Z ee null null -bb 2 false -ff 2 true +bb 2 0 +ff 2 1 cc 3 null -aa 1 true -dd null false +aa 1 1 +dd null 0 bb null null select oref, a from t2 where a in (select min(ie) from t1 where oref=t2.oref group by grp); oref a @@ -1125,12 +1125,12 @@ bb 2 dd null select oref, a, a in (select min(ie) from t1 where oref=t2.oref group by grp having min(ie) > 1) Z from t2; oref a Z -ee null false -bb 2 false -ff 2 true -cc 3 false -aa 1 false -dd null false +ee null 0 +bb 2 0 +ff 2 1 +cc 3 0 +aa 1 0 +dd null 0 bb null null select oref, a from t2 where a in (select min(ie) from t1 where oref=t2.oref group by grp having min(ie) > 1); oref a @@ -1151,12 +1151,12 @@ insert into t2 values('ee', NULL, 1),('bb', 2, 1), ('ff', 2, 2),('cc', 3, NULL), select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2; oref a b Z ee null 1 null -bb 2 1 false -ff 2 2 true +bb 2 1 0 +ff 2 2 1 cc 3 null null bb null null null -aa 1 1 true -dd 1 null false +aa 1 1 1 +dd 1 null 0 select oref, a, b from t2 where (a,b) in (select ie1,ie2 from t1 where oref=t2.oref); oref a b ff 2 2 @@ -1167,13 +1167,13 @@ bb 2 1 dd 1 null select oref, a, b,(a,b) in (select min(ie1),max(ie2) from t1 where oref=t2.oref group by grp) Z from t2; oref a b Z -ee null 1 false -bb 2 1 false -ff 2 2 false +ee null 1 0 +bb 2 1 0 +ff 2 2 0 cc 3 null null bb null null null -aa 1 1 true -dd 1 null false +aa 1 1 1 +dd 1 null 0 select oref, a, b from t2 where (a,b) in (select min(ie1), max(ie2) from t1 where oref=t2.oref group by grp); oref a b aa 1 1 @@ -1191,12 +1191,12 @@ create table t2 (oref char(4), a int); insert into t2 values ('ee', NULL),('bb', 2),('cc', 5),('cc', 2),('cc', NULL),('aa', 1),('bb', NULL); select oref, a, a in (select ie from t1 where oref=t2.oref) z from t2; oref a z -ee null false -bb 2 false -cc 5 true -cc 2 false +ee null 0 +bb 2 0 +cc 5 1 +cc 2 0 cc null null -aa 1 true +aa 1 1 bb null null select oref, a from t2 where a in (select ie from t1 where oref=t2.oref); oref a @@ -1209,12 +1209,12 @@ bb 2 cc 2 select oref, a, a in (select min(ie) from t1 where oref=t2.oref group by grp) z from t2; oref a z -ee null false -bb 2 false -cc 5 true -cc 2 false +ee null 0 +bb 2 0 +cc 5 1 +cc 2 0 cc null null -aa 1 true +aa 1 1 bb null null DROP TABLE IF EXISTS t1; drop table if exists t2; @@ -1244,10 +1244,10 @@ null 1 SELECT (t1.id IN (SELECT t2.id FROM t2,t3 WHERE t3.name='xxx' AND t2.id=t3.id)) AS x FROM t1; x -false -false -false -false +0 +0 +0 +0 DROP TABLE IF EXISTS t1; drop table if exists t2; drop table if exists t3; @@ -1508,29 +1508,29 @@ SELECT (NULL, NULL) IN (SELECT 1,1 FROM t1); null SELECT (NULL OR 1) IN (SELECT 1 FROM t1); (null or 1) in (select 1 from t1) -true +1 SELECT (NULL IS NULL) IN (SELECT 1 FROM t1); (null is null) in (select 1 from t1) -true +1 DELETE FROM t1; SELECT NULL IN (SELECT 1 FROM t1); NULL IN (SELECT 1 FROM t1) -false +0 SELECT (NULL AND 1) IN (SELECT 1 FROM t1); (null and 1) in (select 1 from t1) -false +0 SELECT (NULL, 1) IN (SELECT 1,1 FROM t1); (NULL, 1) IN (SELECT 1,1 FROM t1) -false +0 SELECT (NULL, NULL) IN (SELECT 1,1 FROM t1); (NULL, NULL) IN (SELECT 1,1 FROM t1) -false +0 SELECT (NULL OR 1) IN (SELECT 1 FROM t1); (null or 1) in (select 1 from t1) -false +0 SELECT (NULL IS NULL) IN (SELECT 1 FROM t1); (null is null) in (select 1 from t1) -false +0 DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a INTEGER); INSERT INTO t1 VALUES (1), (2), (3); diff --git a/test/distributed/cases/system/system.result b/test/distributed/cases/system/system.result index 91a1387785301..ffe69f2cce772 100644 --- a/test/distributed/cases/system/system.result +++ b/test/distributed/cases/system/system.result @@ -1,9 +1,9 @@ select mo_cpu("total") >= mo_cpu("available"); mo_cpu(total) >= mo_cpu(available) -true +1 select mo_memory("total") >= mo_memory("available"); mo_memory(total) >= mo_memory(available) -true +1 select * from information_schema.files limit 1; file_id file_name file_type tablespace_name table_catalog table_schema table_name logfile_group_name logfile_group_number engine fulltext_keys deleted_rows update_count free_extents total_extents extent_size initial_size maximum_size autoextend_size creation_time last_update_time last_access_time recover_time transaction_counter version row_format table_rows avg_row_length data_length max_data_length index_length data_free create_time update_time check_time checksum status extra use system; diff --git a/test/distributed/cases/system_variable/system_variables.result b/test/distributed/cases/system_variable/system_variables.result index 87714d84bd6c5..12f777a9e13fc 100644 --- a/test/distributed/cases/system_variable/system_variables.result +++ b/test/distributed/cases/system_variable/system_variables.result @@ -6,6 +6,12 @@ set max_allowed_packet = default; set wait_timeout = default; set tx_isolation = default; set tx_isolation = default; +show variables like 'server_id'; +Variable_name Value +server_id uuid +select @@server_id; +@@server_id +uuid show variables like 'auto%'; Variable_name Value auto_generate_certs on @@ -79,7 +85,7 @@ show variables where variable_name like 'system%' and variable_name != 'system_t Variable_name Value select @@system_time_zone != ''; @@system_time_zone != -true +1 show variables like 'trans%'; Variable_name Value transaction_alloc_block_size 8192 diff --git a/test/distributed/cases/system_variable/system_variables.sql b/test/distributed/cases/system_variable/system_variables.sql index 0b5fdd909a223..1ad3866151c77 100644 --- a/test/distributed/cases/system_variable/system_variables.sql +++ b/test/distributed/cases/system_variable/system_variables.sql @@ -11,6 +11,10 @@ set max_allowed_packet = default; set wait_timeout = default; set tx_isolation = default; set tx_isolation = default; +-- @ignore:1 +show variables like 'server_id'; +-- @ignore:0 +select @@server_id; -- auto_increment_increment diff --git a/test/distributed/cases/table/cluster_table/cluster_table.result b/test/distributed/cases/table/cluster_table/cluster_table.result index 0ddfe414bbe3c..a71d30c5b18fd 100644 --- a/test/distributed/cases/table/cluster_table/cluster_table.result +++ b/test/distributed/cases/table/cluster_table/cluster_table.result @@ -149,22 +149,22 @@ update cluster_table_2 set account_id=(select account_id from mo_account where a update cluster_table_2 set account_id=(select account_id from mo_account where account_name="test_account2") where account_id=2; select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_2; col1 col2 col3 col4 col5 col6 col7 col8 col9 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 use mo_catalog; select * from cluster_table_2; col1 col2 col3 col4 col5 col6 col7 col8 col9 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 use mo_catalog; select * from cluster_table_2; col1 col2 col3 col4 col5 col6 col7 col8 col9 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 drop table cluster_table_2; drop table if exists cluster_table_3; create cluster table cluster_table_3( @@ -188,99 +188,99 @@ update cluster_table_3 set account_id=(select account_id from mo_account where a update cluster_table_3 set account_id=(select account_id from mo_account where account_name="test_account2") where account_id=2; select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 update cluster_table_3 set col1=100 where account_id=0 and col1=1; select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 update cluster_table_3 set col1=100 where account_id=(select account_id from mo_account where account_name="test_account1") and col1=1; select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -1 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 +1 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 update cluster_table_3 set col1=100 where account_id=(select account_id from mo_account where account_name="test_account2") and col1=1; select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar delete from cluster_table_3 where account_id=0; select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar delete from cluster_table_3 where account_id=(select account_id from mo_account where account_name="test_account1"); select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 use mo_catalog; select * from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 -2 10.9 13 2022-10-02 true {"b": 2} nihao 文本 字符 -100 1.09 1 2022-10-02 false {"a": 1} 你好 text varchar +2 10.9 13 2022-10-02 1 {"b": 2} nihao 文本 字符 +100 1.09 1 2022-10-02 0 {"a": 1} 你好 text varchar delete from cluster_table_3 where account_id=(select account_id from mo_account where account_name="test_account2"); select col1,col2,col3,col4,col5,col6,col7,col8,col9 from cluster_table_3; col1 col2 col3 col4 col5 col6 col7 col8 col9 diff --git a/test/distributed/cases/table/external_table.result b/test/distributed/cases/table/external_table.result index aca7f768412ad..6710aa87833af 100644 --- a/test/distributed/cases/table/external_table.result +++ b/test/distributed/cases/table/external_table.result @@ -147,10 +147,10 @@ char_1 char_2 date_1 date_2 date_3 create external table ex_table_31(clo1 tinyint default 8,clo2 smallint null,clo3 int not null,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255),col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 varchar(255),col19 varchar(255),col20 varchar(255),primary key(clo1))infile{"filepath"='$resources/external_table_file/ex_table_3_6.csv'} fields terminated by ','; select clo1,clo2,clo3,clo4,clo5,clo6,clo7,clo8,col9,col10,col11,col12,col13,col15,col16,col17,col18,col19,col20 from ex_table_31; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col15 col16 col17 col18 col19 col20 -1 11 1 2 15 600 700 56 3.4365 5.559 math 2020-04-30 1998-08-07 00:00:00 true 602.53 abcdefg message s@126.com comment balabalabalabalabala -2 20 3 4 21 220 1 3 7.2914 6.5836 art 2020-02-22 1998-06-04 00:00:00 false 878.09 abcdefg message r@sina.com aaaabbbbbbccccc -3 9 null 20 1 500 2 4 1.1559 6.5635 english 2020-02-16 1998-01-21 23:59:59 true 439.95 EF,GHI,G;KL/MN?OPQR.STU-_+=VWXYZabcdefgh OPQR.STU-_+=VWXYZa U-_+=VWXYZabcdefghigklmno .STU-_+=VWXYZab -3 20 null 7 1 700 600 20 7.2914 1.1732 science 2020-05-08 1998-12-30 00:00:00 false 428.14 U-_+=VWXYZabcdefghigklmnopqrstuvwxy L/MN?OPQR.STU-_+=VWXYZabcdefghigklmnopqrstuvwxyz012 r@sina.com bbbbbbccccc +1 11 1 2 15 600 700 56 3.4365 5.559 math 2020-04-30 1998-08-07 00:00:00 1 602.53 abcdefg message s@126.com comment balabalabalabalabala +2 20 3 4 21 220 1 3 7.2914 6.5836 art 2020-02-22 1998-06-04 00:00:00 0 878.09 abcdefg message r@sina.com aaaabbbbbbccccc +3 9 null 20 1 500 2 4 1.1559 6.5635 english 2020-02-16 1998-01-21 23:59:59 1 439.95 EF,GHI,G;KL/MN?OPQR.STU-_+=VWXYZabcdefgh OPQR.STU-_+=VWXYZa U-_+=VWXYZabcdefghigklmno .STU-_+=VWXYZab +3 20 null 7 1 700 600 20 7.2914 1.1732 science 2020-05-08 1998-12-30 00:00:00 0 428.14 U-_+=VWXYZabcdefghigklmnopqrstuvwxy L/MN?OPQR.STU-_+=VWXYZabcdefghigklmnopqrstuvwxyz012 r@sina.com bbbbbbccccc create external table ex_table_4(clo1 tinyint,clo2 smallint,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255),col12 Date, col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 varchar(255),col19 varchar(255),col20 varchar(255))infile{"filepath"='$resources/external_table_file/ex_table_sep_1.csv'} fields terminated by '|' enclosed by '\"' lines terminated by '\n'; select clo1,clo5,clo7,col12,col13,col16,col17,col18 from ex_table_4; diff --git a/test/distributed/cases/table/truncate_table_2.result b/test/distributed/cases/table/truncate_table_2.result index a7ede88e8ae85..a91f98aea4aac 100644 --- a/test/distributed/cases/table/truncate_table_2.result +++ b/test/distributed/cases/table/truncate_table_2.result @@ -9,10 +9,10 @@ insert into trun_table_01 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2 insert into trun_table_01 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 209.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_01; select * from trun_table_01; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 @@ -23,15 +23,15 @@ insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11 insert into trun_table_01(clo2 ,clo3 ,clo4,clo5,clo6,clo7,clo8 ,col9,col10,col11,col12,col13,col14,col15,col16,col17,col18) values (-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,11.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 54.30 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 11.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} update trun_table_01 set clo3=90 ,col12='2011-01-21' where clo1=1; Duplicate entry '3a155a41170b33cd' for key '__mo_cpkey_004clo3005col12' update trun_table_01 set clo3=66 ,col12='2011-01-21' where clo1=1; select * from trun_table_01; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 11.43 tttext {"a": "3", "b": [0, 1, 2]} -1 -2 66 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 54.30 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 11.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 66 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 54.30 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_01; select * from trun_table_01; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 @@ -52,7 +52,7 @@ create table trun_table_01(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,cl insert into trun_table_01 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_01; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} create temporary table trun_table_02(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json,primary key(clo3,col12),unique key uk1 (col16),key k1 (clo1)); insert into trun_table_02 values (1,-2,3,56,9,8,10,50,99.0,82.99,'yellllow','1999-11-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,23.98430943,'tttext','{"a": "3","b": [0,1,2]}'); insert into trun_table_02 values (2,-2,90,56,9,8,10,50,99.0,82.99,'yellllow','2011-01-21','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,98.23,'tttext','{"a": "3","b": [0,1,2]}'); @@ -60,10 +60,10 @@ insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2 insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,209.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 98.23 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 77.30 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 209.43 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 98.23 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 77.30 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 209.43 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 @@ -72,27 +72,27 @@ insert into trun_table_02 values (3,-2,100,56,9,8,10,50,99.0,82.99,'yellllow','2 insert into trun_table_02 values (4,-2,102,56,9,8,10,50,99.0,82.99,'yellllow','2022-10-11','1999-11-11 12:00:00','2010-11-11 11:00:00.00',false,2.43,'tttext','{"a": "3","b": [0,1,2]}'); select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 2.43 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 2.43 tttext {"a": "3", "b": [0, 1, 2]} delete from trun_table_02 where clo1=3; select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 2.43 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 2.43 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 insert into trun_table_02 select * from trun_table_01; select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90 where clo1=1; select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} update trun_table_02 set clo3=90, col12='1992-11-01' where clo1=1; select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 90 56 9 8 10 50 99.0 82.99 yellllow 1992-11-01 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_02; select * from trun_table_02; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 @@ -100,17 +100,17 @@ drop table trun_table_02; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; select * from trun_table_03; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; select * from trun_table_03; clo1 clo2 clo3 clo4 clo5 clo6 clo7 clo8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 -1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} -4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 false 23.98 tttext {"a": "3", "b": [0, 1, 2]} +1 -2 3 56 9 8 10 50 99.0 82.99 yellllow 1999-11-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +2 -2 90 56 9 8 10 50 99.0 82.99 yellllow 2011-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +3 -2 100 56 9 8 10 50 99.0 82.99 yellllow 2021-01-21 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} +4 -2 102 56 9 8 10 50 99.0 82.99 yellllow 2022-10-11 1999-11-11 12:00:00 2010-11-11 11:00:00 0 23.98 tttext {"a": "3", "b": [0, 1, 2]} truncate table trun_table_03; drop table trun_table_03; create external table trun_table_03(clo1 tinyint AUTO_INCREMENT,clo2 smallint not null,clo3 int,clo4 bigint,clo5 tinyint unsigned,clo6 smallint unsigned,clo7 int unsigned,clo8 bigint unsigned,col9 float,col10 double,col11 varchar(255) default 'style',col12 Date,col13 DateTime,col14 timestamp,col15 bool,col16 decimal(5,2),col17 text,col18 json)infile{"filepath"='$resources/external_table_file/trun_table.csv'} fields terminated by '|' lines terminated by '\n'; diff --git a/test/distributed/cases/util/fault.result b/test/distributed/cases/util/fault.result index 59337f585cd1c..8889dbfe3e9c1 100644 --- a/test/distributed/cases/util/fault.result +++ b/test/distributed/cases/util/fault.result @@ -1,12 +1,12 @@ select disable_fault_injection(); disable_fault_injection() -true +1 select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('ret', ':::', 'return', 0, ''); add_fault_point(ret, :::, return, 0, ) -true +1 select trigger_fault_point('ret'); trigger_fault_point(ret) 0 @@ -18,10 +18,10 @@ trigger_fault_point(ret) 0 select add_fault_point('cnt', ':::', 'getcount', 0, 'ret'); add_fault_point(cnt, :::, getcount, 0, ret) -true +1 select trigger_fault_point('cnt'); trigger_fault_point(cnt) 3 select disable_fault_injection(); disable_fault_injection() -true +1 diff --git a/test/distributed/cases/view/system_view.result b/test/distributed/cases/view/system_view.result index db58aa24d711d..0f5f70bd73511 100644 --- a/test/distributed/cases/view/system_view.result +++ b/test/distributed/cases/view/system_view.result @@ -4,26 +4,26 @@ sleep(5) 0 select count(*) > 0 from mo_sessions() t; count(*) > 0 -true +1 select count(*) > 0 from mo_sessions() as t where txn_id != ''; count(*) > 0 -true +1 select count(*) > 0 from mo_transactions() t join mo_sessions() s on t.txn_id = s.txn_id; count(*) > 0 -true +1 commit; select count(*) > 0 from mo_cache() c; count(*) > 0 -true +1 select count(*) >0 from mo_configurations() t; count(*) > 0 -true +1 select count(*) >0 from mo_configurations() t where node_type = 'cn'; count(*) > 0 -true +1 select distinct node_type,default_value from mo_configurations() t where name like '%frontend.port'; node_type default_value cn 6001 select count(*) > 0 from mo_configurations() t where internal = 'advanced'; count(*) > 0 -true +1 diff --git a/test/distributed/cases/view/view-subquery-with-any.result b/test/distributed/cases/view/view-subquery-with-any.result index dcb546b4ffdf3..edbed2a67c940 100644 --- a/test/distributed/cases/view/view-subquery-with-any.result +++ b/test/distributed/cases/view/view-subquery-with-any.result @@ -107,37 +107,37 @@ insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); select s1, s1 = ANY (SELECT s1 FROM t2) from t1; s1 s1 = any (select s1 from t2) -a1 true -a2 true -a3 false +a1 1 +a2 1 +a3 0 select s1, s1 < ANY (SELECT s1 FROM t2) from t1; s1 s1 < any (select s1 from t2) -a1 true -a2 false -a3 false +a1 1 +a2 0 +a3 0 select s1, s1 = ANY (SELECT s1 FROM t2) from t1; s1 s1 = any (select s1 from t2) -a1 true -a2 true -a3 false +a1 1 +a2 1 +a3 0 create view v1 as select s1, s1 = ANY (SELECT s1 FROM t2) from t1; create view v2 as select s1, s1 < ANY (SELECT s1 FROM t2) from t1; create view v3 as select s1, s1 = ANY (SELECT s1 FROM t2) from t1; select * from v1; s1 s1 = any (select s1 from t2) -a1 true -a2 true -a3 false +a1 1 +a2 1 +a3 0 select * from v2; s1 s1 < any (select s1 from t2) -a1 true -a2 false -a3 false +a1 1 +a2 0 +a3 0 select * from v3; s1 s1 = any (select s1 from t2) -a1 true -a2 true -a3 false +a1 1 +a2 1 +a3 0 drop view v1; drop view v2; drop view v3; @@ -540,10 +540,10 @@ select (select 1,2) = (select * from t1); [unknown result because it is related to issue#7691] select (1,2) = ANY (select * from t1); (1, 2) = any (select * from t1) -false +0 select (1,2) != ALL (select * from t1); (1, 2) != all (select * from t1) -true +1 create view v1 as select (select * from t1) = (select 1,2); [unknown result because it is related to issue#7691] create view v2 as select (select 1,2) = (select * from t1); @@ -556,10 +556,10 @@ select * from v2; [unknown result because it is related to issue#7691] select * from v3; (1, 2) = any (select * from t1) -false +0 select * from v4; (1, 2) != all (select * from t1) -true +1 drop view v1; [unknown result because it is related to issue#7691] drop view v2; @@ -960,7 +960,7 @@ select 1 > ANY (SELECT * from t1); null select 10 > ANY (SELECT * from t1); 10 > any (select * from t1) -true +1 create view v1 as select 1 > ANY (SELECT * from t1); create view v2 as select 10 > ANY (SELECT * from t1); select * from v1; @@ -968,7 +968,7 @@ select * from v1; null select * from v2; 10 > any (select * from t1) -true +1 drop view v1; drop view v2; DROP TABLE IF EXISTS t1; @@ -980,7 +980,7 @@ A > any (select * from t1) null select 'XYZS' > ANY (SELECT * from t1); XYZS > any (select * from t1) -true +1 create view v1 as select 'A' > ANY (SELECT * from t1); create view v2 as select 'XYZS' > ANY (SELECT * from t1); select * from v1; @@ -988,7 +988,7 @@ A > any (select * from t1) null select * from v2; XYZS > any (select * from t1) -true +1 drop view v1; drop view v2; DROP TABLE IF EXISTS t1; @@ -1000,7 +1000,7 @@ select 1.5 > ANY (SELECT * from t1); null select 10.5 > ANY (SELECT * from t1); 10.5 > any (select * from t1) -true +1 create view v1 as select 1.5 > ANY (SELECT * from t1); create view v2 as select 10.5 > ANY (SELECT * from t1); select * from v1; @@ -1008,7 +1008,7 @@ select * from v1; null select * from v2; 10.5 > any (select * from t1) -true +1 drop view v1; drop view v2; DROP TABLE IF EXISTS t1; diff --git a/test/distributed/cases/view/view-subquery-with-exists.result b/test/distributed/cases/view/view-subquery-with-exists.result index 35e79914c2ff9..4006da3b63d54 100644 --- a/test/distributed/cases/view/view-subquery-with-exists.result +++ b/test/distributed/cases/view/view-subquery-with-exists.result @@ -1,10 +1,10 @@ SELECT EXISTS(SELECT 1+1); exists (select 1 + 1) -true +1 create view v1 as SELECT EXISTS(SELECT 1+1); select * from v1; exists (select 1 + 1) -true +1 drop view v1; drop table if exists t1; drop table if exists t2; @@ -549,37 +549,37 @@ CREATE TABLE t1 ( a int, b int ); INSERT INTO t1 VALUES (1,1),(2,2),(3,3); SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a) IS NULL from t1 a; exists (select a from t1 where b = 2 and a.a > t1.a) is null -false -false -false +0 +0 +0 SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a) IS NOT NULL from t1 a; exists (select a from t1 where b = 2 and a.a < t1.a) is not null -true -true -true +1 +1 +1 SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a) IS NULL from t1 a; exists (select a from t1 where b = 2 and a.a = t1.a) is null -false -false -false +0 +0 +0 create view v1 as SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a) IS NULL from t1 a; create view v2 as SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a) IS NOT NULL from t1 a; create view v3 as SELECT EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a) IS NULL from t1 a; select * from v1; exists (select a from t1 where b = 2 and a.a > t1.a) is null -false -false -false +0 +0 +0 select * from v2; exists (select a from t1 where b = 2 and a.a < t1.a) is not null -true -true -true +1 +1 +1 select * from v3; exists (select a from t1 where b = 2 and a.a = t1.a) is null -false -false -false +0 +0 +0 drop view v1; drop view v2; drop view v3; diff --git a/test/distributed/cases/view/view-subquery-with-in.result b/test/distributed/cases/view/view-subquery-with-in.result index 793c9a78e04c7..49f6111c2921f 100644 --- a/test/distributed/cases/view/view-subquery-with-in.result +++ b/test/distributed/cases/view/view-subquery-with-in.result @@ -1,10 +1,10 @@ SELECT 1 IN (SELECT 1); 1 in (select 1) -true +1 create view v1 as SELECT 1 IN (SELECT 1); select * from v1; 1 in (select 1) -true +1 drop view v1; SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); 1 @@ -46,11 +46,11 @@ drop view v3; invalid view 'view-subquery-with-in.v3' SELECT ((0,1) NOT IN (SELECT NULL,1)) IS NULL; ((0, 1) not in (select null, 1)) is null -true +1 create view v1 as SELECT ((0,1) NOT IN (SELECT NULL,1)) IS NULL; select * from v1; ((0, 1) not in (select null, 1)) is null -true +1 drop view v1; drop table if exists t1; drop table if exists t2; @@ -83,11 +83,11 @@ drop view v2; drop view v3; SELECT 0 IN (SELECT 1 FROM t1 a); 0 in (select 1 from t1 as a) -false +0 create view v1 as SELECT 0 IN (SELECT 1 FROM t1 a); select * from v1; 0 in (select 1 from t1 as a) -false +0 drop view v1; select * from t3 where a in (select a,b from t2); invalid input: subquery returns more than 1 column @@ -114,26 +114,26 @@ insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; s1 s1 not in (select s1 from t2) -a1 false -a2 false -a3 true +a1 0 +a2 0 +a3 1 select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; s1 s1 not in (select s1 from t2 where s1 < a2) -a1 false -a2 true -a3 true +a1 0 +a2 1 +a3 1 create view v1 as select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; create view v2 as select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; select * from v1; s1 s1 not in (select s1 from t2) -a1 false -a2 false -a3 true +a1 0 +a2 0 +a3 1 select * from v2; s1 s1 not in (select s1 from t2 where s1 < a2) -a1 false -a2 true -a3 true +a1 0 +a2 1 +a3 1 drop view v1; drop view v2; drop table if exists t1; @@ -221,15 +221,15 @@ CREATE TABLE t2(a int); INSERT INTO t2 VALUES (1),(2),(3); SELECT a, a IN (SELECT a FROM t1) FROM t2; a a in (select a from t1) -1 true +1 1 2 null -3 true +3 1 create view v1 as SELECT a, a IN (SELECT a FROM t1) FROM t2; select * from v1; a a in (select a from t1) -1 true +1 1 2 null -3 true +3 1 drop view v1; drop table if exists t1; drop table if exists t2; @@ -422,10 +422,10 @@ create table t3 (a int); insert into t3 values (NULL), (NULL); select a, oref, a in (select max(ie) from t1 where oref=t2.oref group by grp) Z from t2; a oref z -1 1 true -2 2 false +1 1 1 +2 2 0 3 3 null -null 4 false +null 4 0 null 2 null select a, oref from t2 where a in (select max(ie) from t1 where oref=t2.oref group by grp); a oref @@ -435,15 +435,15 @@ select max(ie) from t1 where oref=t2.oref group by grp union select max(ie) from t1 where oref=t2.oref group by grp ) Z from t2; a oref z -1 1 true -2 2 false +1 1 1 +2 2 0 3 3 null -null 4 false +null 4 0 null 2 null select a in (select max(ie) from t1 where oref=4 group by grp) from t3; a in (select max(ie) from t1 where oref = 4 group by grp) -false -false +0 +0 create view v1 as select a, oref, a in (select max(ie) from t1 where oref=t2.oref group by grp) Z from t2; create view v2 as select a, oref from t2 where a in (select max(ie) from t1 where oref=t2.oref group by grp); create view v3 as select a, oref, a in ( @@ -453,25 +453,25 @@ select max(ie) from t1 where oref=t2.oref group by grp create view v4 as select a in (select max(ie) from t1 where oref=4 group by grp) from t3; select * from v1; a oref z -1 1 true -2 2 false +1 1 1 +2 2 0 3 3 null -null 4 false +null 4 0 null 2 null select * from v2; a oref 1 1 select * from v3; a oref z -1 1 true -2 2 false +1 1 1 +2 2 0 3 3 null -null 4 false +null 4 0 null 2 null select * from v4; a in (select max(ie) from t1 where oref = 4 group by grp) -false -false +0 +0 drop view v1; drop view v2; drop view v3; @@ -535,20 +535,20 @@ create table t1 (a int); insert into t1 values (1),(2),(3); select 1 IN (SELECT * from t1); 1 in (select * from t1) -true +1 select 10 IN (SELECT * from t1); 10 in (select * from t1) -false +0 select NULL IN (SELECT * from t1); null in (select * from t1) null update t1 set a=NULL where a=2; select 1 IN (SELECT * from t1); 1 in (select * from t1) -true +1 select 3 IN (SELECT * from t1); 3 in (select * from t1) -true +1 select 10 IN (SELECT * from t1); 10 in (select * from t1) null @@ -560,7 +560,7 @@ create view v6 as select 3 IN (SELECT * from t1); create view v7 as select 10 IN (SELECT * from t1); select * from v1; 1 in (select * from t1) -true +1 select * from v2; 10 in (select * from t1) null @@ -569,10 +569,10 @@ null in (select * from t1) null select * from v5; 1 in (select * from t1) -true +1 select * from v6; 3 in (select * from t1) -true +1 select * from v7; 10 in (select * from t1) null @@ -587,10 +587,10 @@ create table t1 (a varchar(20)); insert into t1 values ('A'),('BC'),('DEF'); select 'A' IN (SELECT * from t1); A in (select * from t1) -true +1 select 'XYZS' IN (SELECT * from t1); XYZS in (select * from t1) -false +0 select NULL IN (SELECT * from t1); null in (select * from t1) null @@ -599,10 +599,10 @@ create view v2 as select 'XYZS' IN (SELECT * from t1); create view v3 as select NULL IN (SELECT * from t1); select * from v1; A in (select * from t1) -true +1 select * from v2; XYZS in (select * from t1) -false +0 select * from v3; null in (select * from t1) null @@ -612,10 +612,10 @@ drop view v3; update t1 set a=NULL where a='BC'; select 'A' IN (SELECT * from t1); A in (select * from t1) -true +1 select 'DEF' IN (SELECT * from t1); DEF in (select * from t1) -true +1 select 'XYZS' IN (SELECT * from t1); XYZS in (select * from t1) null @@ -624,10 +624,10 @@ create view v2 as select 'DEF' IN (SELECT * from t1); create view v3 as select 'XYZS' IN (SELECT * from t1); select * from v1; A in (select * from t1) -true +1 select * from v2; DEF in (select * from t1) -true +1 select * from v3; XYZS in (select * from t1) null @@ -639,10 +639,10 @@ create table t1 (a float); insert into t1 values (1.5),(2.5),(3.5); select 1.5 IN (SELECT * from t1); 1.5 in (select * from t1) -true +1 select 10.5 IN (SELECT * from t1); 10.5 in (select * from t1) -false +0 select NULL IN (SELECT * from t1); null in (select * from t1) null @@ -651,10 +651,10 @@ create view v2 as select 10.5 IN (SELECT * from t1); create view v3 as select NULL IN (SELECT * from t1); select * from v1; 1.5 in (select * from t1) -true +1 select * from v2; 10.5 in (select * from t1) -false +0 select * from v3; null in (select * from t1) null @@ -664,10 +664,10 @@ drop view v3; update t1 set a=NULL where a=2.5; select 1.5 IN (SELECT * from t1); 1.5 in (select * from t1) -true +1 select 3.5 IN (SELECT * from t1); 3.5 in (select * from t1) -true +1 select 10.5 IN (SELECT * from t1); 10.5 in (select * from t1) null @@ -676,10 +676,10 @@ create view v2 as select 3.5 IN (SELECT * from t1); create view v3 as select 10.5 IN (SELECT * from t1); select * from v1; 1.5 in (select * from t1) -true +1 select * from v2; 3.5 in (select * from t1) -true +1 select * from v3; 10.5 in (select * from t1) null @@ -697,30 +697,30 @@ INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; a t1.a in (select t2.a from t2) -1 true -2 true -3 true -4 false +1 1 +2 1 +3 1 +4 0 SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; a t1.a in (select t2.a from t2 cross join t3 where t3.a = t2.a) -1 true -2 true -3 true -4 false +1 1 +2 1 +3 1 +4 0 create view v1 as SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; create view v2 as SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; select * from v1; a t1.a in (select t2.a from t2) -1 true -2 true -3 true -4 false +1 1 +2 1 +3 1 +4 0 select * from v2; a t1.a in (select t2.a from t2 cross join t3 where t3.a = t2.a) -1 true -2 true -3 true -4 false +1 1 +2 1 +3 1 +4 0 drop view v1; drop view v2; drop table if exists t1; @@ -740,23 +740,23 @@ DROP TABLE IF EXISTS t1; create table t1 (a float); select 10.5 IN (SELECT * from t1 LIMIT 1); 10.5 in (select * from t1 limit 1) -false +0 select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); [unknown result because it is related to issue#4354] select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); 10.5 in (select * from t1 union select 1.5 limit 1) -false +0 create view v1 as select 10.5 IN (SELECT * from t1 LIMIT 1); create view v2 as select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); create view v3 as select 10.5 IN (SELECT * from t1 UNION SELECT 1.5 LIMIT 1); select * from v1; 10.5 in (select * from t1 limit 1) -false +0 select * from v2; [unknown result because it is related to issue#4354] select * from v3; 10.5 in (select * from t1 union select 1.5 limit 1) -false +0 drop view v1; drop view v2; drop view v3; @@ -765,34 +765,34 @@ create table t1 (a int, b real, c varchar(10)); insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); select (1, 1, 'a') IN (select a,b,c from t1); (1, 1, a) in (select a, b, c from t1) -true +1 select (1, 2, 'a') IN (select a,b,c from t1); (1, 2, a) in (select a, b, c from t1) -false +0 select (1, 1, 'a') IN (select b,a,c from t1); (1, 1, a) in (select b, a, c from t1) -true +1 select (1, 1, 'a') IN (select a,b,c from t1 where a is not null); (1, 1, a) in (select a, b, c from t1 where a is not null) -true +1 select (1, 2, 'a') IN (select a,b,c from t1 where a is not null); (1, 2, a) in (select a, b, c from t1 where a is not null) -false +0 select (1, 1, 'a') IN (select b,a,c from t1 where a is not null); (1, 1, a) in (select b, a, c from t1 where a is not null) -true +1 select (1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a'); (1, 1, a) in (select a, b, c from t1 where c = b or c = a) -true +1 select (1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a'); (1, 2, a) in (select a, b, c from t1 where c = b or c = a) -false +0 select (1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a'); (1, 1, a) in (select b, a, c from t1 where c = b or c = a) -true +1 select (1, 1, 'a') IN (select b,a,c from t1 limit 2); (1, 1, a) in (select b, a, c from t1 limit 2) -true +1 create view v1 as select (1, 1, 'a') IN (select a,b,c from t1); create view v2 as select (1, 2, 'a') IN (select a,b,c from t1); create view v3 as select (1, 1, 'a') IN (select b,a,c from t1); @@ -805,34 +805,34 @@ create view v9 as select (1, 1, 'a') IN (select b,a,c from t1 where c='b' or c=' create view v10 as select (1, 1, 'a') IN (select b,a,c from t1 limit 2); select * from v1; (1, 1, a) in (select a, b, c from t1) -true +1 select * from v2; (1, 2, a) in (select a, b, c from t1) -false +0 select * from v3; (1, 1, a) in (select b, a, c from t1) -true +1 select * from v4; (1, 1, a) in (select a, b, c from t1 where a is not null) -true +1 select * from v5; (1, 2, a) in (select a, b, c from t1 where a is not null) -false +0 select * from v6; (1, 1, a) in (select b, a, c from t1 where a is not null) -true +1 select * from v7; (1, 1, a) in (select a, b, c from t1 where c = b or c = a) -true +1 select * from v8; (1, 2, a) in (select a, b, c from t1 where c = b or c = a) -false +0 select * from v9; (1, 1, a) in (select b, a, c from t1 where c = b or c = a) -true +1 select * from v10; (1, 1, a) in (select b, a, c from t1 limit 2) -true +1 drop view v1; drop view v2; drop view v3; @@ -879,13 +879,13 @@ INSERT INTO t2 VALUES (101, 201); INSERT INTO t2 VALUES (103, 203); SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1; ((a1, a2) in (select * from t2 where b2 > 0)) is null -false -false +0 +0 create view v1 as SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1; select * from v1; ((a1, a2) in (select * from t2 where b2 > 0)) is null -false -false +0 +0 drop view v1; DROP TABLE IF EXISTS t1; drop table if exists t2; @@ -895,28 +895,28 @@ create table t2 (a int, b int); insert into t2 values (1,1), (3,3); select a, b, (a,b) in (select a, min(b) from t2 group by a) Z from t1; a b z -0 0 false -2 2 false -3 3 true +0 0 0 +2 2 0 +3 3 1 create view v1 as select a, b, (a,b) in (select a, min(b) from t2 group by a) Z from t1; select * from v1; a b z -0 0 false -2 2 false -3 3 true +0 0 0 +2 2 0 +3 3 1 drop view v1; insert into t2 values (NULL,4); select a, b, (a,b) in (select a, min(b) from t2 group by a) Z from t1; a b z -0 0 false -2 2 false -3 3 true +0 0 0 +2 2 0 +3 3 1 create view v1 as select a, b, (a,b) in (select a, min(b) from t2 group by a) Z from t1; select * from v1; a b z -0 0 false -2 2 false -3 3 true +0 0 0 +2 2 0 +3 3 1 drop view v1; DROP TABLE IF EXISTS t1; drop table if exists t2; diff --git a/test/distributed/cases/window/time_window.result b/test/distributed/cases/window/time_window.result index fa659fa9ec724..eec5dff7886cd 100644 --- a/test/distributed/cases/window/time_window.result +++ b/test/distributed/cases/window/time_window.result @@ -26,16 +26,16 @@ insert into time_window02 values ('2023-10-26 10:20:00.000', null); insert into time_window02 values ('2023-10-26 10:30:00.000', true); select * from time_window02; ts col2 -2023-10-26 10:00:00 false -2023-10-26 10:10:00 true +2023-10-26 10:00:00 0 +2023-10-26 10:10:00 1 2023-10-26 10:20:00 null -2023-10-26 10:30:00 true +2023-10-26 10:30:00 1 select _wstart, _wend, max(col2), min(col2) from time_window02 where ts > '2020-01-11 12:00:12.000' and ts < '2024-01-13 00:00:00.000' interval(ts, 10, second) fill(prev); _wstart _wend max(col2) min(col2) -2023-10-26 10:00:00 2023-10-26 10:00:10 false false -2023-10-26 10:10:00 2023-10-26 10:10:10 true true -2023-10-26 10:20:00 2023-10-26 10:20:10 true true -2023-10-26 10:30:00 2023-10-26 10:30:10 true true +2023-10-26 10:00:00 2023-10-26 10:00:10 0 0 +2023-10-26 10:10:00 2023-10-26 10:10:10 1 1 +2023-10-26 10:20:00 2023-10-26 10:20:10 1 1 +2023-10-26 10:30:00 2023-10-26 10:30:10 1 1 drop table time_window02; drop table if exists time_window03; create table time_window03 (ts datetime primary key , col2 int); diff --git a/test/distributed/cases/window/window.result b/test/distributed/cases/window/window.result index f3a34260daa29..606cd8de75af0 100644 --- a/test/distributed/cases/window/window.result +++ b/test/distributed/cases/window/window.result @@ -816,10 +816,10 @@ insert into bool01 values(5, null, null); insert into bool01 values(6, null, '1997-11-10 10:10:10'); select * from bool01; col1 col2 col3 -1 true 2023-05-16 00:12:12 -2 false 1997-01-13 12:12:00 -3 true 2000-10-10 11:11:11 -4 false 1020-10-01 01:01:01 +1 1 2023-05-16 00:12:12 +2 0 1997-01-13 12:12:00 +3 1 2000-10-10 11:11:11 +4 0 1020-10-01 01:01:01 5 null null 6 null 1997-11-10 10:10:10 select rank() over (partition by col2 order by col1), sum(col1) over (partition by col2 order by col3) from bool01; @@ -3858,10 +3858,10 @@ insert into uint_16 values(null, null, null); insert into uint_16 values(65535, null, '1997-11-10 10:10:10'); select * from uint_16; col1 col2 col3 -0 true 2023-05-16 00:12:12 -0 false 1997-01-13 12:12:00 -65535 true 2000-10-10 11:11:11 -4 false 1020-10-01 01:01:01 +0 1 2023-05-16 00:12:12 +0 0 1997-01-13 12:12:00 +65535 1 2000-10-10 11:11:11 +4 0 1020-10-01 01:01:01 null null null 65535 null 1997-11-10 10:10:10 select max(col1) over (partition by col2 order by col1 rows between unbounded preceding and unbounded following) as col1 from uint_16; diff --git a/test/distributed/cases/zz_accesscontrol/account_restricted.result b/test/distributed/cases/zz_accesscontrol/account_restricted.result index f3abf048d3fbd..60df4ebd69aa7 100644 --- a/test/distributed/cases/zz_accesscontrol/account_restricted.result +++ b/test/distributed/cases/zz_accesscontrol/account_restricted.result @@ -229,7 +229,7 @@ update res_test.r_test set c1=5 where c2='h'; delete from res_test.r_test where c1=4; select count(*) > 0 from system.statement_info; count( * ) > 0 -true +1 delete from system.statement_info; internal error: do not have privilege to execute the statement select * from res_test.r_test; diff --git a/test/distributed/cases/zz_accesscontrol/create_account.result b/test/distributed/cases/zz_accesscontrol/create_account.result index 5786e1985cb75..9e78ade8c6092 100644 --- a/test/distributed/cases/zz_accesscontrol/create_account.result +++ b/test/distributed/cases/zz_accesscontrol/create_account.result @@ -1,10 +1,10 @@ set global enable_privilege_cache = off; select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/trace/partitionstate', ':::', 'echo', 20, 'mo_tables'); add_fault_point(fj/trace/partitionstate, :::, echo, 20, mo_tables) -true +1 drop account if exists `test@123456`; drop account if exists testaccount; drop account if exists 123_acc; @@ -288,5 +288,5 @@ drop account if exists account; drop account if exists ccc; select disable_fault_injection(); disable_fault_injection() -true +1 set global enable_privilege_cache = on; diff --git a/test/distributed/cases/zz_accesscontrol/grant_privs_role.result b/test/distributed/cases/zz_accesscontrol/grant_privs_role.result index c5bcc1304a348..e790a21a08d0b 100644 --- a/test/distributed/cases/zz_accesscontrol/grant_privs_role.result +++ b/test/distributed/cases/zz_accesscontrol/grant_privs_role.result @@ -19,26 +19,26 @@ create user testuser IDENTIFIED BY '123456'; grant select,insert,update on table testdb.* to test_role with grant option; select privilege_name,obj_type,privilege_level,with_grant_option from mo_catalog.mo_role_privs where role_name='test_role'; privilege_name obj_type privilege_level with_grant_option -select table d.* true -insert table d.* true -update table d.* true +select table d.* 1 +insert table d.* 1 +update table d.* 1 grant all on account * to test_role; select privilege_name,obj_type,privilege_level,with_grant_option from mo_catalog.mo_role_privs where role_name='test_role'; privilege_name obj_type privilege_level with_grant_option -select table d.* true -insert table d.* true -update table d.* true -account all account * false +select table d.* 1 +insert table d.* 1 +update table d.* 1 +account all account * 0 grant OWNERSHIP on database *.* to test_role; grant OWNERSHIP on table *.* to test_role; select privilege_name,obj_type,privilege_level,with_grant_option from mo_catalog.mo_role_privs where role_name='test_role'; privilege_name obj_type privilege_level with_grant_option -select table d.* true -insert table d.* true -update table d.* true -account all account * false -database ownership database *.* false -table ownership table *.* false +select table d.* 1 +insert table d.* 1 +update table d.* 1 +account all account * 0 +database ownership database *.* 0 +table ownership table *.* 0 grant select,insert,update on testdb.* to test_role; SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 36 near " testdb.* to test_role;"; grant select,insert,update on account * to 'test_role'; @@ -402,15 +402,15 @@ grant select ,insert ,update on table *.* to r1,r2 with grant option; grant select ,insert ,update on table *.* to r1,r2 with grant option; select role_name,obj_type,privilege_name,privilege_level,with_grant_option from mo_catalog.mo_role_privs where role_name in ('r1','r2'); role_name obj_type privilege_name privilege_level with_grant_option -r1 database create table *.* false -r2 database create table *.* false -r1 table table ownership d.t false -r1 table select *.* true -r2 table select *.* true -r1 table insert *.* true -r2 table insert *.* true -r1 table update *.* true -r2 table update *.* true +r1 database create table *.* 0 +r2 database create table *.* 0 +r1 table table ownership d.t 0 +r1 table select *.* 1 +r2 table select *.* 1 +r1 table insert *.* 1 +r2 table insert *.* 1 +r1 table update *.* 1 +r2 table update *.* 1 grant r1,r2 to user1,user2; grant r1,r2 to user1,user2; select user_name,role_name,obj_type,privilege_name,privilege_level from mo_catalog.mo_user_grant,mo_catalog.mo_user,mo_catalog.mo_role_privs where mo_user_grant.user_id=mo_user.user_id and mo_role_privs.role_id=mo_user_grant.role_id and user_name in ('user1','user2') and role_name in ('r1','r2'); diff --git a/test/distributed/cases/zz_accesscontrol/inner_object.result b/test/distributed/cases/zz_accesscontrol/inner_object.result index 89311fe69d0f9..b8b30980e4cae 100644 --- a/test/distributed/cases/zz_accesscontrol/inner_object.result +++ b/test/distributed/cases/zz_accesscontrol/inner_object.result @@ -11,10 +11,10 @@ role_id role_name owner 1 public 0 select enable_fault_injection(); enable_fault_injection() -true +1 select add_fault_point('fj/trace/partitionstate', ':::', 'echo', 20, 'mo_tables'); add_fault_point(fj/trace/partitionstate, :::, echo, 20, mo_tables) -true +1 create account account1 ADMIN_NAME 'admin' IDENTIFIED BY '123456'; select role_id,role_name,owner from mo_catalog.mo_role; role_id role_name owner @@ -86,11 +86,11 @@ rel_version INT UNSIGNED(0) YES null catalog_version INT UNSIGNED(0) YES null select datname, dat_createsql from mo_database; datname dat_createsql -system create database system -system_metrics create database system_metrics +mo_catalog information_schema create database information_schema mysql create database mysql -mo_catalog +system create database system +system_metrics create database system_metrics select relname from mo_tables where relname="sql_statement_total"; relname sql_statement_total @@ -275,7 +275,7 @@ created_time TIMESTAMP(0) YES null comment TEXT(0) YES null select disable_fault_injection(); disable_fault_injection() -true +1 create account ac_1 ADMIN_NAME 'admin' IDENTIFIED BY '111'; create database sys_db1; create table sys_db1.sys_t1(c1 char); @@ -539,14 +539,14 @@ UNIQUE KEY `idx_mocadmin_users_username` (`username`) ); SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'etao' AND table_name = 'users' ORDER BY ORDINAL_POSITION; column_name column_default is_nullable = YES data_type character_maximum_length column_type column_key extra column_comment numeric_precision numeric_scale datetime_precision -id null false VARCHAR 128 VARCHAR(128) PRI null null null -username null true VARCHAR 255 VARCHAR(255) UNI null null null -password null true VARCHAR 512 VARCHAR(512) null null null -user_status null true TINYINT null TINYINT(8) null null null -user_role null true TINYINT null TINYINT(8) null null null -created_at null true DATETIME null DATETIME(0) null null 0 -updated_at null true DATETIME null DATETIME(0) null null 0 -user_source null true TINYINT null TINYINT(8) null null null +id null 0 VARCHAR 128 VARCHAR(128) PRI null null null +username null 1 VARCHAR 255 VARCHAR(255) UNI null null null +password null 1 VARCHAR 512 VARCHAR(512) null null null +user_status null 1 TINYINT null TINYINT(8) null null null +user_role null 1 TINYINT null TINYINT(8) null null null +created_at null 1 DATETIME null DATETIME(0) null null 0 +updated_at null 1 DATETIME null DATETIME(0) null null 0 +user_source null 1 TINYINT null TINYINT(8) null null null drop database etao; drop account if exists acc1; create account acc1 admin_name 'root' identified by '111'; @@ -567,13 +567,13 @@ UNIQUE KEY `idx_mocadmin_users_username` (`username`) ); SELECT column_name, column_default, is_nullable = 'YES', data_type, character_maximum_length, column_type, column_key, extra, column_comment, numeric_precision, numeric_scale , datetime_precision FROM information_schema.columns WHERE table_schema = 'etao' AND table_name = 'users' ORDER BY ORDINAL_POSITION; column_name column_default is_nullable = YES data_type character_maximum_length column_type column_key extra column_comment numeric_precision numeric_scale datetime_precision -id null false VARCHAR 128 VARCHAR(128) PRI null null null -username null true VARCHAR 255 VARCHAR(255) UNI null null null -password null true VARCHAR 512 VARCHAR(512) null null null -user_status null true TINYINT null TINYINT(8) null null null -user_role null true TINYINT null TINYINT(8) null null null -created_at null true DATETIME null DATETIME(0) null null 0 -updated_at null true DATETIME null DATETIME(0) null null 0 -user_source null true TINYINT null TINYINT(8) null null null +id null 0 VARCHAR 128 VARCHAR(128) PRI null null null +username null 1 VARCHAR 255 VARCHAR(255) UNI null null null +password null 1 VARCHAR 512 VARCHAR(512) null null null +user_status null 1 TINYINT null TINYINT(8) null null null +user_role null 1 TINYINT null TINYINT(8) null null null +created_at null 1 DATETIME null DATETIME(0) null null 0 +updated_at null 1 DATETIME null DATETIME(0) null null 0 +user_source null 1 TINYINT null TINYINT(8) null null null drop database etao; drop account acc1; diff --git a/test/distributed/cases/zz_statement_query_type/aggr_error_stmt.result b/test/distributed/cases/zz_statement_query_type/aggr_error_stmt.result index 82c69770a0f60..bf5e13f385771 100644 --- a/test/distributed/cases/zz_statement_query_type/aggr_error_stmt.result +++ b/test/distributed/cases/zz_statement_query_type/aggr_error_stmt.result @@ -1,5 +1,5 @@ select error, count(1) < sum(IF(aggr_count=0, 1, aggr_count)) check_result, count(1) cnt, sum(IF(aggr_count=0, 1, aggr_count)) sum from system.statement_info where account="bvt_aggr_error_stmt" and sql_source_type="cloud_nonuser_sql" group by error; error check_result cnt sum -SQL parser error: table "statement_not_exist_3" does not exist true 1 3 -SQL parser error: table "statement_not_exist_2" does not exist true 1 3 -SQL parser error: table "statement_not_exist" does not exist true 1 9 +SQL parser error: table "statement_not_exist_3" does not exist 1 1 3 +SQL parser error: table "statement_not_exist_2" does not exist 1 1 3 +SQL parser error: table "statement_not_exist" does not exist 1 1 9 diff --git a/test/distributed/cases/zz_statement_query_type/query_tcp.result b/test/distributed/cases/zz_statement_query_type/query_tcp.result index 2412014c0e2c4..7130d02506521 100644 --- a/test/distributed/cases/zz_statement_query_type/query_tcp.result +++ b/test/distributed/cases/zz_statement_query_type/query_tcp.result @@ -1,20 +1,20 @@ set @tcp_cnt=5; select statement, json_unquote(json_extract(stats, '$[7]')) between (@tcp_cnt-2) and (@tcp_cnt+5) check_val, statement_id, stats, json_extract(stats, '$[7]') pkg_cnt from system.statement_info where account= 'bvt_query_tcp' and statement='select * from 32kb_8192row_int order by a' order by request_at desc limit 1; statement check_val statement_id stats pkg_cnt -select * from 32kb_8192row_int order by a true ignored ignored 5 +select * from 32kb_8192row_int order by a 1 ignored ignored 5 set @tcp_cnt=3; select left(statement, 47) stmt, json_unquote(json_extract(stats, '$[7]')) between (@tcp_cnt-2) and (@tcp_cnt+5) check_val, statement_id, stats, json_extract(stats, '$[7]') pkg_cnt from system.statement_info where account= 'bvt_query_tcp' and statement like 'insert into 32kb_8192row_int values (1),(1),(1)%' order by request_at desc limit 1; stmt check_val statement_id stats pkg_cnt -insert into 32kb_8192row_int values (1),(1),(1) true ignored ignored 3 +insert into 32kb_8192row_int values (1),(1),(1) 1 ignored ignored 3 set @tcp_cnt=1; select left(statement, 16) as stmt, json_unquote(json_extract(stats, '$[7]')) between (@tcp_cnt-2) and (@tcp_cnt+5) check_val, statement_id, stats, json_extract(stats, '$[7]') pkg_cnt from system.statement_info where account= 'bvt_query_tcp' and statement like 'load data infile%rawlog_withnull.csv%' and statement_type = 'Load' order by request_at desc limit 1; stmt check_val statement_id stats pkg_cnt -load data infile true ignored ignored 1 +load data infile 1 ignored ignored 1 set @tcp_cnt=26; select left(statement, 22) as stmt, json_unquote(json_extract(stats, '$[7]')) between (@tcp_cnt-2) and (@tcp_cnt+5) check_val, statement_id, stats, json_extract(stats, '$[7]') pkg_cnt from system.statement_info where account= 'bvt_query_tcp' and statement like 'load data local%rawlog_withnull.csv%' and statement_type = 'Load' order by request_at desc limit 1; stmt check_val statement_id stats pkg_cnt -load data local infile true ignored ignored 26 +load data local infile 1 ignored ignored 26 set @tcp_cnt=1; select statement, json_unquote(json_extract(stats, '$[7]')) between (@tcp_cnt-2) and (@tcp_cnt+5) check_val, statement_id, stats, json_extract(stats, '$[7]') pkg_cnt from system.statement_info where account= 'bvt_query_tcp' and statement='use test' order by request_at desc limit 1; statement check_val statement_id stats pkg_cnt -use test true ignored ignored 1 +use test 1 ignored ignored 1