Re: Wanted: Help with 'ON DUPLICATE KEY' syntax

2005-06-30 Thread Johan Höök

Hi Siegfried,
I think you've run into bug #8732:
...
Description:
if you do a INSERT INTO table (col_list) SELECT ... ON DUPLICATE KEY 
UPDATE and
refer to the same column in the col_list and in the UPDATE clause, it 
will bail

out, doesn't seem like it should, since not listing the column in the INSERT
list will make it work.
...

I've run into it myself on 4.1.12.

/Johan

Siegfried Heintze wrote:

Thanks for deciphering that terrible message, Shawn. I accidentally must
have hit the paste key too many times.

Anyway, here is my new insert statement:


INSERT INTO jobtitlecount (fkJobPosting, dtSnapShot, cJobTitle) VALUES
(211584,'2005-06-26',2) ON DUPLICATE KEY UPDATE cJobTitle=2 



DBD::mysql::st execute failed: You have an error in your SQL syntax.  Check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'ON DUPLICATE KEY UPDATE cJobTitle=2' at line 1 at
./crawl-hot-jobs.pl line 675.



I'm looking at the documentation on
http://dev.mysql.com/doc/mysql/en/insert.html and I don't see what I am
doing wrong.

Thanks,
Siegfried





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: default connection charset - SOLVED

2005-06-30 Thread Varshavchick Alexander

Hi,

Luckily I already found the solution, may be it'll be usefull for someone 
else. All that was needed was adding the following line to my.cnf file:


[mysqld]
init-connect="SET NAMES koi8r"

Regards


Alexander Varshavchick, Metrocom Joint Stock Company
Phone: (812)718-3322, 718-3115(fax)

On Wed, 29 Jun 2005, Gleb Paharenko wrote:


Privet.

As I know, PHP usually takes the character set from the server.
Please send part of your configuration file related to character sets.


Varshavchick Alexander <[EMAIL PROTECTED]> wrote:

Hi,

I have mysql 4.1.12 started with the default charset 'koi8r' and I have
the following problem: when connecting from PHP, the default
results and connection charsets become latin1, so all not-latin characters
get lost (they are displayed as ?). Of cause, if I explicitely set these
charsets to koi8r in the PHP scripts after the mysql_connect statement, it
starts working correctly, but the problem is, there are so many php
scripts calling mysql_connect function that I cannot change them all.

I tried adding the default-character-set options into my.cnf in the
[mysql] section and it workso for mysql command line but not for the php.

So is there any way of setting the default connection charset which will
work from php? Or the only way is downgrading to mysql 4.0 to make the
existing php script work?

Regards


Alexander Varshavchick, Metrocom Joint Stock Company
Phone: (812)718-3322, 718-3115(fax)







--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Wanted: Help with 'ON DUPLICATE KEY' syntax

2005-06-30 Thread Johan Höök

Hi Jocelyn,
you're right of course. I didn't read the original post
closely enough (it's early in the morning here...).
I missed that SELECT wasn't used.

Regards,
/Johan

[EMAIL PROTECTED] wrote:

Hi Johan,

I don't think it's its problem, since MySQL returns a "You have an error
in your SQL syntax." error, and not those specified in this bug report.
This means the SQL parser failed to understand its query.

Regards,
  Jocelyn



Hi Siegfried,
I think you've run into bug #8732:
...
Description:
if you do a INSERT INTO table (col_list) SELECT ... ON DUPLICATE KEY
UPDATE and
refer to the same column in the col_list and in the UPDATE clause, it
will bail
out, doesn't seem like it should, since not listing the column in the
INSERT
list will make it work.
...

I've run into it myself on 4.1.12.

/Johan

Siegfried Heintze wrote:


Thanks for deciphering that terrible message, Shawn. I accidentally must
have hit the paste key too many times.

Anyway, here is my new insert statement:


INSERT INTO jobtitlecount (fkJobPosting, dtSnapShot, cJobTitle) VALUES
(211584,'2005-06-26',2) ON DUPLICATE KEY UPDATE cJobTitle=2


DBD::mysql::st execute failed: You have an error in your SQL syntax.
Check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'ON DUPLICATE KEY UPDATE cJobTitle=2' at line 1 at
./crawl-hot-jobs.pl line 675.



I'm looking at the documentation on
http://dev.mysql.com/doc/mysql/en/insert.html and I don't see what I am
doing wrong.

Thanks,
Siegfried





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]








-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

limit of record in table Myisam

2005-06-30 Thread Arcangelo Casavola

Hi,
i've MySQL 4.0.18 
and 1 table type Myisam with many record (1.900.000)

Is there a limit of number of record for this table?

thank's
Arcangelo



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Avoiding full table scans

2005-06-30 Thread David Kagiri
Hi
I our database there is one table that will grow into tetrabytes within a short 
time.
 
I would like to know how i can reduce full table scans.
 
I have used separate tables as per region for now but the problem is if i 
create a new table i am forced to recompile the application.
 
I can easily avoid this by using one table and an extra field to flag which 
region a paricular transaction happened.However i need ideas of how i can avoid 
full table scans because slow queries are unacceptable. it will also give me 
more flexibility in writing reports 
 
I will gladly appreciate any links that are specific to this problem and case 
studies.There people who need to be convinced

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Duplicate entry error

2005-06-30 Thread anurag.dashputre

Hi all,
I am getting duplicate entry error while inserting data in the table.
My table name is TEMP and it contains only one field which is primary key ,nt 
null as well as auto increment .

050628 16:05:00  Slave: Error 'Duplicate entry '77' for key 1' on query
'INSERT INTO TEMP VALUES ()'. Default database: '', 
Error_code: 1062
050628 16:05:00  Error running query, slave SQL thread aborted.
Fix the problem, and restart the slave SQL thread with "SLAVE START". We 
stopped at log 'log-bin.018' position 37918

I have a master slave setup.So slave database has entries upto 77 only but 
master database has entries upto 114.
If I again start inesrting entries then entries in slave database will start 
from 115 which is really danagerous for me.

I couldn't understand the statement

Fix the problem, and restart the slave SQL thread with "SLAVE START".

Can anybody help me in solving this issue ?

Thanks and Regards,
Anurag


