Exceptions not caught in UDF written in C++ in MySQL 5.5

2011-08-30 Thread H. Steuer

Hello guys,

after upgrading from MySQL 5.1 to 5.5 we encounter a problem that C++ 
exceptions thrown in an UDF are not catched at all. Even there is a 
"catch (... )" at the end
or our try block which avoids exceptions to be thrown outside of the 
UDF, the server crashes with:


terminate called after throwing an instance of 'DATE::DateException'
110830  8:27:34 - mysqld got signal 6 ;

Even a try to catch DATE::DateException was no success. The very same 
thing was verified with 5.1 and worked out of the box.



Any ideas?

Cheers,
Heri





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



bug in mysql with COUNT() in subqueries

2006-11-15 Thread H. Steuer
guys,

strange things happen when using COUNT() in subqueries. even the use of
HAVING in a SELECT statement turns up a weired result, as it should work
on the result set and should be filtered while rows are returned to the
client.

(you can find the selects and stuff in a more readable way on
http://pastebin.com/824848



mysql> SELECT VERSION();
+---+
| VERSION() |
+---+
| 4.1.18|
+---+
1 row in set (0.00 sec)

... same with other versions, too.

mysql> SELECT COUNT( distinct aCount.isin ) FROM anleihen aCount,
offlinekurse oCount WHERE oCount.isin='DE0001135176' AND
aCount.isin=oCount.isin AND
aCount.fonds=1;
+---+
| COUNT( distinct aCount.isin ) |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

... so in fact the count is 1.

SELECT f.nr, (SELECT COUNT( distinct aCount.isin ) FROM anleihen aCount,
offlinekurse oCount WHERE oCount.isin='DE0001135176' AND
aCount.isin=oCount.isin AND aCount.fonds=f.nr) AS counter FROM fonds f
HAVING nr=1;
+---+-+
| nr| counter |
+---+-+
| 1 |   1 |
+---+-+
1 row in set (0.01 sec)


... correct result here, but simply removing the HAVING returns:

mysql> SELECT f.nr, (SELECT COUNT( distinct aCount.isin ) FROM anleihen
aCount,  offlinekurse oCount WHERE oCount.isin='DE0001135176' AND
aCount.isin=oCount.isin AND aCount.fonds=f.nr) AS counter FROM fonds f;
+---+-+
| nr| counter |
+---+-+
|  2000 |   0 |
|  2001 |   0 |
|  2002 |   0 |
|  2003 |   0 |
|  2004 |   0 |
|  2005 |   0 |
|  2100 |   0 |
|  2101 |   0 |
|  2200 |   0 |
|  2201 |   0 |
|  2202 |   0 |
|  2203 |   0 |
|  2300 |   0 |
|  2301 |   0 |
|  2302 |   0 |
|  2303 |   0 |
|  2304 |   0 |
|  2305 |   0 |
|  2306 |   0 |
|  2307 |   0 |
|  2400 |   0 |
|  2401 |   0 |
|  2500 |   0 |
|  2501 |   0 |
|  2600 |   0 |
|  2601 |   0 |
|  2602 |   0 |
|  2603 |   0 |
|  2700 |   0 |
|  9000 |   0 |
|  9001 |   0 |
| 1 |   0 |
| 6 |   0 |
+---+-+
33 rows in set (0.01 sec)

... which is obviously wrong at least for the row with nr 1.

mysql> EXPLAIN SELECT f.nr, (SELECT COUNT( distinct aCount.isin ) FROM
anleihen aCount,  offlinekurse oCount WHERE oCount.isin='DE0001135176'
AND  aCount.isin=oCount.isin AND aCount.fonds=f.nr) AS counter FROM
fonds f;
++++---+---+-+-+---+--+--+
| id | select_type| table  | type  | possible_keys | key |
key_len | ref   | rows | Extra|
++++---+---+-+-+---+--+--+
|  1 | PRIMARY| f  | index | NULL  | PRIMARY |
2 | NULL  |   33 | Using index  |
|  2 | DEPENDENT SUBQUERY | oCount | ref   | isin  | isin|
13 | const |1 | Using where; Using index |
|  2 | DEPENDENT SUBQUERY | aCount | ALL   | NULL  | NULL|
NULL | NULL  |  143 | Using where  |
++++---+---+-+-+---+--+--+
3 rows in set (0.00 sec)

mysql> EXPLAIN SELECT f.nr, (SELECT COUNT( distinct aCount.isin ) FROM
anleihen aCount,  offlinekurse oCount WHERE oCount.isin='DE0001135176'
AND  aCount.isin=oCount.isin AND aCount.fonds=f.nr) AS counter FROM
fonds f HAVING nr=1;
++++---+---+-+-+---+--+--+
| id | select_type| table  | type  | possible_keys | key |
key_len | ref   | rows | Extra|
++++---+---+-+-+---+--+--+
|  1 | PRIMARY| f  | index | NULL  | PRIMARY |
2 | NULL  |   33 | Using index  |
|  2 | DEPENDENT SUBQUERY | oCount | ref   | isin  | isin|
13 | const |1 | Using where; Using index |
|  2 | DEPENDENT SUBQUERY | aCount | ALL   | NULL  | NULL|
NULL | NULL  |  142 | Using where  |
++++---+---+-+-+---+--+--+
3 rows in set (0.00 sec)


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



mysql 4.1.x and openbsd: client library problem

2005-01-15 Thread H. Steuer
hello guys,

after compiling and installing mysql 4.1.9 from sources, the database server 
seems to work fine, but everything from client/ seems to somehow "hardcode" the 
client library path into the binary.

when e.g. trying to start "mysqladmin" it goes:

# mysqladmin   
mysqladmin: can't load library '../libmysql/.libs/libmysqlclient.so.14.0'

when starting from the client/ directory, it works fine. I fixed that stuff for 
the mysql binary by linking it manually. 

# strings mysqladmin |grep mysqlcl
../libmysql/.libs/libmysqlclient.so.14.0

thats for OpenBSD 3.6 on various installations.
thats the linkage line that the autotools do:

/bin/sh ../libtool --preserve-dup-deps --mode=link g++ -O3 
-fno-implicit-templates -fno-exceptions -fno-rtti -o mysql mysql.o readline.o 
sql_string.o completion_hash.o ../cmd-line-utils/libedit/libedit.a -lncurses 
../libmysql/libmysqlclient.la -lm -lz



any ideas on this?

regards,
heri

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



Re: replication and other col names

2004-11-19 Thread H. Steuer
Hi Gleb,
is that a "no"?  Not having it in the docs doesnt mean that it is not 
possible :)

