Re: MySQL Magazine - Issue 1 available NOW!!!!

2007-06-06 Thread Peter Rosenthal

I would disagree on the use of mysql_real_escape_string(). The use of
placeholders is much safer from a maintenance and 'oops look I typoed it'
perspective.

On 04/06/07, Jon Ribbens [EMAIL PROTECTED] wrote:


On Mon, Jun 04, 2007 at 02:44:25PM -0700, Daevid Vincent wrote:
 Thanks for the magazine. I already incorporated a little extra SQL
 injection checking into my db.inc.php wrapper...

 //[dv] added to remove all comments (which may help with SQL injections
 as well.
 $sql = preg_replace(/#.*?[\r\n]/s, '', $sql);
 $sql = preg_replace(/--.*?[\r\n]/s, '', $sql);
 $sql = preg_replace(@/\*(.*?)\*/@s, '', $sql);

Um, what? Both that and the methods described in the magazine are
completely wrong. You use mysql_real_ecape_string(), that's it.

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




Re: [PART 2/2] InnoDB - Different EXPLAINs for same query

2007-01-17 Thread Peter Rosenthal

While I think optimize does an analyze, you may find that just an ANALYZE
will do it instead of a full OPTIMIZE:

http://dev.mysql.com/doc/refman/5.0/en/analyze-table.html


On 18/01/07, William R. Mussatto [EMAIL PROTECTED] wrote:


Just a thought, did you try running Optimize Table from the MySQL
Administrator.  I'm thinking that when you restarted it re-examined the
table statistics and was able to pick a better index.
On Wed, January 17, 2007 14:31, John Anderson said:


 mysql SELECT SQL_NO_CACHE COUNT(rb.subscription_id) as
 recurring_cc_count,

 -   SUM(rb.grace_price) as recurring_cc,

 -   COUNT(sb.subscription_id) as single_cc_count,

 -   SUM(sb.initial_amt) as single_cc

 - FROM customerdetail a

 -   LEFT JOIN recurringbilling rb

 - ON a.subscription_id = rb.subscription_id

 -   LEFT JOIN singlebilling sb

 - ON a.subscription_id = sb.subscription_id

 -   LEFT JOIN (global.subscriptionExchangeRate as ser INNER JOIN
 global.currencyCodes as cur)

 - ON (a.subscription_id = ser.subscriptionId AND
 ser.billedCurrencyCode = cur.currencyCode)

 - WHERE client_accnum = '12345'

 -   AND a.trans_timestamp

 -   BETWEEN '2007010800' AND '20070108235959';

 ++--+-+---+

 | recurring_cc_count | recurring_cc | single_cc_count | single_cc |

 ++--+-+---+

 |  4 |   119.80 |   0 |  NULL |

 ++--+-+---+

 1 row in set (0.40 sec)

 mysql explain SELECT SQL_NO_CACHE COUNT(rb.subscription_id) as
 recurring_cc_count,

 -   SUM(rb.grace_price) as recurring_cc,

 -   COUNT(sb.subscription_id) as single_cc_count,

 -   SUM(sb.initial_amt) as single_cc

 - FROM customerdetail a

 -   LEFT JOIN recurringbilling rb

 - ON a.subscription_id = rb.subscription_id

 -   LEFT JOIN singlebilling sb

 - ON a.subscription_id = sb.subscription_id

 -   LEFT JOIN (global.subscriptionExchangeRate as ser INNER JOIN
 global.currencyCodes as cur)

 - ON (a.subscription_id = ser.subscriptionId AND
 ser.billedCurrencyCode = cur.currencyCode)

 - WHERE client_accnum = '12345'

 -   AND a.trans_timestamp

 -   BETWEEN '2007010800' AND '20070108235959';

 ++-+---++---
 -+-+-+--
 -+--+--+

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

 ++-+---++---
 -+-+-+--
 -+--+--+

 |  1 | SIMPLE  | a | range  |
 client_idx,trans_idx,accno_trans_idx,accnumactive,accsubactive |
 accno_trans_idx | 7   | NULL  |4 | Using
 where; Using index |

 |  1 | SIMPLE  | rb| eq_ref | PRIMARY
 | PRIMARY | 8   | company.a.subscription_id  |1 |
 |

 |  1 | SIMPLE  | sb| eq_ref | PRIMARY
 | PRIMARY | 8   | company.a.subscription_id  |1 |
 |

 |  1 | SIMPLE  | ser   | ref| PRIMARY,billedCurrencyCode
 | PRIMARY | 8   | company.a.subscription_id  |1 |
 |

 |  1 | SIMPLE  | cur   | eq_ref | PRIMARY
 | PRIMARY | 2   | global.ser.billedCurrencyCode |1 |
 Using index  |

 ++-+---++---
 -+-+-+--
 -+--+--+

 5 rows in set (0.00 sec)



 mysql show index from customerdetail;

 +++-+--+
 -+---+-+--++--+-
 ---+-

 +

 | Table  | Non_unique | Key_name| Seq_in_index |
 Column_name | Collation | Cardinality | Sub_part | Packed | Null |
 Index_type | Comment

 |

 +++-+--+
 -+---+-+--++--+-
 ---+-

 ..SNIP

 | customerdetail |  1 | accno_trans_idx |1 |
 client_accnum   | A |   17052 | NULL | NULL   |  |
 BTREE  |

 |

 | customerdetail |  1 | accno_trans_idx |2 |
 trans_timestamp | A |49042196 | NULL | NULL   |  |
 BTREE  |

 ..SNIP

 +++-+--+
 

Re: Losing MySQL 5.0 connection at random on Windows box

2006-10-27 Thread Peter Rosenthal

10061 means actively refused. Maybe check your event log around the same
time to see if mysql died?

On 27/10/06, mos [EMAIL PROTECTED] wrote:


Since installing MySQL 5.0.24 on Windows XP, once or twice a week I'll get
an error message Can't connect to MySQL server on 'localhost' (10061)
Socket error on connect. WSAGetLastError return 10061. Does anyone know
what could be causing it?

This didn't happen when I ways using MySQL 4.1

Mike

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




Re: Anyone tried solidDB for MySQL?

2006-08-29 Thread Peter Rosenthal

http://www.solidtech.com/en/carrier-grade/index.asp

http://dev.soliddb.com/en/index.php

On 29/08/06, Ratheesh K J [EMAIL PROTECTED] wrote:


What is this solidDB? where can i get much info on this??

Thanks,
Ratheesh Bhat K J




Re: Anyone tried solidDB for MySQL?

2006-08-26 Thread Peter Rosenthal

I've installed the beta and imported data. It took longer to import than
InnoDB does so I think at least inserts are slower.

I haven't benchmarked reads or anything yet. I like the idea of having MVCC
instead of locks. We would benefit more from better query planning so I'm
unsure whether we will bother changing from InnoDB.




On 25/08/06, Cory Robin [EMAIL PROTECTED] wrote:


I've heard absolutely wonderful things about this transaction-safe storage
engine.   We're using InnoDB now and are always looking for the best
solution as we scale our DB operations.

Has anyone tried the SolidDB for MySQL beta stuff yet?

What do you think of it?

Cory.






Sub-query optimizer improvements scheduled?

2006-05-06 Thread Peter Rosenthal

Out of interest is there any time on the roadmap to improve the query
optimizer's handling of sub-queries as specified in
http://dev.mysql.com/doc/refman/5.0/en/subquery-restrictions.html ?

Thanks.