Re: MySQL 4.1.8 InnoDB: data unavailability among different connections

2005-01-15 Thread Heikki Tuuri
Jose,
you must commit also the read transaction.
http://dev.mysql.com/doc/mysql/en/InnoDB_consistent_read.html
Best regards,
Heikki Tuuri
Innobase Oy
Foreign keys, transactions, and row level locking for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM 
tables
http://www.innodb.com/order.php

Order MySQL technical support from https://order.mysql.com/
- Original Message - 
From: Jose Antonio [EMAIL PROTECTED]
Newsgroups: mailing.database.myodbc
Sent: Saturday, January 15, 2005 1:34 AM
Subject: Re: MySQL 4.1.8  InnoDB: data unavailability among different 
connections


I'm doing the Commit so probably is the extra settings in the SQL. Could
you please elaborate a bit more on that?
Thank you in advance,
Jose.
Jeff Mathis escribi:
simple answer is transactions. until you issue a commit, or otherwise
specify extra settings in your SQL syntax, other connections do not
see your data.
Jose Antonio wrote:
Hi!
I am experiencing something weird using MySQL 4.1.8 with InnoDB tables.
I have an application, let's call it A, that is monitoring the data
that is available in the database. The data is inserted in the
database by a different application, let's call it B. The problem is
the following:
A starts a connection with MySQL and all the data inserted until the
connection time is available; however, the data that is inserted by B
while A is running is not visible to A. If A is re-started all the
data that was inserted by B is now available.
A is a plotting program and B is a data importer process.
Any clue on what may be going wrong?
Thank you in advance.
Jose.


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


Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Dave Merrill
I'm just starting to look at MySQL, been working w SQL Server.

I just noticed that in MySQL, you can't concatenate strings with '+', like
you can in SQL Server. In other words, in SQL Server
SELECT 'asdf' + 'qwer'
gives 'asdfqwer', but in MySQL, it gives 0. For MySQL, you seem to have to
use CONCAT.

I'm very surprised. Not only is this really really common operation much
more awkward in MySQL, but I thought string concatenation w '+' was totally
standard SQL.

Not so? Is there some db option to allow it?

Dave Merrill



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



RE: Strip off leading and trailing spaces once in db?

2005-01-15 Thread Dave Merrill
UPDATE my_table
SET my_column = TRIM(my_column),
my_other_column = TRIM(my_other_column)

etc... 

Dave Merrill


 Is it possible to remove all trailing and leading spaces for selected 
 fields once the data has already been loaded?
 
 Steve


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



Insert if Update failed without Select

2005-01-15 Thread sam wun
Hi,
Without using Select statement, how can I execute Insert SQL statement 
if Update action is failed?
I may be asking for too much. If Select statemnet have to be used to 
determine the existence of a recordset, what is an efficient way to 
execute Insert if Update is failed? I m using MySQL 5.0

Any example would be very apprecated.
Thanks
Sam.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Dave Merrill
???

SELECT 'asdf' . 'qwer'

...gives Error Code : 1064, You have an error in your SQL syntax...

I also can't find any reference to this use of periods in the docs.

Have you tried it? Can you point me to something that says it ought to work?
BTW, I'm trying this w mysql 4.1.7-nt-max on win2k, if it matters.


Also, part of my question was about standards, and it appears that I was
being ignorant. Found this:

-
The ANSI SQL concatenation operator is || used in Oracle, DB2 and others.
The + string concatenation operator in SQL Server is not portable to other
RDBMSs.
-

That was here, in an excerpt from a book on SQL Server:
  http://www.informit.com/articles/article.asp?p=327992seqNum=3

Looks like I was brought up in Microsoft's little corner of the world,
mistaking their standards for actual standards. Typical Micro$oft
intentional disruption.

But it appears that MySQL doesn't support || either, and neither does SQL
Server. So much for anyone other than customers caring about standards.
Writing platform agnostic sql seems much less likely than I'd guessed, even
on a very basic level.

