MySQL, 1st Edition (00-1 printing) - Errata

This document lists the known errors for the book:

MySQL, 1st Edition (00-1 printing)
Paul DuBois
New Riders
1999
ISBN 0-7357-0921-1
[book information]
Number of items: 42
Date of most recently reported item: 2000-06-29

Sort by: [page number] [most recent errata first]
Date 2000-06-29
Page 419, first code example
Reported by Mark R. Cervarich
Description

The first two lines on the page look like this:

# cp mysql.server /etc/rc.d/init.d
# cd
/etc/init.d

The second line is incorrect; the lines should look like this:

# cp mysql.server /etc/rc.d/init.d
# cd
/etc/rc.d/init.d

Date 2000-06-27
Page 523, STRCMP() function description
Reported by Dustin Revin
Description

The return values for STRCMP() are incorrect. This function returns 1, 0, or -1 if the first argument is lexicographically greater than, equal to, or less than the second argument. If either argument is NULL, the function returns NULL.

A better set of examples would be:

STRCMP("a","a") -> 0
STRCMP("a","A") ->
1
STRCMP("A","a") ->
-1

Date 2000-06-27
Page 525, FLOOR() function description
Reported by Dustin Revin
Description

The description says "Returns the largest integer not greater than x (that is, x with the fractional part chopped off)." Unfortunately, the part in parentheses is true only for positive integers. For negative numbers, the result is not simply a fractional chop. Delete the phrase in parentheses.


Date 2000-06-20
Page 505, description for TINYTEXT
Reported by Bill from Sheridan, OR
Description

The superscript for the upper range of the length of TINYTEXT values is incorrect. The range is 0 to 2^8 - 1 bytes, not 0 to 2^87 - 1 bytes.


Date 2000-06-20
Page 661, third bullet
Reported by Paul DuBois
Description

The syntax line for the selectcol_arrayref() method is incorrect. The method returns a reference to an array ($ary_ref), not an array (@ary_ref).


Date 2000-05-28
Page 362, second code listing
Reported by Anatole Varin
Description

There is a print() statement that should be a printf() statement.

Change this line:

print ("number of
rows returned: %d\n", mysql_num_rows ($result));

To this:

printf ("number of rows returned: %d\n",
mysql_num_rows
($result));

Date 2000-05-09
Page 250, second-to-last paragraph
Reported by Shawn Vines
Description

The paragraph begins by referencing the mysql_rows_affected() function. The function name should be mysql_affected_rows().


Date 2000-05-07
Page 14, Figure 1.1
Reported by Floyd Baker
Description

The third row from the bottom of the lowest box has an ad_num value of 48. As such, it should have an arrow leading to it from the 48 in the middle box. But let's just pretend it has a value of 49 instead.


Date 2000-04-26
Page 82, paragraph before first heading
Reported by Michael Hackett
Description There should be a period after "... as ASCII codes and converted to characters".

Date 2000-04-26
Page 96, third paragraph
Reported by Michael Hackett
Description

If the series begins at 1,000,000, you'll be able to add nine million customers before the digit count changes, not one million as the text says.

Change:

You'll be able to add a million ...

To:

You'll be able to add well over a million ...


Date 2000-04-26
Page 108, second paragraph
Reported by Michael Hackett
Description

Change:

... you need not supply leading two digits for month and day values that are less than 10.

To:

... you need not supply a leading zero digit for month or day values that are less than 10.


Date 2000-04-26
Page 150, last paragraph
Reported by Michael Hackett
Description

Change:

... exits when an error occurs, and is an error ...

To:

... exits when an error occurs, and it is an error ...


Date 2000-04-26
Page 160, first example
Reported by Michael Hackett
Description

Change:

SELECT ... FROM
t1

To:

SELECT * FROM
t1

Date 2000-04-26
Page 168, second example
Reported by Michael Hackett
Description

The workaround for versions of MySQL older than 3.23 should not use TYPE=HEAP, because HEAP tables were introduced in MySQL 3.23.

Change the second line of the example:

TYPE=HEAP SELECT ... FROM table1 WHERE
...

To:

SELECT ... FROM table1 WHERE
...

Date 2000-04-11
Page 158, last paragraph
Reported by Jeff Dietz
Description

The text of the paragraph does not match the preceding syntax description.

Change:

Everything in this syntax is optional except the word SELECT and the column_list part ...

To:

Everything in this syntax is optional except the word SELECT and the selection_list part ...


Date 2000-04-05
Page 45, last paragraph, first line
Reported by Andrew Arensburger
Description

Extraneous space.

Change:

... can use arithmetic operators , as in Table 1.1 ...

To:

... can use arithmetic operators, as in Table 1.1 ...


Date 2000-04-05
Page 215, last sentence of text prior to note at bottom
Reported by William Sommers
Description

Change:

Use the module version by default and the standalone version for situations in which scripts with the privileges of a particular user.

To:

Use the module version by default and the standalone version for situations in which scripts need to run with the privileges of a particular user.


Date 2000-04-05
Page 287, second line of first code listing
Reported by William Sommers
Description

Change:

while (@ary =
$sth->fetchrow_array ())
{77
    $delim =
"";

To:

while (@ary =
$sth->fetchrow_array ())
{
    $delim =
"";

Date 2000-04-05
Page 300, first bullet, first sentence
Reported by William Sommers
Description

Change:

The DBI_DSN environment variable is used if the data source is undefined or the empty string is undefined.

To:

The DBI_DSN environment variable is used if the data source is undefined or is the empty string.


Date 2000-04-05
Page 327, last code listing
Reported by William Sommers
Description

Change:

</HEAD>            <-
beginning of document
head

To:

</HEAD>
<- end of document
head

Date 2000-04-05
Page 334, third code listing
Reported by William Sommers
Description

The output from the Perl script is missing a character.

Change:

x&lt;=y,
right

To:

x&lt;=y,
right?

Date 2000-03-31
Page 206, third bullet
Reported by Margie Wiers
Description

The phrase "GNU's Not UNIX" is missing the trailing double quote.


Date 2000-03-30
Page 353, second-to-last paragraph
Reported by Daniel Holtzman
Description

The row-fetching code in the last example on the page uses mysql_fetch_array(), but the following paragraph refers to mysql_fetch_row(). The paragraph should say mysql_fetch_array():

To get this value, we pass the result set identifier to mysql_fetch_array() to fetch the row, assign the row to the variable $row, and access the first element as $row[0].


Date 2000-03-27
Page 156, third paragraph
Reported by William Sommers
Description

Change:

For versions of MySQL prior to 3.23, it's essential that joined columns be of the same time ...

To:

For versions of MySQL prior to 3.23, it's essential that joined columns be of the same type ...


Date 2000-03-25
Page 90, second paragraph
Reported by William Sommers
Description

Change:

The DECIMAL type differs from FLOAT and DECIMAL in that DECIMAL ...

To:

The DECIMAL type differs from FLOAT and DOUBLE in that DECIMAL ...


Date 2000-03-24
Page 25, second paragraph
Reported by Tim Fields
Description

Change:

Our member table will use separate ...

To:

Our president table will use separate ...


Date 2000-03-23
Page 46-47
Reported by Ryan Caveney
Description

There are three instances of "Maryland" on these pages. They all should be "Massachusetts" (the example queries look for state="MA").


Date 2000-03-20
Page 56, last code listing
Reported by John P. McDaniel
Description

The state abbreviation for Arkansas is AR, not AK. Change the AK in the listing to AR.


Date 2000-03-20
Page 58, last code listing
Reported by John P. McDaniel
Description

The state abbreviation for Arkansas is AR, not AK. Change the AK in the listing to AR.


Date 2000-03-20
Page 59, last code listing
Reported by John P. McDaniel
Description

The state abbreviation for Arkansas is AR, not AK. Change the AK in the listing to AR.


Date 2000-03-01
Page 125, second paragraph after first code listing
Reported by Ryan Caveney
Description

Change:

For example, (4*3)/(4-2) evaluates to the value 2.

To:

For example, (4*3)/(4-2) evaluates to the value 6.


Date 2000-02-15
Page 527, description of the SIN() function
Reported by David Block
Description

There should not be two bullets for the SIN() function. The text of the second SIN() bullet is part of the preceding description.


Date 2000-02-12
Page 372, listing for add_new_event() function
Reported by Marc Infield
Description

There is an instance of addslashes() written incorrectly as $addslashes().

Change:

addslashes
($date), $addslashes
($type));

To:

addslashes
($date), addslashes
($type));

Date 2000-02-09
Page 338, paragraph following second bullet
Reported by Derick Siddoway
Description

Change:

The tables in the samp_db table are relatively ...

To:

The tables in the samp_db database are relatively ...

And change:

If you edit samp_db to display tables from ...

To:

If you edit samp_browse to display tables from ...


Date 2000-02-08
Page 42, middle of page
Reported by Derick Siddoway
Description

Change the query that says:

SELECT birth_date FROM
...

To:

SELECT birth FROM
...

Date 1999-12-28
Page 43, query2
Description

The output should look like this:

+-----------+-----+------------+
| name      | sex | student_id |
+-----------+-----+------------+
| Megan     | F   |          1 |
| Joseph    | M   |          2 |
| Kyle      | M   |          3 |
| Katie     | F   |          4 |
...

Date 1999-12-28
Page 43, query3
Description

The output should look like this:

+-----------+
| name      |
+-----------+
| Megan     |
| Joseph    |
| Kyle      |
| Katie     |
...

Date 1999-12-28
Page 43, query4
Description

The output should look like this:

+-----------+-----+------------+
| name      | sex | student_id |
+-----------+-----+------------+
| Megan     | F   |          1 |
| Joseph    | M   |          2 |
| Kyle      | M   |          3 |
| Katie     | F   |          4 |
...

Date 1999-12-28
Page 44, query1
Description

The output should look like this:

+------------+----------+-------+
| student_id | event_id | score |
+------------+----------+-------+
|          5 |        3 |    97 |
|         18 |        3 |    96 |
|          1 |        6 |   100 |
|          5 |        6 |    97 |
|         11 |        6 |    98 |
|         16 |        6 |    98 |
+------------+----------+-------+

Date 1999-12-28
Page 56,query 1
Description

The output is missing from the book. It should look like this:

+-----------+------------+
| last_name | first_name |
+-----------+------------+
| Polk      | James K.   |
| Taft      | William H. |
| Ford      | Gerald R   |
| Bush      | George W.  |
+-----------+------------+

Date 1999-12-28
Page 58, query 3
Description

The rows of the output are reversed. They should look like this:

+-----+----------+
| sex | COUNT(*)
|
+-----+----------+
| F   |       15 |
| M   |       16
|
+-----+----------+

Date 1999-12-28
Page 65, query 1
Description

The query produces no more lines of output than are shown. The "..." is incorrect.


This document is maintained by Paul DuBois. Please report any errors you find in the book that are not already listed here.