Skip to content

Commit

Permalink
Restructure egg layout a bit (move module tests into tests dir as str…
Browse files Browse the repository at this point in the history
…ess-test.scm and add 'run.scm' to support automated salmonella tests, and remove unused tests. To actually make this work we'll need to get rid of the requirement to make a secrets file. Perhaps use the env or something?)

--HG--
rename : test-freetds-module.scm => tests/stress-test.scm
rename : test-freetds-secret-default.scm => tests/test-freetds-secret-default.scm
  • Loading branch information
Peter Bex committed Apr 24, 2011
1 parent c56b13c commit 08c3d99
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 851 deletions.
99 changes: 54 additions & 45 deletions TODO
Expand Up @@ -29,50 +29,6 @@
#+END_SRC
* TODO test cases
throw in some null strings, too.
* TODO [#A] determining whether data is NULL
should we zero the memory first? maybe it doesn't touch it. never
mind; see guide, p. 55:

#+BEGIN_QUOTE
When a row containing NULL values is fetched from a server,
Client-Library substitutes specified “null substitution values” for
the null columns when copying the row data to program variables.

#+BEGIN_EXAMPLE
Destination type Null substitution value
CS_BINARY_TYPE Empty array
CS_VARBINARY_TYPE Empty array
CS_BIT_TYPE 0
CS_CHAR_TYPE Empty string
CS_VARCHAR_TYPE Empty string
CS_DATE_TYPE 4 bytes of zeros
CS_DATETIME_TYPE 8 bytes of zeros
CS_DATETIME4_TYPE 4 bytes of zeros
CS_TINYINT_TYPE 0
CS_SMALLINT_TYPE 0
CS_INT_TYPE 0
CS_DECIMAL_TYPE 0.0 (with default scale and precision)
CS_NUMERIC_TYPE 0.0 (with default scale and precision)
CS_FLOAT_TYPE 0.0
CS_REAL_TYPE 0.0
CS_MONEY_TYPE $0.0
CS_MONEY4_TYPE $0.0
CS_BOUNDARY_TYPE Empty string
CS_SENSITIVITY_TYPE Empty string
CS_TEXT_TYPE Empty string
CS_TIME_TYPE 4 bytes of zeros
CS_IMAGE_TYPE Empty array
#+END_EXAMPLE

To change null substitution values, an application can call the
CS-Library routine =cs_setnull=.
#+END_QUOTE

postgre has a =PQgetisnull=, by the way; and the egg returns
=(sql-null)=.

this is top priority now, unfortunately, especially with dates;
which throw an error when NULL.
* TODO =make-{context, connection, etc.}= -> ={context, connect}=
* TODO abstract away =context*=?
no, let's provide it initially; "power users" may yet want to
Expand Down Expand Up @@ -100,7 +56,6 @@
binary(8) column. A nullable timestamp column is semantically
equivalent to a varbinary(8) column.
#+END_QUOTE
* TODO dynamic queries
* TODO chunking text, images (=ct_get_data=)
* TODO varbinary
# <<varbinary>>
Expand Down Expand Up @@ -195,6 +150,60 @@
an extra query every time? is it the case that you have no idea how
many 0s are significant? i think so. or is it the case that 256
corresponds to only 4 bytes?
* TODO Prepared statements
This can be done using "ct_dynamic". We may not want to do this if
prepared statements can also be done through SQL (not sure). Also,
it introduces additional library complexity for something that's rarely
absolutely necessary - the overhead is usually in query exection,
not planning.
* DONE dynamic queries
This referred to parameterizable queries. Real "ct_dynamic" dynamic
queries may be useful to do later; this can create actual prepared
statements and return a handle to them.
* DONE [#A] determining whether data is NULL
should we zero the memory first? maybe it doesn't touch it. never
mind; see guide, p. 55:

#+BEGIN_QUOTE
When a row containing NULL values is fetched from a server,
Client-Library substitutes specified “null substitution values” for
the null columns when copying the row data to program variables.

#+BEGIN_EXAMPLE
Destination type Null substitution value
CS_BINARY_TYPE Empty array
CS_VARBINARY_TYPE Empty array
CS_BIT_TYPE 0
CS_CHAR_TYPE Empty string
CS_VARCHAR_TYPE Empty string
CS_DATE_TYPE 4 bytes of zeros
CS_DATETIME_TYPE 8 bytes of zeros
CS_DATETIME4_TYPE 4 bytes of zeros
CS_TINYINT_TYPE 0
CS_SMALLINT_TYPE 0
CS_INT_TYPE 0
CS_DECIMAL_TYPE 0.0 (with default scale and precision)
CS_NUMERIC_TYPE 0.0 (with default scale and precision)
CS_FLOAT_TYPE 0.0
CS_REAL_TYPE 0.0
CS_MONEY_TYPE $0.0
CS_MONEY4_TYPE $0.0
CS_BOUNDARY_TYPE Empty string
CS_SENSITIVITY_TYPE Empty string
CS_TEXT_TYPE Empty string
CS_TIME_TYPE 4 bytes of zeros
CS_IMAGE_TYPE Empty array
#+END_EXAMPLE

To change null substitution values, an application can call the
CS-Library routine =cs_setnull=.
#+END_QUOTE

postgre has a =PQgetisnull=, by the way; and the egg returns
=(sql-null)=.

this is top priority now, unfortunately, especially with dates;
which throw an error when NULL.
* DONE fix the fucking memory problems (unusable?)
CLOSED: [2011-04-11 Mon 19:23]
- CLOSING NOTE [2011-04-11 Mon 19:24] \\
Expand Down
6 changes: 5 additions & 1 deletion freetds.meta
Expand Up @@ -7,4 +7,8 @@
"Peter Bex")
(synopsis "Bindings for FreeTDS")
(files "freetds.scm"
"freetds.setup"))
"freetds.setup"
"freetds.meta"
"tests/test-freetds-secret-default.scm"
"tests/stress-test.scm"
"tests/run.scm"))

0 comments on commit 08c3d99

Please sign in to comment.