Dave Merrill


 The period is used to concatenate so replace your concatenate plus with a
 period.

  I'm just starting to look at MySQL, been working w SQL Server.
 
  I just noticed that in MySQL, you can't concatenate strings
 with '+', like
  you can in SQL Server. In other words, in SQL Server
  SELECT 'asdf' + 'qwer'
  gives 'asdfqwer', but in MySQL, it gives 0. For MySQL, you seem
 to have to
  use CONCAT.
 
  I'm very surprised. Not only is this really really common operation much
  more awkward in MySQL, but I thought string concatenation w '+' was
 totally
  standard SQL.
 
  Not so? Is there some db option to allow it?
 
  Dave Merrill



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



Re: Insert if Update failed without Select

2005-01-15 Thread Mattias J
At 2005-01-15 14:48, you wrote:
Without using Select statement, how can I execute Insert SQL statement if 
Update action is failed?
I may be asking for too much. If Select statemnet have to be used to 
determine the existence of a recordset, what is an efficient way to 
execute Insert if Update is failed? I m using MySQL 5.0
Look at http://dev.mysql.com/doc/mysql/en/REPLACE.html 

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


Re: Insert if Update failed without Select

2005-01-15 Thread Mattias J
Please also note hat UPDATE returns the number of records updated. If your 
UPDATE returns 0, you know that the record does not exist, and you might 
want to INSERT instead.

At 2005-01-15 14:54, you wrote:
At 2005-01-15 14:48, you wrote:
Without using Select statement, how can I execute Insert SQL statement if 
Update action is failed?
I may be asking for too much. If Select statemnet have to be used to 
determine the existence of a recordset, what is an efficient way to 
execute Insert if Update is failed? I m using MySQL 5.0
Look at http://dev.mysql.com/doc/mysql/en/REPLACE.html

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


MySQL 4.1.8 and storing east characters

2005-01-15 Thread Martin Gallagher
Hi,

 

Ive recently upgraded to MySQL 4.1.8 for the UTF-8 support.

 

Ive updated my previous data which was Western European languages, now Id 
like to get to grips on more exotic dialects such as Korean, Japanese and deep 
East languages such as Greek and Romanian.

 

The problem is I keep getting corrupted character data.

 

The source of the data is XML converted to UTF-8 by libxml, but when ever I try 
to insert this data into the MySQL table some data gets corrupted.

 

Here is an example:

 

http://www.feedsfarm.com/s/s-50-+site%3Aa

 

The table has been converted to utf8, I have the character sets installed on my 
client machine, and some of the characters are correct, but a lot of the 
characters come out as: ?? in Firefox, and  and  in IE 6.

 

When I validate the document @ W3C I get:

Sorry, I am unable to validate this document because on lines 70, 74, 79, 
83, 87, 91, 95, 99, 103, 107, 111, 115, 120, 127, 133, 139 it contained one or 
more bytes that I cannot interpret as utf-8

 

Does anyone know what the source of my problem is?

 

Cheers,

Martin

 

XMLMania.com http://www.xmlmania.com  - The Definitive XML Source...

 



Re: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Robert Alexander
At 07:37 -0500 2005/01/15, Dave Merrill wrote:
I thought string concatenation w '+' was totally
standard SQL.
Hmmm, this is the first I've heard of + being used for 
concatenation (in SQL). Then again, I've never used MS SQL Server. 
:-)

Each language is going to have its own personality.  If they all did 
things the same way, we wouldn't have the wealth of different ones to 
choose from.

Might not be a good idea, Dave, to take MS products as examples of 
what accepted standards are.  MS has a long history of lack of 
respect for established standards.

I suspect MySQL is more ANSI compliant than MS SQL Server.
Rob
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Dave Merrill
As I said in my msg, I found out that I was wrong, '+' isn't ANSI, it's just
microsoft. But mysql doesn't support the ANSI standard '||' either.

