Why MySQL support was broken in 1.0.5.1

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Why MySQL support was broken in 1.0.5.1

Postby fox » 12 Oct 2005, 19:06

Fig. A:

mysql> create table test_1 (id integer not null primary key) type=InnoDB;
Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> create table test_2 (id integer not null primary key references test_1(id) on delete cascade) type=InnoDB;
Query OK, 0 rows affected, 1 warning (0.04 sec)


Question: was foreign key actually created on the table and will cascade deletes function?

Fig. B:

mysql> insert into test_2 values (666);
Query OK, 1 row affected (0.01 sec)


Oh, it wasn't. Because MySQL actually accepts foreign key definitions in slightly different format, but doesn't bother to fucking tell me it just ignored half of table definition and ABORT THE TABLE CREATION. I hate this piece of shit excuse for a database more and more every time I have to deal with it.

slw

one more reason

Postby slw » 13 Oct 2005, 06:08

One more reason to hate it: you have to escape things before using them in SQL queries. While importing my OPML, I got a SQL error because one of the feed titles had a single quote (') in it. I fixed this by adding these two lines:


$title = mysql_real_escape_string($title);
$url = mysql_real_escape_string($url);


at line 55 of opml.php.

Steve

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Postby fox » 13 Oct 2005, 08:39

Well, escaping is actually okay. It's on the forum why it was removed from OPML import (it was there before).


Return to “Support”

Who is online

Users browsing this forum: No registered users and 6 guests