data

package
v0.0.0-...-91c5940 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2017 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package data contains the structures of all SQL datatypes used by rsql.

These datatypes are VOID, SYSCOLLATOR, SYSLANGUAGE, BOOLEAN, VARBINARY, VARCHAR, REGEXPLIKE, BIT, TINYINT, SMALLINT, INT, BIGINT, MONEY, NUMERIC, FLOAT, DATE, TIME, DATETIME.

  • VOID are created only by untyped NULL literals in a SQL expression, e.g. INSERT INTO T VALUES(NULL, 'hello').
  • SYSCOLLATOR contain collation data, used for VARCHAR operations, like sorting or searching.
  • SYSLANGUAGE contain language data, used for DATETIME operations (localized day of week or month name). Also used for number formatting (thousand separator and decimal point symbols).
  • BOOLEAN are created only as result of a boolean expression, e.g. SELECT ... WHERE NAME = 'fred'
  • REGEXPLIKE are used only by the LIKE operator.
  • you cannot explicitely DECLARE variables of type VOID, SYSCOLLATOR, SYSLANGUAGE, BOOLEAN, REGEXPLIKE.

In rsql source code, these datatypes are structs with names like Data_INT, Data_DATETIME, etc. They are called "dataslots".

Several fields are set only at the parse stage (during decoration or the AST tree), and are not modified during the execution by the VM.
They describe the properties of the dataslot:
    - Data_datatype
    - Data_kind
    - Data_precision
    - Data_scale
    - Data_fixlen_flag

Other fields contain dataslot's value, and are updated during execution by the VM:
    - data_error
    - data_NULL_flag
    - data_val

SQL operators and builtin functions take dataslots as arguments.
As an example, let's have the expression "price + 100.50".
The virual machine will call the function Add_NUMERIC(r *NUMERIC, a *NUMERIC, b *NUMERIC), with 'a' pointing to the NUMERIC that stores 'price' column value, and 'b' pointing to the NUMERIC storing 100.50 value.
The result will be stored in 'r'.
When an error occurs during the operation (overflow, division by 0, impossible conversion, etc), the field r.data_error is filled with the error.
    If an operator is NULL, the result is often NULL, which sets the field r.data_NULL_flag to true.
    Else, r.data_error is set to nil, r.data_NULL_flag is set to false, and the result is written in r.data_val.

Index

Constants

View Source
const (
	RANDOM_CONSONNANTS_UPPER = "BCDFGHJKLMNPQRSTVWXZ" // must be ascii, because the function Sysfunc_random_VARCHAR expects it
	RANDOM_CONSONNANTS       = "bcdfghjklmnpqrstvwxz" // same
	RANDOM_VOWELS_UPPER      = "AEIOU"                // same
	RANDOM_VOWELS            = "aeiou"                // same
)
View Source
const (
	MSGP_DATATYPE_VOID      = 1
	MSGP_DATATYPE_BOOLEAN   = 2
	MSGP_DATATYPE_VARBINARY = 4
	MSGP_DATATYPE_VARCHAR   = 6

	MSGP_DATATYPE_BIT      = 9
	MSGP_DATATYPE_TINYINT  = 10
	MSGP_DATATYPE_SMALLINT = 11
	MSGP_DATATYPE_INT      = 12
	MSGP_DATATYPE_BIGINT   = 13

	MSGP_DATATYPE_MONEY   = 15
	MSGP_DATATYPE_NUMERIC = 16
	MSGP_DATATYPE_FLOAT   = 17

	MSGP_DATATYPE_DATE     = 19
	MSGP_DATATYPE_TIME     = 20
	MSGP_DATATYPE_DATETIME = 21
)

These datatype codes are only used when rsql sends data to the client. They are never used for internal use by rsql server. They only have a meaning for the client, when it must decode the received data.

NEVER CHANGE THESE VALUES, AS THEY ARE PART OF THE API, AS SEEN BY THE CLIENT
View Source
const APPEND_MSGP_SCRATCH_BUFFER_CAPACITY = 50 // good enough to store MONEY or NUMERIC values
View Source
const MYBIN_CAPACITY_DEFAULT = 30
View Source
const MYSTR_CAPACITY_DEFAULT = 30 // default capacity VARCHAR buffer for string storage. Operations on VARCHAR increase the capacity as needed.
View Source
const (
	SYSVAR_VARCHAR_PRECISION_MAX = 255 // precision for system variable of type VARCHAR, e.g. _@current_db
)

Variables

View Source
var (
	DTFORMAT_1  = []byte(`MM\/dd\/yy`)
	DTFORMAT_2  = []byte(`yy\.MM\.dd`)
	DTFORMAT_3  = []byte(`dd\/MM\/yy`)
	DTFORMAT_4  = []byte(`dd\.MM\.yy`)
	DTFORMAT_5  = []byte(`dd\-MM\-yy`)
	DTFORMAT_6  = []byte(`dd MMM yy`)
	DTFORMAT_7  = []byte(`MMM dd\, yy`)
	DTFORMAT_10 = []byte(`MM\-dd\-yy`)
	DTFORMAT_11 = []byte(`yy\/MM\/dd`)
	DTFORMAT_12 = []byte(`yyMMdd`)

	DTFORMAT_0_100  = []byte(`MMM d yyyy h\:mmtt`)
	DTFORMAT_101    = []byte(`MM\/dd\/yyyy`)
	DTFORMAT_102    = []byte(`yyyy\.MM\.dd`)
	DTFORMAT_103    = []byte(`dd\/MM\/yyyy`)
	DTFORMAT_104    = []byte(`dd\.MM\.yyyy`)
	DTFORMAT_105    = []byte(`dd\-MM\-yyyy`)
	DTFORMAT_106    = []byte(`dd MMM yyyy`)
	DTFORMAT_107    = []byte(`MMM dd\, yyyy`)
	DTFORMAT_8_108  = []byte(`HH\:mm\:ss`)
	DTFORMAT_9_109  = []byte(`MMM d yyyy h\:mm\:ss\.ffftt`)
	DTFORMAT_110    = []byte(`MM\-dd\-yyyy`)
	DTFORMAT_111    = []byte(`yyyy\/MM\/dd`)
	DTFORMAT_112    = []byte(`yyyyMMdd`)
	DTFORMAT_13_113 = []byte(`dd MMM yyyy HH:mm\:ss\.fff`)
	DTFORMAT_14_114 = []byte(`HH:mm\:ss\.fff`)
	DTFORMAT_20_120 = []byte(`yyyy\-MM\-dd HH\:mm\:ss`)
	DTFORMAT_21_121 = []byte(`yyyy\-MM\-dd HH\:mm\:ss\.fff`)
	DTFORMAT_126    = []byte(`yyyy\-MM\-dd\THH\:mm\:ss\.fff`)
)
View Source
var (
	DFORMAT_1  = []byte(`MM\/dd\/yy`)
	DFORMAT_2  = []byte(`yy\.MM\.dd`)
	DFORMAT_3  = []byte(`dd\/MM\/yy`)
	DFORMAT_4  = []byte(`dd\.MM\.yy`)
	DFORMAT_5  = []byte(`dd\-MM\-yy`)
	DFORMAT_6  = []byte(`dd MMM yy`)
	DFORMAT_7  = []byte(`MMM dd\, yy`)
	DFORMAT_10 = []byte(`MM\-dd\-yy`)
	DFORMAT_11 = []byte(`yy\/MM\/dd`)
	DFORMAT_12 = []byte(`yyMMdd`)

	DFORMAT_0_100 = []byte(`MMM d yyyy`)
	DFORMAT_101   = []byte(`MM\/dd\/yyyy`)
	DFORMAT_102   = []byte(`yyyy\.MM\.dd`)
	DFORMAT_103   = []byte(`dd\/MM\/yyyy`)
	DFORMAT_104   = []byte(`dd\.MM\.yyyy`)
	DFORMAT_105   = []byte(`dd\-MM\-yyyy`)
	DFORMAT_106   = []byte(`dd MMM yyyy`)
	DFORMAT_107   = []byte(`MMM dd\, yyyy`)
	//	DFORMAT_8_108  = []byte(`HH\:mm\:ss`)
	DFORMAT_9_109  = []byte(`MMM d yyyy`)
	DFORMAT_110    = []byte(`MM\-dd\-yyyy`)
	DFORMAT_111    = []byte(`yyyy\/MM\/dd`)
	DFORMAT_112    = []byte(`yyyyMMdd`)
	DFORMAT_13_113 = []byte(`dd MMM yyyy`)
	//	DFORMAT_14_114 = []byte(`HH:mm\:ss\.fff`)
	DFORMAT_20_120 = []byte(`yyyy\-MM\-dd`)
	DFORMAT_21_121 = []byte(`yyyy\-MM\-dd`)
	DFORMAT_126    = []byte(`yyyy\-MM\-dd`)
)
View Source
var (
	TFORMAT_0_100  = []byte(`h\:mmtt`)
	TFORMAT_8_108  = []byte(`HH\:mm\:ss`)
	TFORMAT_9_109  = []byte(`h\:mm\:ss\.ffftt`)
	TFORMAT_13_113 = []byte(`HH:mm\:ss\.fff`)
	TFORMAT_14_114 = []byte(`HH:mm\:ss\.fff`)
	TFORMAT_20_120 = []byte(`HH\:mm\:ss`)
	TFORMAT_21_121 = []byte(`HH\:mm\:ss\.fff`)
	TFORMAT_126    = []byte(`HH\:mm\:ss\.fff`)
)
View Source
var G_POWER_OF_10 = [rsql.DATATYPE_PRECISION_BIGINT]int64{
	1,
	10,
	100,
	1000,
	10000,
	100000,
	1000000,
	10000000,
	100000000,
	1000000000,

	10000000000,
	100000000000,
	1000000000000,
	10000000000000,
	100000000000000,
	1000000000000000,
	10000000000000000,
	100000000000000000,
	1000000000000000000,
}

index from 0 to DATATYPE_PRECISION_BIGINT-1 Used e.g. for Sysfunc_round_INT().

Functions

func Add_BIGINT

func Add_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Add_FLOAT

func Add_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Add_INT

func Add_INT(r *INT, a *INT, b *INT)

func Add_NUMERIC

func Add_NUMERIC(r *NUMERIC, a *NUMERIC, b *NUMERIC)

func Add_SMALLINT

func Add_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Add_TINYINT

func Add_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Add_VARBINARY

func Add_VARBINARY(r *VARBINARY, a *VARBINARY, b *VARBINARY)

func Add_VARCHAR

func Add_VARCHAR(r *VARCHAR, a *VARCHAR, b *VARCHAR)

Add_VARCHAR returns a copy of two strings concatenated together.

The operands and result are NFC.

Beware that the result length can be larger than the sum of the two string lengths.
    We consider it as "pathological" cases, which are rarely seen.
    If it happens, the result is stored without being truncated, and may be larger than target precision. That's the best we can do, and an expected behavior.

    For example, a = U+1EBF                NFC  length=1  LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
                 b = U+0327                NFC  length=1  COMBINING CEDILLA
               a+b = U+0229 U+0302 U+0301  NFC  length=3  LATIN SMALL LETTER E WITH CEDILLA, COMBINING CIRCUMFLEX ACCENT, COMBINING ACUTE ACCENT

func Add_VOID

func Add_VOID(r *VOID, a *VOID, b *VOID)

func Add_date_time_DATETIME

func Add_date_time_DATETIME(r *DATETIME, a *DATE, b *TIME)

func Append_export

func Append_export(dest []byte, a rsql.IDataslot, date_format []byte, time_format []byte, datetime_format []byte, langinfo *lang.Langinfo) []byte

Append_export is used by BULK EXPORT.

func Assign_BIGINT

func Assign_BIGINT(r *BIGINT, a *BIGINT) *rsql.Error

func Assign_BIGINT_value

func Assign_BIGINT_value(r *BIGINT, val int64)

Assign_BIGINT_value is used by VM to assign value to OUT variables. Also used by btree module to assign page_no to a page entry row.

func Assign_BIT

func Assign_BIT(r *BIT, a *BIT) *rsql.Error

func Assign_DATE

func Assign_DATE(r *DATE, a *DATE) *rsql.Error

func Assign_DATETIME

func Assign_DATETIME(r *DATETIME, a *DATETIME) *rsql.Error

func Assign_FLOAT

func Assign_FLOAT(r *FLOAT, a *FLOAT) *rsql.Error

func Assign_INT

func Assign_INT(r *INT, a *INT) *rsql.Error

func Assign_INT_value

func Assign_INT_value(r *INT, val int32)

Assign_INT_value is used by VM to assign value to OUT variables.

func Assign_MONEY

func Assign_MONEY(r *MONEY, a *MONEY) *rsql.Error

func Assign_NUMERIC

func Assign_NUMERIC(r *NUMERIC, a *NUMERIC) *rsql.Error

func Assign_SMALLINT

func Assign_SMALLINT(r *SMALLINT, a *SMALLINT) *rsql.Error

func Assign_SYSLANGUAGE

func Assign_SYSLANGUAGE(r *SYSLANGUAGE, a *SYSLANGUAGE) *rsql.Error

func Assign_TIME

func Assign_TIME(r *TIME, a *TIME) *rsql.Error

func Assign_TINYINT

func Assign_TINYINT(r *TINYINT, a *TINYINT) *rsql.Error

func Assign_VARBINARY

func Assign_VARBINARY(r *VARBINARY, a *VARBINARY) *rsql.Error

func Assign_VARCHAR

func Assign_VARCHAR(r *VARCHAR, a *VARCHAR) *rsql.Error

func Assign_VARCHAR_bytes

func Assign_VARCHAR_bytes(r *VARCHAR, val []byte, normalize_flag bool) *rsql.Error

Assign_VARCHAR_bytes is used during BULK INSERT, to copy field content from file into a VARCHAR working dataslot.

Pass true for normalize_flag only for VARCHAR target datatslots. Other types don't need normalization, as valid field for INT, DATE, etc only contain ascii, or raise a parse error.

func Assign_VARCHAR_empty_string

func Assign_VARCHAR_empty_string(r *VARCHAR)

Assign_VARCHAR_empty_string is used during BULK INSERT, to put an empty string into a VARCHAR working dataslot.

func Assign_VARCHAR_value

func Assign_VARCHAR_value(r *VARCHAR, val string) *rsql.Error

Assign_VARCHAR_value is used by VM to assign value to OUT variables, e.g. _@current_db_name..

Fixlen_flag must be false (r must be VARCHAR, not CHAR).

func Bitwise_and_BIGINT

func Bitwise_and_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Bitwise_and_BIT

func Bitwise_and_BIT(r *BIT, a *BIT, b *BIT)

func Bitwise_and_INT

func Bitwise_and_INT(r *INT, a *INT, b *INT)

func Bitwise_and_SMALLINT

func Bitwise_and_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Bitwise_and_TINYINT

func Bitwise_and_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Bitwise_or_BIGINT

func Bitwise_or_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Bitwise_or_BIT

func Bitwise_or_BIT(r *BIT, a *BIT, b *BIT)

func Bitwise_or_INT

func Bitwise_or_INT(r *INT, a *INT, b *INT)

func Bitwise_or_SMALLINT

func Bitwise_or_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Bitwise_or_TINYINT

func Bitwise_or_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Bitwise_unary_not_BIGINT

func Bitwise_unary_not_BIGINT(r *BIGINT, a *BIGINT)

func Bitwise_unary_not_BIT

func Bitwise_unary_not_BIT(r *BIT, a *BIT)

func Bitwise_unary_not_INT

func Bitwise_unary_not_INT(r *INT, a *INT)

func Bitwise_unary_not_SMALLINT

func Bitwise_unary_not_SMALLINT(r *SMALLINT, a *SMALLINT)

func Bitwise_unary_not_TINYINT

func Bitwise_unary_not_TINYINT(r *TINYINT, a *TINYINT)

func Bitwise_xor_BIGINT

func Bitwise_xor_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Bitwise_xor_BIT

func Bitwise_xor_BIT(r *BIT, a *BIT, b *BIT)

func Bitwise_xor_INT

func Bitwise_xor_INT(r *INT, a *INT, b *INT)

func Bitwise_xor_SMALLINT

func Bitwise_xor_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Bitwise_xor_TINYINT

func Bitwise_xor_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Case_BIGINT

func Case_BIGINT(r *BIGINT, a_list []Case_element_t)

func Case_BIT

func Case_BIT(r *BIT, a_list []Case_element_t)

func Case_DATE

func Case_DATE(r *DATE, a_list []Case_element_t)

func Case_DATETIME

func Case_DATETIME(r *DATETIME, a_list []Case_element_t)

func Case_FLOAT

func Case_FLOAT(r *FLOAT, a_list []Case_element_t)

func Case_INT

func Case_INT(r *INT, a_list []Case_element_t)

func Case_MONEY

func Case_MONEY(r *MONEY, a_list []Case_element_t)

func Case_NUMERIC

func Case_NUMERIC(r *NUMERIC, a_list []Case_element_t)

func Case_SMALLINT

func Case_SMALLINT(r *SMALLINT, a_list []Case_element_t)

func Case_TIME

func Case_TIME(r *TIME, a_list []Case_element_t)

func Case_TINYINT

func Case_TINYINT(r *TINYINT, a_list []Case_element_t)

func Case_VARBINARY

func Case_VARBINARY(r *VARBINARY, a_list []Case_element_t)

func Case_VARCHAR

func Case_VARCHAR(r *VARCHAR, a_list []Case_element_t)

func Case_VOID

func Case_VOID(r *VOID, a_list []Case_element_t)

func Cast_BIGINT_to_BIGINT

func Cast_BIGINT_to_BIGINT(r *BIGINT, a *BIGINT)

func Cast_BIGINT_to_BIT

func Cast_BIGINT_to_BIT(r *BIT, a *BIGINT)

