niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » MySQL
err-report help me
Post new topic   Reply to topic Page 1 of 67 [996 Posts] View previous topic :: View next topic
Goto page:  1, 2, 3, ..., 65, 66, 67 Next
Author Message
Gleb Paharenko
*nix forums Guru


Joined: 02 Feb 2005
Posts: 1318

PostPosted: Wed Feb 02, 2005 12:48 pm    Post subject: Re: err-report help me Reply with quote

Hello.



See:

http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html

http://dev.mysql.com/doc/mysql/en/windows-troubleshooting.html





" ???" <zhanghjun@langchao.com> wrote:

Quote:
mysql=A3=AC=C4=FA=BA=C3=A3=A1



=09 when click mysql.exe on $home\bin ,the report err is

"D:\Program Files\mysql\bin>mysql

ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)=

"



please help me



=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=D6=C2

=C0=F1=A3=A1

=09=09=09=09



=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1 zhanghjun

=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1zhanghjun@langchao.com

=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A12005-02-02









--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__ Gleb.Paharenko@ensita.net
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET
<___/ www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Gleb Paharenko
*nix forums Guru


Joined: 02 Feb 2005
Posts: 1318

PostPosted: Wed Feb 02, 2005 1:29 pm    Post subject: Re: mysqldump and Foreign Keys Reply with quote

Hello.



Put SET FOREIGN_KEY_CHECKS=0 at the top of your dump file. In 4.1,

mysqldump puts that automatically to the dump file. See comments at:

http://dev.mysql.com/doc/mysql/en/mysqldump.html





Michael Satterwhite <michael@weblore.com> wrote:

Quote:
mysqldump backs all of the tables up in alphabetic order, including the

table create statements. The problem is that if foreign keys exist on

the tables, the reload will not work unless the backup file is hand

edited to insure that tables depended upon are created first. Is there a

way around this? If not, shouldn't the tables be created first and the

foreign keys created at the end of the backup? I *REALLY don't want to

hack mysqldump and am hoping that there's already a way around this - or

that a way is being developed.







--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__ Gleb.Paharenko@ensita.net
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET
<___/ www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Gleb Paharenko
*nix forums Guru


Joined: 02 Feb 2005
Posts: 1318

PostPosted: Wed Feb 02, 2005 2:56 pm    Post subject: Re: help please : ERROR 2006: MySQL server has gone away Reply with quote

Hello.



Does the problem remain? What is in the error log? Please, send

us information about MySQL and operating system versions. There are

two variables: max_allowed_packet - one has client, another has server.

Run mysql with --max_allowed_packet=16M and mysqld with the same value.

May be you have some ulimits which cause such behaviour?





[snip]

And

max_allowed_packet = 16776192

David

Hi,

my interactive_timeout variable is

interactive_timeout 3600

Thanks !"Marois, David" <DAVID.MAROIS@telus.com> wrote:

[snip]



--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__ Gleb.Paharenko@ensita.net
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET
<___/ www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Gleb Paharenko
*nix forums Guru


Joined: 02 Feb 2005
Posts: 1318

PostPosted: Wed Feb 02, 2005 3:27 pm    Post subject: Re: Still can't connect to MySQL 5 on FC3 Reply with quote

Hello.



Quote:
[me@mybox ~] /usr/bin/mysqld_safe

tee: /var/lib/mysql/mybox.err: Permission denied

-rw-rw---- 1 mysql root 1844 Feb 2 08:30 mybox.err



It seems that you launch the mysqld_safe script as 'me' instead of root.





Whil Hentzen <linuxnews@hentzenwerke.com> wrote:

Quote:
Hi folks,



Been doing a lot of noodlin' and googlin' yesterday and today, and

thought I found the problem... but alas!



To recap:



I just installed MySQL 5 on a freshly updated FC3 box. I initially was

getting this error:



[me@mybox ~] /usr/bin/mysqld_safe

Starting mysqld daemon with databases from /var/lib/mysql

/usr/bin/mysqld_safe: line 302: /var/lib/mysql/mybox.err: Permission denied

/usr/bin/mysqld_safe: line 308: /var/lib/mysql/mybox.err: Permission denied

STOPPING server from pid file /var/lib/mysql/mybox.pid

tee: /var/lib/mysql/mybox.err: Permission denied

050202 09:21:36 mysqld ended

tee: /var/lib/mysql/mybox.err: Permission denied



and this one:



[me@mybox ~] mysql -u root

ERROR 2002 (HY000): Can't connect to local MySQL server through socket

'/var/lib/mysql/mysql.sock' (2)

[me@mybox ~]



Then I found the notes about selinux interferring with mysql starting up

at http://forums.mysql.com/read.php?11,7164,7164



I tried

setenforce 0

but I'm still getting the same errors.



Permissions are:



[root@mybox /var/lib/mysql] I AM ROOT: ls -al

total 20572

drwxr-xr-x 4 mysql root 4096 Feb 2 08:30 .

drwxr-xr-x 35 root root 4096 Feb 1 13:45 ..

-rw-rw---- 1 mysql root 1844 Feb 2 08:30 mybox.err

-rw-rw---- 1 mysql mysql 10485760 Feb 2 08:30 ibdata1

-rw-rw---- 1 mysql mysql 5242880 Feb 2 08:30 ib_logfile0

-rw-rw---- 1 mysql mysql 5242880 Feb 2 08:30 ib_logfile1

drwx--x--x 2 mysql root 4096 Feb 1 13:45 mysql

drwxr-xr-x 2 mysql root 4096 Feb 1 13:45 test

[root@mybox /var/lib/mysql]



And the contents of the err file:



[root@mybox /var/lib/mysql] tail mybox.err

InnoDB: Setting log file ./ib_logfile1 size to 5 MB

InnoDB: Database physically writes the file full: wait...

InnoDB: Doublewrite buffer not found: creating new

InnoDB: Doublewrite buffer created

InnoDB: Creating foreign key constraint system tables

InnoDB: Foreign key constraint system tables created

050202 8:30:51 InnoDB: Started; log sequence number 0 0

050202 8:30:51 [ERROR] Fatal error: Can't open privilege tables: Table

'mysql.host' doesn't exist

050202 08:30:51 mysqld ended



I'm stuck. Suggestions?



Whil





--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__ Gleb.Paharenko@ensita.net
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET
<___/ www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Michael Dykman
*nix forums beginner


Joined: 03 Feb 2005
Posts: 27

PostPosted: Thu Feb 03, 2005 5:57 am    Post subject: Re: Best way to store numeric data? Reply with quote

Of course, all engineering is balancing the trade-offs.

The maximum positive value of a BIGINT is 9223372036854775807, which
suggests that it can store any 18 digit value accurately, which perhaps
solves the problem. BIGINT, like DOUBLE, requires 8 bytes storage, so
you are neutral in that regard, but using BIGINT you are adding the CPU
overhead of multiplying and dividing by 10^n on every store/fetch (not
to mention remembering to apply it everywhere). Also, if the code
manipulating this data is C, C++, perl, PHP, Java, lisp or any other
commonly used language, it is very highly probable that the code is
using the IEEE double-precision format (in place since 1985), so any
precision you are worried about losing has already been lost long before
it gets to the SQL engine. If the code is manipulating the data in this
format, that is likely why all your numbers are coming up with exactly
that many digits.

It is possible that the software is using a high-precision library;
check with the developers.. if it's off-the shelf software and it
doesn't mention super-precision as a feature, it's likely using the good
old 8 byte double precision (like 99.99% of all software written in the
last 20 years) and a MySQL DOUBLE will store exactly the value it has
been given.

FYI: the float (IEEE single precision) only guarantees 8 (or 9?) digits
of accuracy if I remember my researches from earlier in the day. MySQL
DECIMAL type serves as a wrapper for both float and double and will
choose the underlaying type depending on the the requested precision.

On Wed, 2005-02-02 at 22:54, Galen wrote:
Quote:
First, I'm storing all my data and I want it stored accurately. I don't
know that I will need quite this much precision in the long run, but
because I am working with highly detailed statistics generated from
hundreds of millions of measurements, I do not want to risk throwing
away information that could prove useful, as this table is only one
step of many.

Regarding the idea of storing as a bigint and simply multiplying the
value the appropriate amount, that's a possibility. It feels a bit
cumbersome, but would work well enough.

I'm still not completely clear on float vs double. My goal is decent
efficiency in storage and very good efficiency in sorting and such. It
seems like all numeric values want to be value(16,15) - meaning an
apparent excess of, oh, 12 places to the left of the decimal. It seems
like a waste.

-Galen


On Feb 2, 2005, at 7:02 PM, Michael Dykman wrote:

I stand corrected.. I thought I recalled that the IEEE for double
precision offered 18 digits of accuracy (been years since I looked at
it) but a little research shows me 15.

- michael dykman

On Wed, 2005-02-02 at 14:02, Roger Baklund wrote:
Michael Dykman wrote:
[...]
The MySQL implementation also supports this optional
precision specification, but the precision value is used only to
determine storage size.

Right. This means you can not have 15 decimals precision using DOUBLE:

mysql> use test
Database changed
mysql> create table dtest(d double(18,15));
Query OK, 0 rows affected (0.01 sec)

mysql> insert into dtest values
(6.984789027653891),(39.484789039053891);
Query OK, 2 rows affected (0.02 sec)
Records: 2 Duplicates: 0 Warnings: 0

mysql> select * from dtest;
+--------------------+
| d |
+--------------------+
| 6.984789027653892 |
| 39.484789039053894 |
+--------------------+
2 rows in set (0.00 sec)

Last digit is "wrong" in both test rows. Increasing precision does
not help:

mysql> create table d2test(d double(18,16));
Query OK, 0 rows affected (0.02 sec)

mysql> insert into d2test values
(6.984789027653891),(39.484789039053891);
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0

mysql> select * from d2test;
+---------------------+
| d |
+---------------------+
| 6.9847890276538909 |
| 39.4847890390538940 |
+---------------------+
2 rows in set (0.00 sec)

This is no error, it is the approximate data type at work... it simply
can not store the exact value.
--
- michael dykman
- michael@dykman.org


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=mysql@zinkconsulting.com



--

- michael dykman
- michael@dykman.org


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Marc Dumontier
*nix forums beginner


Joined: 03 Feb 2005
Posts: 2

PostPosted: Thu Feb 03, 2005 2:42 pm    Post subject: Re: performance on query with ORDER BY clause Reply with quote

Thanks for your reply,

Just to be clear...performing my query without the order by clause will
always return the list sorted by the primary identifier?
so that

SELECT SubmitId from BINDSubmit ORDER BY SubmitId == SELECT SubmitId from BINDSubmit

in this case



Marc

Dathan Pattishall wrote:

Quote:
This tells the optimizer to do a table scan. If you used INNODB it's
already sorted by the primary key since INNODB supports clustered
indexes. Doing a table scan on innodb is very slow due to it's MVCC
control.

It's going to take a long time.



DVP
----
Dathan Vance Pattishall http://www.friendster.com





-----Original Message-----
From: Marc Dumontier [mailto:mrdumont@blueprint.org]
Sent: Wednesday, February 02, 2005 12:02 PM
To: mysql@lists.mysql.com
Subject: performance on query with ORDER BY clause

Hi,

I have a simple query with an ORDER BY clause, and it's
taking forever to run on this table. I hope i've included all
relevent information...it might just be one of the4 server
variables which need adjustment.

the query is

SELECT SubmitId from BINDSubmit ORDER BY SubmitId

SubmitId is the primary Key, about 150,000 records table type
is INNODB

mysql> describe BINDSubmit;
+-----------------+---------------------+------+-----+--------
-------------+----------------+
| Field | Type | Null | Key |
Default | Extra |
+-----------------+---------------------+------+-----+--------
-------------+----------------+
| SubmitId | int(10) unsigned | | PRI |
NULL | auto_increment |
| BindId | int(10) unsigned | | MUL |
0 | |
| UserId | int(10) unsigned | | MUL |
0 | |
| Delegate | int(10) unsigned | | MUL |
0 | |
| Visible | tinyint(1) | | |
1 | |
| Private | tinyint(1) | | |
0 | |
| Compressed | tinyint(1) | | |
0 | |
| Verified | tinyint(1) | | |
0 | |
| Status | tinyint(3) unsigned | | MUL |
0 | |
| CurationType | tinyint(3) unsigned | | |
1 | |
| RecordType | tinyint(3) unsigned | | MUL |
0 | |
| DateCreated | datetime | | MUL | 0000-00-00
00:00:00 | |
| DateLastRevised | datetime | | MUL | 0000-00-00
00:00:00 | |
| XMLRecord | longblob | |
| | |
+-----------------+---------------------+------+-----+--------
-------------+----------------+
14 rows in set (0.00 sec)

mysql> select count(*) from BINDSubmit;
+----------+
| count(*) |
+----------+
| 144140 |
+----------+
1 row in set (5.09 sec)

