Bug in MySQL with Correlated Subqueries?

2004-03-27 Thread Ed Smith
MySQL 4.1.1-alpha incorrectly computes select-list correlated subqueries. See the explanation of the problem below. Is this a known problem? Thanks! Consider the following schema and data: CREATE TABLE person (pid INTEGER, name CHAR(5)); CREATE TABLE phone (pid INTEGER, num CHAR(10)); INSERT

Correlated Subquery Error in MySQL 4.1.1-alpha

2004-03-24 Thread Ed Smith
Consider the following schema and data: CREATE TABLE person (pid INTEGER, name CHAR(5)); CREATE TABLE phone (pid INTEGER, num CHAR(10)); INSERT INTO PERSON VALUES (1, 'Bob'); INSERT INTO PERSON VALUES (2, 'Jane'); INSERT INTO PHONE VALUES (1, '12345'); INSERT INTO PHONE VALUES (1, '23456'); INSER

Re: GROUP BY/ORDER BY Problem

2003-10-05 Thread Ed Smith
The SQL specification does allow aggregates in the ORDER BY. Does mySQL have any plans to add such functionality (or at least add it to its list of things it doesn't do)? The problem with the solution of ordering by an alias is that I may not necessarily want the thing I'm ordering by to be in th

Re: Why does mySQL violate NOT precedence?

2003-10-03 Thread Ed Smith
only one > comparison occurring > instead of two, negating name='Bob'. After all, you > are looking to > negate the equal, not negate name. > > On Friday, October 3, 2003, at 07:42 AM, Ed Smith > wrote: > > > In mySQL 4.1-alpha, 4.0.15a, and 3.23.58, I

GROUP BY/ORDER BY Problem

2003-10-03 Thread Ed Smith
Why doesn't the following work: mysql> CREATE TABLE dog(id integer, breed char(20), age integer, weight integer) ; mysql> SELECT breed, MIN(age) -> FROM dog -> GROUP BY breed -> ORDER BY MIN(age); ERROR : Invalid use of group function but this does mysql> SELECT breed, MIN(age)

Why does mySQL violate NOT precedence?

2003-10-03 Thread Ed Smith
I am reposting this in hopes of convincing the mySQL implementors to change mySQL or to at least gain some understanding as to why they violated the specification. Apparently, in MySQL, NOT has higher precedence than the comparison operators, so WHERE NOT name = 'Bob' is equivalent to WHERE (

Re: NOT problems

2003-10-01 Thread Ed Smith
> >Here's my schema and data: > > > >create table person (name char(5)); > >insert into person values ('Bob'); > >insert into person values ('Jane'); > > > >In mySQL 4.1-alpha, 4.0.15a, and 3.23.58, I get the > >following results: > > > >mysql> SELECT * FROM person WHERE NOT name = 'Bob'; > >Empty

NOT problems

2003-09-30 Thread Ed Smith
Here's my schema and data: create table person (name char(5)); insert into person values ('Bob'); insert into person values ('Jane'); In mySQL 4.1-alpha, 4.0.15a, and 3.23.58, I get the following results: mysql> SELECT * FROM person WHERE NOT name = 'Bob'; Empty set (0.00 sec) mysql> SELECT * F

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-29 Thread Ed Smith
ction 4.6.1 of the 4.1 manual. I appreciate any and all help. For now, I am having to disable foreign key integrity constraint checking. Ed --- Victoria Reznichenko <[EMAIL PROTECTED]> wrote: > Ed Smith <[EMAIL PROTECTED]> wrote: > > Greetings. When I execute the SQL script

Re: FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-26 Thread Ed Smith
ave to do this to make it work. Other suggestions? Thanks. --- Harald Fuchs <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > Ed Smith <[EMAIL PROTECTED]> writes: > > > Greetings. When I execute the SQL script below in > > mySQL 4.1, I get

FOREIGN KEY Weirdness in mySQL 4.1 with VARCHAR

2003-09-26 Thread Ed Smith
Greetings. When I execute the SQL script below in mySQL 4.1, I get ERROR 1216: Cannot add or update a child row: a foreign key constraint fails It is, of course, choking on the enroll row insert. Why is this happening? Here are some things that make the problem go away: 1. Take out the "name

REFERENCES question in mySQL 4.1 - Take 2

2003-09-25 Thread Ed Smith
First, my apologies. I originally posted this to the mailing.databases.mysql newsgroup, not realizing that the newsgroup is just mirror of the mailing list. I have since figured out the answer to my second question (I think) - see below. My answer is: The Primary Key specification creates an in