mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	update mssql drive to last working version 20180314172330-6a30f4e59a44 (#7306)
This commit is contained in:
		
				
					committed by
					
						 Lunny Xiao
						Lunny Xiao
					
				
			
			
				
	
			
			
			
						parent
						
							aeb8f7aad8
						
					
				
				
					commit
					1e46eedce7
				
			
							
								
								
									
										64
									
								
								vendor/github.com/denisenkom/go-mssqldb/mssql_go19.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								vendor/github.com/denisenkom/go-mssqldb/mssql_go19.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| // +build go1.9 | ||||
|  | ||||
| package mssql | ||||
|  | ||||
| import ( | ||||
| 	"database/sql" | ||||
| 	"database/sql/driver" | ||||
| 	"fmt" | ||||
| 	// "github.com/cockroachdb/apd" | ||||
| ) | ||||
|  | ||||
| // Type alias provided for compibility. | ||||
| // | ||||
| // Deprecated: users should transition to the new names when possible. | ||||
| type MssqlDriver = Driver | ||||
| type MssqlBulk = Bulk | ||||
| type MssqlBulkOptions = BulkOptions | ||||
| type MssqlConn = Conn | ||||
| type MssqlResult = Result | ||||
| type MssqlRows = Rows | ||||
| type MssqlStmt = Stmt | ||||
|  | ||||
| var _ driver.NamedValueChecker = &Conn{} | ||||
|  | ||||
| func (c *Conn) CheckNamedValue(nv *driver.NamedValue) error { | ||||
| 	switch v := nv.Value.(type) { | ||||
| 	case sql.Out: | ||||
| 		if c.outs == nil { | ||||
| 			c.outs = make(map[string]interface{}) | ||||
| 		} | ||||
| 		c.outs[nv.Name] = v.Dest | ||||
|  | ||||
| 		// Unwrap the Out value and check the inner value. | ||||
| 		lnv := *nv | ||||
| 		lnv.Value = v.Dest | ||||
| 		err := c.CheckNamedValue(&lnv) | ||||
| 		if err != nil { | ||||
| 			if err != driver.ErrSkip { | ||||
| 				return err | ||||
| 			} | ||||
| 			lnv.Value, err = driver.DefaultParameterConverter.ConvertValue(lnv.Value) | ||||
| 			if err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 		nv.Value = sql.Out{Dest: lnv.Value} | ||||
| 		return nil | ||||
| 	// case *apd.Decimal: | ||||
| 	// 	return nil | ||||
| 	default: | ||||
| 		return driver.ErrSkip | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (s *Stmt) makeParamExtra(val driver.Value) (res Param, err error) { | ||||
| 	switch val := val.(type) { | ||||
| 	case sql.Out: | ||||
| 		res, err = s.makeParam(val.Dest) | ||||
| 		res.Flags = fByRevValue | ||||
| 	default: | ||||
| 		err = fmt.Errorf("mssql: unknown type for %T", val) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
		Reference in New Issue
	
	Block a user