Go figure...

This is my first foray into different flavors of sql, and I'm discovering
how incompatible they really are. I expected that core basics would be the
same, with each manufacturer adding some proprietary extensions, and failing
to support a (hopefully small) subset of standard features.

/dreaming

Dave Merrill


 At 07:37 -0500 2005/01/15, Dave Merrill wrote:
 I thought string concatenation w '+' was totally
 standard SQL.

 Hmmm, this is the first I've heard of + being used for
 concatenation (in SQL). Then again, I've never used MS SQL Server.
 :-)

 Each language is going to have its own personality.  If they all did
 things the same way, we wouldn't have the wealth of different ones to
 choose from.

 Might not be a good idea, Dave, to take MS products as examples of
 what accepted standards are.  MS has a long history of lack of
 respect for established standards.

 I suspect MySQL is more ANSI compliant than MS SQL Server.

 Rob



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



Re: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Jochem van Dieten
On Sat, 15 Jan 2005 11:11:05 -0500, Robert Alexander wrote:
 
 Each language is going to have its own personality.  If they all did
 things the same way, we wouldn't have the wealth of different ones to
 choose from.

DBMS's are not languages, they are implementations.


 Might not be a good idea, Dave, to take MS products as examples of
 what accepted standards are.  MS has a long history of lack of
 respect for established standards.
 
 I suspect MySQL is more ANSI compliant than MS SQL Server.

Can you substantiate that suspicion?

Jochem

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



Re: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Greg Whalin
Jochem van Dieten wrote:
On Sat, 15 Jan 2005 11:11:05 -0500, Robert Alexander wrote:
Each language is going to have its own personality.  If they all did
things the same way, we wouldn't have the wealth of different ones to
choose from.

DBMS's are not languages, they are implementations.

Might not be a good idea, Dave, to take MS products as examples of
what accepted standards are.  MS has a long history of lack of
respect for established standards.
I suspect MySQL is more ANSI compliant than MS SQL Server.

Can you substantiate that suspicion?
Jochem
This entire discussion is somewhat pointless in the face of reality. 
Sure it would be nice if every DB vendor had the exact same syntax, but 
that is not the case.  They all differ enough so that anything more than 
 basic SQL will not migrate.  Accept it, deal with it, and RTFM to 
learn how to use SQL in each implementation.

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


Re: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Jochem van Dieten
On Sat, 15 Jan 2005 11:37:02 -0500, Dave Merrill wrote:
 
 This is my first foray into different flavors of sql, and I'm discovering
 how incompatible they really are. I expected that core basics would be the
 same, with each manufacturer adding some proprietary extensions, and failing
 to support a (hopefully small) subset of standard features.

DBMS's are slowly getting there. What you are (I am) seeing is that
whenever vendors introduce new features that are in the standard, they
follow the syntax from the standard. Yukon will have SQL standard
recursive queries, MySQL will have a standard implementation of
SQL-PSM, PostgreSQL got a standard information schema etc.
It is not going as fast as I would like and vendors are especially
reluctant to rewrite existing features to use standard syntax (in casu
MySQL and the horrible overloading off timestamp behaviours), but it
isn't that long ago that we wouldn't even consider outer join syntax
as standard.

Jochem

-- 
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: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Robert Alexander
At 18:04 +0100 2005/01/15, Jochem van Dieten wrote:
On Sat, 15 Jan 2005 11:11:05 -0500, Robert Alexander wrote:
 Each language is going to have its own personality.  If they all did
 things the same way, we wouldn't have the wealth of different ones to
 choose from.
DBMS's are not languages, they are implementations.
We're not talking about a DBMS engine, Jochem, we're talking about 
SQL: the Structured Query *Language*. The language used to access the 
DBMS engine.


 I suspect MySQL is more ANSI compliant than MS SQL Server.
Can you substantiate that suspicion?
No I can't.  As stated, is is a *suspicion*.  Something I think may 
be true, but I'm not sure, and may be incorrect.  If I were sure, I 
would have stated it as fact.