-Original Message-
From: Johan Höök [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 30, 2005 2:01 PM
To: [EMAIL PROTECTED]
Cc: Siegfried Heintze; mysql@lists.mysql.com
Subject: Re: Wanted: Help with 'ON DUPLICATE KEY' syntax


Hi Jocelyn,
you're right of course. I didn't read the original post
closely enough (it's early in the morning here...).
I missed that SELECT wasn't used.

Regards,
/Johan

[EMAIL PROTECTED] wrote:
> Hi Johan,
>
> I don't think it's its problem, since MySQL returns a "You have an
> error in your SQL syntax." error, and not those specified in this bug
> report. This means the SQL parser failed to understand its query.
>
> Regards,
>   Jocelyn
>
>
>>Hi Siegfried,
>>I think you've run into bug #8732:
>>...
>>Description:
>>if you do a INSERT INTO table (col_list) SELECT ... ON DUPLICATE KEY
>>UPDATE and refer to the same column in the col_list and in the UPDATE
>>clause, it will bail
>>out, doesn't seem like it should, since not listing the column in the
>>INSERT
>>list will make it work.
>>...
>>
>>I've run into it myself on 4.1.12.
>>
>>/Johan
>>
>>Siegfried Heintze wrote:
>>
>>>Thanks for deciphering that terrible message, Shawn. I accidentally
>>>must have hit the paste key too many times.
>>>
>>>Anyway, here is my new insert statement:
>>>
>>>
>>>INSERT INTO jobtitlecount (fkJobPosting, dtSnapShot, cJobTitle)
>>>VALUES
>>>(211584,'2005-06-26',2) ON DUPLICATE KEY UPDATE cJobTitle=2
>>>
>>>
>>>DBD::mysql::st execute failed: You have an error in your SQL syntax.
>>>Check the manual that corresponds to your MySQL server version for
>>>the right syntax to use near 'ON DUPLICATE KEY UPDATE cJobTitle=2' at
>>>line 1 at ./crawl-hot-jobs.pl line 675.
>>>
>>>
>>>
>>>I'm looking at the documentation on
>>>http://dev.mysql.com/doc/mysql/en/insert.html and I don't see what I
>>>am doing wrong.
>>>
>>>Thanks,
>>>Siegfried
>>>
>>>
>>
>>
>>--
>>MySQL General Mailing List
>>For list archives: http://lists.mysql.com/mysql
>>To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>
>
>




Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: limit of record in table Myisam

2005-06-30 Thread d2clon

i was asking for things like these..
look for the thread with this subject:
"mysql and limitations and hardware features support"


for aswer to particular question read this:
http://dev.mysql.com/doc/mysql/en/table-size.html

regards
d2clon


Arcangelo Casavola wrote:

Hi,
i've MySQL 4.0.18 and 1 table type Myisam with many record (1.900.000)
Is there a limit of number of record for this table?

thank's
Arcangelo







--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Grant Syntax Error.?

2005-06-30 Thread Mark Sargent

Hi All,

trying to create a new user with the below,

GRANT ALL PRIVILEGES ON *samhain* TO 'samhain'@'localhost' IDENTIFIED BY 
'passwd' WITH GRANT OPTION;


but, it gives a syntax error message. mysql version is 4.1.12. What is 
wrong with the syntax.? Cheers.


Mark Sargent.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Avoiding full table scans

2005-06-30 Thread Alec . Cawley
David Kagiri <[EMAIL PROTECTED]> wrote on 30/06/2005 09:44:11:

> Hi
> I our database there is one table that will grow into tetrabytes 
> within a short time.
> 
> I would like to know how i can reduce full table scans.
> 
> I have used separate tables as per region for now but the problem is
> if i create a new table i am forced to recompile the application.
> 
> I can easily avoid this by using one table and an extra field to 
> flag which region a paricular transaction happened.However i need 
> ideas of how i can avoid full table scans because slow queries are 
> unacceptable. it will also give me more flexibility in writing reports 
> 
> I will gladly appreciate any links that are specific to this problem
> and case studies.There people who need to be convinced

The answer to your question is Indexes. Ensure that you have indexes on 
your tables for all the different searches you do. Use the EXPLAIN command 
to find out which SELECTs are doing full table scans, and add Indexes as 
appropriate.

Alec



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Grant Syntax Error.?

2005-06-30 Thread Martijn van den Burg
Hi,

> trying to create a new user with the below,
> 
> GRANT ALL PRIVILEGES ON *samhain* TO 'samhain'@'localhost' 
> IDENTIFIED BY 'passwd' WITH GRANT OPTION;

That should be 'samhain.*', not '*samhain*'.


Regards,

Martijn


-- 
The information contained in this communication and any attachments is 
confidential and may be privileged, and is for the sole use of the intended 
recipient(s). Any unauthorized review, use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify the sender 
immediately by replying to this message and destroy all copies of this message 
and any attachments. ASML is neither liable for the proper and complete 
transmission of the information contained in this communication, nor for any 
delay in its receipt.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Help needed regarding MySQL-C Libraries on Linux....

2005-06-30 Thread Ashok Kumar
Dear Friends,
 I'm Ashok here. first i'll tell my sys configuration.
1.Redhat-Linux 9
2.Intel Pentium chipset
3.MySQL 4.1 with Development Libraries

 For this i've downloaded the MySQL4.1 under the
specification "Linux x86 RPM downloads" from the site.

 In my system, the MySQL Server is working well. I
tried to run the C program that will make the
connection to the MySQL database and create the user
database and useracc table.
 It's finely working with Windows-VC++. But when i'm
trying to run with Linux gcc, I'm getting lots of
errors. I don't know what's the problem. I've attached
the C-Pgm and the Error info.

 Pls, help me regarding this.

Thanks and Regards,
 Ashok.



 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com[EMAIL PROTECTED] CGI]# gcc -c -I/usr/lib/bcc/include -I/usr/include/mysql 
user.c

In file included from /usr/include/pthread.h:20,
 from /usr/include/mysql/my_global.h:149,
 from user.c:3:
/usr/include/sched.h:41: parse error before "__THROW"
/usr/include/sched.h:44: parse error before "__THROW"
/usr/include/sched.h:48: parse error before "__THROW"
/usr/include/sched.h:51: parse error before "__THROW"
/usr/include/sched.h:54: parse error before "__THROW"
/usr/include/sched.h:57: parse error before "__THROW"
/usr/include/sched.h:60: parse error before "__THROW"
/usr/include/sched.h:63: parse error before "__THROW"
In file included from /usr/include/mysql/my_global.h:149,
 from user.c:3:
/usr/include/pthread.h:166: parse error before "__THROW"
/usr/include/pthread.h:169: parse error before "__THROW"
/usr/include/pthread.h:172: parse error before "__THROW"
/usr/include/pthread.h:176: parse error before "__THROW"
/usr/include/pthread.h:181: parse error before "__THROW"
/usr/include/pthread.h:187: parse error before "__THROW"
/usr/include/pthread.h:195: parse error before "__THROW"
/usr/include/pthread.h:198: parse error before "__THROW"
/usr/include/pthread.h:202: parse error before "__THROW"
/usr/include/pthread.h:206: parse error before "__THROW"
/usr/include/pthread.h:211: parse error before "__THROW"
/usr/include/pthread.h:217: parse error before "__THROW"
/usr/include/pthread.h:221: parse error before "__THROW"
/usr/include/pthread.h:226: parse error before "__THROW"
/usr/include/pthread.h:230: parse error before "__THROW"
/usr/include/pthread.h:235: parse error before "__THROW"
/usr/include/pthread.h:239: parse error before "__THROW"
/usr/include/pthread.h:243: parse error before "__THROW"
/usr/include/pthread.h:261: parse error before "__THROW"
/usr/include/pthread.h:266: parse error before "__THROW"
/usr/include/pthread.h:285: parse error before "__THROW"
/usr/include/pthread.h:290: parse error before "__THROW"
/usr/include/pthread.h:303: parse error before "__THROW"
/usr/include/pthread.h:309: parse error before "__THROW"
/usr/include/pthread.h:333: parse error before "__THROW"
/usr/include/pthread.h:336: parse error before "__THROW"
/usr/include/pthread.h:339: parse error before "__THROW"
/usr/include/pthread.h:342: parse error before "__THROW"
/usr/include/pthread.h:352: parse error before "__THROW"
/usr/include/pthread.h:359: parse error before "__THROW"
/usr/include/pthread.h:362: parse error before "__THROW"
/usr/include/pthread.h:367: parse error before "__THROW"
/usr/include/pthread.h:371: parse error before "__THROW"
/usr/include/pthread.h:392: parse error before "__THROW"
/usr/include/pthread.h:395: parse error before "__THROW"
/usr/include/pthread.h:398: parse error before "__THROW"
/usr/include/pthread.h:401: parse error before "__THROW"
/usr/include/pthread.h:406: parse error before "__THROW"
/usr/include/pthread.h:415: parse error before "__THROW"
/usr/include/pthread.h:420: parse error before "__THROW"
/usr/include/pthread.h:423: parse error before "__THROW"
/usr/include/pthread.h:428: parse error before "__THROW"
/usr/include/pthread.h:432: parse error before "__THROW"
/usr/include/pthread.h:557: parse error before "__THROW"
/usr/include/pthread.h:560: parse error before "__THROW"
/usr/include/pthread.h:564: parse error before "__THROW"
/usr/include/pthread.h:567: parse error before "__THROW"
/usr/include/pthread.h:577: parse error before "__THROW"
/usr/include/pthread.h:584: parse error before "__THROW"
/usr/include/pthread.h:588: parse error before "__THROW"
/usr/include/pthread.h:591: parse error before "__THROW"
/usr/include/pthread.h:596: parse error before "__THROW"
/usr/include/pthread.h:612: parse error before "__THROW"
/usr/include/pthread.h:621: parse error before "__THROW"
In file included from /usr/include/pthread.h:655,
 from /usr/include/mysql/my_global.h:149,
 from user.c:3:
/usr/include/bits/sigthread.h:32: parse error before '*' token
/usr/include/bits/sigthread.h:36: parse error before "__THROW"
In file included from /usr/include/mysql/my_glob

pthread_cancel_timed_sigwait on OSR5

2005-06-30 Thread Sudhipan Sharma
 

Hi

Iam using SCO OpenServer 5.0.7 with MySQL version 4.0.20 ,sometimes (very
rarely) get this error while running some queries on MySQL, any ideas why?
We're using semaphores for protecting the database, so it is not a
concurrent access problem.

 

(136376800) pthread_cancel_timed_sigwait: thread=0 state=0 mode=0

(136376800) Assertion failed: FALSE in signal.c at 1828

 

MySQL:   4.0.20

FSU-Pthread: 3.14

 

Sometimes we've seen it happening during some operations in the GUI 

Thanks In Advance

Sudhipan


Sudhipan Sharma
56, Janpath, 2nd Floor, New Delhi-110001, India.
Ph # +91-11-23736466 extn 2234; Fax # +91-1123359997
Web:    http://www.in.sco.com/
;http://groups.yahoo.com/group/scoindia/

 "The Legend Continues". SCO Forum 2005. August 7-9. MGM Grand Hotel. Las
Vegas. 

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden





 



Project Management

2005-06-30 Thread David Ziggy Lubowa

Good Afternoon, 


 I was wondering if anyone could point me in the right direction on 
this one,  i need to setup a sort of project management interface which can 
be connected to from different parts of the world for update/write/read and 
offcourse enforce specific rules on particular documents.

The setup would have 3 sections:

 1. one relating to the specific organisations, 


 2. one relating to the project application[s]

 3.  Relating to assesment of the organisations ( which will be 
for specific eyes )


Anyone know of any good open source application i can use to achieve the 
above.

Any help is highly appreciated

cheers

David

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Project Management

2005-06-30 Thread rv
Hereby:
http://www.phprojekt.com/ --> we have used this ourself
http://www.dotproject.net

more can be found here:
http://www.hotscripts.com/PHP/Scripts_and_Programs/Groupware_Tools/index.html

Greetings
Reinhart

Citeren David Ziggy Lubowa <[EMAIL PROTECTED]>:

> 
> Good Afternoon, 
> 
> 
>  I was wondering if anyone could point me in the right direction on 
> this one,  i need to setup a sort of project management interface which can 
> be connected to from different parts of the world for update/write/read and 
> offcourse enforce specific rules on particular documents.
> 
> The setup would have 3 sections:
> 
>  1. one relating to the specific organisations, 
> 
> 
>  2. one relating to the project application[s]
> 
>  3.  Relating to assesment of the organisations ( which will be 
> for specific eyes )
> 
> 
> Anyone know of any good open source application i can use to achieve the 
> above.
> 
> Any help is highly appreciated
> 
> cheers
> 
> David
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 




-
This mail sent through IMP: http://horde.org/imp/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Got error 127 when reading table cat

2005-06-30 Thread nikos
Hello list
Can somebody infor me what is the "Got error 127 when reading table
cat"?

Thank you
Nikos


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Got error 127 when reading table cat

2005-06-30 Thread Jay Blanchard
[snip]
Can somebody infor me what is the "Got error 127 when reading table
cat"?
[/snip]

It means the table is crashed. See
http://dev.mysql.com/doc/mysql/en/repair.html for how to repair the
table.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



drop trigger?

2005-06-30 Thread Patrik Wallstrom
Using 5.0.7-beta the "drop trigger" functions in a very mysterious
way:

mysql> use testdb;
mysql> drop trigger foo;
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '' at line 1
mysql> drop trigger testdb.foo;
ERROR 1146 (42S02): Table 'testdb.testdb' doesn't exist

Seems like a serious bug to me.

-- 
patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-733173956
`-> http://www.gnuheter.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Got error 127 when reading table cat

2005-06-30 Thread Peter
that means you are running out of space on your machine or some specific 
partition

Peter

nikos wrote:

Hello list
Can somebody infor me what is the "Got error 127 when reading table
cat"?

Thank you
Nikos




--
Best regards,

Peter

http://AboutSupport.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Got error 127 when reading table cat

2005-06-30 Thread Mark Papadakis

That's usually an I/O error, if memory serves me right.
Try dumping the data, drop table, recreate it, and re-insert the data  
back-in.


MarkP


On Jun 30, 2005, at 14:34 , nikos wrote:


Hello list
Can somebody infor me what is the "Got error 127 when reading table
cat"?

Thank you
Nikos


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql? 
[EMAIL PROTECTED]






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Help needed regarding MySQL-C Libraries on Linux....

2005-06-30 Thread Ashok Kumar
Hi Prashanth,
 I'm happy to help u. i attached one 'C' code in the
previous mail. just use that code for in vc++. Follow
the procedure,
 1.Create the new "win32 Console App." as a empty
project and add the attached 'C' file to the project.
 2.goto "Tools->options->Directories(tab)" and in that
add the corresponding MySQL Include path and as well
as the lib->debug path.
 3.goto "Project->settings->Link(tab)->General
Category->add the name 'libmysql.lib' in lib modules"
 4.Save the project.
 5.Add the MySQL lib->debug path to the environment
path variable, which is found in
ctrl-panel->system->Advanced->env.var->path (for the
dynamic linking of libmysql.dll file).
 6.Restart the system (for effect of env path var).
 7.Run the project.

 This c pgm will create one database called "user" and
table named "useracc" under the db "user".

Note:
 Don't forget to change the username and password vars
in the pgm if u set anything like that for ur MySQL.

 For further info on C-MySQL read the following page,
some sample chapters are there, that will be useful.
 
http://www.quepublishing.com/articles/article.asp?p=30494&seqNum=2&rl=1

 If u have any doubts means, send that to the group,
rather than sending to the seperate person and so that
reply will be useful for others also.

Thanks and Regards,
 Ashok.



--- "Prashanth H. Baragur"
<[EMAIL PROTECTED]> wrote:

> Ashok,
> 
> Can u do me a favor.
> Am trying to update the mysql server in windows
> using VC++ and C code. 
> Am very new to this domain. Can u please send the
> code u are using in
> VC++ to me?
> 
> Your help would be greatly appreciate.
> Thanks
> prashanth
> 
> -Original Message-
> From: Ashok Kumar [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 30, 2005 3:34 PM
> To: mysql mysql
> Subject: Help needed regarding MySQL-C Libraries on
> Linux
> 
> Dear Friends,
>  I'm Ashok here. first i'll tell my sys
> configuration.
> 1.Redhat-Linux 9
> 2.Intel Pentium chipset
> 3.MySQL 4.1 with Development Libraries
> 
>  For this i've downloaded the MySQL4.1 under the
> specification "Linux x86 RPM downloads" from the
> site.
> 
>  In my system, the MySQL Server is working well. I
> tried to run the C program that will make the
> connection to the MySQL database and create the user
> database and useracc table.
>  It's finely working with Windows-VC++. But when i'm
> trying to run with Linux gcc, I'm getting lots of
> errors. I don't know what's the problem. I've
> attached
> the C-Pgm and the Error info.
> 
>  Pls, help me regarding this.
> 
> Thanks and Regards,
>  Ashok.
> 
> 
>   
> 
> 
> Yahoo! Sports 
> Rekindle the Rivalries. Sign up for Fantasy Football
> 
> http://football.fantasysports.yahoo.com
> 




 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Got error 127 when reading table cat

2005-06-30 Thread nikos
Ok, I get it...

Thanx everybody..

  _  

Qbit
Γατσής Νίκος - Gatsis Nikos
Web developer
tel.: 2108256721 - 2108256722
fax: 2108256712
email: [EMAIL PROTECTED]
http://www.qbit.gr 
 


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 30, 2005 2:44 PM
To: nikos; mysql@lists.mysql.com
Subject: RE: Got error 127 when reading table cat


[snip]
Can somebody infor me what is the "Got error 127 when reading table
cat"? [/snip]

It means the table is crashed. See
http://dev.mysql.com/doc/mysql/en/repair.html for how to repair the
table.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Err NO. 152 need help

2005-06-30 Thread root

Hi List ,

what does error no 152 mean , could not find anything useful from the
manual , was trying to drop a foreign key from an innodb table which has
its corresponding P Key in another table.

Table T_Dropdown (Foreign Key ) references Table T_Questionnaire
( T_QID )

> mysql >alter table T_Dropdown drop foreign key I_QId;
> ERROR 1025 (HY000): Error on rename of './lms/T_Dropdown' to
> './lms/#sql2-8f7-c2' (errno: 152)


 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: drop trigger?

2005-06-30 Thread Jeff Smelser
On Thursday 30 June 2005 06:47 am, Patrik Wallstrom wrote:
> mysql> use testdb;
> mysql> drop trigger foo;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near '' at line 1
> mysql> drop trigger testdb.foo;
> ERROR 1146 (42S02): Table 'testdb.testdb' doesn't exist
>
> Seems like a serious bug to me.

Why not submit a bug?

Jeff


pgpx29Q7QtMCz.pgp
Description: PGP signature


RE: Avoiding full table scans

2005-06-30 Thread emierzwa
You could leave your separate tables by region and create a MERGE
table over them. Your application only needs to reference the MERGE
table name, eliminating the need for your recompiles and MySql will
Handle the underlying tables. You can add or remove tables from the
MERGE at any time. I did notice a user comment in the online doc
http://dev.mysql.com/doc/mysql/en/merge-storage-engine.html
that said there was a 128 table limit, but I never tried that many.

Ed

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 30, 2005 2:56 AM
To: [EMAIL PROTECTED]
Cc: mysql
Subject: Re: Avoiding full table scans

David Kagiri <[EMAIL PROTECTED]> wrote on 30/06/2005 09:44:11:

> Hi
> I our database there is one table that will grow into tetrabytes 
> within a short time.
> 
> I would like to know how i can reduce full table scans.
> 
> I have used separate tables as per region for now but the problem is
> if i create a new table i am forced to recompile the application.
> 
> I can easily avoid this by using one table and an extra field to 
> flag which region a paricular transaction happened.However i need 
> ideas of how i can avoid full table scans because slow queries are 
> unacceptable. it will also give me more flexibility in writing reports

> 
> I will gladly appreciate any links that are specific to this problem
> and case studies.There people who need to be convinced

The answer to your question is Indexes. Ensure that you have indexes on 
your tables for all the different searches you do. Use the EXPLAIN
command 
to find out which SELECTs are doing full table scans, and add Indexes as

appropriate.

Alec



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: drop trigger?

2005-06-30 Thread Jigal van Hemert
From: "Patrik Wallstrom"
> Using 5.0.7-beta the "drop trigger" functions in a very mysterious
> way:
>
> mysql> use testdb;
> mysql> drop trigger foo;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near '' at line 1

MySQL is correct here: the syntax is
drop trigger .;
http://dev.mysql.com/doc/mysql/en/drop-trigger.html

> mysql> drop trigger testdb.foo;
> ERROR 1146 (42S02): Table 'testdb.testdb' doesn't exist

It seems to me that the table testdb doesn't exist (anymore).
Was the trigger 'foo' created for table 'testdb'? Trigger are associated
with tables, not databases (yet).
http://dev.mysql.com/doc/mysql/en/create-trigger.html

If you previously created the trigger for table 'bar', the command should
read:
drop trigger `bar`.`foo`;

Regards, Jigal.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Question about index for group by

2005-06-30 Thread Vivian Wang

Mysql,

I have table structure like this:
CREATE TABLE `promo_2003_1` (
`k1` char(17) NOT NULL default '',
`fname` char(3) default '',
`lname` char(6) default '',
`sndx_lname` char(6) default '',
`suffix` char(5) default '',
`zip5` char(5) default '',
`zip4` char(4) default '',
`firstname` char(30) default '',
`lastname` char(30) default '',
`subcode` char(2) default '',
`usps` char(1) default '',
`promodate` date default '-00-00',
KEY `zip5` (`zip5`,`zip4`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

When I explain those two queries:
1.
explain select zip5, zip4, count(*), 
sum(if(usps='R',1,0)),sum(if(usps='P',1,0)), sum(if(usps='S',1,0)), 
sum(if(usps='H',1,0)), sum(if(subcode in 
('AB','AD','AE','BC','BF','BM','CO','DD','DS','EB','EW','FO','GR','HT','KS','MO','NG','NH','OX','PA','PH','RD','RH','RI','ST','TB','TP','TR'), 
1, 0)), sum(if(subcode in ('CD','MU','CH'), 1, 0)), sum(if(subcode in 
('BA','BD','CF','FG','HE','HW','HL','JP','LX','ML','MT','TC'), 1, 0)), 
sum(if(subcode in ('BL','KC', 'TK'), 1, 0)), sum(if(subcode in 
('CL','EA','EM','SB','TA'), 1, 0)), sum(if(subcode in ('FI', 'PV'), 1, 
0)), sum(if(subcode in ('BA','BD','HE','HW','LX','MT','TC'), 1, 0)), 
sum(if(subcode in 
('AB','AD','AE','BC','BM','CO','CD','CH','DD','DS','EB','EW','FO','KS','ME','MO','MU','NG','NH','OX','PA','PH','RD','RH', 
'RI', 'ST','TB','TP'), 1, 0)), sum(if(subcode in ('BL','KC'), 1, 0)), 
sum(if(subcode in ('BF','HT','GR','TR'), 1, 0)), sum(if(subcode in 
('CF','HL','ML','TK','WC'), 1, 0)), sum(if(subcode in 
('CL','EA','EM','SB','TA'), 1, 0)), sum(if(subcode in ('FG','JP'), 1, 
0)), sum(if(subcode in ('BD', 'LX', 'OX', 'BL', 'KC', 'GR', 'TR', 'TK', 
'WC', 'FG'), 1, 0)), sum(if(subcode in ('CD', 'DD', 'PH'), 1, 0)), 
sum(if(subcode in ('OX', 'PH'), 1, 0)), sum(if(subcode in ('CD', 'DD', 
'GR', 'TR', 'TK', 'EA', 'SB', 'FG'), 1, 0)), sum(if(subcode in ('BD', 
'LX', 'BL', 'KC'), 1, 0)), sum(if(subcode not in ('OX', 'PH','CD', 'DD', 
'GR', 'TR', 'TK', 'EA', 'SB', 'FG','BD', 'LX', 'BL', 'KC'), 1, 0)), 
min(promodate), max(promodate), 
sum(if(promodate>DATE_SUB(CURDATE(),INTERVAL 91 DAY), 1, 0)), 
sum(if(promodate>DATE_SUB(CURDATE(),INTERVAL 182 DAY), 1, 0)), 
sum(if(promodate>DATE_SUB(CURDATE(),INTERVAL 365 DAY), 1, 0)), 
sum(if(promodate>DATE_SUB(CURDATE(),INTERVAL 730 DAY), 1, 0))  from 
promo_2003_2 use index (zip5) where zip5 !='' and zip4 !='' group by 
zip5, zip4;
++-+--+--+---+--+-+--+--+--+ 

| id | select_type | table| type | possible_keys | key  | 
key_len | ref  | rows | Extra|
++-+--+--+---+--+-+--+--+--+ 

|  1 | SIMPLE  | promo_2003_1 | ALL  | zip5  | NULL |
NULL | NULL | 3000 | Using where; Using temporary; Using filesort |
++-+--+--+---+--+-+--+--+--- 



2.
explain select zip5, zip4, count(*) from promo_2003_1 group by zip5, zip4;
++-+--+---+---+--+-+--+--+-+ 

| id | select_type | table| type  | possible_keys | key  | 
key_len | ref  | rows | Extra   |
++-+--+---+---+--+-+--+--+-+ 

|  1 | SIMPLE  | promo_2003_1 | index | NULL  | zip5 |  
11 | NULL | 3000 | Using index |
++-+--+---+---+--+-+--+--+-+ 




Why does query 2 pick the zip5 index, but query 1 doesn't ?
How to speed up the query 1?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Grant Syntax Error.?

2005-06-30 Thread Michael Stassen

Mark Sargent wrote:


Hi All,

trying to create a new user with the below,

GRANT ALL PRIVILEGES ON *samhain* TO 'samhain'@'localhost' IDENTIFIED BY 
'passwd' WITH GRANT OPTION;


but, it gives a syntax error message. mysql version is 4.1.12. What is 
wrong with the syntax.? Cheers.


Mark Sargent.


The problem is with *samhain*.  You probably meant samhain.*, as Martijn has 
already suggested.  GRANT syntax is described in the manual 
.


Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: drop trigger?

2005-06-30 Thread Patrik Wallstrom
On Thu, 30 Jun 2005, Jigal van Hemert wrote:

> MySQL is correct here: the syntax is
> drop trigger .;
> http://dev.mysql.com/doc/mysql/en/drop-trigger.html

Ah, that explains a lot. I just read tablename as database because of
all the other syntax. Works now.

Does anybody now when MySQL plans to support direct references to
table names? (From the docs:
"Note: Currently, triggers have the same limitation as stored functions
 that they may not contain direct references to tables by name. This
 limitation will be lifted as soon as possible.)

-- 
patrik_wallstrom->foodfight->[EMAIL PROTECTED]>+46-733173956
`-> http://www.gnuheter.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Help needed regarding MySQL-C Libraries on Linux....

2005-06-30 Thread Philippe Poelvoorde

Ashok Kumar wrote:

Dear Friends,
 I'm Ashok here. first i'll tell my sys configuration.
1.Redhat-Linux 9
2.Intel Pentium chipset
3.MySQL 4.1 with Development Libraries

 For this i've downloaded the MySQL4.1 under the
specification "Linux x86 RPM downloads" from the site.

 In my system, the MySQL Server is working well. I
tried to run the C program that will make the
connection to the MySQL database and create the user
database and useracc table.
 It's finely working with Windows-VC++. But when i'm
trying to run with Linux gcc, I'm getting lots of
errors. I don't know what's the problem. I've attached
the C-Pgm and the Error info.




[EMAIL PROTECTED] CGI]# gcc -c -I/usr/lib/bcc/include -I/usr/include/mysql 
user.c



