<commit_before>NULL = (1 << 16) - 1

TYPE =
  # Zero-length types
  0x1F:
    type: 'NULL'
    name: 'Null'

  # Fixed-length types
  0x30:
    type: 'INT1'
    name: 'TinyInt'
    declaration: () ->
      'tinyint'
    writeParameterData: (buffer, parameter) ->
      # ParamMetaData (TYPE_INFO)
      buffer.writeUInt8(typeByName.IntN.id)
      buffer.writeUInt8(1)

      # ParamLenData
      if typeof parameter.value == 'undefined' || parameter == null
        buffer.writeUInt8(0)
      else
        buffer.writeUInt8(1)
        buffer.writeInt8(parameter.value)
  0x32:
    type: 'BIT'
    name: 'Bit'
  0x34:
    type: 'INT2'
    name: 'SmallInt'
    declaration: () ->
      'smallint'
    writeParameterData: (buffer, parameter) ->
      # ParamMetaData (TYPE_INFO)
      buffer.writeUInt8(typeByName.IntN.id)
      buffer.writeUInt8(2)

      # ParamLenData
      if typeof parameter.value == 'undefined' || parameter == null
        buffer.writeUInt8(0)
      else
        buffer.writeUInt8(2)
        buffer.writeInt16LE(parameter.value)
  0x38:
    type: 'INT4'
    name: 'Int'
    declaration: () ->
      'int'
    writeParameterData: (buffer, parameter) ->
      # ParamMetaData (TYPE_INFO)
      buffer.writeUInt8(typeByName.IntN.id)
      buffer.writeUInt8(4)

      # ParamLenData
      if typeof parameter.value == 'undefined' || parameter == null
        buffer.writeUInt8(0)
      else
        buffer.writeUInt8(4)
        buffer.writeInt32LE(parameter.value)
  0x3A:
    type: 'DATETIM4'
    name: 'SmallDateTime'
  0x3B:
    type: 'FLT4'
    name: 'Real'
  0x3C:
    type: 'MONEY'
    name: 'Money'<commit_msg>Simplify tests for when to send tinyint, smallint and int parameters as null or as a value.<commit_after>NULL = (1 << 16) - 1

TYPE =
  # Zero-length types
  0x1F:
    type: 'NULL'
    name: 'Null'

  # Fixed-length types
  0x30:
    type: 'INT1'
    name: 'TinyInt'
    declaration: () ->
      'tinyint'
    writeParameterData: (buffer, parameter) ->
      # ParamMetaData (TYPE_INFO)
      buffer.writeUInt8(typeByName.IntN.id)
      buffer.writeUInt8(1)

      # ParamLenData
      if parameter.value?
        buffer.writeUInt8(1)
        buffer.writeInt8(parameter.value)
      else
        buffer.writeUInt8(0)
  0x32:
    type: 'BIT'
    name: 'Bit'
  0x34:
    type: 'INT2'
    name: 'SmallInt'
    declaration: () ->
      'smallint'
    writeParameterData: (buffer, parameter) ->
      # ParamMetaData (TYPE_INFO)
      buffer.writeUInt8(typeByName.IntN.id)
      buffer.writeUInt8(2)

      # ParamLenData
      if parameter.value?
        buffer.writeUInt8(2)
        buffer.writeInt16LE(parameter.value)
      else
        buffer.writeUInt8(0)
  0x38:
    type: 'INT4'
    name: 'Int'
    declaration: () ->
      'int'
    writeParameterData: (buffer, parameter) ->
      # ParamMetaData (TYPE_INFO)
      buffer.writeUInt8(typeByName.IntN.id)
      buffer.writeUInt8(4)

      # ParamLenData
      if parameter.value?
        buffer.writeUInt8(4)
        buffer.writeInt32LE(parameter.value)
      else
        buffer.writeUInt8(0)
  0x3A:
    type: 'DATETIM4'
    name: 'SmallDateTime'
  0x3B:
    type: 'FLT4'
    name: 'Real'
  0x3C:
    type: 'MONEY'
    name: 'Money'
{'fraction_non_alphanumeric': 0.11949099937926753, 'fraction_numerical': 0.03414028553693358, 'mean_word_length': 2.3329886246122027, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2057140', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1151, 'n_words': 221}