I have neither the time nor the inclination to do the research to 
substantiate my impression.  It's just not that important.

Do feel free, though.  :-)
Rob
Jochem
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Paul DuBois
At 8:51 -0500 1/15/05, Dave Merrill wrote:
???
SELECT 'asdf' . 'qwer'
...gives Error Code : 1064, You have an error in your SQL syntax...
I also can't find any reference to this use of periods in the docs.
Mostly we document how MySQL works, not all the things that you
could possibly try that won't work. :-)
Periods are used for qualifying column and table names, e.g.,
tbl_name.col_name or db_name.tbl_name.col_name.
Have you tried it? Can you point me to something that says it ought to work?
BTW, I'm trying this w mysql 4.1.7-nt-max on win2k, if it matters.
Also, part of my question was about standards, and it appears that I was
being ignorant. Found this:
-
The ANSI SQL concatenation operator is || used in Oracle, DB2 and others.
The + string concatenation operator in SQL Server is not portable to other
RDBMSs.
-
That was here, in an excerpt from a book on SQL Server:
  http://www.informit.com/articles/article.asp?p=327992seqNum=3
Looks like I was brought up in Microsoft's little corner of the world,
mistaking their standards for actual standards. Typical Micro$oft
intentional disruption.
But it appears that MySQL doesn't support || either, and neither does SQL
Server. So much for anyone other than customers caring about standards.
Writing platform agnostic sql seems much less likely than I'd guessed, even
on a very basic level.
If you want || to work as the concatenation operator rather than as logical
OR, you can change the SQL mode:
mysql SELECT 'a' || 'b';
++
| 'a' || 'b' |
++
|  0 |
++
1 row in set (0.19 sec)
mysql SET sql_mode='PIPES_AS_CONCAT';
Query OK, 0 rows affected (0.00 sec)
mysql SELECT 'a' || 'b';
++
| 'a' || 'b' |
++
| ab |
++
1 row in set (0.14 sec)
There are a lot of ways you can make the server behave differently
by changing the SQL mode:
http://dev.mysql.com/doc/mysql/en/Server_SQL_mode.html
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Michael Stassen
Starting with 4.0, MySQL can be made to respect the standard of || as the 
concatenation operator with the PIPES_AS_CONCAT sql-mode.  You may want to 
read section 1.5, MySQL Standards Compliance, in the manual 
http://dev.mysql.com/doc/mysql/en/Compatibility.html.  There are some 
options to make mysql more ANSI-compliant documented there.

On the other hand, some have questioned whether there really is, in 
practice, a standard: http://builder.com.com/5100-6388-1046268.html and 
http://www.tdan.com/i016hy01.htm.  (I don't mean to take sides -- I just 
found them interesting.)

Michael
Dave Merrill wrote:
As I said in my msg, I found out that I was wrong, '+' isn't ANSI, it's just
microsoft. But mysql doesn't support the ANSI standard '||' either.
Go figure...
This is my first foray into different flavors of sql, and I'm discovering
how incompatible they really are. I expected that core basics would be the
same, with each manufacturer adding some proprietary extensions, and failing
to support a (hopefully small) subset of standard features.
/dreaming
Dave Merrill

At 07:37 -0500 2005/01/15, Dave Merrill wrote:
I thought string concatenation w '+' was totally
standard SQL.
Hmmm, this is the first I've heard of + being used for
concatenation (in SQL). Then again, I've never used MS SQL Server.
:-)
Each language is going to have its own personality.  If they all did
things the same way, we wouldn't have the wealth of different ones to
choose from.
Might not be a good idea, Dave, to take MS products as examples of
what accepted standards are.  MS has a long history of lack of
respect for established standards.
I suspect MySQL is more ANSI compliant than MS SQL Server.
Rob


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


