Jochen Wiedmann | 1 May 22:29 2004
Picon

Re: Problem with Solaris 9 and SUN cc and make

Donovan, Chris wrote:

>      I am having some issues testing the module DBD::Mysql.  I am more than happy to provide a copy paste of the
error if need but basically everything fails.  Is this known to happen with the tools I am
using(/usr/ccs/bin/make, /opt/SUNWspro/bin/cc)?  Just lemme know if you want more detail.

Your tools are basically fine. (At least, AFAIK, the Sun CC is an ANSI C 
Compiler.) Most possibly your problem is a typical one like inability to 
locate the shared libraries at run time or mixing binaries from different 
sources. Use Google or a similar search engine for research or post an error 
log.

Jochen

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

Jan Eden | 1 May 22:48 2004

Re: Problem with disconnect

Thanks, Rudy and David,

Rudy Lippan wrote on 29.04.2004:

>On Thu, 29 Apr 2004, David Dick wrote:
>
>>>my $query2 = "UPDATE pages SET content = $content WHERE page_id =
>>>$id"; my $sth2 = $dbh->prepare($query2); $sth2->execute();
>>
>>$sth2->finish();
>

That did the trick. 

>This finish should not be needed. And it could all be replaced with
>a simple $sth2->do().

You're right, of course.

- Jan
-- 
A common mistake that people make when trying to design something completely foolproof is to
underestimate the ingenuity of complete fools.

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

(Continue reading)

Jan Eden | 2 May 00:43 2004

Apache error 500

Hi all,

I use a script to edit html pages served from a database. Now a peculiar error pattern shows up:

- New entries to the database never generate an error
- Changes to an existing entry create seem to generate an error when a) the lenght of the content field
exceeds a certain length or b) unmapped characters are detected.
- Nevertheless, the changes are always transferred to the database before the server error occurs.
- This (committing the changes) is the last directive in the script before printing a succeed message and disconnecting.

I tried everything, I just can't seem to find the cause, neither in my database nor in my script. Please check
my script for obvious mistakes. Thanks a lot.

- Jan

#!/usr/bin/perl -w

use strict;
use DBI;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
# mein Modul für user_check, mysql_config und headfoot
use Site2;

my $q = new CGI;

# Standardmodus ist lokal
my $mode = $q->param('mode') || 'local';

# Konfiguration fuer die Verbindung zum MySQL-Server
(Continue reading)

Rudy Lippan | 2 May 01:02 2004

Re: Apache error 500

On Sun, 2 May 2004, Jan Eden wrote:

> Date: Sun,  2 May 2004 00:43:15 +0200
> From: Jan Eden <lists <at> janeden.org>
> To: perl <at> lists.mysql.com
> Subject: Apache error 500
> 
> Hi all,
> 
> I use a script to edit html pages served from a database. Now a peculiar error pattern shows up:
> 
> - New entries to the database never generate an error
> - Changes to an existing entry create seem to generate an error when a) the lenght of the content field
exceeds a certain length or b) unmapped characters are detected.
> - Nevertheless, the changes are always transferred to the database before the server error occurs.
> - This (committing the changes) is the last directive in the script before printing a succeed message and disconnecting.
> 
> I tried everything, I just can't seem to find the cause, neither in my database nor in my script. Please
check my script for obvious mistakes. Thanks a lot.

Look at your apache error log and you should see the errormessage that 
caused the 500.

And a few suggestions/notes:

1. use plaholders for you sql queries.
2. you have RaiseError set but you are not trapping any errors so your scip
   will die whenever any query fails.
3. You might want to look into a templating system such as HTML::Template or 
   Template Toolkit, so you don't have all of that HTML in your perl code (which 
(Continue reading)

mayuran | 2 May 06:33 2004

lock timeouts


My script does the following: forks several children, each child
has some data to update/insert into the db, each child sleep()'s
until all the child have done their work then they all commit.  I
do this by having each child touch a file when they are done their
work and ready to commit.  Each child then waits in a loop, counts
the number of touch files to see if all of them have finished.  If
so they all commit.  The problem is that Im getting alot of 'Lock
wait timeout exceeded' errors from MySQL.  I have a feeling its
related to the sleeping children.  Can anyone offer some background
into this? Or some suggestions to solve it.  I had to fork and have
children do the work because having 1 process do it took too long.
Any suggestions would be much appreciated.

thank you

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

Rudy Lippan | 2 May 07:58 2004

Re: lock timeouts

On Sun, 2 May 2004, mayuran wrote:

> My script does the following: forks several children, each child
> has some data to update/insert into the db, each child sleep()'s
> until all the child have done their work then they all commit.  I
> do this by having each child touch a file when they are done their
> work and ready to commit.  Each child then waits in a loop, counts
> the number of touch files to see if all of them have finished.  If
> so they all commit.  The problem is that Im getting alot of 'Lock
> wait timeout exceeded' errors from MySQL.  I have a feeling its
> related to the sleeping children.  Can anyone offer some background
> into this? Or some suggestions to solve it.  I had to fork and have
> children do the work because having 1 process do it took too long.
> Any suggestions would be much appreciated.