Cast_BIGINT_to_BIT casts BIGINT to BIT. If BIGINT != 0, BIT is set to 1. Else, BIT is set to 0.

func Cast_BIGINT_to_DATETIME

func Cast_BIGINT_to_DATETIME(r *DATETIME, a *BIGINT)

func Cast_BIGINT_to_FLOAT

func Cast_BIGINT_to_FLOAT(r *FLOAT, a *BIGINT)

func Cast_BIGINT_to_INT

func Cast_BIGINT_to_INT(r *INT, a *BIGINT)

func Cast_BIGINT_to_NUMERIC

func Cast_BIGINT_to_NUMERIC(r *NUMERIC, a *BIGINT)

func Cast_BIGINT_to_SMALLINT

func Cast_BIGINT_to_SMALLINT(r *SMALLINT, a *BIGINT)

func Cast_BIGINT_to_TINYINT

func Cast_BIGINT_to_TINYINT(r *TINYINT, a *BIGINT)

func Cast_BIGINT_to_VARCHAR

func Cast_BIGINT_to_VARCHAR(r *VARCHAR, a *BIGINT)

Cast_BIGINT_to_VARCHAR casts BIGINT to VARCHAR. If precision of target is unsufficient, returns an error.

func Cast_BIT_to_BIGINT

func Cast_BIT_to_BIGINT(r *BIGINT, a *BIT)

func Cast_BIT_to_BIT

func Cast_BIT_to_BIT(r *BIT, a *BIT)

func Cast_BIT_to_FLOAT

func Cast_BIT_to_FLOAT(r *FLOAT, a *BIT)

func Cast_BIT_to_INT

func Cast_BIT_to_INT(r *INT, a *BIT)

func Cast_BIT_to_NUMERIC

func Cast_BIT_to_NUMERIC(r *NUMERIC, a *BIT)

func Cast_BIT_to_SMALLINT

func Cast_BIT_to_SMALLINT(r *SMALLINT, a *BIT)

func Cast_BIT_to_TINYINT

func Cast_BIT_to_TINYINT(r *TINYINT, a *BIT)

func Cast_BIT_to_VARCHAR

func Cast_BIT_to_VARCHAR(r *VARCHAR, a *BIT)

Cast_BIT_to_VARCHAR casts BIT to VARCHAR. If precision of target is unsufficient, returns an error.

func Cast_DATETIME_to_DATE

func Cast_DATETIME_to_DATE(r *DATE, a *DATETIME)

func Cast_DATETIME_to_DATETIME

func Cast_DATETIME_to_DATETIME(r *DATETIME, a *DATETIME)

func Cast_DATETIME_to_TIME

func Cast_DATETIME_to_TIME(r *TIME, a *DATETIME)

func Cast_DATE_to_DATE

func Cast_DATE_to_DATE(r *DATE, a *DATE)

func Cast_DATE_to_DATETIME

func Cast_DATE_to_DATETIME(r *DATETIME, a *DATE)

func Cast_FLOAT_to_BIGINT

func Cast_FLOAT_to_BIGINT(r *BIGINT, a *FLOAT)

Cast_FLOAT_to_BIGINT casts FLOAT into BIGINT.

NOTE: the range of float64 values that can be converted to int64 is explained herebelow.

math.MaxInt64 == 9223372036854775807
But float64 cannot store this number, because it has only 15 significant digits, whereas int64 has 19 significant digits.

The consecutive numbers around math.MaxInt64 that are actually stored in float64 are:

    9223372036854777856.0
    9223372036854775808.0  // == float64(math.MaxInt64), which overflows math.MaxInt64
    9223372036854774784.0  // highest float64 which can be converted to int64
    9223372036854773760.0
    9223372036854772736.0

So, float64(math.MaxInt64), which is 9223372036854775808.0, must be excluded from valid range, as it overflows math.MaxInt64 == 9223372036854775807.
We also exclude float64(math.MinInt64), which is -9223372036854775808.0, for symetry with the upper range.

func Cast_FLOAT_to_BIT

func Cast_FLOAT_to_BIT(r *BIT, a *FLOAT)

Cast_FLOAT_to_BIT casts FLOAT to BIT. If FLOAT != 0.0, BIT is set to 1. Else, BIT is set to 0.

func Cast_FLOAT_to_FLOAT

func Cast_FLOAT_to_FLOAT(r *FLOAT, a *FLOAT)

func Cast_FLOAT_to_INT

func Cast_FLOAT_to_INT(r *INT, a *FLOAT)

func Cast_FLOAT_to_NUMERIC

func Cast_FLOAT_to_NUMERIC(r *NUMERIC, a *FLOAT)

func Cast_FLOAT_to_SMALLINT

func Cast_FLOAT_to_SMALLINT(r *SMALLINT, a *FLOAT)

func Cast_FLOAT_to_TINYINT

func Cast_FLOAT_to_TINYINT(r *TINYINT, a *FLOAT)

func Cast_FLOAT_to_VARCHAR

func Cast_FLOAT_to_VARCHAR(r *VARCHAR, a *FLOAT)

Cast_FLOAT_to_VARCHAR casts FLOAT to VARCHAR. If precision of target is unsufficient, returns an error.

func Cast_INT_to_BIGINT

func Cast_INT_to_BIGINT(r *BIGINT, a *INT)

func Cast_INT_to_BIT

func Cast_INT_to_BIT(r *BIT, a *INT)

Cast_INT_to_BIT casts INT to BIT. If INT != 0, BIT is set to 1. Else, BIT is set to 0.

func Cast_INT_to_DATETIME

func Cast_INT_to_DATETIME(r *DATETIME, a *INT)

func Cast_INT_to_FLOAT

func Cast_INT_to_FLOAT(r *FLOAT, a *INT)

func Cast_INT_to_INT

func Cast_INT_to_INT(r *INT, a *INT)

func Cast_INT_to_NUMERIC

func Cast_INT_to_NUMERIC(r *NUMERIC, a *INT)

func Cast_INT_to_SMALLINT

func Cast_INT_to_SMALLINT(r *SMALLINT, a *INT)

func Cast_INT_to_TINYINT

func Cast_INT_to_TINYINT(r *TINYINT, a *INT)

func Cast_INT_to_VARCHAR

func Cast_INT_to_VARCHAR(r *VARCHAR, a *INT)

Cast_INT_to_VARCHAR casts INT to VARCHAR. If precision of target is unsufficient, returns an error.

func Cast_MONEY_to_BIGINT

func Cast_MONEY_to_BIGINT(r *BIGINT, a *MONEY)

Cast_MONEY_to_BIGINT casts MONEY to BIGINT Money values are rounded when cast to any integer type.

Exactly the same as Cast_NUMERIC_to_BIGINT(), except the rounding mode.

func Cast_MONEY_to_INT

func Cast_MONEY_to_INT(r *INT, a *MONEY)

Cast_MONEY_to_INT casts MONEY to INT Money values are rounded when cast to any integer type.

Exactly the same as Cast_NUMERIC_to_INT(), except the rounding mode.

func Cast_MONEY_to_MONEY

func Cast_MONEY_to_MONEY(r *MONEY, a *MONEY)

func Cast_MONEY_to_SMALLINT

func Cast_MONEY_to_SMALLINT(r *SMALLINT, a *MONEY)

Cast_MONEY_to_SMALLINT casts MONEY to SMALLINT Money values are rounded when cast to any integer type.

Exactly the same as Cast_NUMERIC_to_SMALLINT(), except the rounding mode.

func Cast_MONEY_to_TINYINT

func Cast_MONEY_to_TINYINT(r *TINYINT, a *MONEY)

Cast_MONEY_to_TINYINT casts MONEY to TINYINT Money values are rounded when cast to any integer type.

Exactly the same as Cast_NUMERIC_to_TINYINT(), except the rounding mode.

func Cast_MONEY_to_VARCHAR

func Cast_MONEY_to_VARCHAR(r *VARCHAR, a *MONEY)

Cast_MONEY_to_VARCHAR casts MONEY to VARCHAR. If precision of target is unsufficient, returns an error.

Exactly the same as Cast_NUMERIC_to_VARCHAR(), but rounds to 2 digits after fractional point.

func Cast_NUMERIC_to_BIGINT

func Cast_NUMERIC_to_BIGINT(r *BIGINT, a *NUMERIC)

Cast_NUMERIC_to_BIGINT casts NUMERIC to BIGINT Numeric values are truncated when cast to any integer type.

Exactly the same as Cast_MONEY_to_BIGINT(), except the rounding mode.

func Cast_NUMERIC_to_BIT

func Cast_NUMERIC_to_BIT(r *BIT, a *NUMERIC)

Cast_NUMERIC_to_BIT casts NUMERIC to BIT. If NUMERIC != 0, BIT is set to 1. Else, BIT is set to 0.

func Cast_NUMERIC_to_FLOAT

func Cast_NUMERIC_to_FLOAT(r *FLOAT, a *NUMERIC)

Cast_NUMERIC_to_FLOAT casts NUMERIC to FLOAT

func Cast_NUMERIC_to_INT

func Cast_NUMERIC_to_INT(r *INT, a *NUMERIC)

Cast_NUMERIC_to_INT casts NUMERIC to INT Numeric values are truncated when cast to any integer type.

Exactly the same as Cast_MONEY_to_INT(), except the rounding mode.

func Cast_NUMERIC_to_NUMERIC

func Cast_NUMERIC_to_NUMERIC(r *NUMERIC, a *NUMERIC)

Cast_NUMERIC_to_NUMERIC casts NUMERIC to NUMERIC

func Cast_NUMERIC_to_SMALLINT

func Cast_NUMERIC_to_SMALLINT(r *SMALLINT, a *NUMERIC)

Cast_NUMERIC_to_SMALLINT casts NUMERIC to SMALLINT Numeric values are truncated when cast to any integer type.

Exactly the same as Cast_MONEY_to_SMALLINT(), except the rounding mode.

func Cast_NUMERIC_to_TINYINT

func Cast_NUMERIC_to_TINYINT(r *TINYINT, a *NUMERIC)

Cast_NUMERIC_to_TINYINT casts NUMERIC to TINYINT Numeric values are truncated when cast to any integer type.

Exactly the same as Cast_MONEY_to_TINYINT(), except the rounding mode.

func Cast_NUMERIC_to_VARCHAR

func Cast_NUMERIC_to_VARCHAR(r *VARCHAR, a *NUMERIC)

Cast_NUMERIC_to_VARCHAR casts NUMERIC to VARCHAR. If precision of target is unsufficient, returns an error.

func Cast_SMALLINT_to_BIGINT

func Cast_SMALLINT_to_BIGINT(r *BIGINT, a *SMALLINT)

func Cast_SMALLINT_to_BIT

func Cast_SMALLINT_to_BIT(r *BIT, a *SMALLINT)

Cast_SMALLINT_to_BIT casts SMALLINT to BIT. If SMALLINT != 0, BIT is set to 1. Else, BIT is set to 0.

func Cast_SMALLINT_to_DATETIME

func Cast_SMALLINT_to_DATETIME(r *DATETIME, a *SMALLINT)

func Cast_SMALLINT_to_FLOAT

func Cast_SMALLINT_to_FLOAT(r *FLOAT, a *SMALLINT)

func Cast_SMALLINT_to_INT

func Cast_SMALLINT_to_INT(r *INT, a *SMALLINT)

func Cast_SMALLINT_to_NUMERIC

func Cast_SMALLINT_to_NUMERIC(r *NUMERIC, a *SMALLINT)

func Cast_SMALLINT_to_SMALLINT

func Cast_SMALLINT_to_SMALLINT(r *SMALLINT, a *SMALLINT)

func Cast_SMALLINT_to_TINYINT

func Cast_SMALLINT_to_TINYINT(r *TINYINT, a *SMALLINT)

func Cast_SMALLINT_to_VARCHAR

func Cast_SMALLINT_to_VARCHAR(r *VARCHAR, a *SMALLINT)

Cast_SMALLINT_to_VARCHAR casts SMALLINT to VARCHAR. If precision of target is unsufficient, returns an error.

func Cast_TIME_to_DATETIME

func Cast_TIME_to_DATETIME(r *DATETIME, a *TIME)

func Cast_TIME_to_TIME

func Cast_TIME_to_TIME(r *TIME, a *TIME)

func Cast_TINYINT_to_BIGINT

func Cast_TINYINT_to_BIGINT(r *BIGINT, a *TINYINT)

func Cast_TINYINT_to_BIT

func Cast_TINYINT_to_BIT(r *BIT, a *TINYINT)

Cast_TINYINT_to_BIT casts TINYINT to BIT. If TINYINT != 0, BIT is set to 1. Else, BIT is set to 0.

func Cast_TINYINT_to_DATETIME

func Cast_TINYINT_to_DATETIME(r *DATETIME, a *TINYINT)

func Cast_TINYINT_to_FLOAT

func Cast_TINYINT_to_FLOAT(r *FLOAT, a *TINYINT)

func Cast_TINYINT_to_INT

func Cast_TINYINT_to_INT(r *INT, a *TINYINT)

func Cast_TINYINT_to_NUMERIC

func Cast_TINYINT_to_NUMERIC(r *NUMERIC, a *TINYINT)

func Cast_TINYINT_to_SMALLINT

func Cast_TINYINT_to_SMALLINT(r *SMALLINT, a *TINYINT)

func Cast_TINYINT_to_TINYINT

func Cast_TINYINT_to_TINYINT(r *TINYINT, a *TINYINT)

func Cast_TINYINT_to_VARCHAR

func Cast_TINYINT_to_VARCHAR(r *VARCHAR, a *TINYINT)

Cast_TINYINT_to_VARCHAR casts TINYINT to VARCHAR. If precision of target is unsufficient, returns an error.

func Cast_VARBINARY_to_BIGINT

func Cast_VARBINARY_to_BIGINT(r *BIGINT, a *VARBINARY)

func Cast_VARBINARY_to_BIT

func Cast_VARBINARY_to_BIT(r *BIT, a *VARBINARY)

Cast_VARBINARY_to_BIT casts VARBINARY to BIT. If VARBINARY != 0, BIT is set to 1. Else, BIT is set to 0.

func Cast_VARBINARY_to_INT

func Cast_VARBINARY_to_INT(r *INT, a *VARBINARY)

func Cast_VARBINARY_to_SMALLINT

func Cast_VARBINARY_to_SMALLINT(r *SMALLINT, a *VARBINARY)

func Cast_VARBINARY_to_TINYINT

func Cast_VARBINARY_to_TINYINT(r *TINYINT, a *VARBINARY)

func Cast_VARBINARY_to_VARBINARY

func Cast_VARBINARY_to_VARBINARY(r *VARBINARY, a *VARBINARY)

func Cast_VARCHAR_to_BIGINT

func Cast_VARCHAR_to_BIGINT(r *BIGINT, a *VARCHAR)

func Cast_VARCHAR_to_BIT

func Cast_VARCHAR_to_BIT(r *BIT, a *VARCHAR)

Cast_VARCHAR_to_BIT casts VARCHAR to BIT.

If string is empty or contains only spaces, it is cast to 0.

If string contains a character which is not 0..9, an error is returned.

If one of these digits is not 0, the string is cast to 1, else, to 0.

  • NULL is cast to NULL
  • empty string ” is cast to 0
  • space string ' ' is cast to 0
  • 'FALSE' is cast to 0
  • 'TRUE' is cast to 1
  • '0' is cast to 0
  • '00000' is cast to 0
  • '2345' is cast to 1
  • '-2345' error
  • ' 2345' error
  • 'a2345' error
  • ' abcd' error

func Cast_VARCHAR_to_FLOAT

func Cast_VARCHAR_to_FLOAT(r *FLOAT, a *VARCHAR)

func Cast_VARCHAR_to_INT

func Cast_VARCHAR_to_INT(r *INT, a *VARCHAR)

func Cast_VARCHAR_to_NUMERIC

func Cast_VARCHAR_to_NUMERIC(r *NUMERIC, a *VARCHAR)

func Cast_VARCHAR_to_SMALLINT

func Cast_VARCHAR_to_SMALLINT(r *SMALLINT, a *VARCHAR)

func Cast_VARCHAR_to_SYSLANGUAGE

func Cast_VARCHAR_to_SYSLANGUAGE(r *SYSLANGUAGE, a *VARCHAR)

func Cast_VARCHAR_to_TINYINT

func Cast_VARCHAR_to_TINYINT(r *TINYINT, a *VARCHAR)

func Cast_VARCHAR_to_VARBINARY_intern

func Cast_VARCHAR_to_VARBINARY_intern(r *VARBINARY, a *VARCHAR)

Cast_VARCHAR_to_VARBINARY_intern is not allowed to be used in normal TSQL script. It is only used internally by BULK INSERT.

This function converts a 0x hexa string representation into byte slice.

func Cast_VARCHAR_to_VARCHAR

func Cast_VARCHAR_to_VARCHAR(r *VARCHAR, a *VARCHAR)

func Cast_VOID_to_BIGINT

func Cast_VOID_to_BIGINT(r *BIGINT, a *VOID)

func Cast_VOID_to_BIT

func Cast_VOID_to_BIT(r *BIT, a *VOID)

func Cast_VOID_to_DATE

func Cast_VOID_to_DATE(r *DATE, a *VOID)

func Cast_VOID_to_DATETIME

func Cast_VOID_to_DATETIME(r *DATETIME, a *VOID)

func Cast_VOID_to_FLOAT

func Cast_VOID_to_FLOAT(r *FLOAT, a *VOID)

func Cast_VOID_to_INT

func Cast_VOID_to_INT(r *INT, a *VOID)

func Cast_VOID_to_MONEY

func Cast_VOID_to_MONEY(r *MONEY, a *VOID)

func Cast_VOID_to_NUMERIC

func Cast_VOID_to_NUMERIC(r *NUMERIC, a *VOID)

