mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): vendor update for sqlchemy click decimal field (#20361)
This commit is contained in:
@@ -94,14 +94,14 @@ require (
|
||||
k8s.io/cri-api v0.22.17
|
||||
k8s.io/klog/v2 v2.2.0
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240523082917-4977738de7e0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240524093211-18cb24fd9ae1
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
|
||||
yunion.io/x/pkg v1.10.1-0.20240523064807-c920e765a118
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240524113104-170e3ba87126
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
|
||||
)
|
||||
|
||||
|
||||
@@ -1307,8 +1307,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240523082917-4977738de7e0 h1:svVqtfhchyqOUjLOasxRR4v5hYDsM5tZiqEAvR7R2jU=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240523082917-4977738de7e0/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240524093211-18cb24fd9ae1 h1:/cunCP3lgz4Am7TgynPbZ5Oci0DVO8rg+fcFlTyxUSs=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240524093211-18cb24fd9ae1/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
@@ -1326,7 +1326,7 @@ yunion.io/x/pkg v1.10.1-0.20240523064807-c920e765a118 h1:0k48mRv/+9uElQr6+OPKsfx
|
||||
yunion.io/x/pkg v1.10.1-0.20240523064807-c920e765a118/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305 h1:TIXzc634+YSAs2+3A+TyPmKAGd6HtAYU3M4cKwzUuo0=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305/go.mod h1:5W8ghvJ4TNt/r2yDjjD3i4QsZgIiJX45dhRQBGWPHsQ=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240524113104-170e3ba87126 h1:lg8ZkMsuF4L+yqRhFDNxhxaOuuvY9HLzr3FW7BRa5vE=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240524113104-170e3ba87126/go.mod h1:5W8ghvJ4TNt/r2yDjjD3i4QsZgIiJX45dhRQBGWPHsQ=
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ=
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
Vendored
+2
-2
@@ -1684,7 +1684,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
|
||||
# sigs.k8s.io/yaml v1.2.0
|
||||
## explicit; go 1.12
|
||||
sigs.k8s.io/yaml
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240523082917-4977738de7e0
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240524093211-18cb24fd9ae1
|
||||
## explicit; go 1.18
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
@@ -1837,7 +1837,7 @@ yunion.io/x/pkg/utils
|
||||
# yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
## explicit; go 1.12
|
||||
yunion.io/x/s3cli
|
||||
# yunion.io/x/sqlchemy v1.1.3-0.20240417115142-4f4271cd8305
|
||||
# yunion.io/x/sqlchemy v1.1.3-0.20240524113104-170e3ba87126
|
||||
## explicit; go 1.17
|
||||
yunion.io/x/sqlchemy
|
||||
yunion.io/x/sqlchemy/backends
|
||||
|
||||
+9
@@ -17,6 +17,7 @@ package esxi
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/vmware/govmomi/object"
|
||||
"github.com/vmware/govmomi/property"
|
||||
@@ -42,6 +43,8 @@ type SDatacenter struct {
|
||||
iresoucePool []cloudprovider.ICloudProject
|
||||
clusters []*SCluster
|
||||
|
||||
netLock sync.Mutex
|
||||
|
||||
Name string
|
||||
}
|
||||
|
||||
@@ -522,6 +525,8 @@ func (dc *SDatacenter) scanAllDvPortgroups() error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "dc.manager.scanAllMObjects mo.DistributedVirtualPortgroup")
|
||||
}
|
||||
dc.netLock.Lock()
|
||||
defer dc.netLock.Unlock()
|
||||
for i := range dvports {
|
||||
net := NewDistributedVirtualPortgroup(dc.manager, &dvports[i], dc)
|
||||
dc.inetworks[net.GetName()] = net
|
||||
@@ -536,6 +541,8 @@ func (dc *SDatacenter) scanAllNetworks() error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "dc.manager.scanAllMObjects mo.Network")
|
||||
}
|
||||
dc.netLock.Lock()
|
||||
defer dc.netLock.Unlock()
|
||||
for i := range nets {
|
||||
net := NewNetwork(dc.manager, &nets[i], dc)
|
||||
dc.inetworks[net.GetName()] = net
|
||||
@@ -548,6 +555,8 @@ func (dc *SDatacenter) scanDcNetworks() error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "resolveNetworks")
|
||||
}
|
||||
dc.netLock.Lock()
|
||||
defer dc.netLock.Unlock()
|
||||
for i := range nets {
|
||||
net := nets[i]
|
||||
dc.inetworks[net.GetName()] = net
|
||||
|
||||
+4
-1
@@ -403,7 +403,10 @@ type SDecimalColumn struct {
|
||||
// ColType implementation of SDecimalColumn for IColumnSpec
|
||||
func (c *SDecimalColumn) ColType() string {
|
||||
str := c.SClickhouseBaseColumn.ColType()
|
||||
return fmt.Sprintf("%s(%d, %d)", str, c.width, c.Precision)
|
||||
if str == "Decimal" {
|
||||
return fmt.Sprintf("%s(%d, %d)", str, c.width, c.Precision)
|
||||
}
|
||||
return fmt.Sprintf("%s(%d)", str, c.Precision)
|
||||
}
|
||||
|
||||
// IsNumeric implementation of SDecimalColumn for IColumnSpec
|
||||
|
||||
+8
@@ -83,6 +83,14 @@ func (info *sSqlColumnInfo) getTagmap() map[string]string {
|
||||
}
|
||||
tagmap[sqlchemy.TAG_DEFAULT] = defVal
|
||||
}
|
||||
sqlType := info.getType()
|
||||
if strings.HasPrefix(sqlType, "Decimal") {
|
||||
re := regexp.MustCompile(`Decimal\((\d+),\s*(\d+)\)`)
|
||||
match := re.FindStringSubmatch(sqlType)
|
||||
if len(match) == 3 {
|
||||
tagmap[sqlchemy.TAG_WIDTH], tagmap[sqlchemy.TAG_PRECISION] = match[1], match[2]
|
||||
}
|
||||
}
|
||||
return tagmap
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -50,8 +50,7 @@ type sQueryJoin struct {
|
||||
}
|
||||
|
||||
// SQuery is a data structure represents a SQL query in the form of
|
||||
//
|
||||
// SELECT ... FROM ... JOIN ... ON ... WHERE ... GROUP BY ... ORDER BY ... HAVING ...
|
||||
// SELECT ... FROM ... JOIN ... ON ... WHERE ... GROUP BY ... ORDER BY ... HAVING ...
|
||||
type SQuery struct {
|
||||
rawSql string
|
||||
fields []IQueryField
|
||||
|
||||
Reference in New Issue
Block a user