github.com/XiaoMi/Gaea@v1.2.5/parser/model/flags.go (about) 1 // Copyright 2018 PingCAP, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 package model 15 16 // Flags are used by tipb.SelectRequest.Flags to handle execution mode, like how to handle truncate error. 17 const ( 18 // FlagIgnoreTruncate indicates if truncate error should be ignored. 19 // Read-only statements should ignore truncate error, write statements should not ignore truncate error. 20 FlagIgnoreTruncate uint64 = 1 21 // FlagTruncateAsWarning indicates if truncate error should be returned as warning. 22 // This flag only matters if FlagIgnoreTruncate is not set, in strict sql mode, truncate error should 23 // be returned as error, in non-strict sql mode, truncate error should be saved as warning. 24 FlagTruncateAsWarning = 1 << 1 25 // FlagPadCharToFullLength indicates if sql_mode 'PAD_CHAR_TO_FULL_LENGTH' is set. 26 FlagPadCharToFullLength = 1 << 2 27 // FlagInInsertStmt indicates if this is a INSERT statement. 28 FlagInInsertStmt = 1 << 3 29 // FlagInUpdateOrDeleteStmt indicates if this is a UPDATE statement or a DELETE statement. 30 FlagInUpdateOrDeleteStmt = 1 << 4 31 // FlagInSelectStmt indicates if this is a SELECT statement. 32 FlagInSelectStmt = 1 << 5 33 // FlagOverflowAsWarning indicates if overflow error should be returned as warning. 34 // In strict sql mode, overflow error should be returned as error, 35 // in non-strict sql mode, overflow error should be saved as warning. 36 FlagOverflowAsWarning = 1 << 6 37 // FlagIgnoreZeroInDate indicates if ZeroInDate error should be ignored. 38 // Read-only statements should ignore ZeroInDate error. 39 // Write statements should not ignore ZeroInDate error in strict sql mode. 40 FlagIgnoreZeroInDate = 1 << 7 41 // FlagDividedByZeroAsWarning indicates if DividedByZero should be returned as warning. 42 FlagDividedByZeroAsWarning = 1 << 8 43 )