is BCC the 8086 compiler ? then I'm not sure gcc can deal with those 
includes.
To get the proper flags, I'll advise you to use the mysql_config program 
like :

/usr/local/mysql/bin/mysql_config --cflags

(you didn't attach your program, so I can't see what is going on)

--
Philippe Poelvoorde
COS Trading Ltd.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Grant Syntax Error.?

2005-06-30 Thread Gleb Paharenko
Hello.



If you want wildcards you could use something like this:

  grant all privileges on `%samhain%`.* to [EMAIL PROTECTED] identified

by 'passwd' with grant option;





Mark Sargent <[EMAIL PROTECTED]> wrote:

> Hi All,

> 

> trying to create a new user with the below,

> 

> GRANT ALL PRIVILEGES ON *samhain* TO 'samhain'@'localhost' IDENTIFIED BY 

> 'passwd' WITH GRANT OPTION;

> 

> but, it gives a syntax error message. mysql version is 4.1.12. What is 

> wrong with the syntax.? Cheers.

> 

> Mark Sargent.

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   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/[EMAIL PROTECTED]



Re: Err NO. 152 need help

2005-06-30 Thread Gleb Paharenko
Hello.



perror 152

MySQL error code 152: Cannot delete a parent row



Something prevents your query from deleting a parent row. In my opinion,

