order desc problem

2006-07-09 Thread M B Neretlis
the order comes out of sequence showing 10.11.12.13 etc before the number 2---
Can anyone help me out


?php
 //get user tips
 $query = @mysql_query(SELECT * FROM tips WHERE user_id = $user_id AND comp_id 
= $comp_id ORDER by round DESC);
 while ($result = @mysql_fetch_array($query)) {
 ?

Re: order desc problem

2006-07-09 Thread Aleksandar Bradaric
Hi,

 the order comes out of sequence showing 10.11.12.13 etc before the number 2---
 Can anyone help me out

That's  because  you  are  sorting  the  result  on a string
(char/varchar)  column.  Try  using  CAST  to  convert it to
int or something similar: ORDER BY cast(column as unsigned)


Best regards,
Aleksandar


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



Re: order desc problem

2006-07-09 Thread Chris Sansom

At 20:27 +0800 9/7/06, M  B Neretlis wrote:

the order comes out of sequence showing 10.11.12.13 etc before the number 2---
Can anyone help me out


?php
 //get user tips
 $query = @mysql_query(SELECT * FROM tips WHERE user_id = $user_id 
AND comp_id = $comp_id ORDER by round DESC);

 while ($result = @mysql_fetch_array($query)) {
 ?


Coo - something I actually know!

What column type is round? I bet it's a varchar or some other 
non-numeric type. If I'm right, it's sorting lexically, so 1 comes 
before 11, comes before 2, etc.


Change it to a some flavour of int and it should work.

--
Cheers... Chris
Highway 57 Web Development -- http://highway57.co.uk/

But what ... is it good for?
   -- Engineer at the Advanced Computing Systems Division of IBM,
 commenting on the microchip, 1968

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



a lil sql help please.

2006-07-09 Thread m i l e s

Hi,

I have the following Query and Im a lil lost on this one

SELECT DISTINCT tbe_orders.order_id, tbe_orders.order_date,  
tbe_orders.order_piececount

FROM tbe_orders

The query produces the following results:

+++
+ order_id  + order_date  +  order_piececount +
+++
+ oid1  + 2006-07-08  +1  +
+ oid1  + 2006-07-08  +2  +
+ oid1  + 2006-07-08  +3  +
+ oid5  + 2006-07-08  +7  +
+ oid5  + 2006-07-08  +1  +
+ oid4  + 2006-07-08  +1  +
+ oid4  + 2006-07-08  +2  +
+ oid4  + 2006-07-08  +1  +
+++

This is actually right.  However, ideally what I'm wanting is this:

+++
+ order_id  + order_date  +  order_piececount +
+++
+ oid1  + 2006-07-08  +6  +
+ oid5  + 2006-07-08  +8  +
+ oid4  + 2006-07-08  +4  +
+++

Note the order_piececount column.

What do I need to do to my SQL statement to perform this action ?

My guess that I need to perform a secondary query inside the  
statement to get the computed value of order_piececount.


Anyone ?

M i l e s.

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



Re: a lil sql help please.

2006-07-09 Thread Davor Dundovic

At 18:51 9.7.2006, you wrote:

Hi,

I have the following Query and Im a lil lost on this one

SELECT DISTINCT tbe_orders.order_id, tbe_orders.order_date,
tbe_orders.order_piececount
FROM tbe_orders



SELECT tbe_orders.order_id, 
tbe_orders.order_date,  sum(tbe_orders.order_piececount)

FROM tbe_orders
GROUP BY tbe_orders.order_id

or

SELECT tbe_orders.order_id, 
tbe_orders.order_date,  sum(tbe_orders.order_piececount)

FROM tbe_orders
GROUP BY tbe_orders.order_id, tbe_orders.order_date


depending whether date matters or not.



Regards, Dundo.



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



Re: a lil sql help please.

2006-07-09 Thread John L Meyer

m i l e s wrote:

Hi,

I have the following Query and Im a lil lost on this one

SELECT DISTINCT tbe_orders.order_id, tbe_orders.order_date,  
tbe_orders.order_piececount

FROM tbe_orders

The query produces the following results:

+++
+ order_id  + order_date  +  order_piececount +
+++
+ oid1  + 2006-07-08  +1  +
+ oid1  + 2006-07-08  +2  +
+ oid1  + 2006-07-08  +3  +
+ oid5  + 2006-07-08  +7  +
+ oid5  + 2006-07-08  +1  +
+ oid4  + 2006-07-08  +1  +
+ oid4  + 2006-07-08  +2  +
+ oid4  + 2006-07-08  +1  +
+++

This is actually right.  However, ideally what I'm wanting is this:

+++
+ order_id  + order_date  +  order_piececount +
+++
+ oid1  + 2006-07-08  +6  +
+ oid5  + 2006-07-08  +8  +
+ oid4  + 2006-07-08  +4  +
+++

Note the order_piececount column.

What do I need to do to my SQL statement to perform this action ?

My guess that I need to perform a secondary query inside the  
statement to get the computed value of order_piececount.


Anyone ?

M i l e s.

SELECT DISTINCT tbe_orders.order_id, tbe_orders.order_date,  
SUM(tbe_orders.order_piececount )

FROM tbe_orders GROUP BY order_id;



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



How to look for balanced parenthesis?

2006-07-09 Thread mos
I have a complicated SQL statement with around a dozen if(this,val1,val2) 
embedded in it and there are even nested If clauses. I'm getting syntax 
errors because I'm not balancing the ( ) properly. Is there any free 
software out there for Windows that I can copy and paste the SQL statement 
into that will show me where the parenthesis are unbalanced? It doesn't 
have to know about SQL, I just to either highlight the parenthesis range or 
find out when the parenthesis become out of sync.


TIA
(Mike))


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



Re: How to look for balanced parenthesis?

2006-07-09 Thread Rhino


- Original Message - 
From: mos [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Sunday, July 09, 2006 1:35 PM
Subject: How to look for balanced parenthesis?


I have a complicated SQL statement with around a dozen if(this,val1,val2) 
embedded in it and there are even nested If clauses. I'm getting syntax 
errors because I'm not balancing the ( ) properly. Is there any free 
software out there for Windows that I can copy and paste the SQL statement 
into that will show me where the parenthesis are unbalanced? It doesn't 
have to know about SQL, I just to either highlight the parenthesis range or 
find out when the parenthesis become out of sync.




I'm going to give you one answer that you almost certainly won't like: 
Eclipse. Eclipse is an IDE for developing programs, especially Java, and it 
has a parenthesis matcher which also handles braces and square brackets. 
Installing Eclipse solely for the bracket matcher is a bit like using atomic 
weapons to kill mosquitos but if you were going to develop applications 
anyway and wanted a great IDE, it might be the answer to your problem. It's 
free by the way. You can get it at http://eclipse.org.


Another editor that can also match brackets is PFE, Programmer's File 
Editor. It's also free and is a good editor. You can find it many places, 
including http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/pfefiles.htm. It 
only runs on Windows though.


Another decent little editor that has the feature is TextPad. It's also free 
and can be found at http://www.textpad.com/.


There are probably more basic editors out there that have bracket matchers 
but I can't name any for you. I'm not even sure what the feature you want is 
supposed to be called: bracket matcher, parenthesis balancer, or 
whatever. It's getting to be a pretty standard feature in editors in recent 
years, although it doesn't seem to be in NotePad or WordPad.


--
Rhino




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 2006-07-04


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



very basic questions

2006-07-09 Thread Jhst463
Hello, I'm new to MySQL and SQL have some very basic questions about them.  
I'm relatively competant in programming, so maybe if someone could answer ...


1. Are SQL files, eg. foo.sql, referred to as scripts or programs or what.  
(In searching for answers to 2. below and don't know if I'm using the right 
terms)

2. How do you get MySQL to execute a SQL file? I downloaded 
fill_help_tables.sql from the website, and it's comments tell how to load 
from the command 
line:
mysql -u root -p mysql  file_name
but I would like to load a file from the interactive mode, ie. from the 
mysql prompt.

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



Re: very basic questions

2006-07-09 Thread Jo�o C�ndido de Souza Neto
SQL files are just text files that has sql commands in. If you want to load 
a sql file from mysql prompt you can do like this.

mysql -u root -p mysql

mysql load file.sql;

It's better to remember you that you'll have to be in the folder where the 
file.sql is before call the mysql prompt.

Hope helped with this.
[EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED]
 Hello, I'm new to MySQL and SQL have some very basic questions about them.
 I'm relatively competant in programming, so maybe if someone could answer 
 ...


 1. Are SQL files, eg. foo.sql, referred to as scripts or programs or what.
 (In searching for answers to 2. below and don't know if I'm using the 
 right
 terms)

 2. How do you get MySQL to execute a SQL file? I downloaded
 fill_help_tables.sql from the website, and it's comments tell how to 
 load from the command
 line:
 mysql -u root -p mysql  file_name
 but I would like to load a file from the interactive mode, ie. from the
 mysql prompt. 



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



Re: very basic questions

2006-07-09 Thread Martin Jespersen
1: .sql files are usually textfiles with sql statements in them 
delimited by ;


2: do the following

1) start the client - /path/to/mysql -u user -ppass
2) select your database (if nescessary) - use db
3) import the sql file - source /path/to/fill_help_tables.sql