func Cast_VOID_to_REGEXPLIKE

func Cast_VOID_to_REGEXPLIKE(r *REGEXPLIKE, a *VOID)

func Cast_VOID_to_SMALLINT

func Cast_VOID_to_SMALLINT(r *SMALLINT, a *VOID)

func Cast_VOID_to_SYSLANGUAGE

func Cast_VOID_to_SYSLANGUAGE(r *SYSLANGUAGE, a *VOID)

func Cast_VOID_to_TIME

func Cast_VOID_to_TIME(r *TIME, a *VOID)

func Cast_VOID_to_TINYINT

func Cast_VOID_to_TINYINT(r *TINYINT, a *VOID)

func Cast_VOID_to_VARBINARY

func Cast_VOID_to_VARBINARY(r *VARBINARY, a *VOID)

func Cast_VOID_to_VARCHAR

func Cast_VOID_to_VARCHAR(r *VARCHAR, a *VOID)

func Cast_VOID_to_VOID

func Cast_VOID_to_VOID(r *VOID, a *VOID)

func Clone_row

func Clone_row(kind rsql.Kind_t, row rsql.Row) rsql.Row

func Clone_row_for_orderby

func Clone_row_for_orderby(kind rsql.Kind_t, row rsql.Row) rsql.Row

func Comp_equal_BIGINT

func Comp_equal_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT)

func Comp_equal_BIT

func Comp_equal_BIT(r *BOOLEAN, a *BIT, b *BIT)

func Comp_equal_DATETIME

func Comp_equal_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME)

func Comp_equal_FLOAT

func Comp_equal_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT)

func Comp_equal_INT

func Comp_equal_INT(r *BOOLEAN, a *INT, b *INT)

func Comp_equal_NUMERIC

func Comp_equal_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC)

func Comp_equal_SMALLINT

func Comp_equal_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT)

func Comp_equal_TINYINT

func Comp_equal_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT)

func Comp_equal_VARBINARY

func Comp_equal_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY)

func Comp_equal_VARCHAR

func Comp_equal_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, coll *SYSCOLLATOR)

func Comp_equal_VOID

func Comp_equal_VOID(r *BOOLEAN, a *VOID, b *VOID)

func Comp_greater_BIGINT

func Comp_greater_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT)

func Comp_greater_BIT

func Comp_greater_BIT(r *BOOLEAN, a *BIT, b *BIT)

func Comp_greater_DATETIME

func Comp_greater_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME)

func Comp_greater_FLOAT

func Comp_greater_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT)

func Comp_greater_INT

func Comp_greater_INT(r *BOOLEAN, a *INT, b *INT)

func Comp_greater_NUMERIC

func Comp_greater_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC)

func Comp_greater_SMALLINT

func Comp_greater_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT)

func Comp_greater_TINYINT

func Comp_greater_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT)

func Comp_greater_VARBINARY

func Comp_greater_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY)

func Comp_greater_VARCHAR

func Comp_greater_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, coll *SYSCOLLATOR)

func Comp_greater_VOID

func Comp_greater_VOID(r *BOOLEAN, a *VOID, b *VOID)

func Comp_greater_equal_BIGINT

func Comp_greater_equal_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT)

func Comp_greater_equal_BIT

func Comp_greater_equal_BIT(r *BOOLEAN, a *BIT, b *BIT)

func Comp_greater_equal_DATETIME

func Comp_greater_equal_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME)

func Comp_greater_equal_FLOAT

func Comp_greater_equal_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT)

func Comp_greater_equal_INT

func Comp_greater_equal_INT(r *BOOLEAN, a *INT, b *INT)

func Comp_greater_equal_NUMERIC

func Comp_greater_equal_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC)

func Comp_greater_equal_SMALLINT

func Comp_greater_equal_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT)

func Comp_greater_equal_TINYINT

func Comp_greater_equal_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT)

func Comp_greater_equal_VARBINARY

func Comp_greater_equal_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY)

func Comp_greater_equal_VARCHAR

func Comp_greater_equal_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, coll *SYSCOLLATOR)

func Comp_greater_equal_VOID

func Comp_greater_equal_VOID(r *BOOLEAN, a *VOID, b *VOID)

func Comp_less_BIGINT

func Comp_less_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT)

func Comp_less_BIT

func Comp_less_BIT(r *BOOLEAN, a *BIT, b *BIT)

func Comp_less_DATETIME

func Comp_less_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME)

func Comp_less_FLOAT

func Comp_less_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT)

func Comp_less_INT

func Comp_less_INT(r *BOOLEAN, a *INT, b *INT)

func Comp_less_NUMERIC

func Comp_less_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC)

func Comp_less_SMALLINT

func Comp_less_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT)

func Comp_less_TINYINT

func Comp_less_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT)

func Comp_less_VARBINARY

func Comp_less_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY)

func Comp_less_VARCHAR

func Comp_less_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, coll *SYSCOLLATOR)

func Comp_less_VOID

func Comp_less_VOID(r *BOOLEAN, a *VOID, b *VOID)

func Comp_less_equal_BIGINT

func Comp_less_equal_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT)

func Comp_less_equal_BIT

func Comp_less_equal_BIT(r *BOOLEAN, a *BIT, b *BIT)

func Comp_less_equal_DATETIME

func Comp_less_equal_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME)

func Comp_less_equal_FLOAT

func Comp_less_equal_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT)

func Comp_less_equal_INT

func Comp_less_equal_INT(r *BOOLEAN, a *INT, b *INT)

func Comp_less_equal_NUMERIC

func Comp_less_equal_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC)

func Comp_less_equal_SMALLINT

func Comp_less_equal_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT)

func Comp_less_equal_TINYINT

func Comp_less_equal_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT)

func Comp_less_equal_VARBINARY

func Comp_less_equal_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY)

func Comp_less_equal_VARCHAR

func Comp_less_equal_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, coll *SYSCOLLATOR)

func Comp_less_equal_VOID

func Comp_less_equal_VOID(r *BOOLEAN, a *VOID, b *VOID)

func Comp_like_VARCHAR

func Comp_like_VARCHAR(r *BOOLEAN, a *VARCHAR, b *REGEXPLIKE, coll *SYSCOLLATOR)

func Comp_not_equal_BIGINT

func Comp_not_equal_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT)

func Comp_not_equal_BIT

func Comp_not_equal_BIT(r *BOOLEAN, a *BIT, b *BIT)

func Comp_not_equal_DATETIME

func Comp_not_equal_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME)

func Comp_not_equal_FLOAT

func Comp_not_equal_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT)

func Comp_not_equal_INT

func Comp_not_equal_INT(r *BOOLEAN, a *INT, b *INT)

func Comp_not_equal_NUMERIC

func Comp_not_equal_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC)

func Comp_not_equal_SMALLINT

func Comp_not_equal_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT)

func Comp_not_equal_TINYINT

func Comp_not_equal_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT)

func Comp_not_equal_VARBINARY

func Comp_not_equal_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY)

func Comp_not_equal_VARCHAR

func Comp_not_equal_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, coll *SYSCOLLATOR)

func Comp_not_equal_VOID

func Comp_not_equal_VOID(r *BOOLEAN, a *VOID, b *VOID)

func Comp_not_like_VARCHAR

func Comp_not_like_VARCHAR(r *BOOLEAN, a *VARCHAR, b *REGEXPLIKE, coll *SYSCOLLATOR)

func Convert_VARCHAR_to_XXX

func Convert_VARCHAR_to_XXX(r rsql.IDataslot, a *VARCHAR, style *INT, syslang *SYSLANGUAGE)

Convert_VARCHAR_to_XXX is used during BULK INSERT, to convert VARCHAR field into proper target datatype.

style and syslang are only used by DATE, TIME and DATETIME.

func Copy_BIGINT

func Copy_BIGINT(r *BIGINT, a *BIGINT)

func Copy_BIT

func Copy_BIT(r *BIT, a *BIT)

func Copy_BOOLEAN

func Copy_BOOLEAN(r *BOOLEAN, a *BOOLEAN)

func Copy_DATE

func Copy_DATE(r *DATE, a *DATE)

func Copy_DATETIME

func Copy_DATETIME(r *DATETIME, a *DATETIME)

func Copy_FLOAT

func Copy_FLOAT(r *FLOAT, a *FLOAT)

func Copy_INT

func Copy_INT(r *INT, a *INT)

func Copy_MONEY

func Copy_MONEY(r *MONEY, a *MONEY)

func Copy_NUMERIC

func Copy_NUMERIC(r *NUMERIC, a *NUMERIC)

func Copy_SMALLINT

func Copy_SMALLINT(r *SMALLINT, a *SMALLINT)

func Copy_TIME

func Copy_TIME(r *TIME, a *TIME)

func Copy_TINYINT

func Copy_TINYINT(r *TINYINT, a *TINYINT)

func Copy_VARBINARY

func Copy_VARBINARY(r *VARBINARY, a *VARBINARY)

func Copy_VARCHAR

func Copy_VARCHAR(r *VARCHAR, a *VARCHAR)

func Copy_VOID

func Copy_VOID(r *VOID, a *VOID)

func Data_XXX_result_properties_equal

func Data_XXX_result_properties_equal(dataslot_a rsql.IDataslot, dataslot_b rsql.IDataslot) bool

Data_XXX_result_properties_equal compares two result dataslots, and return true if datatypes and properties are the same.

func Dataslot_XXX_NULL_new

func Dataslot_XXX_NULL_new(kind rsql.Kind_t, sql_datatype rsql.Datatype_t, sql_precision uint16, sql_scale uint16, fixlen_flag bool) rsql.IDataslot

Dataslot_XXX_NULL_new creates a new Dataslot of the requested datatype, initialized to NULL.

It is used to create a new Dataslot for all the Token_primaries, initialized with a NULL value.

Note : for the 'literal' primaries ( string constants, int constants, etc ), which do have a value and are not NULL, you must use Dataslot_literal_FLOAT_new() etc instead.

rsql.DATATYPE_CHAR is not allowed as sql_datatype. Instead, use rsql.DATATYPE_VARCHAR with fixlen_flag=1.

You must pass 0 for arguments that are not relevant for the requested datatype. E.g. pass 0 for sql_scale when you request a VARCHAR.

func Dataslot_XXX_clone

func Dataslot_XXX_clone(kind rsql.Kind_t, a rsql.IDataslot) rsql.IDataslot

func Dataslot_XXX_copy

func Dataslot_XXX_copy(dest rsql.IDataslot, src rsql.IDataslot)

func Dataslot_address

func Dataslot_address(a rsql.IDataslot) string

used by ast.debug_print functions. Returns address of dataslot as hexa string.

func Debug_display_row

func Debug_display_row(row rsql.Row, width_limit int, separator byte, option_ms bool) string

Debug_display_row displays a string representation of a Row. It is used for debugging only, as it is quite rough.

width_limit is the maximum width for VARBINARY and VARCHAR. If option_ms is true, milliseconds are displayed for TIME and DATETIME.

func Deserialize_tuple_field

func Deserialize_tuple_field(dataslot rsql.IDataslot, tuple rsql.Tuple, field_no uint16)

func Divide_BIGINT

func Divide_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Divide_FLOAT

func Divide_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Divide_INT

func Divide_INT(r *INT, a *INT, b *INT)

func Divide_NUMERIC

func Divide_NUMERIC(r *NUMERIC, a *NUMERIC, b *NUMERIC)

func Divide_SMALLINT

func Divide_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Divide_TINYINT

func Divide_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Divide_VOID

func Divide_VOID(r *VOID, a *VOID, b *VOID)

func Get_value_from_VARCHAR

func Get_value_from_VARCHAR(dataslot rsql.IDataslot) (val string)

Get_value_from_VARCHAR is used to retrieve _@current_db_name value, as string. Panics if error or NULL.

func Get_value_from_literal_xxxINT

func Get_value_from_literal_xxxINT(dataslot rsql.IDataslot) (val int64, ok bool)

func Get_value_from_xxxINT

func Get_value_from_xxxINT(dataslot rsql.IDataslot) (val int64)

Get_value_from_xxxINT is used to retrieve ROWID or IDENTITY value, as int64. Panics if error or NULL.

func In_list_BIGINT

func In_list_BIGINT(r *BOOLEAN, a *BIGINT, b_list []*BIGINT)

In_list_BIGINT checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_BIT

func In_list_BIT(r *BOOLEAN, a *BIT, b_list []*BIT)

In_list_BIT checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_DATE

func In_list_DATE(r *BOOLEAN, a *DATE, b_list []*DATE)

In_list_DATE checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_DATETIME

func In_list_DATETIME(r *BOOLEAN, a *DATETIME, b_list []*DATETIME)

In_list_DATETIME checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_FLOAT

func In_list_FLOAT(r *BOOLEAN, a *FLOAT, b_list []*FLOAT)

In_list_FLOAT checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_INT

func In_list_INT(r *BOOLEAN, a *INT, b_list []*INT)

In_list_INT checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_MONEY

func In_list_MONEY(r *BOOLEAN, a *MONEY, b_list []*MONEY)

In_list_MONEY checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_NUMERIC

func In_list_NUMERIC(r *BOOLEAN, a *NUMERIC, b_list []*NUMERIC)

In_list_NUMERIC checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_SMALLINT

func In_list_SMALLINT(r *BOOLEAN, a *SMALLINT, b_list []*SMALLINT)

In_list_SMALLINT checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_TIME

func In_list_TIME(r *BOOLEAN, a *TIME, b_list []*TIME)

In_list_TIME checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_TINYINT

func In_list_TINYINT(r *BOOLEAN, a *TINYINT, b_list []*TINYINT)

In_list_TINYINT checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_VARBINARY

func In_list_VARBINARY(r *BOOLEAN, a *VARBINARY, b_list []*VARBINARY)

In_list_VARBINARY checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_VARCHAR

func In_list_VARCHAR(r *BOOLEAN, a *VARCHAR, b_list []*VARCHAR, coll *SYSCOLLATOR)

In_list_VARCHAR checks if a exists in b_list. It returns TRUE, FALSE, or NULL.

b_list can be empty.

  • if left operand is error, result is error
  • if left operand is NULL, result is NULL
  • if left operand value is found in list, result is TRUE (even if some elements in the list are error or NULL)
  • if left operand value is not found in list:
  • if error value exists in list, result is error
  • if NULL value exists in list, result is NULL
  • else, result is FALSE

func In_list_VOID

func In_list_VOID(r *BOOLEAN, a *VOID, b_list []*VOID)

func Is_not_null_BIGINT

func Is_not_null_BIGINT(r *BOOLEAN, a *BIGINT)

func Is_not_null_BIT

func Is_not_null_BIT(r *BOOLEAN, a *BIT)

func Is_not_null_DATE

func Is_not_null_DATE(r *BOOLEAN, a *DATE)

func Is_not_null_DATETIME

func Is_not_null_DATETIME(r *BOOLEAN, a *DATETIME)

func Is_not_null_FLOAT

func Is_not_null_FLOAT(r *BOOLEAN, a *FLOAT)

func Is_not_null_INT

func Is_not_null_INT(r *BOOLEAN, a *INT)

func Is_not_null_MONEY

func Is_not_null_MONEY(r *BOOLEAN, a *MONEY)

func Is_not_null_NUMERIC

func Is_not_null_NUMERIC(r *BOOLEAN, a *NUMERIC)

func Is_not_null_SMALLINT

func Is_not_null_SMALLINT(r *BOOLEAN, a *SMALLINT)

func Is_not_null_TIME

func Is_not_null_TIME(r *BOOLEAN, a *TIME)

func Is_not_null_TINYINT

func Is_not_null_TINYINT(r *BOOLEAN, a *TINYINT)

func Is_not_null_VARBINARY

func Is_not_null_VARBINARY(r *BOOLEAN, a *VARBINARY)

func Is_not_null_VARCHAR

func Is_not_null_VARCHAR(r *BOOLEAN, a *VARCHAR)

func Is_not_null_VOID

func Is_not_null_VOID(r *BOOLEAN, a *VOID)

func Is_null_BIGINT

func Is_null_BIGINT(r *BOOLEAN, a *BIGINT)

func Is_null_BIT

func Is_null_BIT(r *BOOLEAN, a *BIT)

func Is_null_DATE

func Is_null_DATE(r *BOOLEAN, a *DATE)

func Is_null_DATETIME

func Is_null_DATETIME(r *BOOLEAN, a *DATETIME)

func Is_null_FLOAT

func Is_null_FLOAT(r *BOOLEAN, a *FLOAT)

func Is_null_INT

func Is_null_INT(r *BOOLEAN, a *INT)

func Is_null_MONEY

func Is_null_MONEY(r *BOOLEAN, a *MONEY)

func Is_null_NUMERIC

func Is_null_NUMERIC(r *BOOLEAN, a *NUMERIC)

func Is_null_SMALLINT

func Is_null_SMALLINT(r *BOOLEAN, a *SMALLINT)

func Is_null_TIME

func Is_null_TIME(r *BOOLEAN, a *TIME)

func Is_null_TINYINT

func Is_null_TINYINT(r *BOOLEAN, a *TINYINT)

func Is_null_VARBINARY

func Is_null_VARBINARY(r *BOOLEAN, a *VARBINARY)

func Is_null_VARCHAR

func Is_null_VARCHAR(r *BOOLEAN, a *VARCHAR)

func Is_null_VOID

func Is_null_VOID(r *BOOLEAN, a *VOID)

func Jump_if_NULL_or_false

func Jump_if_NULL_or_false(basicblock_source *rsql.Basicblock, data_condition *BOOLEAN, basicblock_target *rsql.Basicblock) *rsql.Error

Jump_if_NULL_or_false prepares basicblock_source to jump to basicblock_target, only if data_condition is NULL or false.

func Jump_out

