MCPcopy Create free account
hub / github.com/sql-js/sql.js / test_zero_byte_index

Function test_zero_byte_index

test/test_functions.js:33–41  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

31 db.exec("CREATE TABLE test3 (data); INSERT INTO test3 VALUES (x'6100ff'), (x'ffffff00ffff');");
32
33 function test_zero_byte_index(data) {
34 // Data is a Uint8Array
35 for (var i=0; i<data.length; i++) {
36 if (data[i] === 0) {
37 return i;
38 }
39 }
40 return -1;
41 };
42
43 db.create_function("TestZeroByteIndex", test_zero_byte_index);
44 result = db.exec("SELECT TestZeroByteIndex(data) FROM test3;");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…