[EMAIL PROTECTED] wrote:
Hello, I'm new to MySQL and SQL have some very basic questions about them.  
I'm relatively competant in programming, so maybe if someone could answer ...



1. Are SQL files, eg. foo.sql, referred to as scripts or programs or what.  
(In searching for answers to 2. below and don't know if I'm using the right 
terms)


2. How do you get MySQL to execute a SQL file? I downloaded 
fill_help_tables.sql from the website, and it's comments tell how to load from the command 
line:

mysql -u root -p mysql  file_name
but I would like to load a file from the interactive mode, ie. from the 
mysql prompt.




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



Re: How to look for balanced parenthesis?

2006-07-09 Thread Miles Thompson

At 02:35 PM 7/9/2006, mos wrote:

I have a complicated SQL statement with around a dozen 
if(this,val1,val2) embedded in it and there are even nested If clauses. 
I'm getting syntax errors because I'm not balancing the ( ) properly. Is 
there any free software out there for Windows that I can copy and paste 
the SQL statement into that will show me where the parenthesis are 
unbalanced? It doesn't have to know about SQL, I just to either highlight 
the parenthesis range or find out when the parenthesis become out of sync.


TIA
(Mike))



Mike,


EditPlus will match parentheses;  I think the latest version of UltraEdit 
does as well.