mysql> explain select SubmitId from BINDSubmit ORDER BY SubmitId;
+------------+-------+---------------+---------+---------+----
--+--------+-------------+
| table | type | possible_keys | key | key_len |
ref | rows
| Extra |
+------------+-------+---------------+---------+---------+----
--+--------+-------------+
| BINDSubmit | index | NULL | PRIMARY | 4 |
NULL | 404947
| Using index |
+------------+-------+---------------+---------+---------+----
--+--------+-------------+
1 row in set (0.00 sec)



# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 128M
max_allowed_packet = 40M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency thread_concurrency = 4

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /usr/local/mysql/data/
innodb_data_file_path = ibdata1:100M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/data/
innodb_log_arch_dir = /usr/local/mysql/data/ # You can set
.._buffer_pool_size up to 50 - 80 % # of RAM but beware of
setting memory usage too high innodb_buffer_pool_size = 512M
innodb_additional_mem_pool_size = 20M # Set .._log_file_size
to 25 % of buffer pool size innodb_log_file_size = 64M
innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit =
1 innodb_lock_wait_timeout = 50




Any help would be appreciated, so far query has been running
for 3000 seconds

Marc Dumontier


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=dathan@friendster.com









--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Thomas Sundberg
*nix forums beginner


Joined: 04 Feb 2005
Posts: 9

PostPosted: Fri Feb 04, 2005 10:39 am    Post subject: Syntax diagram, where is it located in the doc? Reply with quote

Hi!

I'm looking for the syntax diagram for MySQL and can't find it. I have
downloaded the entire MySQL manual as one html page and searched it for the
definition of where_definition and I cant find it. Could somebody please
point me to a location where the complete syntax diagram can be found?

Does anybody at the list know the answer to my question? I sent it a few
days ago and haven't received any response. It does exist a syntax diagram
for MySQL, doesn't it?

/Thomas


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Guest






PostPosted: Fri Feb 04, 2005 10:45 am    Post subject: Re: Syntax diagram, where is it located in the doc? Reply with quote

"Thomas Sundberg" <thomas.sundberg@gamefederation.com> wrote on 04/02/2005
11:39:12:

Quote:
Hi!

I'm looking for the syntax diagram for MySQL and can't find it. I have
downloaded the entire MySQL manual as one html page and searched it for
the
definition of where_definition and I cant find it. Could somebody please
point me to a location where the complete syntax diagram can be found?

Does anybody at the list know the answer to my question? I sent it a few
days ago and haven't received any response. It does exist a syntax
diagram
for MySQL, doesn't it?

Since no-one replied to your first post, apparently not. I have never seen
such a thing.

Alec Cawley


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Thomas Sundberg
*nix forums beginner


Joined: 04 Feb 2005
Posts: 9

PostPosted: Fri Feb 04, 2005 11:46 am    Post subject: RE: Syntax diagram, where is it located in the doc? Reply with quote

Quote:
-----Original Message-----
From: Alec.Cawley@Quantel.Com [mailto:Alec.Cawley@Quantel.Com]
Sent: den 4 februari 2005 12:45
To: thomas.sundberg@gamefederation.com
Cc: mysql@lists.mysql.com
Subject: Re: Syntax diagram, where is it located in the doc?

"Thomas Sundberg" <thomas.sundberg@gamefederation.com> wrote
on 04/02/2005
11:39:12:

Hi!

I'm looking for the syntax diagram for MySQL and can't find
it. I have
downloaded the entire MySQL manual as one html page and
searched it
for
the
definition of where_definition and I cant find it. Could somebody
please point me to a location where the complete syntax
diagram can be found?

Does anybody at the list know the answer to my question? I
sent it a
few days ago and haven't received any response. It does
exist a syntax
diagram
for MySQL, doesn't it?

Since no-one replied to your first post, apparently not. I
have never seen such a thing.

Strange, where is the definition for the syntax element "where_definition"
done then? That is the part of the syntax diagram I currently looking for.
It is defined as an element in the select syntax diagram. But when trying to
find the definition for what is legal to put in a where clause, I just can't
find it.

Could somebody point in me the correct direction?

/Thomas


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Michael Stassen
*nix forums Guru


Joined: 04 Feb 2005
Posts: 403

PostPosted: Fri Feb 04, 2005 12:19 pm    Post subject: Re: Syntax diagram, where is it located in the doc? Reply with quote