regards,
heri
- Original Message - 
From: "Gleb Paharenko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 19, 2004 4:35 PM
Subject: Re: replication and other col names


Hello.
There are no such tips in documentation.

gents,
is there a way to do replication where all database fields
on the slave have the same type, but other names?
i didnt investigate a binary log yet to check how queries are
stored there, but maybe one of you has experiences with this kind of 
configuration.

kind regards,
heri"H. Steuer" <[EMAIL PROTECTED]> wrote:

--
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]



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


replication and other col names

2004-11-19 Thread H. Steuer
hi gents,

is there a way to do replication where all database fields
on the slave have the same type, but other names?

i didnt investigate a binary log yet to check how queries are
stored there, but maybe one of you has experiences with this kind of 
configuration.

kind regards,
heri


Re: Exportation

2003-12-08 Thread H. Steuer
use mysqldump to dump all your databases.
man mysqldump should help further.

regards,
/H


On Mon, 08 Dec 2003 22:49:30 +0100
Pierre-Etienne Mélet <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I have a question concerning the portability of the files of the 
> database. Is there a way to export the content of a database from PC 
> (win or *NIX) to Mac ?
> 
> Great thanks
> 
> -- 
> Mélet Pierre-Etienne
> 
> 
> 
> 
> -- 
> 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]



cross database queries

2003-12-08 Thread H. Steuer
hello guys,

im just wondering if there are any limitations in cross database queries like:
SELECT one.* FROM db1.one, db2.two;

are there any differences in joining tables from within various databases to joinin 
tables from within the same database?
the background of my question is that various users which all have their own database 
need to share common data. so i wanted to create one common database which they all 
have access to.

i did some tests and all succeeded. but want to be sure before heading production 
status.


thanks alot for your help.


kind regards,

heri

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



Re: C API problems with InnoDB

2002-12-03 Thread H. Steuer
Hi Stefan,

> Does the second shell actually perform those changes? In this case, I
assume
> it's got something to do with the isolation level / consistent read in
> InnoDB tables. "shell1" sees all its changes immediately, "shell2" (the
> application) has just a snapshot of the data at the time it performs the
> select.