It is a real help at times.

Cheers - Miles Thompson



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.9.10/383 - Release Date: 7/7/2006



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



Re: How to look for balanced parenthesis?

2006-07-09 Thread Miles Thompson

At 03:48 PM 7/9/2006, Rhino wrote:



- Original Message - From: mos [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Sunday, July 09, 2006 1:35 PM
Subject: How to look for balanced parenthesis?


I have a complicated SQL statement with around a dozen 
if(this,val1,val2) embedded in it and there are even nested If clauses. 
I'm getting syntax errors because I'm not balancing the ( ) properly. 
Is there any free software out there for Windows that I can copy and 
paste the SQL statement into that will show me where the parenthesis are 
unbalanced? It doesn't have to know about SQL, I just to either highlight 
the parenthesis range or find out when the parenthesis become out of sync.


I'm going to give you one answer that you almost certainly won't like: 
Eclipse. Eclipse is an IDE for developing programs, especially Java, and 
it has a parenthesis matcher which also handles braces and square 
brackets. Installing Eclipse solely for the bracket matcher is a bit like 
using atomic weapons to kill mosquitos but if you were going to develop 
applications anyway and wanted a great IDE, it might be the answer to your 
problem. It's free by the way. You can get it at http://eclipse.org.


Another editor that can also match brackets is PFE, Programmer's File 
Editor. It's also free and is a good editor. You can find it many places, 
including http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/pfefiles.htm. It 
only runs on Windows though.


Another decent little editor that has the feature is TextPad. It's also 
free and can be found at http://www.textpad.com/.


There are probably more basic editors out there that have bracket matchers 
but I can't name any for you. I'm not even sure what the feature you want 
is supposed to be called: bracket matcher, parenthesis balancer, or 
whatever. It's getting to be a pretty standard feature in editors in 
recent years, although it doesn't seem to be in NotePad or WordPad.


--
Rhino


Rhino,

Eclipse can't edit files on the server, can it?

I used to use UltraEdit, but then switched to EditPlus because it can edit 
remote files almost transparently. (Opening a file FTP's it down, you edit 
local copy, Saving FTP's it back.)


Cheers - Miles Thompson



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.9.10/383 - Release Date: 7/7/2006



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



Re: Cumulative Totals

2006-07-09 Thread Frederik Eaton
From this discussion, I'm assuming that there is no support for a
cumulative total index, is this correct? In other words, I'm looking
for an index which lets me query a cumulative sum of a column in
constant time, and which lets me find a row which has for instance the
smallest cumulative sum above a certain value in constant time as
well.

I'm in the process of implementing B-trees in procedural SQL so that I
can do this efficiently, but I wanted to make sure I wasn't
duplicating anyone's effort.

Frederik

On Fri, May 27, 2005 at 03:07:24PM -0400, [EMAIL PROTECTED] wrote:
 Just in case you did not follow this suggestion, if you are using 4.0.x this 
 is
 very simple. I was looking for this:
 
   set @total:=0;
   select f1,f2,...,@total:[EMAIL PROTECTED] as Total from table where ...;
 
 is pretty simple.
 
 On Wed, 25 May 2005, Dan Bolser wrote:
 
  On Wed, 25 May 2005, Russell Horn wrote:
 
  I have a pretty simple table with a list of payments, not much more
  than:
  
  paymentID | amount | paymentDate
  1| 123| 2005-01-10
  2| 77 | 2005-01-13
  3| 45 | 2005-02-16
  4| 13 | 2005-02-17
  
  
  I can get totals per month using a query like:
  
  SELECT SUM(amount) , DATE_FORMAT( `paymentDate` , '%Y-%m' )   FROM
  `payments`   GROUP BY DATE_FORMAT( payments . date , '%Y-%m' )
  
  That would give me:
  
  amount | paymentDate
  200| 2005-01
  58 | 2005-02
  
  Is there any way to get a running cumulative total directly from mysql?
  Something like:
  
  amount | paymentDate
  200| 2005-01
  258| 2005-02
  
 
  http://dev.mysql.com/doc/mysql/en/variables.html
 
 
  :D
 
 
 
 
  Thanks,
  
  Russell.
  
  
  
 
 
  --
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 _
 Douglas Denault
 http://www.safeport.com
 [EMAIL PROTECTED]
 Voice: 301-469-8766
   Fax: 301-469-0601
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 

-- 
http://ofb.net/~frederik/

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



Re: How to look for balanced parenthesis?

2006-07-09 Thread mos

At 01:48 PM 7/9/2006, you wrote:


- Original Message - From: mos [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Sunday, July 09, 2006 1:35 PM
Subject: How to look for balanced parenthesis?


I have a complicated SQL statement with around a dozen 
if(this,val1,val2) embedded in it and there are even nested If clauses. 
I'm getting syntax errors because I'm not balancing the ( ) properly. 
Is there any free software out there for Windows that I can copy and 
paste the SQL statement into that will show me where the parenthesis are 
unbalanced? It doesn't have to know about SQL, I just to either highlight 
the parenthesis range or find out when the parenthesis become out of sync.


I'm going to give you one answer that you almost certainly won't like: 
Eclipse. Eclipse is an IDE for developing programs, especially Java, and 
it has a parenthesis matcher which also handles braces and square 
brackets. Installing Eclipse solely for the bracket matcher is a bit like 
using atomic weapons to kill mosquitos but if you were going to develop 
applications anyway and wanted a great IDE, it might be the answer to your 
problem. It's free by the way. You can get it at http://eclipse.org.


That's ok, our provincial bird is the mosquito and we need all the weapons 
we can get.bg
I was going to try eclipse anyways for another project I'm going to start. 
Some people like eclipse, others hate it because it crashes a lot.



Another editor that can also match brackets is PFE, Programmer's File 
Editor. It's also free and is a good editor. You can find it many places, 
including http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/pfefiles.htm. It 
only runs on Windows though.


Another decent little editor that has the feature is TextPad. It's also 
free and can be found at http://www.textpad.com/.


There are probably more basic editors out there that have bracket matchers 
but I can't name any for you. I'm not even sure what the feature you want 
is supposed to be called: bracket matcher, parenthesis balancer, or 
whatever. It's getting to be a pretty standard feature in editors in 
recent years, although it doesn't seem to be in NotePad or WordPad.


Thanks for the list of editors. I'm surprised my version of Notetab pro 
doesn't have bracket matching. I may need to upgrade.


Mike 



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



How does one speed up delete-Again

2006-07-09 Thread Jacob, Raymond A Jr
I started the operation below on Friday at  1300hrs EST
 DELETE data
 FROM data, event
 WHERE data.cid = event.cid
 AND event.timestamp  2006-05-01


It is now Sunday 22:00hrs EST and the operation is still running.

Question: Should it take this long to delete 7.5 million records from a
4.5GB
Table?

Question: Other than writing a script to export all the cid's to a file
and  deleting the records one at a time so at least I can delete some
records. 
Is there a way to delete records one at a time or in groups
so that if I have to stop the operation the delete will not rolled back?

Question:Does anyone on the list have experience deleting what I guess
is a large number of 
records from a large table? i.e. how long does it take?

r/Raymond


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



Re: mysqldump - dump file per table?

2006-07-09 Thread Greg 'groggy' Lehey
On Friday,  7 July 2006 at 14:53:11 -0500, Dan Buettner wrote:
 I'm preparing to implement some mysqldump-based backups, and would
 really like to find an easy way to dump out one SQL file per table,
 rather than single massive SQL file with all tables from all
 databases.

 In other words, if I have database DB1 with tables TBL1 and TBL2, and
 database DB2 with tables TBL3 and TBL4, I'd end up with files named
 something like this, containing just the table create and data for
 each:

 20060707.DB1.TBL1.sql
 20060707.DB1.TBL2.sql
 20060707.DB2.TBL3.sql
 20060707.DB2.TBL4.sql

 This would make selective restores a lot easier, and would also allow
 us to set up development/testing environments more easily than one big
 file.

 I'd use mysqlhotcopy but we're in an InnoDB environment.

 I can implement this with a little perl script but wondered if anyone
 was aware of a tool out there already?

As has been discussed, there's no current method.  It's certainly as
an enhancement.  doable (though we'd need to think about how to name
the dump files).  You could put in a bug report asking for the
functionality, though honestly I don't see much likelihood of us doing
it in the near future.  But then, I don't decide the priorities.

On the other hand, if the bug report is accompanied by working code to
implement this functionality, there's a much better chance of it being
accepted.  If you or somebody else want to do this, please contact me
first so that we can discuss the approach.

Greg
--
Greg Lehey, Senior Software Engineer, Online Backup
MySQL AB, http://www.mysql.com/
Echunga, South Australia
Phone: +61-8-8388-8286   Mobile: +61-418-838-708
VoIP:  sip:[EMAIL PROTECTED], sip:[EMAIL PROTECTED]
Diary http://www.lemis.com/grog/diary.html

Are you MySQL certified?  http://www.mysql.com/certification/


pgpBt1YxNlABd.pgp
Description: PGP signature


Re: PHP connects in Latin1 when it should do it in UTF-8

2006-07-09 Thread Santiago del Castillo
Hi, i fixed it with this:

[mysqld]
init-connect='SET NAMES utf8'

And now works like a charm :)

Your solution it's the right one for you because you have databases in
different encodings, Since i don't, i didn't wanted to do extra queries
to the DB. In fact, that solution is the one i was using until now :).


Eric Butera wrote:
 On 7/6/06, Santiago del Castillo [EMAIL PROTECTED] wrote:
 
 Hi, i'm having a bit of a headache with PHP and MySQL, i've some
 questions:


 1) I've a database in UTF-8 and when i connect to it with mysql_connect,
 and exec a query with mysql_query, the results are in latin1. (i proved
 this with mysql_query(show variables like 'char%');
 2) Is there any way to force mysql to make connections in utf8?

 here is the mysql status command report:

 
 In my scripts I issue these commands on connect.  This seems to
 resolve the problem for me.  I cannot change it in my.cnf since
 changing the default from latin1 to utf8 would break previous sites.
 
 SET NAMES 'utf8'
 SET collation_connection = 'utf8_unicode_ci'
 

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