func Jump_out(basicblock_source *rsql.Basicblock, basicblock_target *rsql.Basicblock)

Jump_out prepares basicblock_source to jump to basicblock_target unconditionnaly.

func Jump_out_true_false

func Jump_out_true_false(basicblock_source *rsql.Basicblock, data_condition *BOOLEAN, basicblock_true *rsql.Basicblock, basicblock_false *rsql.Basicblock) *rsql.Error

Jump_out_true_false prepares basicblock_source to jump to basicblock_true or basicblock_false, depending on the value of data_condition.

func Jump_return

func Jump_return(basicblock_source *rsql.Basicblock, returned_value *INT) (retval int64, rsql_err *rsql.Error)

Jump_return

func Logical_and_BOOLEAN

func Logical_and_BOOLEAN(r *BOOLEAN, a *BOOLEAN, b *BOOLEAN)

Logical_and_BOOLEAN computes the logical AND operation.

Note that MS SQL Server,     false AND error -> false
                     but     error AND false -> error

For rsql, we prefer to have false as result in both cases.

func Logical_or_BOOLEAN

func Logical_or_BOOLEAN(r *BOOLEAN, a *BOOLEAN, b *BOOLEAN)

Logical_or_BOOLEAN computes the logical OR operation.

Note that MS SQL Server,     true OR error -> true
                     but     error OR true -> error

For rsql, we prefer to have true as result in both cases.

func Logical_unary_not_BOOLEAN

func Logical_unary_not_BOOLEAN(r *BOOLEAN, a *BOOLEAN)

Logical_unary_not_BOOLEAN computes the logical NOT operation.

func Modulo_BIGINT

func Modulo_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Modulo_INT

func Modulo_INT(r *INT, a *INT, b *INT)

func Modulo_SMALLINT

func Modulo_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Modulo_TINYINT

func Modulo_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Modulo_VOID

func Modulo_VOID(r *VOID, a *VOID, b *VOID)

func Multiply_BIGINT

func Multiply_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Multiply_FLOAT

func Multiply_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Multiply_INT

func Multiply_INT(r *INT, a *INT, b *INT)

func Multiply_NUMERIC

func Multiply_NUMERIC(r *NUMERIC, a *NUMERIC, b *NUMERIC)

func Multiply_SMALLINT

func Multiply_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Multiply_TINYINT

func Multiply_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Multiply_VOID

func Multiply_VOID(r *VOID, a *VOID, b *VOID)

func New_index_leaf_row_from_base_fields

func New_index_leaf_row_from_base_fields(kind rsql.Kind_t, indexdef *rsql.Tabledef, base_tabledef *rsql.Tabledef, base_fields rsql.Row) (index_leaf_row rsql.Row, covering_index bool)

New_index_leaf_row_from_base_fields creates a new leaf Row for an index (tabledef), which dataslots point to the corresponding base_fields if it exists.

If covering_index returns true, it means that the index contains all the fields used by the query, and there is no need to read the base table.

If index is not covering, new base nk fields dataslots are put in base_fields, if they not already exist.

NOTE: the returned row CANNOT BE USED FOR INDEX LOOKUP, because index leading nk fields have a dataslots, but trailing nk fields may be nil.

It is just used to load the values from the index leaf page, so that Sargs check can be performed.

func New_leaf_row

func New_leaf_row(kind rsql.Kind_t, tabledef *rsql.Tabledef) (leaf_row rsql.Row, index_ROWID int, index_IDENTITY int)

New_leaf_row creates a new leaf Row, with NULL dataslots of proper types.

func New_leaf_row_for_nk_lookup

func New_leaf_row_for_nk_lookup(kind rsql.Kind_t, tabledef *rsql.Tabledef) rsql.Row

New_leaf_row_for_nk_lookup is used to create the row that will be used for index lookup.

Dataslots are created only for the index nk fields. Other fields are nil.

func New_literal_INT_BIGINT_or_NUMERIC

func New_literal_INT_BIGINT_or_NUMERIC(s string) (rsql.IDataslot, *rsql.Error)

New_literal_INT_BIGINT_or_NUMERIC creates a new data.INT, data.BIGINT or data.NUMERIC, converting a string to number. Returns an error if invalid string, or if result is Inf or Nan.

If the literal number is too big to fit in an INT, then a NUMERIC is returned.

func New_node_row

func New_node_row(kind rsql.Kind_t, tabledef *rsql.Tabledef) rsql.Row

New_node_row creates a new node Row, with NULL dataslots of proper types.

A node Row contains a BIGINT field at last position, for target_page_no. This field is not described in Tabledef.Td_nk list.

func Not_in_list_BIGINT

func Not_in_list_BIGINT(r *BOOLEAN, a *BIGINT, b_list []*BIGINT)

func Not_in_list_BIT

func Not_in_list_BIT(r *BOOLEAN, a *BIT, b_list []*BIT)

func Not_in_list_DATE

func Not_in_list_DATE(r *BOOLEAN, a *DATE, b_list []*DATE)

func Not_in_list_DATETIME

func Not_in_list_DATETIME(r *BOOLEAN, a *DATETIME, b_list []*DATETIME)

func Not_in_list_FLOAT

func Not_in_list_FLOAT(r *BOOLEAN, a *FLOAT, b_list []*FLOAT)

func Not_in_list_INT

func Not_in_list_INT(r *BOOLEAN, a *INT, b_list []*INT)

func Not_in_list_MONEY

func Not_in_list_MONEY(r *BOOLEAN, a *MONEY, b_list []*MONEY)

func Not_in_list_NUMERIC

func Not_in_list_NUMERIC(r *BOOLEAN, a *NUMERIC, b_list []*NUMERIC)

func Not_in_list_SMALLINT

func Not_in_list_SMALLINT(r *BOOLEAN, a *SMALLINT, b_list []*SMALLINT)

func Not_in_list_TIME

func Not_in_list_TIME(r *BOOLEAN, a *TIME, b_list []*TIME)

func Not_in_list_TINYINT

func Not_in_list_TINYINT(r *BOOLEAN, a *TINYINT, b_list []*TINYINT)

func Not_in_list_VARBINARY

func Not_in_list_VARBINARY(r *BOOLEAN, a *VARBINARY, b_list []*VARBINARY)

func Not_in_list_VARCHAR

func Not_in_list_VARCHAR(r *BOOLEAN, a *VARCHAR, b_list []*VARCHAR, coll *SYSCOLLATOR)

func Not_in_list_VOID

func Not_in_list_VOID(r *BOOLEAN, a *VOID, b_list []*VOID)

func RO_LEAF_Data_XXX_equal

func RO_LEAF_Data_XXX_equal(dataslot_a rsql.IDataslot, dataslot_b rsql.IDataslot) bool

RO_LEAF_Data_XXX_equal compares two dataslots for equality, comparing datatypes, attributes and value. Dataslot must be KIND_RO_LEAF. This means that it is a constant literal, or it is a constant computed during constant folding stage.

func Read_entry_from_node_page

func Read_entry_from_node_page(node_entry rsql.Row, tabledef *rsql.Tabledef, page *cache.Page, tuple_index int)

Read_entry_from_node_page fills in node_entry dataslots with data from a tuple in page.

node_entry contains the native key columns, followed by a *BIGINT for storing the target page_no.

func Read_row_from_leaf_page

func Read_row_from_leaf_page(leaf_row rsql.Row, tabledef *rsql.Tabledef, page *cache.Page, tuple_index int)

Read_row_from_leaf_page fills in leaf_row dataslots with data from a tuple in page.

func Set_BIGINT_value_from_int64

func Set_BIGINT_value_from_int64(r *BIGINT, val int64)

Set_BIGINT_value_from_int64 assigns a int64 value to BIGINT.

func Set_INT_value_from_int64

func Set_INT_value_from_int64(r *INT, val int64)

Set_INT_value_from_int64 assigns a int64 value to INT. If overflow, INT will contain an error.

func Set_SMALLINT_value_from_int64

func Set_SMALLINT_value_from_int64(r *SMALLINT, val int64)

Set_SMALLINT_value_from_int64 assigns a int64 value to SMALLINT. If overflow, SMALLINT will contain an error.

func Set_TINYINT_value_from_int64

func Set_TINYINT_value_from_int64(r *TINYINT, val int64)

Set_TINYINT_value_from_int64 assigns a int64 value to TINYINT. If overflow, TINYINT will contain an error.

func Set_int32_value

func Set_int32_value(dataslot rsql.IDataslot, val int32) *rsql.Error

func Set_value_to_xxxINT

func Set_value_to_xxxINT(dataslot rsql.IDataslot, val int64) *rsql.Error

Set_value_to_xxxINT is used to sets ROWID or IDENTITY value. An error is returned if overflow.

func Subtract_BIGINT

func Subtract_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Subtract_FLOAT

func Subtract_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Subtract_INT

func Subtract_INT(r *INT, a *INT, b *INT)

func Subtract_NUMERIC

func Subtract_NUMERIC(r *NUMERIC, a *NUMERIC, b *NUMERIC)

func Subtract_SMALLINT

func Subtract_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Subtract_TINYINT

func Subtract_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Subtract_VOID

func Subtract_VOID(r *VOID, a *VOID, b *VOID)

func Sysfunc_abs_BIGINT

func Sysfunc_abs_BIGINT(r *BIGINT, a *BIGINT)

func Sysfunc_abs_FLOAT

func Sysfunc_abs_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_abs_INT

func Sysfunc_abs_INT(r *INT, a *INT)

func Sysfunc_abs_NUMERIC

func Sysfunc_abs_NUMERIC(r *NUMERIC, a *NUMERIC)

func Sysfunc_acos_FLOAT

func Sysfunc_acos_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_aggr_count_BIGINT

func Sysfunc_aggr_count_BIGINT(r *INT, a *BIGINT)

Sysfunc_aggr_count_BIGINT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_BIT

func Sysfunc_aggr_count_BIT(r *INT, a *BIT)

Sysfunc_aggr_count_BIT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_DATETIME

func Sysfunc_aggr_count_DATETIME(r *INT, a *DATETIME)

Sysfunc_aggr_count_DATETIME is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_FLOAT

func Sysfunc_aggr_count_FLOAT(r *INT, a *FLOAT)

Sysfunc_aggr_count_FLOAT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_INT

func Sysfunc_aggr_count_INT(r *INT, a *INT)

Sysfunc_aggr_count_INT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_NUMERIC

func Sysfunc_aggr_count_NUMERIC(r *INT, a *NUMERIC)

Sysfunc_aggr_count_NUMERIC is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_SMALLINT

func Sysfunc_aggr_count_SMALLINT(r *INT, a *SMALLINT)

Sysfunc_aggr_count_SMALLINT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_TINYINT

func Sysfunc_aggr_count_TINYINT(r *INT, a *TINYINT)

Sysfunc_aggr_count_TINYINT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_VARBINARY

func Sysfunc_aggr_count_VARBINARY(r *INT, a *VARBINARY)

Sysfunc_aggr_count_VARBINARY is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_VARCHAR

func Sysfunc_aggr_count_VARCHAR(r *INT, a *VARCHAR)

Sysfunc_aggr_count_VARCHAR is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_BIGINT

func Sysfunc_aggr_count_big_BIGINT(r *BIGINT, a *BIGINT)

Sysfunc_aggr_count_big_BIGINT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_BIT

func Sysfunc_aggr_count_big_BIT(r *BIGINT, a *BIT)

Sysfunc_aggr_count_big_BIT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_DATETIME

func Sysfunc_aggr_count_big_DATETIME(r *BIGINT, a *DATETIME)

Sysfunc_aggr_count_big_DATETIME is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_FLOAT

func Sysfunc_aggr_count_big_FLOAT(r *BIGINT, a *FLOAT)

Sysfunc_aggr_count_big_FLOAT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_INT

func Sysfunc_aggr_count_big_INT(r *BIGINT, a *INT)

Sysfunc_aggr_count_big_INT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_NUMERIC

func Sysfunc_aggr_count_big_NUMERIC(r *BIGINT, a *NUMERIC)

Sysfunc_aggr_count_big_NUMERIC is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_SMALLINT

func Sysfunc_aggr_count_big_SMALLINT(r *BIGINT, a *SMALLINT)

Sysfunc_aggr_count_big_SMALLINT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_TINYINT

func Sysfunc_aggr_count_big_TINYINT(r *BIGINT, a *TINYINT)

Sysfunc_aggr_count_big_TINYINT is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_VARBINARY

func Sysfunc_aggr_count_big_VARBINARY(r *BIGINT, a *VARBINARY)

Sysfunc_aggr_count_big_VARBINARY is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_count_big_VARCHAR

func Sysfunc_aggr_count_big_VARCHAR(r *BIGINT, a *VARCHAR)

Sysfunc_aggr_count_big_VARCHAR is an aggregate function. It injects 1 if value of 'a' is not NULL into 'r'.

func Sysfunc_aggr_max_BIGINT

func Sysfunc_aggr_max_BIGINT(r *BIGINT, a *BIGINT)

Sysfunc_aggr_max_BIGINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_BIT

func Sysfunc_aggr_max_BIT(r *BIT, a *BIT)

Sysfunc_aggr_max_BIT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_DATETIME

func Sysfunc_aggr_max_DATETIME(r *DATETIME, a *DATETIME)

Sysfunc_aggr_max_DATETIME is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_FLOAT

func Sysfunc_aggr_max_FLOAT(r *FLOAT, a *FLOAT)

Sysfunc_aggr_max_FLOAT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_INT

func Sysfunc_aggr_max_INT(r *INT, a *INT)

Sysfunc_aggr_max_INT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_NUMERIC

func Sysfunc_aggr_max_NUMERIC(r *NUMERIC, a *NUMERIC)

Sysfunc_aggr_max_NUMERIC is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_SMALLINT

func Sysfunc_aggr_max_SMALLINT(r *SMALLINT, a *SMALLINT)

Sysfunc_aggr_max_SMALLINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_TINYINT

func Sysfunc_aggr_max_TINYINT(r *TINYINT, a *TINYINT)

Sysfunc_aggr_max_TINYINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_VARBINARY

func Sysfunc_aggr_max_VARBINARY(r *VARBINARY, a *VARBINARY)

Sysfunc_aggr_max_VARBINARY is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_max_VARCHAR

func Sysfunc_aggr_max_VARCHAR(r *VARCHAR, a *VARCHAR, coll *SYSCOLLATOR)

Sysfunc_aggr_max_VARCHAR is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_BIGINT

func Sysfunc_aggr_min_BIGINT(r *BIGINT, a *BIGINT)

Sysfunc_aggr_min_BIGINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_BIT

func Sysfunc_aggr_min_BIT(r *BIT, a *BIT)

Sysfunc_aggr_min_BIT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_DATETIME

func Sysfunc_aggr_min_DATETIME(r *DATETIME, a *DATETIME)

Sysfunc_aggr_min_DATETIME is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_FLOAT

func Sysfunc_aggr_min_FLOAT(r *FLOAT, a *FLOAT)

Sysfunc_aggr_min_FLOAT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_INT

func Sysfunc_aggr_min_INT(r *INT, a *INT)

Sysfunc_aggr_min_INT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_NUMERIC

func Sysfunc_aggr_min_NUMERIC(r *NUMERIC, a *NUMERIC)

Sysfunc_aggr_min_NUMERIC is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_SMALLINT

func Sysfunc_aggr_min_SMALLINT(r *SMALLINT, a *SMALLINT)

Sysfunc_aggr_min_SMALLINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_TINYINT

func Sysfunc_aggr_min_TINYINT(r *TINYINT, a *TINYINT)

Sysfunc_aggr_min_TINYINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_VARBINARY

func Sysfunc_aggr_min_VARBINARY(r *VARBINARY, a *VARBINARY)

Sysfunc_aggr_min_VARBINARY is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_min_VARCHAR

func Sysfunc_aggr_min_VARCHAR(r *VARCHAR, a *VARCHAR, coll *SYSCOLLATOR)

Sysfunc_aggr_min_VARCHAR is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_sum_BIGINT

func Sysfunc_aggr_sum_BIGINT(r *BIGINT, a *BIGINT)

Sysfunc_aggr_sum_BIGINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_sum_BIT

func Sysfunc_aggr_sum_BIT(r *BIGINT, a *BIT)

Sysfunc_aggr_sum_BIT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_sum_FLOAT

func Sysfunc_aggr_sum_FLOAT(r *FLOAT, a *FLOAT)

Sysfunc_aggr_sum_FLOAT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_sum_INT

func Sysfunc_aggr_sum_INT(r *BIGINT, a *INT)

Sysfunc_aggr_sum_INT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_sum_NUMERIC

func Sysfunc_aggr_sum_NUMERIC(r *NUMERIC, a *NUMERIC)

Sysfunc_aggr_sum_NUMERIC is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_sum_SMALLINT

func Sysfunc_aggr_sum_SMALLINT(r *BIGINT, a *SMALLINT)

Sysfunc_aggr_sum_SMALLINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_aggr_sum_TINYINT

func Sysfunc_aggr_sum_TINYINT(r *BIGINT, a *TINYINT)

Sysfunc_aggr_sum_TINYINT is an aggregate function. It injects value of 'a' into 'r'.

func Sysfunc_ascii_VARCHAR

func Sysfunc_ascii_VARCHAR(r *INT, a *VARCHAR)

Sysfunc_ascii_VARCHAR return the code of the first rune. If string is empty, returns NULL. Same as Sysfunc_unicode_VARCHAR.

func Sysfunc_asin_FLOAT

func Sysfunc_asin_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_atan_FLOAT

func Sysfunc_atan_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_atatdatefirst_SYSLANGUAGE

func Sysfunc_atatdatefirst_SYSLANGUAGE(r *INT, a *SYSLANGUAGE)

Sysfunc_atatdatefirst_SYSLANGUAGE implements the SQL function @@DATEFIRST.

