RE: Rollback on a Transaction with No Updates

2007-09-18 Thread Robert DiFalco
Well, assume a higher level abstraction that does not give clients to
that abstraction access to the raw connection. It only has methods like
update, search, commit, or rollback. What the connection is doing is a
kind of implementation detail.

-Original Message-
From: Michael Dykman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 18, 2007 10:00 AM
To: Robert DiFalco
Cc: Baron Schwartz; mysql@lists.mysql.com
Subject: Re: Rollback on a Transaction with No Updates

I realize that wasn't the question, but it does seem like a lot of
trouble to get the equivalent of setAutoCommit(true);

On 9/17/07, Robert DiFalco <[EMAIL PROTECTED]> wrote:
> Sure, but that wasn't really the question.
>
> -Original Message-
> From: Michael Dykman [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 17, 2007 2:56 PM
> To: Robert DiFalco
> Cc: Baron Schwartz; mysql@lists.mysql.com
> Subject: Re: Rollback on a Transaction with No Updates
>
> If your transaction are only 1 query deep, why use them at all?  An 
> individual query is already atomic, regardless of table type/server 
> mode.
>
>  - michael dkyman
>
>
> On 9/17/07, Robert DiFalco <[EMAIL PROTECTED]> wrote:
> > While it is functionally equivalent I wonder if it the code paths 
> > taken are the same. I suppose for both commit and rollback mysql 
> > would
>
> > have to look for any pending work, if there were none both would do
> nothing.
> > That's what makes me think that there is probably no performance 
> > difference between the two. I ask this because my programmers like 
> > to do
> > this:
> >
> > con = ...
> > try
> > {
> >queryOnlyWith( con );
> > }
> > finally
> > {
> >con.rollback();
> > }
> >
> > And I wanted to make sure that this would perform the same and act 
> > the
>
> > same as issuing a commit (unless there was an exception but I'm not 
> > analyzing that case).
> >
> > -Original Message-
> > From: Baron Schwartz [mailto:[EMAIL PROTECTED]
> > Sent: Monday, September 17, 2007 2:36 PM
> > To: Robert DiFalco
> > Cc: mysql@lists.mysql.com
> > Subject: Re: Rollback on a Transaction with No Updates
> >
> > Robert DiFalco wrote:
> > > Is there any difference between calling rollback or commit on a 
> > > transaction that did not alter data? For example, not a read-only 
> > > transaction but a transaction that only performed read-only
selects.
> > > Any difference in performance between calling rollback or commit? 
> > > I know they are functionally the same at the high level.
> >
> > The only thing I could think of was possibly rollback would leave 
> > open
>
> > transaction and its read view if you are running in REPEATABLE READ 
> > isolation mode, whereas commit begins a new transaction and discards

> > the read view.  But I just tested that, and both commands start a 
> > new transaction and discard the read view.
> >
> > That's a long way of saying they are functionally equivalent as far 
> > as
>
> > I know, as long as there are no changes to discard.
> >
> > Baron
> >
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >
>
>
> --
>  - michael dykman
>  - [EMAIL PROTECTED]
>
>  - All models are wrong.  Some models are useful.
>
>
>


-- 
 - michael dykman
 - [EMAIL PROTECTED]

 - All models are wrong.  Some models are useful.



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



Re: Could drbd randomly flip bits? Was: Database page corruption on disk occurring during mysqldump on a fresh database and Was: Spontaneous development of supremely large files on different ext3 file

2007-09-18 Thread Stephen Samuel
You may want to excercise your I/O subsystem.

Given that you probably don't want to stomp on a live filesystem, you
might want to create a file of a couple of gigabytes and turn it into
a pseudo-device with
'lofs(1)'.

EG:

# make a 15GB test file
dd if=/dev/zero of=the_testfile bs=1M count=15000
# find a free loopback pseudo-device
device=`losetup -f`
# attach it to the 5GB test file
losetup $device the_testfile
# exercise this block of data
nice badblocks -w -p5 $device  # 5 passes of a read-write test.

The other thing to do would be a memory test, to makes sure that
there's not something very wrong with your memory subsystem. I think
that there are tools that can do a *partial* memtest on a live system,
but a (really) quick look didn't find them.
Most  distributions have a memtest boot option which runs a
(reasonably) complete memory test.


On 9/17/07, Andreas Dilger <[EMAIL PROTECTED]> wrote:
> On Sep 17, 2007  13:31 -0400, Maurice Volaski wrote:
> > In using drbd 8.0.5 recently, I have come across at least two
> > instances where a bit on disk apparently flipped spontaneously in the
> > ext3 metadata on volumes running on top of drbd.
> >
> > Also, I have been seeing regular corruption of a mysql database,
> > which runs on top of drbd, and when I reported this as a bug since I
> > also recently upgraded mysql versions, they question whether drbd
> > could be responsible!
>
> Seems unlikely - more likely to be RAM or similar (would include cable
> for PATA/SCSI but that is less likely an issue for SATA).
>
> Cheers, Andreas
> --
> Andreas Dilger
> Principal Software Engineer
> Cluster File Systems, Inc.
>
> ___
> Ext3-users mailing list
> [EMAIL PROTECTED]
> https://www.redhat.com/mailman/listinfo/ext3-users
>


-- 
Stephen Samuel http://www.bcgreen.com
778-861-7641

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



non-blocking connect and EAGAIN

2007-09-18 Thread Dmitriy MiksIr

Hello!
I got a lot of mysql errors "Can't connect to local MySQL server through 
socket '/var/lib/mysql/mysql.sock' (11)".


I trace one of this error and see, what non-blocking connect return 
EAGAIN. See:

fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
connect(3, {sa_family=AF_FILE, path="/var/lib/mysql/mysql.sock"}, 110) = 
-1 EAGAIN (Resource temporarily unavailable)


Mysql's connect do not detect this error:
  if ((res != 0) && (s_err != EINPROGRESS))
  {
errno= s_err;   /* Restore it */
return(-1);
  }

Is this kernel bug (Linux 2.6.16-std26-smp-alt1)?... which return EAGAIN 
instead of EINPROGRESS, or some other troubles can force EAGAIN on unix 
socket connect?



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



Re: Rollback on a Transaction with No Updates

2007-09-18 Thread Michael Dykman
I realize that wasn't the question, but it does seem like a lot of
trouble to get the equivalent of setAutoCommit(true);

On 9/17/07, Robert DiFalco <[EMAIL PROTECTED]> wrote:
> Sure, but that wasn't really the question.
>
> -Original Message-
> From: Michael Dykman [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 17, 2007 2:56 PM
> To: Robert DiFalco
> Cc: Baron Schwartz; mysql@lists.mysql.com
> Subject: Re: Rollback on a Transaction with No Updates
>
> If your transaction are only 1 query deep, why use them at all?  An
> individual query is already atomic, regardless of table type/server
> mode.
>
>  - michael dkyman
>
>
> On 9/17/07, Robert DiFalco <[EMAIL PROTECTED]> wrote:
> > While it is functionally equivalent I wonder if it the code paths
> > taken are the same. I suppose for both commit and rollback mysql would
>
> > have to look for any pending work, if there were none both would do
> nothing.
> > That's what makes me think that there is probably no performance
> > difference between the two. I ask this because my programmers like to
> > do
> > this:
> >
> > con = ...
> > try
> > {
> >queryOnlyWith( con );
> > }
> > finally
> > {
> >con.rollback();
> > }
> >
> > And I wanted to make sure that this would perform the same and act the
>
> > same as issuing a commit (unless there was an exception but I'm not
> > analyzing that case).
> >
> > -Original Message-
> > From: Baron Schwartz [mailto:[EMAIL PROTECTED]
> > Sent: Monday, September 17, 2007 2:36 PM
> > To: Robert DiFalco
> > Cc: mysql@lists.mysql.com
> > Subject: Re: Rollback on a Transaction with No Updates
> >
> > Robert DiFalco wrote:
> > > Is there any difference between calling rollback or commit on a
> > > transaction that did not alter data? For example, not a read-only
> > > transaction but a transaction that only performed read-only selects.
> > > Any difference in performance between calling rollback or commit? I
> > > know they are functionally the same at the high level.
> >
> > The only thing I could think of was possibly rollback would leave open
>
> > transaction and its read view if you are running in REPEATABLE READ
> > isolation mode, whereas commit begins a new transaction and discards
> > the read view.  But I just tested that, and both commands start a new
> > transaction and discard the read view.
> >
> > That's a long way of saying they are functionally equivalent as far as
>
> > I know, as long as there are no changes to discard.
> >
> > Baron
> >
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >
>
>
> --
>  - michael dykman
>  - [EMAIL PROTECTED]
>
>  - All models are wrong.  Some models are useful.
>
>
>


-- 
 - michael dykman
 - [EMAIL PROTECTED]

 - All models are wrong.  Some models are useful.

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



declaration of constants in MySQL functions

2007-09-18 Thread spikerlion
Hello,

is there a possibility to declare constants in MySQL functions?

declare test_name varchar(50) DEFAULT 'test';

The variable test_name here ist changeable but it should not be.


Oracle syntax:
test_name CONSTANT VARCHAR2(50)  := 'test';


Regards,
Spiker
-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

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