summaryrefslogtreecommitdiff
path: root/Docs/internals.texi
diff options
context:
space:
mode:
authorunknown <jcole@mugatu.spaceapes.com>2002-03-17 05:30:03 -0600
committerunknown <jcole@mugatu.spaceapes.com>2002-03-17 05:30:03 -0600
commit0224a6da7d8a87718992448180e78afe2d01823a (patch)
tree048011983a229fc7edc84432b2727659005c22bc /Docs/internals.texi
parentade0c20727857164efc25d5b21a83177ee5c2ba8 (diff)
downloadmariadb-git-0224a6da7d8a87718992448180e78afe2d01823a.tar.gz
Added Makefile.am targets for internals.texi.
Cleaned up internals.texi, changed tabs to spaces. Docs/Makefile.am: Added Makefile.am targets for internals.texi. Docs/internals.texi: Cleanups, replaced tabs with spaces.
Diffstat (limited to 'Docs/internals.texi')
-rw-r--r--Docs/internals.texi168
1 files changed, 92 insertions, 76 deletions
diff --git a/Docs/internals.texi b/Docs/internals.texi
index 39e254f0f50..5bf5fc35344 100644
--- a/Docs/internals.texi
+++ b/Docs/internals.texi
@@ -184,7 +184,7 @@ Now the code in @file{sql/records.cc} will be used to read through them
in sorted order by using the row pointers in the result file.
To optimize this, we read in a big block of row pointers, sort these
and then we read the rows in the sorted order into a row buffer
-(@code{record_buffer}) .
+(@code{record_buffer}).
@end itemize
@@ -287,7 +287,7 @@ Put the @samp{@{} after a @code{switch} on the same line, as this gives
better overall indentation for the switch statement:
@example
-switch (arg) {
+switch (arg) @{
@end example
@item
@@ -489,6 +489,8 @@ Remember to lock databases for optimal caching.
@item void end_key_cache _A((void));
End key caching.
+@end table
+
@node DBUG, protocol, mysys functions, Top
@@ -548,48 +550,57 @@ Print query.
@section Raw Packet Without Compression
@example
--------------------------------------------------
-| Packet Length | Packet no | Data |
-| 3 Bytes | 1 Byte | n Bytes |
--------------------------------------------------
++-----------------------------------------------+
+| Packet Length | Packet no | Data |
+| 3 Bytes | 1 Byte | n Bytes |
++-----------------------------------------------+
@end example
-3 Byte packet length
- The length is calculated with int3store
- See include/global.h for details.
- The max packetsize can be 16 MB.
-1 Byte packet no
+@table @asis
+@item 3 Byte packet length
+The length is calculated with int3store
+See include/global.h for details.
+The max packetsize can be 16 MB.
-If no compression is used the first 4 bytes of each paket
-is the header of the paket.
-The packet number is incremented for each sent packet. The first
-packet starts with 0
+@item 1 Byte packet no
+If no compression is used the first 4 bytes of each packet is the header
+of the packet. The packet number is incremented for each sent packet.
+The first packet starts with 0.
+@item n Byte data
-n Byte data
+@end table
The packet length can be recalculated with:
+
+@example
length = byte1 + (256 * byte2) + (256 * 256 * byte3)
+@end example
+
@node raw packet with compression, basic packets, raw packet without compression, protocol
@section Raw Packet With Compression
@example
------------------------------------------------------
-| Packet Length | Packet no | Uncomp. Packet Length |
-| 3 Bytes | 1 Byte | 3 Bytes |
------------------------------------------------------
++---------------------------------------------------+
+| Packet Length | Packet no | Uncomp. Packet Length |
+| 3 Bytes | 1 Byte | 3 Bytes |
++---------------------------------------------------+
@end example
-3 Byte packet length
- The length is calculated with int3store
- See include/global.h for details.
- The max packetsize can be 16 MB.
-1 Byte packet no
-3 Byte uncompressed packet length
+@table @asis
+@item 3 Byte packet length
+The length is calculated with int3store
+See include/global.h for details.
+The max packetsize can be 16 MB.
+
+@item 1 Byte packet no
+@item 3 Byte uncompressed packet length
+@end table
If compression is used the first 7 bytes of each packet
is the header of the packet.
+
@node basic packets, communication, raw packet with compression, protocol
@section Basic Packets
@@ -598,52 +609,57 @@ is the header of the packet.
* error packet::
@end menu
+
@node ok packet, error packet, basic packets, basic packets
@subsection OK Packet
- For details see sql/net_pkg.cc
- function send_ok
+For details, see @file{sql/net_pkg.cc::send_ok()}.
+
@example
- -------------------------------------------------
- | Header | No of Rows | Affected Rows |
- | | 1 Byte | 1-8 Byte |
- -------------------------------------------------
- | ID (last_insert_id) | Status | Length |
- | 1-8 Byte | 2 Byte | 1-8 Byte |
- -------------------------------------------------
- | Messagetext |
- | n Byte |
- -------------------------------------------------
++-----------------------------------------------+
+| Header | No of Rows | Affected Rows |
+| | 1 Byte | 1-8 Byte |
+|-----------------------------------------------|
+| ID (last_insert_id) | Status | Length |
+| 1-8 Byte | 2 Byte | 1-8 Byte |
+|-----------------------------------------------|
+| Messagetext |
+| n Byte |
++-----------------------------------------------+
@end example
- Header
- 1 byte number of rows ? (always 0 ?)
- 1-8 bytes affected rows
- 1-8 byte id (last_insert_id)
- 2 byte Status (usually 0)
- If the OK-packege includes a message:
- 1-8 bytes length of message
- n bytes messagetext
+@table @asis
+@item Header
+@item 1 byte number of rows ? (always 0 ?)
+@item 1-8 bytes affected rows
+@item 1-8 byte id (last_insert_id)
+@item 2 byte Status (usually 0)
+@item If the OK-packege includes a message:
+@item 1-8 bytes length of message
+@item n bytes messagetext
+@end table
@node error packet, , ok packet, basic packets
@subsection Error Packet
@example
- -------------------------------------------------
- | Header | Statuscode | Error no |
- | | 1 Byte | 2 Byte |
- -------------------------------------------------
- | Messagetext | 0x00 |
- | n Byte | 1 Byte |
- -------------------------------------------------
++-----------------------------------------------+
+| Header | Status code | Error no |
+| | 1 Byte | 2 Byte |
+|-----------------------------------------------|
+| Messagetext | 0x00 |
+| n Byte | 1 Byte |
++-----------------------------------------------+
@end example
- Header
- 1 byte status code (0xFF = ERROR)
- 2 byte error number (is only sent to new 3.23 clients.
- n byte errortext
- 1 byte 0x00
+@table @asis
+@item Header
+@item 1 byte status code (0xFF = ERROR)
+@item 2 byte error number (is only sent to new 3.23 clients.
+@item n byte errortext
+@item 1 byte 0x00
+@end table
@node communication, fieldtype codes, basic packets, protocol
@@ -742,24 +758,24 @@ is the header of the packet.
@section Fieldtype Codes
@example
- display_length |enum_field_type |flags
- ----------------------------------------------------
-Blob 03 FF FF 00 |01 FC |03 90 00 00
-Mediumblob 03 FF FF FF |01 FC |03 90 00 00
-Tinyblob 03 FF 00 00 |01 FC |03 90 00 00
-Text 03 FF FF 00 |01 FC |03 10 00 00
-Mediumtext 03 FF FF FF |01 FC |03 10 00 00
-Tinytext 03 FF 00 00 |01 FC |03 10 00 00
-Integer 03 0B 00 00 |01 03 |03 03 42 00
-Mediumint 03 09 00 00 |01 09 |03 00 00 00
-Smallint 03 06 00 00 |01 02 |03 00 00 00
-Tinyint 03 04 00 00 |01 01 |03 00 00 00
-Varchar 03 XX 00 00 |01 FD |03 00 00 00
-Enum 03 05 00 00 |01 FE |03 00 01 00
-Datetime 03 13 00 00 |01 0C |03 00 00 00
-Timestamp 03 0E 00 00 |01 07 |03 61 04 00
-Time 03 08 00 00 |01 0B |03 00 00 00
-Date 03 0A 00 00 |01 0A |03 00 00 00
+ display_length |enum_field_type |flags
+ ----------------------------------------------------
+Blob 03 FF FF 00 |01 FC |03 90 00 00
+Mediumblob 03 FF FF FF |01 FC |03 90 00 00
+Tinyblob 03 FF 00 00 |01 FC |03 90 00 00
+Text 03 FF FF 00 |01 FC |03 10 00 00
+Mediumtext 03 FF FF FF |01 FC |03 10 00 00
+Tinytext 03 FF 00 00 |01 FC |03 10 00 00
+Integer 03 0B 00 00 |01 03 |03 03 42 00
+Mediumint 03 09 00 00 |01 09 |03 00 00 00
+Smallint 03 06 00 00 |01 02 |03 00 00 00
+Tinyint 03 04 00 00 |01 01 |03 00 00 00
+Varchar 03 XX 00 00 |01 FD |03 00 00 00
+Enum 03 05 00 00 |01 FE |03 00 01 00
+Datetime 03 13 00 00 |01 0C |03 00 00 00
+Timestamp 03 0E 00 00 |01 07 |03 61 04 00
+Time 03 08 00 00 |01 0B |03 00 00 00
+Date 03 0A 00 00 |01 0A |03 00 00 00
@end example
@c The Index was empty, and ugly, so I removed it. (jcole, Sep 7, 2000)