github.com/dolthub/go-mysql-server@v0.18.0/enginetest/queries/convert_queries.go (about) 1 // Copyright 2023 Dolthub, 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 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package queries 16 17 var ConvertTests = []struct { 18 Field string 19 Op string 20 Operand string 21 ExpCnt int 22 }{ 23 {Field: "i8", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 24 {Field: "i8", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 25 {Field: "i8", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 26 {Field: "i8", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 27 {Field: "i8", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 28 {Field: "i8", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 29 {Field: "i8", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 30 {Field: "i8", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 31 {Field: "i8", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 32 {Field: "i8", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 33 34 {Field: "i16", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 35 {Field: "i16", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 36 {Field: "i16", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 37 {Field: "i16", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 38 {Field: "i16", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 39 {Field: "i16", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 40 {Field: "i16", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 41 {Field: "i16", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 42 {Field: "i16", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 43 {Field: "i16", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 44 45 {Field: "i32", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 46 {Field: "i32", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 47 {Field: "i32", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 48 {Field: "i32", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 49 {Field: "i32", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 50 {Field: "i32", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 51 {Field: "i32", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 52 {Field: "i32", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 53 {Field: "i32", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 54 {Field: "i32", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 55 56 {Field: "i64", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 57 {Field: "i64", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 58 {Field: "i64", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 59 {Field: "i64", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 60 {Field: "i64", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 61 {Field: "i64", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 62 {Field: "i64", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 63 {Field: "i64", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 64 {Field: "i64", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 65 {Field: "i64", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 66 67 {Field: "u8", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 68 {Field: "u8", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 69 {Field: "u8", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 70 {Field: "u8", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 71 {Field: "u8", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 72 {Field: "u8", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 73 {Field: "u8", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 74 {Field: "u8", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 75 {Field: "u8", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 76 {Field: "u8", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 77 78 {Field: "u16", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 79 {Field: "u16", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 80 {Field: "u16", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 81 {Field: "u16", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 82 {Field: "u16", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 83 {Field: "u16", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 84 {Field: "u16", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 85 {Field: "u16", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 86 {Field: "u16", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 87 {Field: "u16", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 88 89 {Field: "u32", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 90 {Field: "u32", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 91 {Field: "u32", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 92 {Field: "u32", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 93 {Field: "u32", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 94 {Field: "u32", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 95 {Field: "u32", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 96 {Field: "u32", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 97 {Field: "u32", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 98 {Field: "u32", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 99 100 {Field: "u64", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 101 {Field: "u64", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 102 {Field: "u64", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 103 {Field: "u64", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 104 {Field: "u64", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 105 {Field: "u64", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 106 {Field: "u64", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 107 {Field: "u64", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 108 {Field: "u64", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 109 {Field: "u64", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 110 111 {Field: "f32", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 112 {Field: "f32", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 113 {Field: "f32", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 114 {Field: "f32", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 115 {Field: "f32", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 116 {Field: "f32", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 117 {Field: "f32", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 118 {Field: "f32", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 119 {Field: "f32", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 120 {Field: "f32", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 121 122 {Field: "f64", Op: "=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 123 {Field: "f64", Op: "<=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 124 {Field: "f64", Op: ">=", Operand: "3720481604718463778705849469618542795", ExpCnt: 0}, 125 {Field: "f64", Op: "<>", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 126 {Field: "f64", Op: "!=", Operand: "3720481604718463778705849469618542795", ExpCnt: 1}, 127 {Field: "f64", Op: "=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 128 {Field: "f64", Op: "<=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 0}, 129 {Field: "f64", Op: ">=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 130 {Field: "f64", Op: "<>", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 131 {Field: "f64", Op: "!=", Operand: "-3720481604718463778705849469618542795", ExpCnt: 1}, 132 133 {Field: "i8", Op: "=", Operand: "'string'", ExpCnt: 0}, 134 {Field: "i8", Op: "<=", Operand: "'string'", ExpCnt: 0}, 135 {Field: "i8", Op: ">=", Operand: "'string'", ExpCnt: 1}, 136 {Field: "i8", Op: "<>", Operand: "'string'", ExpCnt: 1}, 137 {Field: "i8", Op: "!=", Operand: "'string'", ExpCnt: 1}, 138 139 {Field: "i16", Op: "=", Operand: "'string'", ExpCnt: 0}, 140 {Field: "i16", Op: "<=", Operand: "'string'", ExpCnt: 0}, 141 {Field: "i16", Op: ">=", Operand: "'string'", ExpCnt: 1}, 142 {Field: "i16", Op: "<>", Operand: "'string'", ExpCnt: 1}, 143 {Field: "i16", Op: "!=", Operand: "'string'", ExpCnt: 1}, 144 145 {Field: "i32", Op: "=", Operand: "'string'", ExpCnt: 0}, 146 {Field: "i32", Op: "<=", Operand: "'string'", ExpCnt: 0}, 147 {Field: "i32", Op: ">=", Operand: "'string'", ExpCnt: 1}, 148 {Field: "i32", Op: "<>", Operand: "'string'", ExpCnt: 1}, 149 {Field: "i32", Op: "!=", Operand: "'string'", ExpCnt: 1}, 150 151 {Field: "i64", Op: "=", Operand: "'string'", ExpCnt: 0}, 152 {Field: "i64", Op: "<=", Operand: "'string'", ExpCnt: 0}, 153 {Field: "i64", Op: ">=", Operand: "'string'", ExpCnt: 1}, 154 {Field: "i64", Op: "<>", Operand: "'string'", ExpCnt: 1}, 155 {Field: "i64", Op: "!=", Operand: "'string'", ExpCnt: 1}, 156 157 {Field: "u8", Op: "=", Operand: "'string'", ExpCnt: 0}, 158 {Field: "u8", Op: "<=", Operand: "'string'", ExpCnt: 0}, 159 {Field: "u8", Op: ">=", Operand: "'string'", ExpCnt: 1}, 160 {Field: "u8", Op: "<>", Operand: "'string'", ExpCnt: 1}, 161 {Field: "u8", Op: "!=", Operand: "'string'", ExpCnt: 1}, 162 163 {Field: "u16", Op: "=", Operand: "'string'", ExpCnt: 0}, 164 {Field: "u16", Op: "<=", Operand: "'string'", ExpCnt: 0}, 165 {Field: "u16", Op: ">=", Operand: "'string'", ExpCnt: 1}, 166 {Field: "u16", Op: "<>", Operand: "'string'", ExpCnt: 1}, 167 {Field: "u16", Op: "!=", Operand: "'string'", ExpCnt: 1}, 168 169 {Field: "u32", Op: "=", Operand: "'string'", ExpCnt: 0}, 170 {Field: "u32", Op: "<=", Operand: "'string'", ExpCnt: 0}, 171 {Field: "u32", Op: ">=", Operand: "'string'", ExpCnt: 1}, 172 {Field: "u32", Op: "<>", Operand: "'string'", ExpCnt: 1}, 173 {Field: "u32", Op: "!=", Operand: "'string'", ExpCnt: 1}, 174 175 {Field: "u64", Op: "=", Operand: "'string'", ExpCnt: 0}, 176 {Field: "u64", Op: "<=", Operand: "'string'", ExpCnt: 0}, 177 {Field: "u64", Op: ">=", Operand: "'string'", ExpCnt: 1}, 178 {Field: "u64", Op: "<>", Operand: "'string'", ExpCnt: 1}, 179 {Field: "u64", Op: "!=", Operand: "'string'", ExpCnt: 1}, 180 181 {Field: "f32", Op: "=", Operand: "'string'", ExpCnt: 0}, 182 {Field: "f32", Op: "<=", Operand: "'string'", ExpCnt: 0}, 183 {Field: "f32", Op: ">=", Operand: "'string'", ExpCnt: 1}, 184 {Field: "f32", Op: "<>", Operand: "'string'", ExpCnt: 1}, 185 {Field: "f32", Op: "!=", Operand: "'string'", ExpCnt: 1}, 186 187 {Field: "f64", Op: "=", Operand: "'string'", ExpCnt: 0}, 188 {Field: "f64", Op: "<=", Operand: "'string'", ExpCnt: 0}, 189 {Field: "f64", Op: ">=", Operand: "'string'", ExpCnt: 1}, 190 {Field: "f64", Op: "<>", Operand: "'string'", ExpCnt: 1}, 191 {Field: "f64", Op: "!=", Operand: "'string'", ExpCnt: 1}, 192 193 {Field: "i8", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 194 {Field: "i8", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 195 {Field: "i8", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 196 {Field: "i8", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 197 {Field: "i8", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 198 199 {Field: "i16", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 200 {Field: "i16", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 201 {Field: "i16", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 202 {Field: "i16", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 203 {Field: "i16", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 204 205 {Field: "i32", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 206 {Field: "i32", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 207 {Field: "i32", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 208 {Field: "i32", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 209 {Field: "i32", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 210 211 {Field: "i64", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 212 {Field: "i64", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 213 {Field: "i64", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 214 {Field: "i64", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 215 {Field: "i64", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 216 217 {Field: "u8", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 218 {Field: "u8", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 219 {Field: "u8", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 220 {Field: "u8", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 221 {Field: "u8", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 222 223 {Field: "u16", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 224 {Field: "u16", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 225 {Field: "u16", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 226 {Field: "u16", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 227 {Field: "u16", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 228 229 {Field: "u32", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 230 {Field: "u32", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 231 {Field: "u32", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 232 {Field: "u32", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 233 {Field: "u32", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 234 235 {Field: "u64", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 236 {Field: "u64", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 237 {Field: "u64", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 238 {Field: "u64", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 239 {Field: "u64", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 240 241 {Field: "f32", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 242 {Field: "f32", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 243 {Field: "f32", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 244 {Field: "f32", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 245 {Field: "f32", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 246 247 {Field: "f64", Op: "=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 248 {Field: "f64", Op: "<=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 0}, 249 {Field: "f64", Op: ">=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 250 {Field: "f64", Op: "<>", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 251 {Field: "f64", Op: "!=", Operand: "STR_TO_DATE('21,5,2013','%d,%m,%Y');", ExpCnt: 1}, 252 }