it could be some lock from another transaction or query.





root <[EMAIL PROTECTED]> wrote:

> 

> Hi List ,

> 

> what does error no 152 mean , could not find anything useful from the

> manual , was trying to drop a foreign key from an innodb table which has

> its corresponding P Key in another table.

> 

> Table T_Dropdown (Foreign Key ) references Table T_Questionnaire

> ( T_QID )

> 

>> mysql >alter table T_Dropdown drop foreign key I_QId;

>> ERROR 1025 (HY000): Error on rename of './lms/T_Dropdown' to

>> './lms/#sql2-8f7-c2' (errno: 152)

> 

> 

>  CAUTION - Disclaimer *

> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
> for the use of the addressee(s). If you are not the intended recipient, 
> please notify the sender by e-mail and delete the original message. Further, 
> you are not to copy, disclose, or distribute this e-mail or its contents to 
> any other person and any such actions are unlawful. This e-mail may contain 
> viruses. Infosys has taken every reasonable precaution to minimize this risk, 
> but is not liable for any damage you may sustain as a result of any virus in 
> this e-mail. You should carry out your own virus checks before opening the 
> e-mail or attachment. Infosys reserves the right to monitor and review the 
> content of all messages sent to or from this e-mail address. Messages sent to 
> or from this e-mail address may be stored on the Infosys e-mail system.