It is not the sleeping children that are causing your lock wait timeouts. It is
fact that your children, like most children, do not like to share. The easiest
fix to this would be to set autocommit on. And from your description it does not
sound like are you doing that much with the transactions anway... Are you
rolling back all of the transactions in all of the chilren if one of them fails?  
If you need the txs then try limiting the time you have a transaction open (ie
commit as soon as possible), but still be prepared to replay the transaction it
in the event that you get a collision.

Here is an example script  that will cauase a lock wait timeout (note the 
useless update and the tx isolation level is as low as you can get):

#!/usr/local/bin/perl -w

use strict;
(Continue reading)

Jan Eden | 2 May 12:17 2004

Re: Apache error 500

Hi Rudy,

I solved the problem described in great detail. It was a print statement I had overlooked which would be
printed out before the HTML header under certain circumstances.

Thanks for your helpful suggestions, I will utilize them when streamlining my script (i.e. tomorrow).

Best,

Jan
-- 
There are 10 kinds of people:  those who understand binary, and those who don't

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

Ruslan U. Zakirov | 3 May 19:55 2004
Picon

[PATCH] mysql_db_quote + UTF8 flagged strings

	Hello.
Attached patch fix problems for users of perl5.8.x and strings with UTF8 
flag enabled.

In general case current code shouldn't give user big problems(it just 
doesn't copy UTF8 flag on new string), but perl(5.8.{0..4}) has small 
bug in 'sassign' op code and perl doesn't drop magic from strings in 
next code:

$utf_str = $dbh->quote( $utf_str );

under some conditions(I can't figure them out) $utf_str can be currupted 
in future use.

This patch works as workaround for perl bug and also fix logic of mysql 
quote sub which should copy UTF8 flag if it is set on src str.

				Best regards. Ruslan.

PS. PERL_VERSION check should be changed to right values, I don't know 
when UTF8 flag was introduced.

Attachment (mysql_quote_utf_fix.patch): application/aegis-patch, 597 bytes
--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org
Donovan, Chris | 4 May 08:06 2004

RE: Problem with Solaris 9 and SUN cc and make

Hello,

     I have finally found the problem and fixed it.  I am using the module DBD::Mysql through the use of Bugzilla. 
Bugzilla requires the module.  I found that when I installed a package that I downloaded from sunfreeware
and the binary from mysql.com it was failing.  Now it was definately as Jochen had said below.  I was failing
to find mysqlclient.so which in both packages was a astatic library (as I understand it).  Now
specifically DBD::Mysql was looking for mysqlclient.so which happens to not be included in either
instance of MySQL.  I fixed my errors by downloading the source and compiling it for my own use.  By default
MySQL 3.23.53 make both static and shared libraries according to the "./configure --help" option.  Once I
was able to make && make install this and started the server then my DBD::Mysql modules compiled, tested,
installed and ran fine.

     I understand that not everything that is needed can be documented. Could this issue be documented in the
README or somewhere for future admins with the same problem?  I noticed several of these issues out on google.

Thanks again,

Chris Donovan-

:> -----Original Message-----
:> From: Jochen Wiedmann [mailto:jochen.wiedmann <at> freenet.de]
:> Sent: Sunday, 2 May 2004 6:29 AM
:> To: Donovan, Chris
:> Cc: msql-mysql-modules <at> lists.mysql.com
:> Subject: Re: Problem with Solaris 9 and SUN cc and make
:> 
:> 
:> Donovan, Chris wrote:
:> 
:> >      I am having some issues testing the module 
(Continue reading)

Jan Eden | 4 May 19:01 2004

Possible security flaws

Hi all,

could you point out the possible security problems with the following design (planned)?

I have a database on my ISP's server which is accessible via a read-only and a read/write account.

Now the CGI scripts I wrote to handle the database call the following subroutine from a module:

sub mysql_config {
    my $mode = shift;
    my ($server, $db, $username, $password);
    if ($mode eq 'local') {
        # local configuration
        $server = 'localhost'; # The database server
        $db = '************'; # The name of our database.
        $username = '********' ;# the username 
        $password = '************' ;# the password
        # editor configuration
    } elsif ($mode eq 'editor') {
        # pair.com configuration (write)
        $server = '***********'; # The database server
        $db = '*******'; # The name of our database
        $username = '***********' ;# the username for reading/writing 
        $password = '*************' ;# the password
    } else {
    # read-only configuration
        $server = '**********'; # The database server
        $db = '******'; # The name of our database
        $username = '************' ;# the username for reading 
        $password = '*********' ;# the password
(Continue reading)


Gmane