<commit_before>#!/usr/local/bin/node

var sys = require("sys");
var db = require("../lib/mysql-native").createTCPClient(); // localhost:3306 by default
db.auto_prepare = true;
function dump_rows(cmd)
{
   cmd.addListener('row', function(r) { sys.puts("row: " + sys.inspect(r)); } );
}

db.auth("test", "testuser", "testpass");

var params = [null, 'test', null, 'test', 'test', null, 'test', 8, 'test', 'testagain',
null, 'test', null, 'test', 'test', null, 'test', 8, 'test', 'testagain', undefined]

dump_rows(db.execute("select ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?", params));
dump_rows(db.execute("select ?,?", ["hello", null]));
dump_rows(db.execute("select ?,?,?,?,?,?", [null, 'hola', null, 'test', 'test2', 'another str']));
dump_rows(db.execute("select ?,?,?,?,?,?", [null, 'hola', 'word', null, 'sdfsdf', '5']));
db.close();<commit_msg>Added insert null param test<commit_after>#!/usr/local/bin/node

var sys = require("sys");
var db = require("../lib/mysql-native").createTCPClient(); // localhost:3306 by default
db.auto_prepare = true;
function dump_rows(cmd)
{
   cmd.addListener('row', function(r) { sys.puts("row: " + sys.inspect(r)); } );
}

db.auth("test", "root", "root");


var params = [null, 'test', null, 'test', 'test', null, 'test', 8, 'test', 'testagain',
null, 'test', null, 'test', 'test', null, 'test', 8, 'test', 'testagain', undefined]

dump_rows(db.execute("select ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?", params));
dump_rows(db.execute("select ?,?", ["hello", null]));
dump_rows(db.execute("select ?,?,?,?,?,?", [null, 'hola', null, 'test', 'test2', 'another str']));
dump_rows(db.execute("select ?,?,?,?,?,?", [null, 'hola', 'word', null, 'sdfsdf', '5']));

db.query("create temporary table nullparams( \
  id int(11) unsigned NOT NULL AUTO_INCREMENT, \
  a int(11) unsigned NULL, \
  b varchar(255) CHARACTER SET utf8 DEFAULT NULL, \
  c text CHARACTER SET utf8, \
  PRIMARY KEY (id) \
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;").addListener('end', function() {
  dump_rows(db.execute("insert into nullparams (a, b, c) values (?,?,?)", [null, "word", null]))
  dump_rows(db.execute("select * from nullparams"))
  db.close();  
})

{'fraction_non_alphanumeric': 0.2708618331053352, 'fraction_numerical': 0.012311901504787962, 'mean_word_length': 6.032051282051282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2454267', 'n_tokens_mistral': 839, 'n_tokens_neox': 804, 'n_words': 180}