> ***INFOSYS End of Disclaimer INFOSYS***

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   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/[EMAIL PROTECTED]



Re: drop trigger?

2005-06-30 Thread Gleb Paharenko
Hello.



You should include table name on which you had created the trigger:



mysql> delimiter $$

mysql> create trigger t1 after insert on ta for each row  begin set

@a=1; end $$

Query OK, 0 rows affected (0.17 sec)



mysql> drop trigger ta.t1$$

Query OK, 0 rows affected (0.00 sec)







Patrik Wallstrom <[EMAIL PROTECTED]> wrote:

> Using 5.0.7-beta the "drop trigger" functions in a very mysterious

> way:

> 

> mysql> use testdb;

> mysql> drop trigger foo;

> ERROR 1064 (42000): You have an error in your SQL syntax; check the

> manual that corresponds to your MySQL server version for the right

> syntax to use near '' at line 1

> mysql> drop trigger testdb.foo;

> ERROR 1146 (42S02): Table 'testdb.testdb' doesn't exist

> 

> Seems like a serious bug to me.

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   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/[EMAIL PROTECTED]



Re: Duplicate entry error

2005-06-30 Thread Gleb Paharenko
Hello.



Please examine your master's binary and slave's relay logs with

mysqlbinlog utility to find if sent and received SQL statements are

