MySQL int expressions.

This commit is contained in:
go-jet 2019-07-31 13:02:30 +02:00
parent 163ecf4c42
commit fcce8d4262
19 changed files with 654 additions and 168 deletions

84
tests/testdata/common/common.go vendored Normal file
View file

@ -0,0 +1,84 @@
package common
type EqualityExpResult struct {
Eq1 *bool
Eq2 *bool
Distinct1 *bool
Distinct2 *bool
NotDistinct1 *bool
NotDistinct2 *bool
Lt1 *bool
Lt2 *bool
Lte1 *bool
Lte2 *bool
Gt1 *bool
Gt2 *bool
Gte1 *bool
Gte2 *bool
}
type AllTypesIntegerExpResult struct {
EqualityExpResult `alias:"."`
Add1 *int64
Add2 *int64
Sub1 *int64
Sub2 *int64
Mul1 *int64
Mul2 *int64
Div1 *int64
Div2 *int64
Mod1 *int64
Mod2 *int64
Pow1 *int64
Pow2 *int64
BitAnd1 *int64
BitAnd2 *int64
BitOr1 *int64
BitOr2 *int64
BitXor1 *int64
BitXor2 *int64
BitShiftLeft1 *int64
BitShiftLeft2 *int64
BitShiftRight1 *int64
BitShiftRight2 *int64
}
type FloatExpressionTestResult struct {
Eq1 *bool
Eq2 *bool
Eq3 *bool
Distinct1 *bool
Distinct2 *bool
Distinct3 *bool
NotDistinct1 *bool
NotDistinct2 *bool
NotDistinct3 *bool
Lt1 *bool
Lt2 *bool
Gt1 *bool
Gt2 *bool
Add1 *float64
Add2 *float64
Sub1 *float64
Sub2 *float64
Mul1 *float64
Mul2 *float64
Div1 *float64
Div2 *float64
Mod1 *float64
Mod2 *float64
Pow1 *float64
Pow2 *float64
Abs *float64
Power *float64
Sqrt *float64
Cbrt *float64
Ceil *float64
Floor *float64
Round1 *float64
Round2 *float64
Sign *float64
Trunc *float64
}

View file

@ -1,40 +0,0 @@
package common
type FloatExpressionTestResult struct {
Eq1 *bool
Eq2 *bool
Eq3 *bool
Distinct1 *bool
Distinct2 *bool
Distinct3 *bool
NotDistinct1 *bool
NotDistinct2 *bool
NotDistinct3 *bool
Lt1 *bool
Lt2 *bool
Gt1 *bool
Gt2 *bool
Add1 *float64
Add2 *float64
Sub1 *float64
Sub2 *float64
Mul1 *float64
Mul2 *float64
Div1 *float64
Div2 *float64
Mod1 *float64
Mod2 *float64
Pow1 *float64
Pow2 *float64
Abs *float64
Power *float64
Sqrt *float64
Cbrt *float64
Ceil *float64
Floor *float64
Round1 *float64
Round2 *float64
Sign *float64
Trunc *float64
}

View file

@ -0,0 +1,78 @@
[
{
"Eq1": true,
"Eq2": false,
"Distinct1": false,
"Distinct2": true,
"NotDistinct1": true,
"NotDistinct2": false,
"Lt1": true,
"Lt2": false,
"Lte1": true,
"Lte2": false,
"Gt1": false,
"Gt2": true,
"Gte1": false,
"Gte2": true,
"Add1": 10000,
"Add2": 5011,
"Sub1": 0,
"Sub2": 4989,
"Mul1": 25000000,
"Mul2": 55000,
"Div1": 1,
"Div2": 454,
"Mod1": 0,
"Mod2": 6,
"Pow1": 38416,
"Pow2": 7529536,
"BitAnd1": 14,
"BitAnd2": 14,
"BitOr1": 14,
"BitOr2": 30,
"BitXor1": 0,
"BitXor2": 5,
"BitShiftLeft1": 1792,
"BitShiftLeft2": 224,
"BitShiftRight1": 3,
"BitShiftRight2": 7
},
{
"Eq1": true,
"Eq2": false,
"Distinct1": false,
"Distinct2": true,
"NotDistinct1": true,
"NotDistinct2": false,
"Lt1": null,
"Lt2": false,
"Lte1": null,
"Lte2": false,
"Gt1": null,
"Gt2": true,
"Gte1": null,
"Gte2": true,
"Add1": 10000,
"Add2": 5011,
"Sub1": 0,
"Sub2": 4989,
"Mul1": 25000000,
"Mul2": 55000,
"Div1": 1,
"Div2": 454,
"Mod1": 0,
"Mod2": 6,
"Pow1": 38416,
"Pow2": 7529536,
"BitAnd1": 14,
"BitAnd2": 14,
"BitOr1": 14,
"BitOr2": 30,
"BitXor1": 0,
"BitXor2": 5,
"BitShiftLeft1": 1792,
"BitShiftLeft2": 224,
"BitShiftRight1": 3,
"BitShiftRight2": 7
}
]