May I create more than 200 databases for one mysqld?

2006-07-09 Thread 古雷
May I create more than 200 databases for one mysqld?
And is there any disadvantage when there're many databases on one mysqld?

Thanks.

Regards,

Gu Lei

RE: May I create more than 200 databases for one mysqld?

2006-07-09 Thread paul rivers
Yes, you can.

Whether there are disadvantages depends mainly on how you are using mysql.

When there are many databases (an order of magnitude or more than what you
propose), some people report that show databases can be slow.  

Otherwise, the disadvantages are mainly administrative.  For example, do you
find permissions and accounts too messy for that many databases?  When you
are trying to troubleshoot activity in one database by examining the client
log, is it too noisy due to the other databases?  Do you find it too
burdensome to upgrade that many databases from one version to the next?

Since mysql is threaded, sometimes it makes sense to run multiple mysqld
processes on the same machine.  But again, this is more an administrative
decision than a technical one.  200+ databases is certainly well within
practical mysqld limits.

Regards,
Paul

-Original Message-
From: 古雷 [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 09, 2006 8:27 PM
To: mysql@lists.mysql.com
Subject: May I create more than 200 databases for one mysqld?

May I create more than 200 databases for one mysqld?
And is there any disadvantage when there're many databases on one mysqld?

Thanks.

Regards,

Gu Lei


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



Benchmarking GUI tool

2006-07-09 Thread Michael Louie Loria
Hello,

Does anybody know a Benchmarking GUI tool for MySQL under windows?


Thanks,

Mic



signature.asc
Description: OpenPGP digital signature


EINTR in my_connect()

2006-07-09 Thread Batara Kesuma

Hi all,

Is there any reason to abort connection when error code is EINTR? I  
tried to patch it as below:


---

[EMAIL PROTECTED]:~/src/mysql-5.0.22/libmysqld]$ diff -c client.c  
client.c.patch