different. Sent your MySQL versions on master and slave. Include complete

output of 'SHOW SLAVE STATUS'. If your version is rather old, check if the

problem remains after upgrade.







[EMAIL PROTECTED] wrote:

> 

> Hi all,

> I am getting duplicate entry error while inserting data in the table.

> My table name is TEMP and it contains only one field which is primary key=

> ,nt null as well as auto increment .

> 

> 050628 16:05:00  Slave: Error 'Duplicate entry '77' for key 1' on query

> 'INSERT INTO TEMP VALUES ()'. Default database: ' here>', Error_code: 1062

> 050628 16:05:00  Error running query, slave SQL thread aborted.=0D

> Fix the problem, and restart the slave SQL thread with "SLAVE START". We=

> stopped at log 'log-bin.018' position 37918

> 

> I have a master slave setup.So slave database has entries upto 77 only but=

> master database has entries upto 114.

> If I again start inesrting entries then entries in slave database will=

> start from 115 which is really danagerous for me.

> 

> I couldn't understand the statement=0D

> 

> Fix the problem, and restart the slave SQL thread with "SLAVE START".

> 

> Can anybody help me in solving this issue ?

> 

> Thanks and Regards,

> Anurag

> 

> 

> -Original Message-

> From: Johan H=F6=F6k [mailto:[EMAIL PROTECTED]

> Sent: Thursday, June 30, 2005 2:01 PM

> To: [EMAIL PROTECTED]

> Cc: Siegfried Heintze; mysql@lists.mysql.com

> Subject: Re: Wanted: Help with 'ON DUPLICATE KEY' syntax

> 

> 

> Hi Jocelyn,

> you're right of course. I didn't read the original post

> closely enough (it's early in the morning here...).

> I missed that SELECT wasn't used.

> 

> Regards,

>/Johan

> 

> [EMAIL PROTECTED] wrote:

>> Hi Johan,

>>=0D

>> I don't think it's its problem, since MySQL returns a "You have an=0D

>> error in your SQL syntax." error, and not those specified in this bug=0D

>> report. This means the SQL parser failed to understand its query.

>>=0D

>> Regards,

>>   Jocelyn

>>=0D

>>=0D

>>>Hi Siegfried,

>>>I think you've run into bug #8732:

>>>...

>>>Description:

>>>if you do a INSERT INTO table (col_list) SELECT ... ON DUPLICATE KEY=0D

>>>UPDATE and refer to the same column in the col_list and in the UPDATE=0D

>>>clause, it will bail

>>>out, doesn't seem like it should, since not listing the column in the

>>>INSERT

>>>list will make it work.

>>>...

>>>

>>>I've run into it myself on 4.1.12.

>>>

>>>/Johan

>>>

>>>Siegfried Heintze wrote:

>>>

Thanks for deciphering that terrible message, Shawn. I accidentally=0D

must have hit the paste key too many times.



Anyway, here is my new insert statement:





INSERT INTO jobtitlecount (fkJobPosting, dtSnapShot, cJobTitle)=0D

VALUES

(211584,'2005-06-26',2) ON DUPLICATE KEY UPDATE cJobTitle=3D2





DBD::mysql::st execute failed: You have an error in your SQL syntax.=0D

Check the manual that corresponds to your MySQL server version for=0D

the right syntax to use near 'ON DUPLICATE KEY UPDATE cJobTitle=3D2' at=

> =0D

line 1 at ./crawl-hot-jobs.pl line 675.







I'm looking at the documentation on=0D

http://dev.mysql.com/doc/mysql/en/insert.html and I don't see what I=0D

am doing wrong.



Thanks,

Siegfried





>>>

>>>

>>>--

>>>MySQL General Mailing List

>>>For list archives: http://lists.mysql.com/mysql

>>>To unsubscribe:http://lists.mysql.com/mysql?unsub=

> [EMAIL PROTECTED]

>>=0D

>>=0D

>>=0D

>>=0D

> 

> 

> 

> 

> Confidentiality Notice=0D

> 

> The information contained in this electronic message and any attachments to=

> this message are intended

> for the exclusive use of the addressee(s) and may contain confidential or=

> privileged information. If

> you are not the intended recipient, please notify the sender at Wipro or=

> [EMAIL PROTECTED] immediately

> and destroy all copies of this message and any attachments.

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   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/[EMAIL PROTECTED]



Re: Avoiding full table scans

2005-06-30 Thread Gleb Paharenko
Hello.



See:

  http://dev.mysql.com/doc/mysql/en/how-to-avoid-table-scan.html







David Kagiri <[EMAIL PROTECTED]> wrote:

> [-- text/plain, encoding 8bit, charset: iso-8859-1, 15 lines --]

> 

> Hi

> I our database there is one table that will grow into tetrabytes within a 
> short time.

> 

> I would like to know how i can reduce full table scans.

> 

> I have used separate tables as per region for now but the problem is if i 
> create a new table i am forced to recompile the application.

> 

> I can easily avoid this by using one table and an extra field to flag which 
> region a paricular transaction happened.However i need ideas of how i can 
> avoid full table scans because slow queries are unacceptable. it will also 
> give me more flexibility in writing reports 

> 

> I will gladly appreciate any links that are specific to this problem and case 
> studies.There people who need to be convinced

> 

> __

> Do You Yahoo!?

> Tired of spam?  Yahoo! Mail has the best spam protection around 

> http://mail.yahoo.com 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   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/[EMAIL PROTECTED]



Possible to delay index writes until server is less busy?

2005-06-30 Thread Mathias
We've been benchmarking a database that in real-life will have a huge 
write load (max peak load 1 inserts/second) to the same table (MyISAM).


We will need about 4 indexes for that table. However, from our benchmark 
tests, it is clear that writing indexes takes too many resources and 
impedes the speed of inserting new records.


To overcome this, we are thinking of:
1 -  using several smaller tables (instead of one big one) by creating 
and writing to a new table every x hours,
2 -  wait with writing the indexes until a new table has been created 
where the next inserts will be (i.e, not write indexes until the table 
has been closed)


The biggest problem now is if the indexes are created when the server is 
very busy. If there was a way of telling MySQL to delay creating the 
indexes when it is busy, then a big obstacle would be out of the way.


Is this possible? We could not find anything in the MySQL documentation 
concerning this.


Any suggestions would be greatly appreciated.

Kind regards,

Mathias


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Records which link to other records in same table

2005-06-30 Thread zzapper
Hi,
I'm designing a simple family tree db which is at present just a flat table
In which each record everyone has a father & mother, a variable number of 
wives,and variable number
of children.
The links to other family tree members is always the record_id of another 
record.

At present I'm manually inserting the "links" eg my father is record_id 52, my 
mother recordid 60 my
children records 100,101,102

I can write queries to display everyone's father mother children etc no problem.

* But My question is 

Is it possible/useful to define any sort of relationships/linking the 
wife/father/mother/children
fields and the recordid of other records

 I'm fogging on this, your advice pls

-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Records which link to other records in same table

2005-06-30 Thread Alec . Cawley
news <[EMAIL PROTECTED]> wrote on 30/06/2005 16:47:43:


> I'm designing a simple family tree db which is at present just a flat 
table
> In which each record everyone has a father & mother, a variable 
> number of wives,and variable number
> of children.
> The links to other family tree members is always the record_id of 
> another record.
> 
> At present I'm manually inserting the "links" eg my father is 
> record_id 52, my mother recordid 60 my
> children records 100,101,102
> 
> I can write queries to display everyone's father mother children etc
> no problem.
> 
> * But My question is 
> 
> Is it possible/useful to define any sort of relationships/linking 
> the wife/father/mother/children
> fields and the recordid of other records
> 
>  I'm fogging on this, your advice pls

This is a link, previously recommended on this list, which I have found 
very useful:

http://www.sitepoint.com/article/hierarchical-data-database

Alec



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Records which link to other records in same table

2005-06-30 Thread SGreen
[EMAIL PROTECTED] wrote on 06/30/2005 11:59:43 AM:

> news <[EMAIL PROTECTED]> wrote on 30/06/2005 16:47:43:
> 
> 
> > I'm designing a simple family tree db which is at present just a flat 
> table
> > In which each record everyone has a father & mother, a variable 
> > number of wives,and variable number
> > of children.
> > The links to other family tree members is always the record_id of 
> > another record.
> > 
> > At present I'm manually inserting the "links" eg my father is 
> > record_id 52, my mother recordid 60 my
> > children records 100,101,102
> > 
> > I can write queries to display everyone's father mother children etc
> > no problem.
> > 
> > * But My question is 
> > 
> > Is it possible/useful to define any sort of relationships/linking 
> > the wife/father/mother/children
> > fields and the recordid of other records
> > 
> >  I'm fogging on this, your advice pls
> 
> This is a link, previously recommended on this list, which I have found 
> very useful:
> 
> http://www.sitepoint.com/article/hierarchical-data-database
> 
> Alec
> 

I agree with Alec. Why try to flatten a tree when you don't need to? 
However, you are going to need to expand on that article to make it fit 
into a genealogy application. (more on that in a sec)

To answer your question about storing the "relationship" information I 
would give a qualified "yes" as you only need to distinguish between 
parent-child relationships (births and adoptions) and same-level 
relationships (marriages) and when they existed (emancipated minors, 
placed for adoption, marriage, or divorce). I didn't say anything about 
sibling relationships (brothers, sisters), aunts/uncles, or cousins. Those 
are "relationships" based on relative positions in the tree and don't 
necessarily require that a direct linkage between any two people to exist. 
What relationship someone is to someone else is related to how you 
navigate from one person node to another: PersonA is a first cousin to 
PersonB if you navigate from A to B along the following path:

Move up two levels (grandparents) then down to a node not already visited 
(you would now be at a sibling node to one of PersonA's parents, an Aunt 
or Uncle). Move down one more level.

Here is another. PersonB is the sister-in law of PersonA if you can 
navigate either of the following paths from A to B:

Change nodes laterally through a marriage (the spouse of A). Move up one 
level. Move down one level to a female node. You would now be at the 
sister of A's spouse.
-- or --
Move up one level (a parent of A). Move down one level to any node other 
than PersonA( a sibling). Move laterally by marriage to a female node. Now 
you are at the wife of a sibling to A.


If you wanted to try to avoid the UP-DOWN navigation required to locate to 
a sibling, I think that including that direct linkage in your tree could 
get messy. What if a family had 8 children. That means that (worst case) 
each of the 8 children would need an entry "sibling-linking" them to each 
of the other 7. That's 56 additional records to avoid one up-link 
navigation and a conditional down-link navigation.  The "sibling" links 
would probably mean faster lookups (like an index) but they would 
definitely add more data overhead (also like an index). It's your call.

The major complexity with making a true family tree isn't in the 
down-links or the side-links, it's in navigating both up and down the tree 
starting from a single person (2 parents, 2 sets of grandparents (and 
their descendants), 4 sets of great-grandparents(and their descendants), 
etc) that turns this kind of relationship database from a single tree into 
multiple sets of interlocking trees (especially if you have cousins that 
marry each other). Odds are your database will need to be less 
tree-oriented and more network-oriented . The article is a great place to 
start (I very highly recommend it, too) but you are going to find the need 
to quickly expand your single tree into a network (someone help me here. I 
know that may not be the "correct" term for what he is modeling but it's 
the closest name I can think of) and that will probably change your node 
numbering algorithms (read the article) in significant ways. Still, start 
with the tree so that you get used to thinking in terms of nodes and 
links. It's going to work loads better than the flat design you have now.

I will do some research (it's related to what I need for my job anyway) 
about storing and modeling networks in relational databases and reply 
again with links when I find some good ones (may not be today). Does 
anyone else already have links on this topic?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


load data infile

2005-06-30 Thread blackwater dev
Hello all,

I have a file where the data looks like this:

"1","23","345","45";
"34","4","444","1er";

I am then trying to load that data using the load data local infile
and this statement:

Load data local infile '/httpd/htdocs/sql/loader.sql' into table
vehicles fields terminated by ',' enclosed by "'" lines terminated by
';'

The rows in loader.sql contain all of the columns so I am not
specifiying the columns and when I run this it tells me it loads 258
rows yet when I look in the db, these rows aren't there.

What am I doing wrong?

Thanks!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Possible to delay index writes until server is less busy?

2005-06-30 Thread gunmuse

Write to a memory table first then do a hotcopy on a scheduled basis.


- Original Message - 
From: "Mathias" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, June 30, 2005 9:10 AM
Subject: Possible to delay index writes until server is less busy?


We've been benchmarking a database that in real-life will have a huge 
write load (max peak load 1 inserts/second) to the same table 
(MyISAM).


We will need about 4 indexes for that table. However, from our benchmark 
tests, it is clear that writing indexes takes too many resources and 
impedes the speed of inserting new records.


To overcome this, we are thinking of:
1 -  using several smaller tables (instead of one big one) by creating and 
writing to a new table every x hours,
2 -  wait with writing the indexes until a new table has been created 
where the next inserts will be (i.e, not write indexes until the table has 
been closed)


The biggest problem now is if the indexes are created when the server is 
very busy. If there was a way of telling MySQL to delay creating the 
indexes when it is busy, then a big obstacle would be out of the way.


Is this possible? We could not find anything in the MySQL documentation 
concerning this.


Any suggestions would be greatly appreciated.

Kind regards,

Mathias


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: load data infile

2005-06-30 Thread lists . mysql-users
Hallo,

Op 30 Jun 05 schreef blackwater dev aan mysql@lists.mysql.com:

 bd> "1","23","345","45";
 bd> "34","4","444","1er";
 bd> Load data local infile '/httpd/htdocs/sql/loader.sql' into table
 bd> vehicles fields terminated by ',' enclosed by "'" lines terminated by
 bd> ';'

I think it should be: enclosed by '"'

Groetjes,

   Hans.

jdh punt beekhuizen bij duinheks punt xs4all punt nl

--- GoldED+/LNX 1.1.5/040412
 * Origin: The Wizard is using MBSE/Linux (2:280/1018)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Possible to delay index writes until server is less busy?

2005-06-30 Thread Dan Nelson
In the last episode (Jun 30), Mathias said:
> We've been benchmarking a database that in real-life will have a huge
> write load (max peak load 1 inserts/second) to the same table
> (MyISAM).
> 
> We will need about 4 indexes for that table. However, from our
> benchmark tests, it is clear that writing indexes takes too many
> resources and impedes the speed of inserting new records.
> 
> To overcome this, we are thinking of:
> 1 -  using several smaller tables (instead of one big one) by creating 
> and writing to a new table every x hours,
> 2 -  wait with writing the indexes until a new table has been created 
> where the next inserts will be (i.e, not write indexes until the table 
> has been closed)

You want the delay_key_write flag.  You can set it per-table, or
globally.  You can use the "FLUSH TABLE mytable" command to force mysql
to update the on-disk copy of the indexes.

http://dev.mysql.com/doc/mysql/en/create-table.html
http://dev.mysql.com/doc/mysql/en/myisam-start.html
http://dev.mysql.com/doc/mysql/en/flush.html

-- 
Dan Nelson
[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Found Wrong Record xxx (using 5.0.6 windoz)

2005-06-30 Thread TheRefUmp
Hi, 
I will give the output below. I just ran an insert of a small amount of data 
into Windoz/MySQL 5.0.6. Then, I ran a "myisampack" agains it. Finally, I ran  
a myisamchk against it and keep coming up against this error:
Found wrong record at 687081

Now, I'm the only one who has access to this database. What's is going on? Can 
anyone help me?
Enclosed is the output of each step below.

Regards,
George

E:\MySQLData\5.0.6\sdidw>myisampack -v --tmpdir=e:\workdir table.MYI
Compressing table.MYD: (100349 records)
- Calculating statistics

normal:  9  empty-space:   0  empty-zero: 1  empty-fill:   9
pre-space:   0  end-space: 0  intervall-fields:   4  zero:14
Original trees:  55  After join: 32
- Compressing file
Min record length: 39   Max length: 58   Mean total length: 46
77.63%
Remember to run myisamchk -rq on compressed tables

E:\MySQLData\5.0.6\sdidw>myisamchk --tmpdir=e:\workdir -rqp --sort-index 
--analyze mytable.MYI
- check record delete-chain
- parallel recovering (with sort) MyISAM-table 'mytable.MYI'
Data records: 100349
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6
- Fixing index 7
- Fixing index 8
- Fixing index 9
- Fixing index 10
- Fixing index 11
Found wrong record at 687081

E:\MySQLData\5.0.6\sdidw>

__
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



View onto tables w/ identical key names

2005-06-30 Thread Les Schaffer
i am working on a database system where a number of tables (5-10) each 
with possibly hundreds of columns share an identical primary key name. 
the truth is if it weren't for a limitation in the number of columns in 
M$ Access (long story: we're creating a client server scheme so they 
can get their Access DB for data analysis purposes post data 
collection)) these would be all one table.


since i need to use MySQL tables with a similar structure (long story), 
i would like to join these tables at the hip, so to speak, with a VIEW. 
however when i try to create said VIEW from a select/join, MySQL balks 
because the primary key name is the same in each table:


 select * from id left join dia USING (mat) left join msa USING (mat) 
left join sq USING (mat)


is there a CREATE VIEW method i am missing for making this happen. yes, 
i can change all the key names to tablename_mat, but prefer not to, 
thats another long story. is there a join that makes all but one o fthe 
mat columns disappear? i have yet to find it. ( ON id.mat=dia.mat doesnt 
work either )


a corollary question: is there a limit to the number of columns in a 
VIEW? i know each InnoDB table (our engine choice for now) must be < 
1000 columns. we are good there and also we are < 8000 bytes per record 
in each table. can a VIEW be wider than 8000 bytes?


many thanks

les schaffer

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Compatibility with ActiveState Perl 5.8.4+?

2005-06-30 Thread Siegfried Heintze
Approximately a half year ago I started to install bugzilla on windows which
uses mysql and perl.

After much grief, I discovered that there was a problem with windows perl
and the latest version of mysql at the time. I finally solved the problem by
rolling back to 4.0.23.

It looks like there are some nice features in 4.1 but they won't work for
me, unless someone has fixed the perl DBI interface.

Has anyone tried the newer versions with perl DBI on windows? How does v5
work, for example?

I'm reluctant to try it out myself because I have applications using mysql
and I would not want to break them by installing v5.

Thanks,
Siegfried


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Records which link to other records in same table

2005-06-30 Thread zzapper
On Thu, 30 Jun 2005 16:47:43 +0100,  wrote:

>Hi,
>I'm designing a simple family tree db which is at present just a flat table
>In which each record everyone has a father & mother, a variable number of 
>wives,and variable number
>of children.
>The links to other family tree members is always the record_id of another 
>record.
>
>At present I'm manually inserting the "links" eg my father is record_id 52, my 
>mother recordid 60 my
>children records 100,101,102
>
>I can write queries to display everyone's father mother children etc no 
>problem.
>
>* But My question is 
>
>Is it possible/useful to define any sort of relationships/linking the 
>wife/father/mother/children
>fields and the recordid of other records
>
> I'm fogging on this, your advice pls
>
My experience so far is that everything is done at the mysql query level and 
nothing
required/possible at the data-design level.
The only thing open for me is whether the children links (up to 20 for 1 
father) shouldn't be in a
separate "pairs link" table; what's the name of this type of table?

eg parent-children table
eg
father 234 child 450
father 234 child 451
father 234 child 453
mother 235 child 450
mother 235 child 451
mother 235 child 453

Now would it be useful to have a couple identifier? to simplify the above


-- 
zzapper
vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"
http://www.rayninfo.co.uk/tips/ vim, zsh & success tips


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]