From the manual, "where_definition consists of the keyword WHERE followed
by an expression that indicates the condition or conditions that rows must
satisfy to be selected." <http://dev.mysql.com/doc/mysql/en/select.html>

That seems simple and straightforward to me. Perhaps if you told us why you
need this, someone could provide you with the answer you need.

Michael

Thomas Sundberg wrote:
Quote:
-----Original Message-----
From: Alec.Cawley@Quantel.Com [mailto:Alec.Cawley@Quantel.Com]
Sent: den 4 februari 2005 12:45
To: thomas.sundberg@gamefederation.com
Cc: mysql@lists.mysql.com
Subject: Re: Syntax diagram, where is it located in the doc?

"Thomas Sundberg" <thomas.sundberg@gamefederation.com> wrote
on 04/02/2005
11:39:12:


Hi!

I'm looking for the syntax diagram for MySQL and can't find

it. I have

downloaded the entire MySQL manual as one html page and

searched it

for

the

definition of where_definition and I cant find it. Could somebody
please point me to a location where the complete syntax

diagram can be found?

Does anybody at the list know the answer to my question? I

sent it a

few days ago and haven't received any response. It does

exist a syntax
diagram

for MySQL, doesn't it?

Since no-one replied to your first post, apparently not. I
have never seen such a thing.


Strange, where is the definition for the syntax element "where_definition"
done then? That is the part of the syntax diagram I currently looking for.
It is defined as an element in the select syntax diagram. But when trying to
find the definition for what is legal to put in a where clause, I just can't
find it.

Could somebody point in me the correct direction?

/Thomas



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Gleb Paharenko
*nix forums Guru


Joined: 02 Feb 2005
Posts: 1318

PostPosted: Fri Feb 04, 2005 12:34 pm    Post subject: Re: Syntax diagram, where is it located in the doc? Reply with quote

Hello.



May be it is not exactly what you want, but usually, I look at

the sql/sql_yacc.yy in a source distribution.





"Thomas Sundberg" <thomas.sundberg@gamefederation.com> wrote:

Quote:
Hi!



I'm looking for the syntax diagram for MySQL and can't find it. I have

downloaded the entire MySQL manual as one html page and searched it for the

definition of where_definition and I cant find it. Could somebody please

point me to a location where the complete syntax diagram can be found?



/Thomas







--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Gleb Paharenko
/ /|_/ / // /\ \/ /_/ / /__ Gleb.Paharenko@ensita.net
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET
<___/ www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Guest






PostPosted: Fri Feb 04, 2005 12:41 pm    Post subject: RE: Syntax diagram, where is it located in the doc? Reply with quote

"Thomas Sundberg" <thomas.sundberg@gamefederation.com> wrote on 04/02/2005
12:46:02:

Quote:


Does anybody at the list know the answer to my question? I
sent it a
few days ago and haven't received any response. It does
exist a syntax
diagram
for MySQL, doesn't it?

Since no-one replied to your first post, apparently not. I
have never seen such a thing.

Strange, where is the definition for the syntax element
"where_definition"
done then? That is the part of the syntax diagram I currently looking
for.
It is defined as an element in the select syntax diagram. But when
trying to
find the definition for what is legal to put in a where clause, I just
can't
find it.

Could somebody point in me the correct direction?

The WHERE keyword is followed by an "expression". There appears to be no
no formal definition of "expression", but it could be informally defined
as the a combination of Operatiors applied to column names and constants.
See manual chapter 12: Operators. The WHERE clause restricts to rows where
the expression returns true.

Alec Cawley.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Thomas Sundberg
*nix forums beginner


Joined: 04 Feb 2005
Posts: 9

PostPosted: Fri Feb 04, 2005 12:48 pm    Post subject: RE: Syntax diagram, where is it located in the doc? Reply with quote

Quote:
-----Original Message-----
From: Michael Stassen [mailto:Michael.Stassen@verizon.net]
Sent: den 4 februari 2005 14:19
To: Thomas Sundberg
Cc: mysql@lists.mysql.com
Subject: Re: Syntax diagram, where is it located in the doc?

From the manual, "where_definition consists of the keyword
WHERE followed by an expression that indicates the condition
or conditions that rows must satisfy to be selected."
http://dev.mysql.com/doc/mysql/en/select.html

That seems simple and straightforward to me. Perhaps if you
told us why you need this, someone could provide you with the
answer you need.