RE: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Dave Merrill
Um, I know that probably seemed a bit random, but I got a msg from someone
saying that was how it worked; it certainly wasn't something I thought,
hence the '???'. Your reply leads me to believe that was a private email not
sent to the list.

Dave Merrill

 ???
 
 SELECT 'asdf' . 'qwer'
 
 ...gives Error Code : 1064, You have an error in your SQL syntax...
 
 I also can't find any reference to this use of periods in the docs.

 Mostly we document how MySQL works, not all the things that you
 could possibly try that won't work. :-)

 Periods are used for qualifying column and table names, e.g.,
 tbl_name.col_name or db_name.tbl_name.col_name.

 
 Have you tried it? Can you point me to something that says it
 ought to work?
 BTW, I'm trying this w mysql 4.1.7-nt-max on win2k, if it matters.



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



Re: MySQL 4.1.8 and storing east characters

2005-01-15 Thread jeremy_march
How are you inserting the data into mysql?  LOAD DATA INFILE?  Be sure the 
client you are using to import the data is using the utf8 character set:

SET CHARACTER SET utf8 or --default-character-set=utf8

The best way to check whether the data was inserted into mysql correctly is to 
use the mysql command line client and select the hex codes for the strings you 
inserted.  This will eliminate apache/php/web browser/terminal issues until you 
know you can insert the data properly into the database.  

SELECT HEX(CONVERT(your_column USING ucs2)) FROM your_table;

I find its easier to check the codes using the ucs2 character set--That's the 
point of the convert() function.  Again make sure the client you are using to 
read the data is using the utf8 character set.

Have you verified that libxml is converting the data correctly?

regards,
Jeremy March

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



RE: MySQL 4.1.8 and storing east characters

2005-01-15 Thread jeremy_march
So its just the Japanese titles which aren't working?  The Greek and Cyrillic 
looked ok to me.  If that's the case then the causes which occur to me would be:

1. The web browser doesn't have a Japanese font (I don't know if I have one or 
not so I can't check that)

