Skip to content

Commit a9a5c33

Browse files
committed
protocol doc
1 parent 6c5ef03 commit a9a5c33

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

protocol_doc/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Use the header names to identify them, don't depend on the order.
340340
| 2 | name | The name of the column. |
341341
| 3 | type | The SQL type of the column. |
342342
| 4 | length | This length value can help displaying the table in a console window. (Fixed-length character display) |
343-
| 5 | typesizes | Optional. Only returned when using the ODBC driver and sent the command `Xsizeheader 1`. Contains the scale and precision (two space separated values) for the types of the columns. |
343+
| 5 | typesizes | Optional. Only returned if enabled by the command `Xsizeheader 1`. Contains the scale and precision (two space separated values) for the types of the columns. Currently used only by the ODBC driver. |
344344

345345
Since the string values in the tuples contain escaped values (like `"\t"`), you can freely split or scan through the rows
346346
by looking for tabulator characters or for their combinations with the commas.
@@ -554,7 +554,13 @@ all special characters, i.e. to use a single function for both purposes:
554554
| Tabulator | U+0009 | `\t` |
555555
| Carriage return | U+000D | `\r` |
556556
| Line feed | U+000A | `\n` |
557+
| Form feed | | `\f` |
557558
| Null character | U+0000 | `\000` |
559+
| All non-printable characters from the ASCII range | - | `\...` |
560+
561+
The `\...` stands for a back-slash, followed by 3 octal (0-7) digits.
562+
The unicode code of the character in octal.
563+
For example: `\011`, `\035`, `\240`.
558564
559565
Notice that `\000` is used, instead of `\0`. A single octal value can fail if
560566
it is followed by numbers in the text, for example: "1234`\0`567". Which can
@@ -611,6 +617,10 @@ has no header lines, but data only.
611617
You can know the number of total rows in the response from the third field (index 2) of
612618
the first line of the [data response](#521-data-response---1).
613619

620+
Data sets are stored on the server side until the client closes the session, or until an error message is returned from the server. There's a command for closing a result set before any of those events by passing only its ID:
621+
622+
Xclose 2
623+
614624
## 6.4. Multiple queries in a single message
615625
616626
You can send multiple SQL queries in a single message, separated by
@@ -703,3 +713,7 @@ All string values need to be escaped as discussed in chapter [Escaping](#61-esca
703713
Date values are also passed as strings.
704714

705715
It is important that when an [error message](#54-error---) is returned, all session data are discarded. Which includes the prepared statements.
716+
717+
When you don't need a prepared statement anymore, you can release it with the following command, passing its ID:
718+
719+
Xrelease 15

0 commit comments

Comments
 (0)