It is very simple but absolutely not straight forward. It really doesn't say
anything. Just that you should do things right and then you will not have
any problems.
The concrete problem I tried to solve were if MySQL supports xor in a where
clause. And if so, how should the syntax be written? That would have been
extremely simple if the syntax diagram started just above the quote you
supplied us with had been completed and not ended when things got a bit
interesting.

/Thomas


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Tom Crimmins
*nix forums addict


Joined: 04 Feb 2005
Posts: 58

PostPosted: Fri Feb 04, 2005 1:16 pm    Post subject: RE: Syntax diagram, where is it located in the doc? Reply with quote

Quote:
-----Original Message-----
From: Thomas Sundberg > Sent: Friday, February 04, 2005 07:48
To: mysql@lists.mysql.com


-----Original Message-----
From: Michael Stassen > > Sent: den 4 februari 2005 14:19
To: Thomas Sundberg
Cc: mysql@lists.mysql.com

From the manual, "where_definition consists of the keyword
WHERE followed by an expression that indicates the condition
or conditions that rows must satisfy to be selected."
http://dev.mysql.com/doc/mysql/en/select.html

That seems simple and straightforward to me. Perhaps if you
told us why you need this, someone could provide you with the
answer you need.

It is very simple but absolutely not straight forward. It
really doesn't say
anything. Just that you should do things right and then you
will not have
any problems.
The concrete problem I tried to solve were if MySQL supports
xor in a where
clause. And if so, how should the syntax be written? That

Yes, you can use XOR in the where clause.

SELECT * FROM mytable WHERE col1 XOR col2;

This is not a bitwise XOR, it evaluates each column to true or false first
then evals the XOR.

example for an int column:

a | b | eval
------------
0 | 0 | false
1 | 0 | true
1 | 1 | false
-1| 12| false
12| 0 | true

Quote:
would have been
extremely simple if the syntax diagram started just above the
quote you
supplied us with had been completed and not ended when things
got a bit
interesting.

/Thomas

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Guest






PostPosted: Fri Feb 04, 2005 1:17 pm    Post subject: RE: Syntax diagram, where is it located in the doc? Reply with quote

"Thomas Sundberg" <thomas.sundberg@gamefederation.com> wrote on 04/02/2005
13:48:03:

Quote:
It is very simple but absolutely not straight forward. It really doesn't
say
anything. Just that you should do things right and then you will not
have
any problems.
The concrete problem I tried to solve were if MySQL supports xor in a
where
clause. And if so, how should the syntax be written? That would have
been
extremely simple if the syntax diagram started just above the quote you
supplied us with had been completed and not ended when things got a bit
interesting.

It would probably not have been very hepful because it would simply have
mentioned <operators> and referred you back to section 12 of the manual
for a complete (and growing) list of operators. Good database practice
suggests that the same data - the list of valid operators - should not be
in two places unless there is an aoutomated method of deriveing the lesser
from the greater.. The "master" copy is the list of operators in the
Syntax section of the manual. Since operators includes words like IN, AND,
NOT, the syntax of operators is roughly [<non-space-character>]* . If you
looked in the manuel, under operators, then bitwise operators, you would
find xor near the top of the table - togehter with the information (not
available in a syntax diagram) that it is only available since 4.0.2.

Alternatively , a second's experimentation (SELECT 5^1Wink would have shown
that it has the "obvious" syntax - or the alternative syntax (SELECT 5 XOR
1Wink ;

Alec Cawley


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 67 [996 Posts] Goto page:  1, 2, 3, ..., 65, 66, 67 Next
View previous topic :: View next topic
The time now is Tue Dec 02, 2008 6:42 am | All times are GMT
navigation Forum index » Databases » MySQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Success delivery report kennykilla Postfix 0 Wed Aug 29, 2007 9:06 am
No new posts Bug Report - Solaris 10 spell Richard B. Gilbert Solaris 0 Fri Jul 21, 2006 11:22 am
No new posts Work-needing packages report for Jul 21, 2006 wnpp@debian.org devel 0 Fri Jul 21, 2006 6:50 am
No new posts Work-needing packages report for Jul 14, 2006 wnpp@debian.org devel 0 Fri Jul 14, 2006 6:50 am
No new posts Work-needing packages report for Jul 7, 2006 wnpp@debian.org devel 0 Fri Jul 07, 2006 6:50 am

Inkjet Printer | eBay | Credit Score | Repair Bad Credit | Mortgage
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2327s ][ Queries: 16 (0.0404s) ][ GZIP on - Debug on ]