2. Japanese characters are longer than 3 bytes long in utf8 (again I don't know 
if that's the case or not).  If they are then according the following link 
mysql only supports up to 3 byte long utf8 characters.

http://dev.mysql.com/doc/mysql/en/Charset-Unicode.html


 I am inserting data into mySQL via this script:
 http://www.feedsfarm.com/tmp.phps
 
 I've set default-character-set=utf8
 
 When I output the data to the browser (see:
 http://www.feedsfarm.com/tmp.php) it displays perfectly in the UTF-8 char
 set.
 
 And I am certain libxml converts ANY encoding to UTF-8 when traversing and
 XML file thru DOM.
 
 Cheers,
 - Martin
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 15 January 2005 20:47
 To: mysql@lists.mysql.com
 Subject: Re: MySQL 4.1.8 and storing east characters
 
 How are you inserting the data into mysql?  LOAD DATA INFILE?  Be sure the
 client you are using to import the data is using the utf8 character set:
 
 SET CHARACTER SET utf8 or --default-character-set=utf8
 
 The best way to check whether the data was inserted into mysql correctly is
 to use the mysql command line client and select the hex codes for the
 strings you inserted.  This will eliminate apache/php/web browser/terminal
 issues until you know you can insert the data properly into the database.  
 
 SELECT HEX(CONVERT(your_column USING ucs2)) FROM your_table;
 
 I find its easier to check the codes using the ucs2 character set--That's
 the point of the convert() function.  Again make sure the client you are
 using to read the data is using the utf8 character set.
 
 Have you verified that libxml is converting the data correctly?
 
 regards,
 Jeremy March
 
 -- 
 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]



RE: MySQL 4.1.8 and storing east characters

2005-01-15 Thread jeremy_march
I just noticed that in the link I sent you Japanese utf8 characters are indeed 
only 3 bytes long.  So much for that idea.


 I am inserting data into mySQL via this script:
 http://www.feedsfarm.com/tmp.phps
 
 I've set default-character-set=utf8
 
 When I output the data to the browser (see:
 http://www.feedsfarm.com/tmp.php) it displays perfectly in the UTF-8 char
 set.
 
 And I am certain libxml converts ANY encoding to UTF-8 when traversing and
 XML file thru DOM.
 
 Cheers,
 - Martin
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: 15 January 2005 20:47
 To: mysql@lists.mysql.com
 Subject: Re: MySQL 4.1.8 and storing east characters
 
 How are you inserting the data into mysql?  LOAD DATA INFILE?  Be sure the
 client you are using to import the data is using the utf8 character set:
 
 SET CHARACTER SET utf8 or --default-character-set=utf8
 
 The best way to check whether the data was inserted into mysql correctly is
 to use the mysql command line client and select the hex codes for the
 strings you inserted.  This will eliminate apache/php/web browser/terminal
 issues until you know you can insert the data properly into the database.  
 
 SELECT HEX(CONVERT(your_column USING ucs2)) FROM your_table;
 
 I find its easier to check the codes using the ucs2 character set--That's
 the point of the convert() function.  Again make sure the client you are
 using to read the data is using the utf8 character set.
 
 Have you verified that libxml is converting the data correctly?
 
 regards,
 Jeremy March
 
 -- 
 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]



RE: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Dave Merrill
Let me ask a slightly different question:

Is there a string concatenation operator in mysql when it's *not* running in
ansi mode? Or is the only way to accomplish that to use CONCAT?

I think I'm hearing that there is no operator, only CONCAT. Right?

Dave Merrill



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



InnoDB race condition inserting into a table with a unique constraint

2005-01-15 Thread Philip Ross
MySQL 4.1.8
I have an InnoDB table with a unique constraint:
CREATE TABLE TEST (
  ID bigint NOT NULL auto_increment,
  NAME varchar(100) NOT NULL,
  VALUE varchar(100),
  PRIMARY KEY (ID),
  UNIQUE KEY IX_NAME (NAME)) ENGINE=InnoDB
Given a particular unique name, I need to either find the existing 
record and return the value or create a new record. I am having problems 
working out how to avoid a race condition though.

If two sessions both issue the query:
SELECT * FROM TEST WHERE NAME='uniquename'
then both could get no row returned and hence try and create a new 
record (one of which would fail with a unique key violation).

Is it possible to get MySQL to lock the table/index so that when two 
sessions run the above query and no rows are found, the second select 
will block until the first transaction has completed? Is there an 
alternative way of structuring the problem that would make this 
concurrently safe?

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


RE: Plus sign doesn't concatenate strings in MySQL?

2005-01-15 Thread Paul DuBois
At 20:32 -0500 1/15/05, Dave Merrill wrote:
Let me ask a slightly different question:
Is there a string concatenation operator in mysql when it's *not* running in
ansi mode? Or is the only way to accomplish that to use CONCAT?
I think I'm hearing that there is no operator, only CONCAT. Right?
Right.
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Replication between different versions

2005-01-15 Thread Kay Obermueller
Hello everybody,
I want to setup replication between Mysql 4.0.15 in SuSE as master and 
4.1.8a-1 of Debian as slave. According to their reference manual it should 
work so far, but are there any compatibility issues to be expected?
Besides, is 4.1.8a-1 from Debian identical to 4.1.8 directly from Mysql?

Kay 

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



repost w/code : can mysql work in Windows but not Solaris?

2005-01-15 Thread leegold
Is there any reason you can see why the fulltext php/mysql code below
works OK on my win2k php4.3.6. mysql 4.1.3 pc  but does *not* work  when
put on a Solaris Server with php5 mysql 4.1.6 ?

That is what happens...I'm suspicious of the accent characters in the
code but I am not sure if there's any truth to my suspicion and how I'd
even test or fix it(?) Here's the snip I think causes the problem:
...
else {
 if ( $Type_Submit == 'radio_and') {
   $radio_keyword = preg_replace('/\s+|^/', ' +', $keyword);
 }
 elseif ( $Type_Submit == 'radio_phrase'){
   $radio_keyword = ''.$keyword.'';
 }
 $query =
   SELECT page.* FROM `page` LEFT JOIN `keywords`  USING
   (`page_id`) WHERE MATCH (`keywords`.`keyword_txt`)
   AGAINST ('$radio_keyword' IN BOOLEAN MODE)
   UNION
   SELECT page.* FROM `page` WHERE MATCH (`title`, `descrip`)
   AGAINST ('$radio_keyword' IN BOOLEAN MODE)
   UNION
   SELECT page.* FROM `page` LEFT JOIN `url_Pages` USING (`page_id`)
   WHERE MATCH (`url_Pages`.`page_url`)
   AGAINST ('$radio_keyword' IN BOOLEAN MODE);
 $result = mysql_query($query);
   }

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



vi.recover in show databases output?

2005-01-15 Thread Justin Lundy
When I open over nine connections to mysql I see vi.recover in my show 
databases output.  The existing connections stay open and continue to 
operate. No new database connections can be made at this point. I should 
be seeing the mysql, phpdig and test databases when performing the query 
but I only see vi.recover? Any ideas why this happens or how to prevent it?

[EMAIL PROTECTED] jbl]$ uname -a
NetBSD subterrain.net 2.0 NetBSD 2.0 (SUBTERRAIN) #1: Tue Dec 28 
22:34:54 EST 2004 
[EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/SUBTERRAIN i386
[EMAIL PROTECTED] jbl]$ ls /var/mysql/
#sql_267_1.MYI  ib_logfile0 phpdig
#sql_267_2.MYI  ib_logfile1 subterrain.net.err
#sql_267_3.MYI  ibdata1 subterrain.net.pid
#sql_2819_2.MYI mysql   test
[EMAIL PROTECTED] jbl]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1180 to server version: 4.1.7

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql show databases;
++
| Database   |
++
| vi.recover |
++
1 row in set (0.00 sec)
mysqlexit;
[EMAIL PROTECTED] jbl]$ find / -name vi.recover
/var/tmp/vi.recover
[EMAIL PROTECTED] jbl]$ su -
Password:
[EMAIL PROTECTED] root]# /usr/pkg/etc/rc.d/mysqld restart
Stopping mysqld.
Waiting for PIDS: 10265, 10265, 10265.
Starting mysqld.
[EMAIL PROTECTED] root]# exit
[EMAIL PROTECTED] jbl]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 4.1.7
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql show databases;
+--+
| Database |
+--+
| mysql|
| phpdig   |
| test |
+--+
3 rows in set (0.04 sec)
mysql exit;
[EMAIL PROTECTED] jbl]$
Thanks,
-JBL
-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: vi.recover in show databases output?

2005-01-15 Thread Dan Nelson
In the last episode (Jan 15), Justin Lundy said:
 When I open over nine connections to mysql I see vi.recover in my show 
 databases output.  The existing connections stay open and continue to 
 operate. No new database connections can be made at this point. I should 
 be seeing the mysql, phpdig and test databases when performing the query 
 but I only see vi.recover? Any ideas why this happens or how to prevent it?
 
 [EMAIL PROTECTED] jbl]$ uname -a
 NetBSD subterrain.net 2.0 NetBSD 2.0 (SUBTERRAIN) #1: Tue Dec 28  22:34:54 
 EST 2004 

On FreeBSD, this was due to realpath not being thread-safe.  It called
chdir() internally and didn't prevent other threads from calling
chdir() or getcwd() at the same time.  NetBSD's realpath looks almost
identical to the old FreeBSD code, so it should be easy to fix by just
merging the fix from FreeBSD.

http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/gen/getcwd.c
http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/realpath.c

The FreeBSD fix is in rev 1.14.

-- 
Dan Nelson
[EMAIL PROTECTED]

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