id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1
value |
|---|---|---|
c28600 | UnspecifiedLength
ft.Decimal = UnspecifiedLength
} | |
c28601 | strs = append(strs, "BINARY")
}
if IsTypeChar(ft.Tp) || IsTypeBlob(ft.Tp) {
if ft.Charset != "" && ft.Charset != charset.CharsetBin {
strs = append(strs, fmt.Sprintf("CHARACTER SET %s", ft.Charset))
}
if ft.Collate != "" && ft.Collate != charset.CharsetBin {
strs = append(strs, fmt.Sprintf("COLLATE %s"... | |
c28602 | := sha1.New()
crypt.Write(bs)
return crypt.Sum(nil)
} | |
c28603 | hash := Sha1Hash([]byte(pwd))
return hex.EncodeToString(hash)
} | |
c28604 | return nil, errors.Trace(err)
}
return x, nil
} | |
c28605 | return d.DoJoin(name, other, false, false, sortOption)
} | |
c28606 | that.IsPartitionedBy
ret.IsLocalSorted = that.IsLocalSorted
inputs := []*Dataset{this, that}
step := this.Flow.MergeDatasets1ShardTo1Step(inputs, ret)
step.SetInstruction(name, instruction.NewJoinPartitionedSorted(isLeftOuterJoin, isRightOuterJoin, sortOption.Indexes()))
return ret
} | |
c28607 |
i, err := data.ToBool(ctx.GetSessionVars().StmtCtx)
if err != nil {
return false, errors.Trace(err)
}
return i != 0, nil
} | |
c28608 | if !idx.Unique {
continue
}
ok := true
newKey := make([]*Column, 0, len(idx.Columns))
for _, idxCol := range idx.Columns {
find := false
for i, col := range tbl.Columns {
if idxCol.Name.L == col.Name.L {
if !mysql.HasNotNullFlag(col.Flag) {
break
}
newKey = append(newKey, sche... | |
c28609 | &ScalarFunction{
FuncName: model.NewCIStr(ast.Cast),
RetType: tp,
Function: bt,
}
} | |
c28610 | return expr
}
value, err := scalarFunc.Eval(nil, ctx)
if err != nil {
log.Printf("There may exist an error during constant folding. The function name is %s, args are %s", scalarFunc.FuncName, args)
return expr
}
return &Constant{
Value: value,
RetType: scalarFunc.RetType,
}
} | |
c28611 | break
}
if readError == nil {
err = f(message)
} else {
return fmt.Errorf("Failed to read message: %v\n", readError)
}
count--
}
return
} | |
c28612 |
return TakeMessage(reader, -1, f)
} | |
c28613 |
l.file.Seek(0, 2)
n, err = l.file.Write(p)
l.size += int64(n)
l.Position += int64(n)
l.waitForReading.Broadcast()
return n, err
} | |
c28614 | ret = append(ret, ai)
} else {
ret = append(ret, bi)
}
}
}
if !found {
nonOverlapping = append(nonOverlapping, ai)
}
}
for _, bi := range b {
var found bool
for _, ai := range a {
if ai.StepId == bi.StepId {
found = true
}
}
if !found {
nonOverlapping = append(nonOverl... | |
c28615 | dummy := &PhysicalDummyScan{}
dummy.tp = "Dummy"
dummy.allocator = p.allocator
dummy.initIDAndContext(p.ctx)
dummy.SetSchema(p.schema)
info := &physicalPlanInfo{p: dummy}
p.storePlanInfo(prop, info)
return info, nil
}
}
}
return nil, nil
} | |
c28616 | prop.props,
sortKeyLen: prop.sortKeyLen,
}
return ret
} | |
c28617 | }
newProps = append(newProps, &columnProp{col: schema.Columns[idx], desc: p.desc})
}
return &requiredProperty{
props: newProps,
sortKeyLen: prop.sortKeyLen,
limit: prop.limit,
}
} | |
c28618 | if x, ok := childInfo.p.(physicalDistSQLPlan); ok {
info := p.convert2PhysicalPlanFinalHash(x, childInfo)
if info != nil {
return info, nil
}
}
}
return p.convert2PhysicalPlanCompleteHash(childInfo), nil
} | |
c28619 | {
physicalInitialize(child.(PhysicalPlan))
}
// initialize attributes
p.SetCorrelated()
} | |
c28620 | binary.BigEndian.PutUint64(data[:], u)
return append(b, data[:]...)
} | |
c28621 | := binary.BigEndian.Uint64(b[:8])
v := decodeCmpUintToInt(^u)
b = b[8:]
return b, v, nil
} | |
c28622 | 64)
if err1 != nil {
return iVal, errors.Trace(ErrOverflow)
}
return iVal, errors.Trace(err)
} | |
c28623 | && (digits[0] == '-' || digits[0] == '+') {
return "0", nil
}
var validInt string
if intCnt <= len(digits) {
validInt = string(digits[:intCnt])
} else {
extraZeroCount := intCnt - len(digits)
if extraZeroCount > 20 {
// Return overflow to avoid allocating too much memory.
return validFloat, errors.Tr... | |
c28624 | }
if eIdx != 0 { // "1e5e"
break
}
eIdx = i
} else if c < '0' || c > '9' {
break
} else {
sawDigit = true
validLen = i + 1
}
}
valid = s[:validLen]
if valid == "" {
valid = "0"
}
if validLen == 0 || validLen != len(s) {
err = errors.Trace(handleTruncateError(sc))
}
return valid, ... | |
c28625 | return v.String(), nil
case Duration:
return v.String(), nil
case *MyDecimal:
return v.String(), nil
case Hex:
return v.ToString(), nil
case Bit:
return v.ToString(), nil
case Enum:
return v.String(), nil
case Set:
return v.String(), nil
default:
return "", errors.Errorf("cannot convert %v(type %T... | |
c28626 | validator{inPrepare: inPrepare}
node.Accept(&v)
return v.err
} | |
c28627 | }
err := outerJoinSimplify(outerPlan, fullConditions)
if err != nil {
return errors.Trace(err)
}
}
if p.JoinType == InnerJoin {
return nil
}
// then simplify embedding outer join.
canBeSimplified := false
for _, expr := range predicates {
isOk, err := isNullRejected(p.ctx, innerTable.GetSchema(), e... | |
c28628 | append(ans, v)
}
ans = append(ans, leftConds...)
ans = append(ans, rightConds...)
ans = append(ans, otherConds...)
ans = append(ans, predicates...)
return ans
} | |
c28629 | omitempty
if isempty[1] {
fieldsInUse--
}
isempty[2] = (z.T == 0) // number, omitempty
if isempty[2] {
fieldsInUse--
}
return fieldsInUse
} | |
c28630 | colMapper: make(map[string]int),
ctx: ctx,
}
return solver.solve(conditions)
} | |
c28631 | o.orderByList = append(o.orderByList, instruction.OrderBy{
Index: index,
Order: order,
})
return o
} | |
c28632 | ret = append(ret, x.Index)
}
return ret
} | |
c28633 | := s.GetColumnIndex(col)
if index != -1 {
return s.Columns[index]
}
return nil
} | |
c28634 | c.Position == col.Position {
return i
}
}
return -1
} | |
c28635 | append(s.Columns, col)
} | |
c28636 | -1 {
ret = append(ret, pos)
} else {
return nil
}
}
return
} | |
c28637 | tmpR.Columns...))
ret.SetUniqueKeys(append(tmpL.Keys, tmpR.Keys...))
return ret
} | |
c28638 | smaller.Broadcast(name, len(bigger.Shards)).LocalHashAndJoinWith(name, bigger, sortOption)
} | |
c28639 | := d.Flow.NewNextDataset(shardCount)
step := d.Flow.AddOneToAllStep(d, ret)
step.SetInstruction(name, instruction.NewBroadcast())
return ret
} | |
c28640 | doline(canvas, lx1, ly1, x2, y2, linestyle(color), dir, label)
case "d":
lx2, ly2 := arrow(canvas, x2, y2, aw, ah, d2, color)
doline(canvas, x1, y1, lx2, ly2, linestyle(color), dir, label)
default:
doline(canvas, x1, y1, x2, y2, linestyle(color), dir, label)
}
} | |
c28641 | yp[2] = (y + h) - n
xp[3] = x + w/2
yp[3] = y + h
xl, yl = x, yp[2]
case "d":
xp[1] = x - w/2
yp[1] = y - h
xp[2] = x
yp[2] = (y - h) + n
xp[3] = x + w/2
yp[3] = y - h
xl, yl = x, yp[2]
}
canvas.Polygon(xp, yp, "fill:"+color+";fill-opacity:"+lopacity)
return xl, yl
} | |
c28642 |
cx, cy = x2, y1
} else {
cx, cy = x1, y2
}
} else {
if direction == "ccw" {
cx, cy = x1, y2
} else {
cx, cy = x2, y1
}
}
canvas.Qbez(x1, y1, cx, cy, x2, y2, style)
labelstyle += "text-anchor:middle"
canvas.Text(lx, ly, label, labelstyle)
} else {
canvas.Line(x1, y1, x2, y2, ... | |
c28643 | y2)
dx := float64(x1 - x2)
m = dy / dx
r = math.Atan2(dy, dx) * (180 / math.Pi)
return m, r
} | |
c28644 | MapperObject{fn, runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()}
return mapperId
} | |
c28645 | k, fn := range reducers {
println(k, "=>", fn.Name)
}
} | |
c28646 | datums = append(datums, types.NewDatum(c.desc), types.NewDatum(c.col.FromID), types.NewDatum(c.col.Index))
}
bytes, err := codec.EncodeValue(nil, datums...)
return bytes, errors.Trace(err)
} | |
c28647 | _, child := range p.children {
child.(LogicalPlan).ResolveIndicesAndCorCols()
}
} | |
c28648 | = append(p.parents, parent)
} | |
c28649 | = append(p.children, child)
} | |
c28650 | par.GetID() == parent.GetID() {
p.parents[i] = newPar
return nil
}
}
return SystemInternalErrorType.Gen("ReplaceParent Failed!")
} | |
c28651 | newChild
return nil
}
}
return SystemInternalErrorType.Gen("ReplaceChildren Failed!")
} | |
c28652 | 0 {
return p.parents[index]
}
return nil
} | |
c28653 | 0 {
return p.children[index]
}
return nil
} | |
c28654 | fmt.Printf("Failed to set timeout: %v\n", err)
}
if c, ok := conn.(*net.TCPConn); ok {
c.SetKeepAlive(true)
}
as.handleRequest(conn)
}()
}
} | |
c28655 | mysql.TypeLongBlob:
return true
default:
return false
}
} | |
c28656 | mysql.TypeVarchar:
return true
default:
return false
}
} | |
c28657 |
return errors.Errorf("constant %v overflows %s", v, TypeStr(tp))
} | |
c28658 | keyIndexes {
if x <= kLen {
keys = append(keys, row.K[x-1])
} else {
keys = append(keys, row.V[x-1-kLen])
}
}
for _, x := range valueIndexes {
if x <= kLen {
values = append(values, row.K[x-1])
} else {
values = append(values, row.V[x-1-kLen])
}
}
row.K, row.V = keys, values
... | |
c28659 | return r.backoff.Next(retry)
} | |
c28660 | func(c *Client) {
c.timeout = timeout
}
} | |
c28661 | func(c *Client) {
c.hystrixTimeout = timeout
}
} | |
c28662 | func(c *Client) {
c.retrier = retrier
}
} | |
c28663 | func(c *Client) {
c.client = client
}
} | |
c28664 |
}
if client.client == nil {
client.client = &http.Client{
Timeout: client.timeout,
}
}
return &client
} | |
c28665 |
}
return (time.Duration(cb.backoffInterval) * time.Millisecond) + (time.Duration(rand.Int63n(cb.maximumJitterInterval)) * time.Millisecond)
} | |
c28666 | time.Duration(math.Min(eb.initialTimeout+math.Pow(eb.exponentFactor, float64(retry)), eb.maxTimeout)+float64(rand.Int63n(eb.maximumJitterInterval))) * time.Millisecond
} | |
c28667 | heimdall.NewNoRetrier(),
}
for _, opt := range opts {
opt(&client)
}
if client.client == nil {
client.client = &http.Client{
Timeout: client.timeout,
}
}
hystrix.ConfigureCommand(client.hystrixCommandName, hystrix.CommandConfig{
Timeout: durationToInt(client.hystrixTime... | |
c28668 | := http.NewRequest(http.MethodPatch, url, body)
if err != nil {
return response, errors.Wrap(err, "PATCH - request creation failed")
}
request.Header = headers
return hhc.Do(request)
} | |
c28669 |
return response, errors.Wrap(err, "DELETE - request creation failed")
}
request.Header = headers
return hhc.Do(request)
} | |
c28670 | nil {
return errors.Wrapf(err, "failed to clear clipboard")
}
out.Print(ctx, "✔ Copied %s to clipboard. Will clear in %d seconds.", color.YellowString(name), ctxutil.GetClipTimeout(ctx))
return nil
} | |
c28671 | := backend.NewCrypto(ctx, cb)
if err != nil {
return nil, errors.Wrapf(err, "unknown crypto backend")
}
return crypto, nil
} | |
c28672 | store
ctx, err = s.generateSetPassword(ctx, name, key, password, kvps)
if err != nil {
return err
}
// if requested launch editor to add more data to the generated secret
if (edit || ctxutil.IsAskForMore(ctx)) && termio.AskForConfirmation(ctx, fmt.Sprintf("Do you want to add more data for %s?", name)) {
if e... | |
c28673 | )
}
if ctxutil.IsAutoClip(ctx) || c.Bool("clip") {
if err := clipboard.CopyTo(ctx, name, []byte(password)); err != nil {
return ExitError(ctx, ExitIO, err, "failed to copy to clipboard: %s", err)
}
}
if c.Bool("print") || c.Bool("clip") {
return nil
}
entry := name
if key != "" {
entry += ":" + k... | |
c28674 | if pwlen < 1 {
return "", ExitError(ctx, ExitUsage, nil, "password length must not be zero")
}
corp, err := termio.AskForBool(ctx, "Do you have strict rules to include different character classes?", false)
if err != nil {
return "", err
}
if corp {
return pwgen.GeneratePasswordWithAllClasses(pwlen)
}
re... | |
c28675 |
iv, err := strconv.Atoi(length)
if err != nil {
return "", ExitError(ctx, ExitUsage, err, "password length must be a number: %s", err)
}
pwlen = iv
}
if pwlen < 1 {
return "", ExitError(ctx, ExitUsage, nil, "password length must not be zero")
}
return xkcdgen.RandomLengthDelim(pwlen, xkcdSeparator, ... | |
c28676 | kvps)
sec.SetPassword(password)
if err := s.Store.Set(sub.WithReason(ctx, "Generated password for YAML key"), name, sec); err != nil {
return ctx, ExitError(ctx, ExitEncrypt, err, "failed to set key '%s' of '%s': %s", key, name, err)
}
return ctx, nil
}
// generate a completely new secret
var err error
... | |
c28677 | list = filterPrefix(uniq(extractEmails(list)), path.Base(needle))
} else {
list = filterPrefix(uniq(extractDomains(list)), needle)
}
for _, v := range list {
fmt.Fprintln(stdout, bashEscape(v))
}
} | |
c28678 | := cmd.Run(); err != nil {
out.Debug(ctx, "editor - cmd: %s %+v - error: %+v", cmd.Path, cmd.Args, err)
return []byte{}, errors.Errorf("failed to run %s with %s file: %s", editor, tmpfile.Name(), err)
}
nContent, err := ioutil.ReadFile(tmpfile.Name())
if err != nil {
return []byte{}, errors.Errorf("failed to... | |
c28679 | }()
}
i := 0
for secret := range checked {
if secret.err != nil {
errors[secret.err.Error()] = append(errors[secret.err.Error()], secret.name)
} else {
duplicates[secret.content] = append(duplicates[secret.content], secret.name)
}
if secret.message != "" {
messages[secret.message] = append(message... | |
c28680 |
if err := validator.Check(password); err != nil {
out.Cyan(ctx, fmt.Sprintf("Warning: %s", err))
}
} | |
c28681 |
if k == passwordKey {
continue
}
_, _ = buf.WriteString(k)
_, _ = buf.WriteString(": ")
if sv, ok := v.(string); ok {
_, _ = buf.WriteString(sv)
}
_, _ = buf.WriteString("\n")
}
return buf.Bytes(), nil
} | |
c28682 | = make(map[string]interface{})
}
return s.d
} | |
c28683 | return nil
}
delete(s.d, key)
return nil
} | |
c28684 | {
return false
}
b2, err := other.Bytes()
if err != nil {
return false
}
return string(b1) == string(b2)
} | |
c28685 | := v.(string); ok {
return sv
}
return ""
} | |
c28686 |
s.d[key] = value
return nil
} | |
c28687 | := s.d[key]
if sv, ok := v.(string); ok {
return sv, nil
}
return "", nil
} | |
c28688 | false
}
return s.storage.Exists(ctx, s.idFile(ctx, ""))
} | |
c28689 | != nil {
return []string{}, err
}
return t.List(maxDepth), nil
} | |
c28690 |
addFileFunc(sf...)
addTplFunc(r.store.ListTemplates(ctx, "")...)
mps := r.MountPoints()
sort.Sort(store.ByPathLen(mps))
for _, alias := range mps {
substore := r.mounts[alias]
if substore == nil {
continue
}
if err := root.AddMount(alias, substore.Path()); err != nil {
return nil, errors.Errorf("fa... | |
c28691 | per secret you should probably use the '--api' flag.")
dumps := c.StringSlice("dumps")
return s.hibpDump(ctx, force, dumps)
} | |
c28692 | len(msg.Header.Recipients))
for k := range msg.Header.Recipients {
ids = append(ids, k)
}
sort.Strings(ids)
return ids, nil
} | |
c28693 | return nil, errors.Wrapf(err, "failed to unmarshal public key: %s", err)
}
return []string{pk.Identity.Name}, nil
} | |
c28694 | return x.pubring.KeyIDs(), nil
} | |
c28695 | return x.secring.KeyIDs(), nil
} | |
c28696 | if strings.HasSuffix(fp, needle) {
ids = append(ids, fp)
}
}
}
sort.Strings(ids)
return ids, nil
} | |
c28697 | key != nil {
return id + " - " + key.PublicKey.Identity.ID()
}
return id
} | |
c28698 | }
if key := x.secring.Get(id); key != nil {
return key.PublicKey.Identity.Name
}
return id
} | |
c28699 | }
if key := x.secring.Get(id); key != nil {
return key.PublicKey.Identity.Email
}
return id
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.