func Sysfunc_atatdateformat_SYSLANGUAGE

func Sysfunc_atatdateformat_SYSLANGUAGE(r *VARCHAR, a *SYSLANGUAGE)

Sysfunc_atatdateformat_SYSLANGUAGE implements the SQL function @@DATEFORMAT.

func Sysfunc_ataterror

func Sysfunc_ataterror(r *INT)

func Sysfunc_atatidentity

func Sysfunc_atatidentity(r *BIGINT, context *rsql.Context)

func Sysfunc_atatlanguage_SYSLANGUAGE

func Sysfunc_atatlanguage_SYSLANGUAGE(r *VARCHAR, a *SYSLANGUAGE)

Sysfunc_atatlanguage_SYSLANGUAGE implements the SQL function @@LANGUAGE.

func Sysfunc_atatrowcount

func Sysfunc_atatrowcount(r *BIGINT, context *rsql.Context)

func Sysfunc_atatservername

func Sysfunc_atatservername(r *VARCHAR)

func Sysfunc_atatservicename

func Sysfunc_atatservicename(r *VARCHAR)

func Sysfunc_atattrancount

func Sysfunc_atattrancount(r *INT, context *rsql.Context)

func Sysfunc_atatversion

func Sysfunc_atatversion(r *VARCHAR)

func Sysfunc_atn2_FLOAT

func Sysfunc_atn2_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Sysfunc_between_BIGINT

func Sysfunc_between_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT, c *BIGINT)

func Sysfunc_between_BIT

func Sysfunc_between_BIT(r *BOOLEAN, a *BIT, b *BIT, c *BIT)

func Sysfunc_between_DATE

func Sysfunc_between_DATE(r *BOOLEAN, a *DATE, b *DATE, c *DATE)

func Sysfunc_between_DATETIME

func Sysfunc_between_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME, c *DATETIME)

func Sysfunc_between_FLOAT

func Sysfunc_between_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT, c *FLOAT)

func Sysfunc_between_INT

func Sysfunc_between_INT(r *BOOLEAN, a *INT, b *INT, c *INT)

func Sysfunc_between_MONEY

func Sysfunc_between_MONEY(r *BOOLEAN, a *MONEY, b *MONEY, c *MONEY)

func Sysfunc_between_NUMERIC

func Sysfunc_between_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC, c *NUMERIC)

func Sysfunc_between_SMALLINT

func Sysfunc_between_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT, c *SMALLINT)

func Sysfunc_between_TIME

func Sysfunc_between_TIME(r *BOOLEAN, a *TIME, b *TIME, c *TIME)

func Sysfunc_between_TINYINT

func Sysfunc_between_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT, c *TINYINT)

func Sysfunc_between_VARBINARY

func Sysfunc_between_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY, c *VARBINARY)

func Sysfunc_between_VARCHAR

func Sysfunc_between_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, c *VARCHAR, coll *SYSCOLLATOR)

func Sysfunc_between_VOID

func Sysfunc_between_VOID(r *BOOLEAN, a *VOID, b *VOID, c *VOID)

func Sysfunc_bomonth_DATE

func Sysfunc_bomonth_DATE(r *DATE, a *DATE, month_duration *INT)

func Sysfunc_bomonth_DATETIME

func Sysfunc_bomonth_DATETIME(r *DATETIME, a *DATETIME, month_duration *INT)

func Sysfunc_ceiling_BIGINT

func Sysfunc_ceiling_BIGINT(r *BIGINT, a *BIGINT)

func Sysfunc_ceiling_FLOAT

func Sysfunc_ceiling_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_ceiling_INT

func Sysfunc_ceiling_INT(r *INT, a *INT)

func Sysfunc_ceiling_NUMERIC

func Sysfunc_ceiling_NUMERIC(r *NUMERIC, a *NUMERIC)

func Sysfunc_char_VARCHAR

func Sysfunc_char_VARCHAR(r *VARCHAR, a *INT)

Sysfunc_char_VARCHAR return the character with code point given by argument. Same as Sysfunc_nchar_VARCHAR.

Target: fixlen_flag = false, precision = 1, collation is default.

func Sysfunc_charindex_VARCHAR

func Sysfunc_charindex_VARCHAR(r *INT, findstr *VARCHAR, s *VARCHAR, start *INT, coll *SYSCOLLATOR)

Sysfunc_charindex_VARCHAR returns the index (1-based) of the substring to find, or 0 if not found.

func Sysfunc_charlen_VARCHAR

func Sysfunc_charlen_VARCHAR(r *INT, a *VARCHAR)

Sysfunc_charlen_VARCHAR returns the length of a string, in runes.

This function returns the total length of the string. It returns the length of the Mystr stored in the Data_VARCHAR, including all trailing blanks.

Example : datalength('abc   ') = 6

IMPORTANT: this function does not exists in MS SQL Server.

With MS SQL Server, you must use LEN(), which excludes trailing spaces, or DATALENGTH(), which returns the number of bytes, not number of characters.
CHARLEN() is a much needed function, but incompatible with MS SQL Server.
I could have named it STRLEN but CHARLEN sounds better to me.

func Sysfunc_choose_BIGINT

func Sysfunc_choose_BIGINT(r *BIGINT, a *INT, b_list []*BIGINT)

func Sysfunc_choose_BIT

func Sysfunc_choose_BIT(r *BIT, a *INT, b_list []*BIT)

func Sysfunc_choose_DATE

func Sysfunc_choose_DATE(r *DATE, a *INT, b_list []*DATE)

func Sysfunc_choose_DATETIME

func Sysfunc_choose_DATETIME(r *DATETIME, a *INT, b_list []*DATETIME)

func Sysfunc_choose_FLOAT

func Sysfunc_choose_FLOAT(r *FLOAT, a *INT, b_list []*FLOAT)

func Sysfunc_choose_INT

func Sysfunc_choose_INT(r *INT, a *INT, b_list []*INT)

func Sysfunc_choose_MONEY

func Sysfunc_choose_MONEY(r *MONEY, a *INT, b_list []*MONEY)

func Sysfunc_choose_NUMERIC

func Sysfunc_choose_NUMERIC(r *NUMERIC, a *INT, b_list []*NUMERIC)

func Sysfunc_choose_SMALLINT

func Sysfunc_choose_SMALLINT(r *SMALLINT, a *INT, b_list []*SMALLINT)

func Sysfunc_choose_TIME

func Sysfunc_choose_TIME(r *TIME, a *INT, b_list []*TIME)

func Sysfunc_choose_TINYINT

func Sysfunc_choose_TINYINT(r *TINYINT, a *INT, b_list []*TINYINT)

func Sysfunc_choose_VARBINARY

func Sysfunc_choose_VARBINARY(r *VARBINARY, a *INT, b_list []*VARBINARY)

func Sysfunc_choose_VARCHAR

func Sysfunc_choose_VARCHAR(r *VARCHAR, a *INT, b_list []*VARCHAR)

func Sysfunc_choose_VOID

func Sysfunc_choose_VOID(r *VOID, a *INT, b_list []*VOID)

func Sysfunc_coalesce_BIGINT

func Sysfunc_coalesce_BIGINT(r *BIGINT, a_list []*BIGINT)

func Sysfunc_coalesce_BIT

func Sysfunc_coalesce_BIT(r *BIT, a_list []*BIT)

func Sysfunc_coalesce_DATE

func Sysfunc_coalesce_DATE(r *DATE, a_list []*DATE)

func Sysfunc_coalesce_DATETIME

func Sysfunc_coalesce_DATETIME(r *DATETIME, a_list []*DATETIME)

func Sysfunc_coalesce_FLOAT

func Sysfunc_coalesce_FLOAT(r *FLOAT, a_list []*FLOAT)

func Sysfunc_coalesce_INT

func Sysfunc_coalesce_INT(r *INT, a_list []*INT)

func Sysfunc_coalesce_MONEY

func Sysfunc_coalesce_MONEY(r *MONEY, a_list []*MONEY)

func Sysfunc_coalesce_NUMERIC

func Sysfunc_coalesce_NUMERIC(r *NUMERIC, a_list []*NUMERIC)

func Sysfunc_coalesce_SMALLINT

func Sysfunc_coalesce_SMALLINT(r *SMALLINT, a_list []*SMALLINT)

func Sysfunc_coalesce_TIME

func Sysfunc_coalesce_TIME(r *TIME, a_list []*TIME)

func Sysfunc_coalesce_TINYINT

func Sysfunc_coalesce_TINYINT(r *TINYINT, a_list []*TINYINT)

func Sysfunc_coalesce_VARBINARY

func Sysfunc_coalesce_VARBINARY(r *VARBINARY, a_list []*VARBINARY)

func Sysfunc_coalesce_VARCHAR

func Sysfunc_coalesce_VARCHAR(r *VARCHAR, a_list []*VARCHAR)

func Sysfunc_coalesce_VOID

func Sysfunc_coalesce_VOID(r *VOID, a_list []*VOID)

func Sysfunc_compile_VARCHAR_to_REGEXPLIKE

func Sysfunc_compile_VARCHAR_to_REGEXPLIKE(r *REGEXPLIKE, a *VARCHAR, escape_char *VARCHAR)

Sysfunc_compile_VARCHAR_to_REGEXPLIKE compiles a LIKE expression passed as VARCHAR, into a REGEXPLIKE. escape_char must contain exaclty one rune or be NULL, else the result will be an error. If escape_char is NULL, there is no escape character.

func Sysfunc_concat_VARCHAR

func Sysfunc_concat_VARCHAR(r *VARCHAR, a_list []*VARCHAR)

Sysfunc_concat_VARCHAR returns contatenation of all arguments, with NULL replaced by empty string.

Target: fixlen_flag = false, precision is sum of all arguments precisions, limited to DATATYPE_VARCHAR_PRECISION_MAX. Collation depends on all argument.

func Sysfunc_convert_DATETIME_to_VARCHAR

func Sysfunc_convert_DATETIME_to_VARCHAR(r *VARCHAR, a *DATETIME, b *INT, syslang *SYSLANGUAGE)

Sysfunc_convert_DATETIME_to_VARCHAR formats a DATETIME into a VARCHAR, with a format style.

CONVERT ( data_type [ ( length ) ] , datetime expression [ , style ] )

NOTE: target may be fixlen, if SQL script was CAST(@mydatetime as char(50)), which has been transformed by the decorator into CONVERT.

func Sysfunc_convert_DATE_to_VARCHAR

func Sysfunc_convert_DATE_to_VARCHAR(r *VARCHAR, a *DATE, b *INT, syslang *SYSLANGUAGE)

Sysfunc_convert_DATE_to_VARCHAR formats a DATE into a VARCHAR, with a format style.

CONVERT ( data_type [ ( length ) ] , date expression [ , style ] )

NOTE: target may be fixlen, if SQL script was CAST(@mydate as char(50)), which has been transformed by the decorator into CONVERT.

func Sysfunc_convert_TIME_to_VARCHAR

func Sysfunc_convert_TIME_to_VARCHAR(r *VARCHAR, a *TIME, b *INT, syslang *SYSLANGUAGE)

Sysfunc_convert_TIME_to_VARCHAR formats a TIME into a VARCHAR, with a format style.

CONVERT ( data_type [ ( length ) ] , time expression [ , style ] )

NOTE: target may be fixlen, if SQL script was CAST(@mytime as char(50)), which has been transformed by the decorator into CONVERT.

func Sysfunc_convert_VARCHAR_to_DATE

func Sysfunc_convert_VARCHAR_to_DATE(r *DATE, a *VARCHAR, style *INT, syslang *SYSLANGUAGE)

func Sysfunc_convert_VARCHAR_to_DATETIME

func Sysfunc_convert_VARCHAR_to_DATETIME(r *DATETIME, a *VARCHAR, style *INT, syslang *SYSLANGUAGE)

func Sysfunc_convert_VARCHAR_to_TIME

func Sysfunc_convert_VARCHAR_to_TIME(r *TIME, a *VARCHAR, style *INT, syslang *SYSLANGUAGE)

func Sysfunc_cos_FLOAT

func Sysfunc_cos_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_cot_FLOAT

func Sysfunc_cot_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_dateadd_day_DATETIME

func Sysfunc_dateadd_day_DATETIME(r *DATETIME, a *INT, b *DATETIME)

Sysfunc_dateadd_day_DATETIME adds number of days to date.

This function is called for DATEADD(day, ...), DATEADD(dayofyear, ...), DATEADD(weekday, ...). In MS SQL Server docs, it is written that " dayofyear , day, and weekday return the same value.".

func Sysfunc_dateadd_hour_DATETIME

func Sysfunc_dateadd_hour_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_hour_TIME

func Sysfunc_dateadd_hour_TIME(r *TIME, a *INT, b *TIME)

func Sysfunc_dateadd_microsecond_DATETIME

func Sysfunc_dateadd_microsecond_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_microsecond_TIME

func Sysfunc_dateadd_microsecond_TIME(r *TIME, a *INT, b *TIME)

func Sysfunc_dateadd_millisecond_DATETIME

func Sysfunc_dateadd_millisecond_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_millisecond_TIME

func Sysfunc_dateadd_millisecond_TIME(r *TIME, a *INT, b *TIME)

func Sysfunc_dateadd_minute_DATETIME

func Sysfunc_dateadd_minute_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_minute_TIME

func Sysfunc_dateadd_minute_TIME(r *TIME, a *INT, b *TIME)

func Sysfunc_dateadd_month_DATETIME

func Sysfunc_dateadd_month_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_nanosecond_DATETIME

func Sysfunc_dateadd_nanosecond_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_nanosecond_TIME

func Sysfunc_dateadd_nanosecond_TIME(r *TIME, a *INT, b *TIME)

func Sysfunc_dateadd_quarter_DATETIME

func Sysfunc_dateadd_quarter_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_second_DATETIME

func Sysfunc_dateadd_second_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_second_TIME

func Sysfunc_dateadd_second_TIME(r *TIME, a *INT, b *TIME)

func Sysfunc_dateadd_week_DATETIME

func Sysfunc_dateadd_week_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_dateadd_year_DATETIME

func Sysfunc_dateadd_year_DATETIME(r *DATETIME, a *INT, b *DATETIME)

func Sysfunc_datediff_day_DATETIME

func Sysfunc_datediff_day_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_day_DATETIME returns number of days between two datetimes.

This function is called for DATEDIFF(day, ...), DATEDIFF(dayofyear, ...).

func Sysfunc_datediff_hour_DATETIME

func Sysfunc_datediff_hour_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_hour_DATETIME returns the real number of hours between two dates.

NOTE: MS SQL Server counts the number of crossings through the hour boundaries.
      I think nobody wants or expects this strange behaviour.
      I decide to return the real hour count between the two dates.

func Sysfunc_datediff_microsecond_DATETIME

func Sysfunc_datediff_microsecond_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_microsecond_DATETIME returns the real number of microseconds between two dates.

NOTE: MS SQL Server counts the number of crossings through the microsecond boundaries.
      I think nobody wants or expects this strange behaviour.
      I decide to return the real microsecond count between the two dates.

func Sysfunc_datediff_millisecond_DATETIME

func Sysfunc_datediff_millisecond_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_millisecond_DATETIME returns the real number of milliseconds between two dates.

NOTE: MS SQL Server counts the number of crossings through the millisecond boundaries.
      I think nobody wants or expects this strange behaviour.
      I decide to return the real millisecond count between the two dates.

func Sysfunc_datediff_minute_DATETIME

func Sysfunc_datediff_minute_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_minute_DATETIME returns the real number of minutes between two dates.

NOTE: MS SQL Server counts the number of crossing through the minute boundaries.
      I think nobody wants or expects this strange behaviour.
      I decide to return the real minute count between the two dates.

func Sysfunc_datediff_month_DATETIME

func Sysfunc_datediff_month_DATETIME(r *INT, a *DATETIME, b *DATETIME)

func Sysfunc_datediff_nanosecond_DATETIME

func Sysfunc_datediff_nanosecond_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_nanosecond_DATETIME returns the real number of nanoseconds between two dates.

NOTE: MS SQL Server counts the number of crossings through the nanosecond boundaries.
      I think nobody wants or expects this strange behaviour.
      I decide to return the real nanosecond count between the two dates.

func Sysfunc_datediff_quarter_DATETIME

func Sysfunc_datediff_quarter_DATETIME(r *INT, a *DATETIME, b *DATETIME)

func Sysfunc_datediff_second_DATETIME

func Sysfunc_datediff_second_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_second_DATETIME returns the real number of seconds between two dates.

NOTE: MS SQL Server counts the number of crossings through the second boundaries.
      I think nobody wants or expects this strange behaviour.
      I decide to return the real second count between the two dates.

func Sysfunc_datediff_week_DATETIME

func Sysfunc_datediff_week_DATETIME(r *INT, a *DATETIME, b *DATETIME)

Sysfunc_datediff_week_DATETIME returns the number of Sundays between a and b. It is the same behaviour as MS SQL Server. Specifying SET DATEFIRST has no effect on DATEDIFF, which always uses Sunday as the first day of the week.

func Sysfunc_datediff_year_DATETIME

func Sysfunc_datediff_year_DATETIME(r *INT, a *DATETIME, b *DATETIME)

func Sysfunc_datefromparts_DATE

func Sysfunc_datefromparts_DATE(r *DATE, year *INT, month *INT, day *INT)

func Sysfunc_datename_day_DATETIME

func Sysfunc_datename_day_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_dayofyear_DATETIME

func Sysfunc_datename_dayofyear_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_hour_DATETIME

func Sysfunc_datename_hour_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_microsecond_DATETIME

func Sysfunc_datename_microsecond_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_millisecond_DATETIME

func Sysfunc_datename_millisecond_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_minute_DATETIME

func Sysfunc_datename_minute_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_month_DATETIME