Well, in fact "shell2" is just another mysql shell I opened. So the
following is the situation :

Application loops. "shell1" changes data. "shell2" (which is just another
mysql shell i opened) can see the changes.
The application still doesnt.

So, how can that be caused by the isolation level ? Even after issuing a
COMMIT in "shell1" (the shell that changes data)
theres nothing visible in the application.

>
> This should however only be true for the select the first time the
> application loops. But if it uses the same conn = mysql_init(NULL); (I am
> not a C programmer), it will keep the same isolation level, and thus, the
> same snapshot.

Well, does that mean that I have to commit that "dummy" transaction in the
application just to have the commited data of
the other sessions available ?  I call it "dummy" because this transaction
doesnt change any data, just SELECTS it.

Here I quote the innodb manual :
"If you are running with the default REPEATABLE READ isolation level, then
all consistent reads within the same transaction read the snapshot
established by the first such read in that transaction. You can get a
fresher snapshot for your queries by committing the current transaction and
after that issuing new queries"

This would explain the behaviour of the application but seems quite useless
to me as I think the task of an atomic operation
should be to have changes done or completely rolled back.

Or do I get something wrong ?

Thanks,
Heri




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: C API problems with InnoDB

2002-12-03 Thread H. Steuer
Hello Mark,

thanks for your answer. In fact the mysql shell where I update the row is
using AUTOCOMMIT=1.
Even after I issue a COMMIT manually the changes are not seen by the
application.
What I dont understand is that the program doing a SELECT has to issue an
COMMIT to have all data available.
Maybe I cannot see through the transaction model at all, but as far as I can
see all other connections should have
the data available after the session that changes data issues a COMMIT
command. But in fact that doesnt happen
here. For what reason ever.

Any other ideas ?

regards,
Heri



> InnoDB takes a consistent 'snapshot' at the beginning of every
> transaction. This enables the 'I' in the infamous 'ACID' test...which is
> isolation...Transacations don't 'see' the effects of other transactions
> until after the others commit. InnoDB runs by default in an 'isolation
> level' of 'REPEATABLE_READ', which means that the isolation a particular
> transaction 'sees' remains in effect until that transaction itself has
> committed. InnoDB accomplishes this through the 'snapshotting' model
> mentioned above.
>
> See
>
> http://www.innodb.com/ibman.html#InnoDB_transaction_model
>
> for more detailed information, or consult any handy transaction
> processing or database textbook ;)
>
> -Mark




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




C API problems with InnoDB

2002-12-02 Thread H. Steuer
Hello MySQL users,

I have a weired issue using the MySQL C API and InnoDB tables.
An application polls a database every 30 seconds. When the application
starts everything seems to be fine.
During the running of the application i change some rows, but the
application itself doesnt see the changes at all.
I tracked down the problem and saw that its only happening if I set
autocommit=0.
If I run a second mysql shell I can see all changes immediately. Just the
application itself doesnt.

Here are the important parts of the code without any exception catching.
Just wanted to show the steps I did for querying the database.

conn = mysql_init(NULL);
mysql_real_connect(
conn,
hostname,
username,
password,
dbname,
0,
NULL,
0)
== NULL);
mysql_query(conn,"SET AUTOCOMMIT=0");


... so far for the preparing of the connection. now for the interresting
part. the following query runs in an loop :


mysql_query(conn,"SELECT
a.id,k.fix_SenderCompID,k.fix_TargetCompID,k.fix_version FROM aorder AS
a,kontrahenten AS k WHERE status='active' AND fix_status='queued_send' AND
k.id=a.kontrahent")

result = mysql_store_result(conn);
while ( ( row = mysql_fetch_row(result) ) != NULL ) {
// do something with the data
}
mysql_free_result(result);
sleep(30);


okay, when running this application does not see the changes to the
database - for what reason ever.
If I drop the SET AUTOCOMMIT=0 it works fine.
When inserting   'mysql_query(conn,"COMMIT;") ' after the mysql_store_result
everything seems to work fine, too.

But theres only a select statement - nothing that changes data at all. why
doesnt the application see the changes without the commit ?
I wrote a small test application without any other code, just this simple
query - the same result.
Can anyone explain this thing to me ?  Why is there a COMMIT needed after a
select ?
When stopping the application and restarting it immediately the changes are
visible, too.
I dont get any further - hope one of you guys can help.

Thanks in advance,
Heri



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php