Re: Another Trailing Spaces Issue

2004-05-02 Thread John Mistler
I am using 4.0.18.  I also checked out the "Bugs Fixed" report--and it kind
of looks like #2295 applies, although I can't be certain.  It definitely
returns rows without trailing spaces, even though the SELECT asks for rows
WITH trailing spaces.

Hmmm...

on 5/2/04 2:05 AM, Matt W at [EMAIL PROTECTED] wrote:

> Hi John,
> 
> What version do you use?  In 4.0.18, they fixed some bugs that were
> introduced in 4.0.17 related to trailing spaces on indexed TEXT-family
> columns: http://dev.mysql.com/doc/mysql/en/News-4.0.18.html
> 
> I see 3 "Bugs fixed" entries with "trailing spaces" in them.  If you're
> not using 4.0.17, what you're seeing IS a bug and should be reported if
> it hasn't already been.
> 
> 
> Matt
> 
> 
> - Original Message -
> From: "John Mistler"
> Sent: Friday, April 30, 2004 1:39 PM
> Subject: Another Trailing Spaces Issue
> 
> 
>> The TINYTEXT format solves the problem of storing the string with
> spaces at
>> the end.  Now, I'm having trouble SELECTING a row WHERE the
> TINYTEXTcolumn =
>> theStringWithTheSpacesAtTheEnd;
>> 
>> If the string is theString + space and another row has an entry with
>> theString (+ no space), the query returns BOTH rows.
>> 
>> Is there a way to get around returning the latter entry?
>> 
>> Thanks,
>> 
>> John
> 


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



Re: Another Trailing Spaces Issue

2004-05-02 Thread Matt W
Hi John,

What version do you use?  In 4.0.18, they fixed some bugs that were
introduced in 4.0.17 related to trailing spaces on indexed TEXT-family
columns: http://dev.mysql.com/doc/mysql/en/News-4.0.18.html

I see 3 "Bugs fixed" entries with "trailing spaces" in them.  If you're
not using 4.0.17, what you're seeing IS a bug and should be reported if
it hasn't already been.


Matt


- Original Message -
From: "John Mistler"
Sent: Friday, April 30, 2004 1:39 PM
Subject: Another Trailing Spaces Issue


> The TINYTEXT format solves the problem of storing the string with
spaces at
> the end.  Now, I'm having trouble SELECTING a row WHERE the
TINYTEXTcolumn =
> theStringWithTheSpacesAtTheEnd;
>
> If the string is theString + space and another row has an entry with
> theString (+ no space), the query returns BOTH rows.
>
> Is there a way to get around returning the latter entry?
>
> Thanks,
>
> John


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



Re: Another Trailing Spaces Issue

2004-04-30 Thread Stephen E. Bacher
>If the string is theString + space and another row has an entry with
>theString (+ no space), the query returns BOTH rows.
>
>Is there a way to get around returning the latter entry?

You could do something like:

select stuff from mytable where stuff = 'foo ' and length(stuff) = 4;

-- 

Steve Bacher
Draper Laboratory
Cambridge, MA, US

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



Re: Another Trailing Spaces Issue

2004-04-30 Thread Chris W
John Mistler wrote:

The TINYTEXT format solves the problem of storing the string with spaces at
the end.  Now, I'm having trouble SELECTING a row WHERE the TINYTEXTcolumn =
theStringWithTheSpacesAtTheEnd;
If the string is theString + space and another row has an entry with
theString (+ no space), the query returns BOTH rows.
Is there a way to get around returning the latter entry?
 

I'm not 100% sure but I remember reading about a binary compare option 
in the documentation that I bet would do the trick.  Take a look at that.

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


Another Trailing Spaces Issue

2004-04-30 Thread John Mistler
The TINYTEXT format solves the problem of storing the string with spaces at
the end.  Now, I'm having trouble SELECTING a row WHERE the TINYTEXTcolumn =
theStringWithTheSpacesAtTheEnd;

If the string is theString + space and another row has an entry with
theString (+ no space), the query returns BOTH rows.

Is there a way to get around returning the latter entry?

Thanks,

John

on 4/30/04 2:42 AM, Matt W at [EMAIL PROTECTED] wrote:

> Hi John,
> 
> I *think* VARCHAR is *supposed* to work that way, but doesn't in MySQL.
> So you'll have to use TINYTEXT.  Its storage requirements are the same
> as VARCHAR(255) and it behaves the same way, except for, I think, 3
> things: 1) the trailing space thing, obviously; 2) it can't have a
> DEFAULT value; and 3) you can't index the whole column -- but you can
> INDEX (col(255)), which has the same effect. :-)
> 
> Hope that helps.
> 
> 
> Matt
> 
> 
> - Original Message -
> From: "John Mistler"
> Sent: Friday, April 30, 2004 3:54 AM
> Subject: Storing a space
> 
> 
>> Is there a way to force an invisible "space" character to be stored at
> the
>> END of a string in a column (either VARCHAR or CHAR), so that when it
> is
>> retrieved the space at the end is not cut off?
>> 
>> theString + space
>> 
>> or even,
>> 
>> theString + space + space + space, etc.
>> 
>> Currently, I can only get the string back as theString
>> 
>> Thanks,
>> 
>> John
> 


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