func Sysfunc_datename_month_DATETIME(r *VARCHAR, a *DATETIME, syslang *SYSLANGUAGE)

func Sysfunc_datename_nanosecond_DATETIME

func Sysfunc_datename_nanosecond_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_quarter_DATETIME

func Sysfunc_datename_quarter_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_second_DATETIME

func Sysfunc_datename_second_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datename_week_DATETIME

func Sysfunc_datename_week_DATETIME(r *VARCHAR, a *DATETIME, syslang *SYSLANGUAGE)

func Sysfunc_datename_weekday_DATETIME

func Sysfunc_datename_weekday_DATETIME(r *VARCHAR, a *DATETIME, syslang *SYSLANGUAGE)

func Sysfunc_datename_year_DATETIME

func Sysfunc_datename_year_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_datepart_day_DATETIME

func Sysfunc_datepart_day_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_dayofyear_DATETIME

func Sysfunc_datepart_dayofyear_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_hour_DATETIME

func Sysfunc_datepart_hour_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_microsecond_DATETIME

func Sysfunc_datepart_microsecond_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_millisecond_DATETIME

func Sysfunc_datepart_millisecond_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_minute_DATETIME

func Sysfunc_datepart_minute_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_month_DATETIME

func Sysfunc_datepart_month_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_nanosecond_DATETIME

func Sysfunc_datepart_nanosecond_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_quarter_DATETIME

func Sysfunc_datepart_quarter_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_second_DATETIME

func Sysfunc_datepart_second_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datepart_week_DATETIME

func Sysfunc_datepart_week_DATETIME(r *INT, a *DATETIME, syslang *SYSLANGUAGE)

func Sysfunc_datepart_weekday_DATETIME

func Sysfunc_datepart_weekday_DATETIME(r *INT, a *DATETIME, syslang *SYSLANGUAGE)

func Sysfunc_datepart_year_DATETIME

func Sysfunc_datepart_year_DATETIME(r *INT, a *DATETIME)

func Sysfunc_datetime2fromparts_DATETIME

func Sysfunc_datetime2fromparts_DATETIME(r *DATETIME, year *INT, month *INT, day *INT, hour *INT, minute *INT, seconds *INT, fractions *INT, precision *INT)

func Sysfunc_datetime_subtract_day_DATETIME

func Sysfunc_datetime_subtract_day_DATETIME(r *DATETIME, a *INT, b *DATETIME)

Sysfunc_datetime_subtract_day_DATETIME subtracts number of days from date (that is, adds -number of days to date). This function is almost a copy of Sysfunc_dateadd_day_DATETIME.

This function is only called for "-" operator in   DATETIME - INT  expression.

func Sysfunc_datetimefromparts_DATETIME

func Sysfunc_datetimefromparts_DATETIME(r *DATETIME, year *INT, month *INT, day *INT, hour *INT, minute *INT, seconds *INT, milliseconds *INT)

func Sysfunc_db_id_BIGINT

func Sysfunc_db_id_BIGINT(r *BIGINT, a *VARCHAR)

func Sysfunc_db_name_VARCHAR

func Sysfunc_db_name_VARCHAR(r *VARCHAR, a *BIGINT)

func Sysfunc_degrees_FLOAT

func Sysfunc_degrees_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_dmy_SYSLANGUAGE

func Sysfunc_dmy_SYSLANGUAGE(r *SYSLANGUAGE, a *SYSLANGUAGE, b *VARCHAR)

Sysfunc_dmy_SYSLANGUAGE implements SQL statement SET DATEFORMAT.

func Sysfunc_eomonth_DATE

func Sysfunc_eomonth_DATE(r *DATE, a *DATE, month_duration *INT)

func Sysfunc_eomonth_DATETIME

func Sysfunc_eomonth_DATETIME(r *DATETIME, a *DATETIME, month_duration *INT)

func Sysfunc_exp_FLOAT

func Sysfunc_exp_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_firstdayofweek_SYSLANGUAGE

func Sysfunc_firstdayofweek_SYSLANGUAGE(r *SYSLANGUAGE, a *SYSLANGUAGE, b *INT)

Sysfunc_firstdayofweek_SYSLANGUAGE implements SQL statement SET DATEFIRST.

func Sysfunc_fit_no_truncate_VARBINARY

func Sysfunc_fit_no_truncate_VARBINARY(r *VARBINARY, a *VARBINARY)

Sysfunc_fit_no_truncate_VARBINARY puts an error in 'r' if 'a' would be truncated because 'r' precision is too small. The user cannot call this function. It is generated by the decorator for INSERT INTO and UPDATE statements.

func Sysfunc_fit_no_truncate_VARCHAR

func Sysfunc_fit_no_truncate_VARCHAR(r *VARCHAR, a *VARCHAR)

Sysfunc_fit_no_truncate_VARCHAR puts an error in 'r' if 'a' would be truncated because 'r' precision is too small. The user cannot call this function. It is generated by the decorator for INSERT INTO and UPDATE statements.

func Sysfunc_floor_BIGINT

func Sysfunc_floor_BIGINT(r *BIGINT, a *BIGINT)

func Sysfunc_floor_FLOAT

func Sysfunc_floor_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_floor_INT

func Sysfunc_floor_INT(r *INT, a *INT)

func Sysfunc_floor_NUMERIC

func Sysfunc_floor_NUMERIC(r *NUMERIC, a *NUMERIC)

func Sysfunc_format_BIGINT

func Sysfunc_format_BIGINT(r *VARCHAR, a *BIGINT, b *VARCHAR, syslang *SYSLANGUAGE)

func Sysfunc_format_DATETIME

func Sysfunc_format_DATETIME(r *VARCHAR, a *DATETIME, b *VARCHAR, syslang *SYSLANGUAGE)

func Sysfunc_format_FLOAT

func Sysfunc_format_FLOAT(r *VARCHAR, a *FLOAT, b *VARCHAR, syslang *SYSLANGUAGE)

Sysfunc_format_FLOAT converts FLOAT to VARCHAR, as requested by the format string.

FORMAT ( float expression, format [ ,language ] )

The format string is e.g. "#'0.00" or "#'##0.00" which will print the number with group separators, with two digits after the fractional point. The format string "0" will round the number to nearest integer value.

NOTE: The rounding is half-to-even (21.5->22, 22.5->22, 23.5->24). It is unlike MS SQL Server, which rounds half-up (21.5->22, 22.5->23, 23.5->24)

func Sysfunc_format_INT

func Sysfunc_format_INT(r *VARCHAR, a *INT, b *VARCHAR, syslang *SYSLANGUAGE)

func Sysfunc_format_NUMERIC

func Sysfunc_format_NUMERIC(r *VARCHAR, a *NUMERIC, b *VARCHAR, syslang *SYSLANGUAGE)

Sysfunc_format_NUMERIC converts NUMERIC to VARCHAR, as requested by the format string.

FORMAT ( numeric expression, format [ ,language ] )

The format string is e.g. "#'0.00" or "#'##0.00" which will print the number with group separators, with two digits after the fractional point. The format string "0" will round the number to nearest integer value. The rounding mode is round-half-up, like MS SQL Server.

func Sysfunc_getutcdate_DATETIME

func Sysfunc_getutcdate_DATETIME(r *DATETIME)

func Sysfunc_iif_BIGINT

func Sysfunc_iif_BIGINT(r *BIGINT, a *BOOLEAN, b *BIGINT, c *BIGINT)

func Sysfunc_iif_BIT

func Sysfunc_iif_BIT(r *BIT, a *BOOLEAN, b *BIT, c *BIT)

func Sysfunc_iif_DATE

func Sysfunc_iif_DATE(r *DATE, a *BOOLEAN, b *DATE, c *DATE)

func Sysfunc_iif_DATETIME

func Sysfunc_iif_DATETIME(r *DATETIME, a *BOOLEAN, b *DATETIME, c *DATETIME)

func Sysfunc_iif_FLOAT

func Sysfunc_iif_FLOAT(r *FLOAT, a *BOOLEAN, b *FLOAT, c *FLOAT)

func Sysfunc_iif_INT

func Sysfunc_iif_INT(r *INT, a *BOOLEAN, b *INT, c *INT)

func Sysfunc_iif_MONEY

func Sysfunc_iif_MONEY(r *MONEY, a *BOOLEAN, b *MONEY, c *MONEY)

func Sysfunc_iif_NUMERIC

func Sysfunc_iif_NUMERIC(r *NUMERIC, a *BOOLEAN, b *NUMERIC, c *NUMERIC)

func Sysfunc_iif_SMALLINT

func Sysfunc_iif_SMALLINT(r *SMALLINT, a *BOOLEAN, b *SMALLINT, c *SMALLINT)

func Sysfunc_iif_TIME

func Sysfunc_iif_TIME(r *TIME, a *BOOLEAN, b *TIME, c *TIME)

func Sysfunc_iif_TINYINT

func Sysfunc_iif_TINYINT(r *TINYINT, a *BOOLEAN, b *TINYINT, c *TINYINT)

func Sysfunc_iif_VARBINARY

func Sysfunc_iif_VARBINARY(r *VARBINARY, a *BOOLEAN, b *VARBINARY, c *VARBINARY)

func Sysfunc_iif_VARCHAR

func Sysfunc_iif_VARCHAR(r *VARCHAR, a *BOOLEAN, b *VARCHAR, c *VARCHAR)

func Sysfunc_iif_VOID

func Sysfunc_iif_VOID(r *VOID, a *BOOLEAN, b *VOID, c *VOID)

func Sysfunc_isdate_VARCHAR

func Sysfunc_isdate_VARCHAR(r *INT, a *VARCHAR, syslang *SYSLANGUAGE)

func Sysfunc_isnull_BIGINT

func Sysfunc_isnull_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Sysfunc_isnull_BIT

func Sysfunc_isnull_BIT(r *BIT, a *BIT, b *BIT)

func Sysfunc_isnull_DATE

func Sysfunc_isnull_DATE(r *DATE, a *DATE, b *DATE)

func Sysfunc_isnull_DATETIME

func Sysfunc_isnull_DATETIME(r *DATETIME, a *DATETIME, b *DATETIME)

func Sysfunc_isnull_FLOAT

func Sysfunc_isnull_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Sysfunc_isnull_INT

func Sysfunc_isnull_INT(r *INT, a *INT, b *INT)

func Sysfunc_isnull_MONEY

func Sysfunc_isnull_MONEY(r *MONEY, a *MONEY, b *MONEY)

func Sysfunc_isnull_NUMERIC

func Sysfunc_isnull_NUMERIC(r *NUMERIC, a *NUMERIC, b *NUMERIC)

func Sysfunc_isnull_SMALLINT

func Sysfunc_isnull_SMALLINT(r *SMALLINT, a *SMALLINT, b *SMALLINT)

func Sysfunc_isnull_TIME

func Sysfunc_isnull_TIME(r *TIME, a *TIME, b *TIME)

func Sysfunc_isnull_TINYINT

func Sysfunc_isnull_TINYINT(r *TINYINT, a *TINYINT, b *TINYINT)

func Sysfunc_isnull_VARBINARY

func Sysfunc_isnull_VARBINARY(r *VARBINARY, a *VARBINARY, b *VARBINARY)

func Sysfunc_isnull_VARCHAR

func Sysfunc_isnull_VARCHAR(r *VARCHAR, a *VARCHAR, b *VARCHAR)

func Sysfunc_isnull_VOID

func Sysfunc_isnull_VOID(r *VOID, a *VOID, b *VOID)

func Sysfunc_isnumeric_BIGINT

func Sysfunc_isnumeric_BIGINT(r *INT, a *BIGINT)

func Sysfunc_isnumeric_BIT

func Sysfunc_isnumeric_BIT(r *INT, a *BIT)

func Sysfunc_isnumeric_FLOAT

func Sysfunc_isnumeric_FLOAT(r *INT, a *FLOAT)

func Sysfunc_isnumeric_INT

func Sysfunc_isnumeric_INT(r *INT, a *INT)

func Sysfunc_isnumeric_NUMERIC

func Sysfunc_isnumeric_NUMERIC(r *INT, a *NUMERIC)

func Sysfunc_isnumeric_SMALLINT

func Sysfunc_isnumeric_SMALLINT(r *INT, a *SMALLINT)

func Sysfunc_isnumeric_TINYINT

func Sysfunc_isnumeric_TINYINT(r *INT, a *TINYINT)

func Sysfunc_isnumeric_VARBINARY

func Sysfunc_isnumeric_VARBINARY(r *INT, a *VARBINARY)

func Sysfunc_isnumeric_VARCHAR

func Sysfunc_isnumeric_VARCHAR(r *INT, a *VARCHAR)

func Sysfunc_isnumeric_VOID

func Sysfunc_isnumeric_VOID(r *INT, a *VOID)

func Sysfunc_left_VARCHAR

func Sysfunc_left_VARCHAR(r *VARCHAR, a *VARCHAR, b *INT)

Sysfunc_left_VARCHAR returns the left substring with 'b' number of runes. If b < 0, an error is returned.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.
        If argument b is a literal INT:
                 - the precision is this value. Precision is adjusted to the range [1...precision of 'a'].
                 - if b is NULL, precision is 1.

func Sysfunc_len_VARBINARY

func Sysfunc_len_VARBINARY(r *INT, a *VARBINARY)

Sysfunc_len_VARBINARY returns the length of a binary string, in bytes.

This function returns the full length of the binary string.

func Sysfunc_len_VARCHAR

func Sysfunc_len_VARCHAR(r *INT, a *VARCHAR)

Sysfunc_len_VARCHAR returns the length of a string, in runes.

This function returns the length of the string, excluding trailing spaces.

All trailing spaces are discarded.
Example : len('abc   ') = 3

func Sysfunc_log10_FLOAT

func Sysfunc_log10_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_log_FLOAT

func Sysfunc_log_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_lower_VARCHAR

func Sysfunc_lower_VARCHAR(r *VARCHAR, a *VARCHAR)

Sysfunc_lower_VARCHAR converts string to lower case.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.

func Sysfunc_ltrim_VARCHAR

func Sysfunc_ltrim_VARCHAR(r *VARCHAR, a *VARCHAR)

Sysfunc_ltrim_VARCHAR discards all leading blanks.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.

func Sysfunc_nchar_VARCHAR

func Sysfunc_nchar_VARCHAR(r *VARCHAR, a *INT)

Sysfunc_nchar_VARCHAR return the character with code point given by argument. Same as Sysfunc_char_VARCHAR.

Target: fixlen_flag = false, precision = 1, collation is default.

func Sysfunc_not_between_BIGINT

func Sysfunc_not_between_BIGINT(r *BOOLEAN, a *BIGINT, b *BIGINT, c *BIGINT)

func Sysfunc_not_between_BIT

func Sysfunc_not_between_BIT(r *BOOLEAN, a *BIT, b *BIT, c *BIT)

func Sysfunc_not_between_DATE

func Sysfunc_not_between_DATE(r *BOOLEAN, a *DATE, b *DATE, c *DATE)

func Sysfunc_not_between_DATETIME

func Sysfunc_not_between_DATETIME(r *BOOLEAN, a *DATETIME, b *DATETIME, c *DATETIME)

func Sysfunc_not_between_FLOAT

func Sysfunc_not_between_FLOAT(r *BOOLEAN, a *FLOAT, b *FLOAT, c *FLOAT)

func Sysfunc_not_between_INT

func Sysfunc_not_between_INT(r *BOOLEAN, a *INT, b *INT, c *INT)

func Sysfunc_not_between_MONEY

func Sysfunc_not_between_MONEY(r *BOOLEAN, a *MONEY, b *MONEY, c *MONEY)

func Sysfunc_not_between_NUMERIC

func Sysfunc_not_between_NUMERIC(r *BOOLEAN, a *NUMERIC, b *NUMERIC, c *NUMERIC)

func Sysfunc_not_between_SMALLINT

func Sysfunc_not_between_SMALLINT(r *BOOLEAN, a *SMALLINT, b *SMALLINT, c *SMALLINT)

func Sysfunc_not_between_TIME

func Sysfunc_not_between_TIME(r *BOOLEAN, a *TIME, b *TIME, c *TIME)

func Sysfunc_not_between_TINYINT

func Sysfunc_not_between_TINYINT(r *BOOLEAN, a *TINYINT, b *TINYINT, c *TINYINT)

func Sysfunc_not_between_VARBINARY

func Sysfunc_not_between_VARBINARY(r *BOOLEAN, a *VARBINARY, b *VARBINARY, c *VARBINARY)

func Sysfunc_not_between_VARCHAR

func Sysfunc_not_between_VARCHAR(r *BOOLEAN, a *VARCHAR, b *VARCHAR, c *VARCHAR, coll *SYSCOLLATOR)

func Sysfunc_not_between_VOID

func Sysfunc_not_between_VOID(r *BOOLEAN, a *VOID, b *VOID, c *VOID)

func Sysfunc_object_id_BIGINT

func Sysfunc_object_id_BIGINT(r *BIGINT, a *VARCHAR, b *VARCHAR, c *VARCHAR, d *VARCHAR)

func Sysfunc_pi_FLOAT

func Sysfunc_pi_FLOAT(r *FLOAT)

func Sysfunc_power_BIGINT

func Sysfunc_power_BIGINT(r *BIGINT, a *BIGINT, b *FLOAT)

Sysfunc_power_BIGINT computes the power operation for BIGINT. The computation is done by converting operand into float64. The result is thus not precise.

func Sysfunc_power_FLOAT

func Sysfunc_power_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Sysfunc_power_INT

func Sysfunc_power_INT(r *INT, a *INT, b *FLOAT)

func Sysfunc_power_NUMERIC

func Sysfunc_power_NUMERIC(r *NUMERIC, a *NUMERIC, b *FLOAT)

func Sysfunc_principal_id_BIGINT