*** client.c2006-07-10 12:24:52.0 +0900
--- client.c.patch  2006-07-10 12:27:21.0 +0900
***
*** 164,170 
res= connect(fd, (struct sockaddr*) name, namelen);
s_err= errno;   /* Save the error... */
fcntl(fd, F_SETFL, flags);
!   if ((res != 0)  (s_err != EINPROGRESS))
{
  errno= s_err; /* Restore it */
  return(-1);
--- 164,170 
res= connect(fd, (struct sockaddr*) name, namelen);
s_err= errno;   /* Save the error... */
fcntl(fd, F_SETFL, flags);
!   if ((res != 0)  (s_err != EINPROGRESS)  (s_err != EINTR))
{
  errno= s_err; /* Restore it */
  return(-1);

---

The reason is I have a lot of Interrupted system call error on my  
client side. I used this as my reference:

http://www.opengroup.org/onlinepubs/009695399/functions/connect.html

--
If the initiating socket is connection-mode, then connect() shall  
attempt to establish a connection to the address specified by the  
address argument. If the connection cannot be established immediately  
and O_NONBLOCK is not set for the file descriptor for the socket,  
connect() shall block for up to an unspecified timeout interval until  
the connection is established. If the timeout interval expires before  
the connection is established, connect() shall fail and the  
connection attempt shall be aborted. If connect() is interrupted by a  
signal that is caught while blocked waiting to establish a  
connection, connect() shall fail and set errno to [EINTR], but the  
connection request shall not be aborted, and the connection shall be  
established asynchronously.


If the connection cannot be established immediately and O_NONBLOCK is  
set for the file descriptor for the socket, connect() shall fail and  
set errno to [EINPROGRESS], but the connection request shall not be  
aborted, and the connection shall be established asynchronously.  
Subsequent calls to connect() for the same socket, before the  
connection is established, shall fail and set errno to [EALREADY].


--

I think for both EINPROGRESS and EINTR errno, the connection request  
should not be aborted. Is there anything that I missed here? Please  
advise, thank you.


Regards,
Batara




 


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