func Sysfunc_principal_id_BIGINT(r *BIGINT, a *BIGINT, b *VARCHAR)

func Sysfunc_principal_name_VARCHAR

func Sysfunc_principal_name_VARCHAR(r *VARCHAR, a *BIGINT, b *BIGINT)

func Sysfunc_radians_FLOAT

func Sysfunc_radians_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_rand_FLOAT

func Sysfunc_rand_FLOAT(r *FLOAT)

func Sysfunc_random_BIGINT

func Sysfunc_random_BIGINT(r *BIGINT, a *BIGINT, b *BIGINT)

func Sysfunc_random_DATE

func Sysfunc_random_DATE(r *DATE, a *DATE, b *DATE)

func Sysfunc_random_FLOAT

func Sysfunc_random_FLOAT(r *FLOAT, a *FLOAT, b *FLOAT)

func Sysfunc_random_INT

func Sysfunc_random_INT(r *INT, a *INT, b *INT)

func Sysfunc_random_NUMERIC

func Sysfunc_random_NUMERIC(r *NUMERIC, p *INT, s *INT)

func Sysfunc_random_VARCHAR

func Sysfunc_random_VARCHAR(r *VARCHAR, lmin *INT, lmax *INT)

func Sysfunc_replace_VARCHAR

func Sysfunc_replace_VARCHAR(r *VARCHAR, a *VARCHAR, findstr *VARCHAR, replacement *VARCHAR, coll *SYSCOLLATOR)

Sysfunc_replace_VARCHAR returns a copy of 'a', with all specified substring replaces by another string.

Target: fixlen_flag = false, precision is DATATYPE_VARCHAR_PRECISION_MAX, collation is same as 'a' argument. Instruction collation encompasses those of 'a' and 'findstr'-

func Sysfunc_replicate_VARCHAR

func Sysfunc_replicate_VARCHAR(r *VARCHAR, a *VARCHAR, b *INT)

Sysfunc_replicate_VARCHAR returns a string copied many times. If b is NULL or b < 0, a NULL string is returned.

Target: fixlen_flag = false, precision is DATATYPE_VARCHAR_PRECISION_MAX, collation is default.
        If argument 'b' is a literal INT:
                 - the precision is this value * precision of a. Precision is adjusted to the range [1...DATATYPE_VARCHAR_PRECISION_MAX].
                 - if argument 'b' is NULL, precision is 1.

func Sysfunc_right_VARCHAR

func Sysfunc_right_VARCHAR(r *VARCHAR, a *VARCHAR, b *INT)

Sysfunc_right_VARCHAR returns the right substring with 'b' number of runes. If b < 0, an error is returned.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.
        If argument b is a literal INT:
                 - the precision is this value. Precision is adjusted to the range [1...precision of 'a'].
                 - if b is NULL, precision is 1.

func Sysfunc_round_BIGINT

func Sysfunc_round_BIGINT(r *BIGINT, a *BIGINT, b *INT, c *INT)

Sysfunc_round_BIGINT rounds or truncate number to given precision.

ROUND ( numeric_expression, decimal precision [ ,truncate flag ] )

func Sysfunc_round_FLOAT

func Sysfunc_round_FLOAT(r *FLOAT, a *FLOAT, b *INT, c *INT)

Sysfunc_round_FLOAT rounds or truncate number to given precision.

ROUND ( numeric_expression, decimal precision [ ,truncate flag ] )

Rounding is half-up, like MS SQL Server. NOTE: STR and FORMAT functions round half-even, because they use strconv.AppendFloat which rounds his way.

func Sysfunc_round_INT

func Sysfunc_round_INT(r *INT, a *INT, b *INT, c *INT)

Sysfunc_round_INT rounds or truncate number to given precision.

ROUND ( numeric_expression, decimal precision [ ,truncate flag ] )

func Sysfunc_round_NUMERIC

func Sysfunc_round_NUMERIC(r *NUMERIC, a *NUMERIC, b *INT, c *INT)

Sysfunc_round_NUMERIC rounds or truncate number to given precision.

ROUND ( numeric_expression, decimal precision [ ,truncate flag ] )

The rounding mode is round-half-up, like MS SQL Server.

func Sysfunc_rtrim_VARCHAR

func Sysfunc_rtrim_VARCHAR(r *VARCHAR, a *VARCHAR)

Sysfunc_rtrim_VARCHAR discards all trailing blanks.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.

func Sysfunc_schema_id_BIGINT

func Sysfunc_schema_id_BIGINT(r *BIGINT, a *BIGINT, b *VARCHAR)

func Sysfunc_schema_name_VARCHAR

func Sysfunc_schema_name_VARCHAR(r *VARCHAR, a *BIGINT, b *BIGINT)

func Sysfunc_scope_identity

func Sysfunc_scope_identity(r *BIGINT, context *rsql.Context)

func Sysfunc_sign_BIGINT

func Sysfunc_sign_BIGINT(r *BIGINT, a *BIGINT)

func Sysfunc_sign_FLOAT

func Sysfunc_sign_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_sign_INT

func Sysfunc_sign_INT(r *INT, a *INT)

func Sysfunc_sign_NUMERIC

func Sysfunc_sign_NUMERIC(r *NUMERIC, a *NUMERIC)

func Sysfunc_sin_FLOAT

func Sysfunc_sin_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_space_VARCHAR

func Sysfunc_space_VARCHAR(r *VARCHAR, a *INT)

Sysfunc_space_VARCHAR returns a string with only spaces. If a is NULL or a < 0, a NULL string is returned.

Target: fixlen_flag = false, precision is DATATYPE_VARCHAR_PRECISION_MAX, collation is default.
        If argument is a literal INT:
                 - the precision is this value. Precision is adjusted to the range [1...DATATYPE_VARCHAR_PRECISION_MAX].
                 - if argument is NULL, precision is 1.

func Sysfunc_sqrt_FLOAT

func Sysfunc_sqrt_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_square_FLOAT

func Sysfunc_square_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_starts_with_VARCHAR

func Sysfunc_starts_with_VARCHAR(r *BOOLEAN, a *VARCHAR, prefix *VARCHAR, prefix_rune_count_hint *INT, coll *SYSCOLLATOR)

Sysfunc_starts_with_VARCHAR returns true if a string starts with prefix. Pass the rune count of prefix in prefix_rune_count_hint, or -1 if it is unknown.

This function is not a SQL Server function, but is used for expression like    country LIKE 'fr%'

func Sysfunc_str_FLOAT

func Sysfunc_str_FLOAT(r *VARCHAR, a *FLOAT, length *INT, decimal *INT)

Sysfunc_str_FLOAT converts FLOAT to VARCHAR, with specified length and decimal number.

STR ( float expression [ ,length [ ,decimal ] ] )

NOTE: The rounding is half-to-even (21.5->22, 22.5->22, 23.5->24). It is unlike MS SQL Server, which rounds half-up (21.5->22, 22.5->23, 23.5->24)

func Sysfunc_stuff_VARCHAR

func Sysfunc_stuff_VARCHAR(r *VARCHAR, a *VARCHAR, start *INT, length *INT, repl *VARCHAR)

Sysfunc_stuff_VARCHAR returns a copy of string 'a', with section at 'start' and 'length' deleted, replaced by 'repl'. If len(a) == 0 or start <= 0 or length < 0, a NULL string is returned.

Target: fixlen_flag = false, precision is sum of 'a' argument string and 'repl' string. Collation is same as 'a' argument.
        Precision is sum of precision of a and precision of repl, limited to DATATYPE_VARCHAR_PRECISION_MAX.

'start' argument is 1-based.

Note: stuff('hello', 6, 1, 'XXXXXXXXXX') returns NULL. Unfortunately, it is not 'helloXXXXXXXXXX'. I just reproduce the behavior of MS SQL Server.

func Sysfunc_substring_VARCHAR

func Sysfunc_substring_VARCHAR(r *VARCHAR, a *VARCHAR, start *INT, length *INT)

Sysfunc_substring_VARCHAR returns a copy of a substring of 'a'. If 'length' argument < 0, an error is returned.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.
        If argument 'length' is a literal INT:
                 - the precision is this value. Precision is adjusted to the range [1...precision of 'a'].

func Sysfunc_suser_id_BIGINT

func Sysfunc_suser_id_BIGINT(r *BIGINT, a *VARCHAR)

func Sysfunc_suser_name_VARCHAR

func Sysfunc_suser_name_VARCHAR(r *VARCHAR, a *BIGINT)

func Sysfunc_tan_FLOAT

func Sysfunc_tan_FLOAT(r *FLOAT, a *FLOAT)

func Sysfunc_timefromparts_TIME

func Sysfunc_timefromparts_TIME(r *TIME, hour *INT, minute *INT, seconds *INT, fractions *INT, precision *INT)

func Sysfunc_trim_VARCHAR

func Sysfunc_trim_VARCHAR(r *VARCHAR, a *VARCHAR)

Sysfunc_trim_VARCHAR discards all leading and trailing blanks.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.

func Sysfunc_typeof_BIGINT

func Sysfunc_typeof_BIGINT(r *VARCHAR, a *BIGINT)

func Sysfunc_typeof_BIT

func Sysfunc_typeof_BIT(r *VARCHAR, a *BIT)

func Sysfunc_typeof_BOOLEAN

func Sysfunc_typeof_BOOLEAN(r *VARCHAR, a *BOOLEAN)

func Sysfunc_typeof_DATE

func Sysfunc_typeof_DATE(r *VARCHAR, a *DATE)

func Sysfunc_typeof_DATETIME

func Sysfunc_typeof_DATETIME(r *VARCHAR, a *DATETIME)

func Sysfunc_typeof_FLOAT

func Sysfunc_typeof_FLOAT(r *VARCHAR, a *FLOAT)

func Sysfunc_typeof_INT

func Sysfunc_typeof_INT(r *VARCHAR, a *INT)

func Sysfunc_typeof_MONEY

func Sysfunc_typeof_MONEY(r *VARCHAR, a *MONEY)

func Sysfunc_typeof_NUMERIC

func Sysfunc_typeof_NUMERIC(r *VARCHAR, a *NUMERIC)

func Sysfunc_typeof_SMALLINT

func Sysfunc_typeof_SMALLINT(r *VARCHAR, a *SMALLINT)

func Sysfunc_typeof_TIME

func Sysfunc_typeof_TIME(r *VARCHAR, a *TIME)

func Sysfunc_typeof_TINYINT

func Sysfunc_typeof_TINYINT(r *VARCHAR, a *TINYINT)

func Sysfunc_typeof_VARBINARY

func Sysfunc_typeof_VARBINARY(r *VARCHAR, a *VARBINARY)

func Sysfunc_typeof_VARCHAR

func Sysfunc_typeof_VARCHAR(r *VARCHAR, a *VARCHAR)

func Sysfunc_typeof_VOID

func Sysfunc_typeof_VOID(r *VARCHAR, a *VOID)

func Sysfunc_unicode_VARCHAR

func Sysfunc_unicode_VARCHAR(r *INT, a *VARCHAR)

Sysfunc_unicode_VARCHAR return the code of the first rune. If string is empty, returns NULL. Same as Sysfunc_ascii_VARCHAR.

func Sysfunc_upper_VARCHAR

func Sysfunc_upper_VARCHAR(r *VARCHAR, a *VARCHAR)

Sysfunc_upper_VARCHAR converts string to upper case.

Target: fixlen_flag = false, precision and collation are same as 'a' argument.

func Sysfunc_utc_to_local_DATETIME

func Sysfunc_utc_to_local_DATETIME(r *DATETIME, a *DATETIME)

func Unary_minus_BIGINT

func Unary_minus_BIGINT(r *BIGINT, a *BIGINT)

func Unary_minus_FLOAT

func Unary_minus_FLOAT(r *FLOAT, a *FLOAT)

func Unary_minus_INT

func Unary_minus_INT(r *INT, a *INT)

func Unary_minus_NUMERIC

func Unary_minus_NUMERIC(r *NUMERIC, a *NUMERIC)

func Unary_minus_SMALLINT

func Unary_minus_SMALLINT(r *SMALLINT, a *SMALLINT)

func Unary_minus_TINYINT

func Unary_minus_TINYINT(r *SMALLINT, a *TINYINT)

Unary_minus_TINYINT computes the unary minus operation.

NOTE : result type is SMALLINT

func Unary_minus_VOID

func Unary_minus_VOID(r *VOID, a *VOID)

func Write_dataslot_msgp

func Write_dataslot_msgp(mw *msgp.Writer, dataslot rsql.IDataslot)

Write_dataslot_msgp is the main function that writes dataslot as messagepack into msgp.Writer.

func Write_datatype_msgp

func Write_datatype_msgp(mw *msgp.Writer, dataslot rsql.IDataslot)

Write_datatype_msgp is the main function that writes datatype as messagepack into msgp.Writer.

func Write_serialized_row

func Write_serialized_row(dest rsql.Tuple, row rsql.Row) (res rsql.Tuple, rsql_err *rsql.Error)

Write_serialized_row writes row values into dest []byte. Length of dest slice must 0.

The result []byte layout is:
        ======================= header of offsets ==================----------------------------- data ------------------------------------
        | offset 0 | offset 1 | ... | offset n-1 | offset sentinel | serialized field 0 | serialized field 1 | ... | serialized field n-1 |
        ============================================================-----------------------------------------------------------------------

offset is a uint16 value:
        - offset i is the start index of the serialized field i.
        - offset sentinel is the total length of the tuple, in bytes.
        - if offset of subsequent tuple == offset of current tuple, length of serialized field is 0, which means that value is NULL

Types

type BIGINT

type BIGINT struct {
	Header
	// contains filtered or unexported fields
}

func Clone_BIGINT

func Clone_BIGINT(kind rsql.Kind_t, a *BIGINT) *BIGINT

func New_BIGINT_NULL

func New_BIGINT_NULL(kind rsql.Kind_t) *BIGINT

New_BIGINT_NULL creates a new data.BIGINT initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_VARIABLE_BIGINT_value

func New_VARIABLE_BIGINT_value(val int64) *BIGINT

New_VARIABLE_BIGINT_value creates a new data.BIGINT, used when we create a new global variable with initial value.

Exactly the same as New_literal_BIGINT_value, except that the dataslot is KIND_VAR_LEAF.

Used to create variables _@system_user_id, etc.

func New_literal_BIGINT_value

func New_literal_BIGINT_value(val int64) *BIGINT

New_literal_BIGINT_value creates a new data.BIGINT from a value.

func (*BIGINT) Data_val

func (a *BIGINT) Data_val() int64

func (*BIGINT) RO_LEAF_hashval

func (a *BIGINT) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*BIGINT) String

func (a *BIGINT) String() string

type BIT

type BIT struct {
	Header
	// contains filtered or unexported fields
}

func Clone_BIT

func Clone_BIT(kind rsql.Kind_t, a *BIT) *BIT

func New_BIT_NULL

func New_BIT_NULL(kind rsql.Kind_t) *BIT

New_BIT_NULL creates a new data.BIT initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_BIT_value

func New_literal_BIT_value(val uint8) *BIT

New_literal_BIT_value creates a new data.BIT from a value. If val == 0, bit value is set to 0. Else, it is set to 1.

func (*BIT) RO_LEAF_hashval

func (a *BIT) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*BIT) Set_to_0

func (r *BIT) Set_to_0()

func (*BIT) Set_to_1

func (r *BIT) Set_to_1()

func (*BIT) String

func (a *BIT) String() string

type BOOLEAN

type BOOLEAN struct {
	Header
	// contains filtered or unexported fields
}

BOOLEAN represents a boolean value, which is TRUE, FALSE, or NULL (unknown)

func Clone_BOOLEAN

func Clone_BOOLEAN(kind rsql.Kind_t, a *BOOLEAN) *BOOLEAN

func New_BOOLEAN_NULL

func New_BOOLEAN_NULL(kind rsql.Kind_t) *BOOLEAN

New_BOOLEAN_NULL creates a new data.BOOLEAN initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_BOOLEAN

func New_literal_BOOLEAN(s string) *BOOLEAN

New_literal_BOOLEAN creates a new data.BOOLEAN from literal string.

func New_literal_BOOLEAN_value

func New_literal_BOOLEAN_value(val bool) *BOOLEAN

New_literal_BOOLEAN_value creates a new data.BOOLEAN from a value.

func (*BOOLEAN) Is_true

func (a *BOOLEAN) Is_true() bool

func (*BOOLEAN) RO_LEAF_hashval

func (a *BOOLEAN) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*BOOLEAN) String

func (a *BOOLEAN) String() string

type Case_element_t

type Case_element_t struct {
	Cond *BOOLEAN
	Val  interface{}
}

Case_element_t is used as element in argument list for CASE expressions.

type Compsort_t

type Compsort_t int // 0 is equality. 1 is greater, and -1 is less.

func Comp_for_sort_BIGINT

func Comp_for_sort_BIGINT(a *BIGINT, b *BIGINT) Compsort_t

Comp_for_sort_BIGINT always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_BIT

func Comp_for_sort_BIT(a *BIT, b *BIT) Compsort_t

Comp_for_sort_BIT always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_DATETIME

func Comp_for_sort_DATETIME(a *DATETIME, b *DATETIME) Compsort_t

Comp_for_sort_DATETIME always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_FLOAT

func Comp_for_sort_FLOAT(a *FLOAT, b *FLOAT) Compsort_t

Comp_for_sort_FLOAT always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_INT

func Comp_for_sort_INT(a *INT, b *INT) Compsort_t

Comp_for_sort_INT always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_NUMERIC

func Comp_for_sort_NUMERIC(a *NUMERIC, b *NUMERIC) Compsort_t

Comp_for_sort_NUMERIC always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_SMALLINT

func Comp_for_sort_SMALLINT(a *SMALLINT, b *SMALLINT) Compsort_t

Comp_for_sort_SMALLINT always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_TINYINT

func Comp_for_sort_TINYINT(a *TINYINT, b *TINYINT) Compsort_t

Comp_for_sort_TINYINT always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_VARBINARY

func Comp_for_sort_VARBINARY(a *VARBINARY, b *VARBINARY) Compsort_t

Comp_for_sort_VARBINARY always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

func Comp_for_sort_VARCHAR

func Comp_for_sort_VARCHAR(a *VARCHAR, b *VARCHAR, coll *SYSCOLLATOR) Compsort_t

Comp_for_sort_VARCHAR always returns a result.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

NOTE: coll.data_cached_collator MUST BE INITIALIZED WITH A VALID *collate.Collator, or it panics.

func Comp_for_sort_xxxINT_yyyINT

func Comp_for_sort_xxxINT_yyyINT(a rsql.AnyINT, b rsql.AnyINT) Compsort_t

Comp_for_sort_xxxINT_yyyINT always returns a result.

Arguments can be TINYINT, SMALLINT, INT or BIGINT.

NULL value < any non-NULL value
NULL value == NULL value

result is 0 if equal, 1 if greater and -1 if less.

NOTE: if a or b is error, panics.

type DATE

type DATE DATETIME

func Clone_DATE

func Clone_DATE(kind rsql.Kind_t, a *DATE) *DATE

func New_DATE_NULL

func New_DATE_NULL(kind rsql.Kind_t) *DATE

New_DATE_NULL creates a new data.DATE initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_DATE_value

func New_literal_DATE_value(val string) (*DATE, *rsql.Error)

New_literal_DATE_value creates a new data.DATE from a value.

Value string must be of the form "1983-04-20".

func (*DATE) RO_LEAF_hashval

func (a *DATE) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*DATE) String

func (a *DATE) String() string

type DATETIME

type DATETIME struct {
	Header
	// contains filtered or unexported fields
}

func Clone_DATETIME

func Clone_DATETIME(kind rsql.Kind_t, a *DATETIME) *DATETIME

func New_DATETIME_NULL

func New_DATETIME_NULL(kind rsql.Kind_t) *DATETIME

New_DATETIME_NULL creates a new data.DATETIME initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_VARIABLE_DATETIME_NULL

func New_VARIABLE_DATETIME_NULL() *DATETIME

New_VARIABLE_DATETIME_NULL creates a new data.DATETIME, used when we create a new global variable with NULL initial value.

Exactly the same as New_VARCHAR_NULL, except that the dataslot is KIND_VAR_LEAF.

func New_literal_DATETIME_value

func New_literal_DATETIME_value(val string) (*DATETIME, *rsql.Error)

New_literal_DATETIME_value creates a new data.DATETIME from a value.

Value string must be of the form "1983-04-20 13:30:04.10".

func (*DATETIME) RO_LEAF_hashval

func (a *DATETIME) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*DATETIME) String

func (a *DATETIME) String() string

type FLOAT

type FLOAT struct {
	Header
	// contains filtered or unexported fields
}

func Clone_FLOAT

func Clone_FLOAT(kind rsql.Kind_t, a *FLOAT) *FLOAT

func New_FLOAT_NULL

func New_FLOAT_NULL(kind rsql.Kind_t) *FLOAT

New_FLOAT_NULL creates a new data.FLOAT initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_FLOAT

func New_literal_FLOAT(s string) (*FLOAT, *rsql.Error)

New_literal_FLOAT creates a new data.FLOAT from literal integer string. Returns an error if invalid string, or if result is Inf or Nan.

func New_literal_FLOAT_value

func New_literal_FLOAT_value(val float64) (*FLOAT, *rsql.Error)

New_literal_FLOAT_value creates a new data.FLOAT from a value. Returns an error if val is Inf or Nan.

func (*FLOAT) RO_LEAF_hashval

func (a *FLOAT) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*FLOAT) String

func (a *FLOAT) String() string
type Header struct {
	Data_datatype rsql.Datatype_t
	Data_kind     rsql.Kind_t // KIND_RO_LEAF, KIND_VAR_LEAF, KIND_COL_LEAF, KIND_TMP
	// contains filtered or unexported fields
}

Header is embedded by all dataslot objects (data.INT, data.FLOAT, etc). The Header struct implements rsql.IDataslot interface.

func (*Header) Datatype

func (head *Header) Datatype() rsql.Datatype_t

func (*Header) Error

func (head *Header) Error() *rsql.Error

func (*Header) Kind

func (head *Header) Kind() rsql.Kind_t

func (*Header) NULL_flag

func (head *Header) NULL_flag() bool

func (*Header) Set_Error

func (head *Header) Set_Error(rsql_err *rsql.Error)

func (*Header) Set_kind

func (head *Header) Set_kind(kind rsql.Kind_t)

func (*Header) Set_to_NULL

func (head *Header) Set_to_NULL()

type INT

type INT struct {
	Header
	// contains filtered or unexported fields
}

func Clone_INT

func Clone_INT(kind rsql.Kind_t, a *INT) *INT

func New_INT_NULL

func New_INT_NULL(kind rsql.Kind_t) *INT

New_INT_NULL creates a new data.INT initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_VARIABLE_INT_value

func New_VARIABLE_INT_value(val int32) *INT

New_VARIABLE_INT_value creates a new data.INT, used when we create a new global variable with initial value.

Exactly the same as New_literal_INT_value, except that the dataslot is KIND_VAR_LEAF.

It was used to create variables _@system_user_id, etc. But now, we prefer to use New_VARIABLE_BIGINT_value() instead, as login_id etc in dictionary are 64 bits values.

func New_literal_INT

func New_literal_INT(s string) (*INT, *rsql.Error)

New_literal_INT creates a new data.INT from literal integer string. Returns an error if invalid string.

func New_literal_INT_value

func New_literal_INT_value(val int32) *INT

New_literal_INT_value creates a new data.INT from a value.

func (*INT) Data_val

func (a *INT) Data_val() int64

func (*INT) RO_LEAF_hashval

func (a *INT) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*INT) String

func (a *INT) String() string

type MONEY

type MONEY NUMERIC

func Clone_MONEY

func Clone_MONEY(kind rsql.Kind_t, a *MONEY) *MONEY

func New_MONEY_NULL

func New_MONEY_NULL(kind rsql.Kind_t) *MONEY

New_MONEY_NULL creates a new data.MONEY initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_MONEY

func New_literal_MONEY(s string) (*MONEY, *rsql.Error)

New_literal_MONEY creates a new data.MONEY, converting string argument to number. Returns an error if invalid string, or if result is Inf or Nan.

func (*MONEY) RO_LEAF_hashval

func (a *MONEY) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*MONEY) String

func (a *MONEY) String() string

type NUMERIC

type NUMERIC struct {
	Header
	Data_precision uint16
	Data_scale     uint16
	// contains filtered or unexported fields
}

func Clone_NUMERIC

func Clone_NUMERIC(kind rsql.Kind_t, a *NUMERIC) *NUMERIC

func New_NUMERIC_NULL

func New_NUMERIC_NULL(kind rsql.Kind_t, precision uint16, scale uint16) *NUMERIC

New_NUMERIC_NULL creates a new data.NUMERIC initialized to NULL. Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc.

func New_literal_NUMERIC

func New_literal_NUMERIC(s string) (*NUMERIC, *rsql.Error)

New_literal_NUMERIC creates a new data.NUMERIC, converting string argument to number. Returns an error if invalid string, or if result is Inf or Nan.

func (*NUMERIC) RO_LEAF_hashval

func (a *NUMERIC) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*NUMERIC) String

func (a *NUMERIC) String() string

type REGEXPLIKE

type REGEXPLIKE struct {
	Header
	// contains filtered or unexported fields
}

func New_REGEXPLIKE_NULL

func New_REGEXPLIKE_NULL(kind rsql.Kind_t) *REGEXPLIKE

New_REGEXPLIKE_NULL creates a new data.REGEXPLIKE initialized to NULL.

In the AST tree, data.REGEXPLIKE inherits the collation from the VARCHAR it has been cast from.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_REGEXPLIKE_value

func New_literal_REGEXPLIKE_value(val string, ec rune) (*REGEXPLIKE, *rsql.Error)

New_literal_REGEXPLIKE_value creates a new data.REGEXPLIKE from a value. Returns an error if string too long or invalid. val is a LIKE expression, e.g. 'art[_][a-dz][0-9]%' ec argument is the escape character. Pass like.NO_ESCAPE_RUNE to disable it.

func (*REGEXPLIKE) RO_LEAF_hashval

func (a *REGEXPLIKE) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*REGEXPLIKE) String

func (a *REGEXPLIKE) String() string

type SMALLINT

type SMALLINT struct {
	Header
	// contains filtered or unexported fields
}

func Clone_SMALLINT

func Clone_SMALLINT(kind rsql.Kind_t, a *SMALLINT) *SMALLINT

func New_SMALLINT_NULL

func New_SMALLINT_NULL(kind rsql.Kind_t) *SMALLINT

New_SMALLINT_NULL creates a new data.SMALLINT initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_SMALLINT_value

func New_literal_SMALLINT_value(val int16) *SMALLINT

New_literal_SMALLINT_value creates a new data.SMALLINT from a value.

func (*SMALLINT) Data_val

func (a *SMALLINT) Data_val() int64

func (*SMALLINT) RO_LEAF_hashval

func (a *SMALLINT) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*SMALLINT) String

func (a *SMALLINT) String() string

type SYSCOLLATOR

type SYSCOLLATOR struct {
	Header
	// contains filtered or unexported fields
}

SYSCOLLATOR represents a collator object

SYSCOLLATOR is always created as a SYSCOLLATOR literal.
    - Normally, it should never be error. But if the VM cannot lazily create the inner actual collator, data_error will be filled with the proper error, which propagates to the result in the normal way.
    - It is never NULL.

func New_literal_SYSCOLLATOR

func New_literal_SYSCOLLATOR(collation_string string) *SYSCOLLATOR

New_literal_SYSCOLLATOR creates a new data.SYSCOLLATOR from a string.

THE collate.Collator OBJECT IS NOT CREATED IN THIS FUNCTION. It will be created lazily later, in the VM, to avoid creating useless collation objects.

func New_literal_SYSCOLLATOR_NO_LAZY

func New_literal_SYSCOLLATOR_NO_LAZY(collation_string string) (*SYSCOLLATOR, *rsql.Error)

New_literal_SYSCOLLATOR_NO_LAZY creates a new data.SYSCOLLATOR from a string.

It is the same as New_literal_SYSCOLLATOR(), but the collate.Collator object IS CREATED in this function.

func (*SYSCOLLATOR) RO_LEAF_hashval

func (a *SYSCOLLATOR) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*SYSCOLLATOR) String

func (a *SYSCOLLATOR) String() string

type SYSLANGUAGE

type SYSLANGUAGE struct {
	Header
	// contains filtered or unexported fields
}

SYSLANGUAGE represents a language object

It can contain an error or a NULL value, like any other datatype.

func Must_New_literal_SYSLANGUAGE_value

func Must_New_literal_SYSLANGUAGE_value(val string) *SYSLANGUAGE

Must_New_literal_SYSLANGUAGE_value creates a new data.SYSLANGUAGE from a value. Panics if error occurs.

func New_SYSLANGUAGE_NULL

func New_SYSLANGUAGE_NULL(kind rsql.Kind_t) *SYSLANGUAGE

New_SYSLANGUAGE_NULL creates a new data.SYSLANGUAGE initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_VARIABLE_SYSLANGUAGE_value

func New_VARIABLE_SYSLANGUAGE_value(val string) (*SYSLANGUAGE, *rsql.Error)

New_VARIABLE_SYSLANGUAGE_value creates a new data.SYSLANGUAGE, used when we create a new global variable with initial value.

Exactly the same as New_literal_SYSLANGUAGE_value, except that the dataslot is KIND_VAR_LEAF.

func New_literal_SYSLANGUAGE_value

func New_literal_SYSLANGUAGE_value(val string) (*SYSLANGUAGE, *rsql.Error)

New_literal_SYSLANGUAGE_value creates a new data.SYSLANGUAGE from a value.

Valid languages exist in lang.LANGUAGE_TO_TAG_MAP, else returns an error.

Valid languages can be of two forms:
    - "French", "Spanish", "English", etc. This form is used by MS SQL Server, and allowed by rsql for compatibility with MS SQL Server.
    - [fr-FR], [fr-CH], [en-US], etc. This is the preferred form, because some information can change for the same language depending on countries.

func (*SYSLANGUAGE) RO_LEAF_hashval

func (a *SYSLANGUAGE) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*SYSLANGUAGE) Set_DMY

func (syslang *SYSLANGUAGE) Set_DMY(val string)

Set_DMY is only used for test.

func (*SYSLANGUAGE) Set_firstdayofweek

func (syslang *SYSLANGUAGE) Set_firstdayofweek(val int)

Set_firstdayofweek is only used for test.

func (*SYSLANGUAGE) String

func (syslang *SYSLANGUAGE) String() string

func (*SYSLANGUAGE) Values

func (syslang *SYSLANGUAGE) Values() (language string, first_day_of_week int, DMY string)

type TIME

type TIME DATETIME

func Clone_TIME

func Clone_TIME(kind rsql.Kind_t, a *TIME) *TIME

func New_TIME_NULL

func New_TIME_NULL(kind rsql.Kind_t) *TIME

New_TIME_NULL creates a new data.TIME initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_TIME_value

func New_literal_TIME_value(val string) (*TIME, *rsql.Error)

New_literal_TIME_value creates a new data.TIME from a value.

Value string must be of the form "15:04:05".

func (*TIME) RO_LEAF_hashval

func (a *TIME) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*TIME) String

func (a *TIME) String() string

type TINYINT

type TINYINT struct {
	Header
	// contains filtered or unexported fields
}

func Clone_TINYINT

func Clone_TINYINT(kind rsql.Kind_t, a *TINYINT) *TINYINT

func New_TINYINT_NULL

func New_TINYINT_NULL(kind rsql.Kind_t) *TINYINT

New_TINYINT_NULL creates a new data.TINYINT initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_TINYINT_value

func New_literal_TINYINT_value(val uint8) *TINYINT

New_literal_TINYINT_value creates a new data.TINYINT from a value.

func (*TINYINT) Data_val

func (a *TINYINT) Data_val() int64

func (*TINYINT) RO_LEAF_hashval

func (a *TINYINT) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*TINYINT) String

func (a *TINYINT) String() string

type VARBINARY

type VARBINARY struct {
	Header
	Data_precision uint16
	// contains filtered or unexported fields
}

func Clone_VARBINARY

func Clone_VARBINARY(kind rsql.Kind_t, a *VARBINARY) *VARBINARY

func New_VARBINARY_NULL

func New_VARBINARY_NULL(kind rsql.Kind_t, precision uint16) *VARBINARY

New_VARBINARY_NULL creates a new data.VARBINARY initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_VARBINARY

func New_literal_VARBINARY(s string) (*VARBINARY, *rsql.Error)

New_literal_VARBINARY creates a new data.VARBINARY from literal hexastring string.

Lex_type must be prefixed by "0x".

func New_literal_VARBINARY_value

func New_literal_VARBINARY_value(val []byte) (*VARBINARY, *rsql.Error)

New_literal_VARBINARY_value creates a new data.VARBINARY from a value.

func (*VARBINARY) RO_LEAF_hashval

func (a *VARBINARY) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*VARBINARY) String

func (a *VARBINARY) String() string

type VARCHAR

type VARCHAR struct {
	Header
	Data_precision   uint16
	Data_fixlen_flag bool
	// contains filtered or unexported fields
}

VARCHAR represents a string value. The SQL CHAR datatype is in fact data.VARCHAR with Data_fixlen_flag=true.

func Clone_VARCHAR

func Clone_VARCHAR(kind rsql.Kind_t, a *VARCHAR) *VARCHAR

func New_VARCHAR_NULL

func New_VARCHAR_NULL(kind rsql.Kind_t, precision uint16, fixlen_flag bool) *VARCHAR

New_VARCHAR_NULL creates a new data.VARCHAR initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_VARIABLE_VARCHAR_value

func New_VARIABLE_VARCHAR_value(val string) (*VARCHAR, *rsql.Error)

New_VARIABLE_VARCHAR_value creates a new data.VARCHAR, used when we create a new global variable with initial value.

Exactly the same as New_literal_VARCHAR_value, except that the dataslot is KIND_VAR_LEAF.

Used to create variables _@current_db, etc.

func New_literal_VARCHAR

func New_literal_VARCHAR(s string) (*VARCHAR, *rsql.Error)

New_literal_VARCHAR creates a new data.VARCHAR from a string. Returns an error if string too long.

func (*VARCHAR) Contains

func (a *VARCHAR) Contains(part []byte) bool

func (*VARCHAR) RO_LEAF_hashval

func (a *VARCHAR) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*VARCHAR) String

func (a *VARCHAR) String() string

func (*VARCHAR) Stringval

func (a *VARCHAR) Stringval() string

type VOID

type VOID struct {
	Header
}

VOID represents a NULL literal

func Clone_VOID

func Clone_VOID(kind rsql.Kind_t, a *VOID) *VOID

func New_VOID_NULL

func New_VOID_NULL(kind rsql.Kind_t) *VOID

New_VOID_NULL creates a new data.VOID initialized to NULL.

Argument 'kind' is kind of node : KIND_RO_LEAF, KIND_VAR_LEAF, etc

func New_literal_VOID_NULL

func New_literal_VOID_NULL() *VOID

New_literal_VOID_NULL creates a new data.VOID.

func (*VOID) RO_LEAF_hashval

func (a *VOID) RO_LEAF_hashval() uint32

RO_LEAF_hashval returns a hash of a KIND_RO_LEAF dataslot value. It is used during Common Subexpression Elimination.

func (*VOID) String

func (a *VOID) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL