Re: Unsigned

2006-04-03 Thread Jos Elkink
Hi Yemi, It means the variable contains only positive values - otherwise one bit would be used to denote whether it's positive or negative. From the documentation: SMALLINT[(M)] [UNSIGNED] [ZEROFILL] A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535.

Unsigned

2006-04-03 Thread Yemi Obembe
What does it mean declaring a table unsigned? An example is a s below: id smallint unsigned not null auto_increment

C API Prepared Statement Data types with unsigned int

2006-03-29 Thread 古雷
NO | | | | | MESSAGEUUID | char(33)| YES | MUL | | | | SMSSEQ| int(10) unsigned| NO | PRI | 0 | | | DESTTERMID| varchar(80) | YES | | | | | MSGOVER | smallint(6) |

BLOB to UNSIGNED, can you do it?

2006-01-20 Thread David Godsey
shifting and masking with integer types so I am trying to cast BLOB as UNSIGNED, but without luck (the data I SUBSTR out will fit into a BIGINT UNSIGNED). Here is a precedure I wrote to show the problem: create procedure test3 () BEGIN DECLARE fdata BLOB; DECLARE foffset INT

Re: Strange behavior with integer unsigned type...

2005-12-30 Thread Stephen Cook
Maybe it is because I am a programmer, but (unsigned) 0 - 1 = 4294967295. What's the big deal? Gleb Paharenko wrote: Hello. That seems like a bug: http://bugs.mysql.com/bug.php?id=14543 Marko Domanovic wrote: mysql 5.0.15-standard UPDATE SET = -1 when the is 0 giv

Re: Strange behavior with integer unsigned type...

2005-12-30 Thread Gleb Paharenko
Hello. That seems like a bug: http://bugs.mysql.com/bug.php?id=14543 Marko Domanovic wrote: > mysql 5.0.15-standard > UPDATE SET = -1 > when the is 0 gives me 4294967295 > is integer(10) unsigned... > > maybe it would be more logical the expression to evalu

Re: Strange behavior with integer unsigned type...

2005-12-24 Thread Marko Domanovic
mysql 5.0.15-standard UPDATE SET = -1 when the is 0 gives me 4294967295 is integer(10) unsigned... maybe it would be more logical the expression to evaluate as 0, insted 2^32 .. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: Strange behavior with integer unsigned type...

2005-12-23 Thread James Harvard
t after an auto_increment column hits its maximum value it will 'roll over' to the lowest value that column will store (i.e. 0 for an unsigned int). Probably if you add 1 to 2^32 (or 2^16 for a SMALLINT, for example) you will get 0. BTW, 18446744073709551615 is the maximum value for a B

Re: Strange behavior with integer unsigned type...

2005-12-23 Thread Gleb Paharenko
Hello. On both 4.1.16 and 5.0.17 I've got the same results, however not 2^32, but 18446744073709551615. 4.0 is deprecated and its results could be different. Please provide exact SQL statement which you're using if you still think that MySQL behaves weirdly with unsigned intege

Strange behavior with integer unsigned type...

2005-12-23 Thread Marko Domanovic
I noticed rather interesting thing... If you deduct 1 from the 0 which is stored in integer unsigned field, you get 2^32, not 0. I think that's how things are not working with version 4, and want to ask is this behavior bug or feature in mysql version 5, and is it customizable? Gree

Re: getLong() vs getInt() result differs on unsigned field

2005-07-18 Thread Kevin McAllister
Bill, Thank you for this. While that is true, the problem is that the number in the database is actually 2 and not 4294967298. It seems the connector/j is sticking that highest bit in there itself, or misbehaving in some other way. Apparently it has been fixed just hasn't been released yet

getLong() vs getInt() result differs on unsigned field

2005-07-18 Thread Bill Easton
-0400 From: Kevin McAllister <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Hello, [...] The problem comes in with fields of type "int(11) unsigned" these are obviously interpreted as Longs on call to resultSet.getObject() which is fine, the problem I am having is that calls to getLong()

Re: MAX on UNSIGNED INT Column

2005-07-06 Thread Jacob S. Barrett
On Wednesday 06 July 2005 11:42 am, Keith Ivey <[EMAIL PROTECTED]> wrote: > Jacob S. Barrett wrote: > > I have a column of type UNSIGNED INT which holds a 32bit counter. When > > the value of the field exceeds 2147483647 (signed max) the value of MAX > > on the colum

Re: MAX on UNSIGNED INT Column

2005-07-06 Thread Keith Ivey
Jacob S. Barrett wrote: I have a column of type UNSIGNED INT which holds a 32bit counter. When the value of the field exceeds 2147483647 (signed max) the value of MAX on the column returns a negative number. Possibly this bug, fixed in 4.1.12? http://bugs.mysql.com/bug.php?id=9298 -- Keith

Re: MAX on UNSIGNED INT Column

2005-07-05 Thread Paul DuBois
At 12:17 -0700 7/5/05, Jacob S. Barrett wrote: I have a column of type UNSIGNED INT which holds a 32bit counter. When the value of the field exceeds 2147483647 (signed max) the value of MAX on the column returns a negative number. If I convert the column to BIGINT the correct MAX is returned

MAX on UNSIGNED INT Column

2005-07-05 Thread Jacob S. Barrett
I have a column of type UNSIGNED INT which holds a 32bit counter. When the value of the field exceeds 2147483647 (signed max) the value of MAX on the column returns a negative number. If I convert the column to BIGINT the correct MAX is returned. Is this expected behavior, am I doing

Re: BIGINT UNSIGNED issue?

2005-02-25 Thread Gleb Paharenko
Hello. The behaviour of UNSIGNED BIGINT was correct on my Win2k Professional. Do you use a mysql command line client or other client software? mysql> create table bu(a bigint unsigned); Query OK, 0 rows affected (0.20 sec) mysql> insert into bu values('1844674407370955161

BIGINT UNSIGNED issue?

2005-02-23 Thread Tim Hayes
Hi I am testing against MySQL 4.1 current release on Windows and there seems to be a fault with unsigned bigint datatypes. Using a BIGINT UNSIGNED datatype, the maximum value that will be accepted on insert query is 9223372036854775807 , which is actually the published maximum for signed Bigints

Re: MySQL 4.1.7: cast(1-2, unsigned) != cast('18446744073709551615' as unsigned)

2004-12-06 Thread Robin Bryce
Ah, Excelent. Thanks for looking at this. The use context that exposed this was using uuids as primary keys. I was breaking the result of uuid() into two parts, and then storing into a pair of bigint unsigned fields that formed a composite primary key: CREATE TABLE `test`.`uuidkeys` ( `uuidlo

Re: MySQL 4.1.7: cast(1-2, unsigned) != cast('18446744073709551615' as unsigned)

2004-12-06 Thread Gleb Paharenko
Hello. I've submitted a bug http://bugs.mysql.com/7036. Robin Bryce <[EMAIL PROTECTED]> wrote: > Hi, > > I'm having trouble converting to and from strings that represent > unsigned BIGINT's. > > My server is MySQL 4.1.7-standard and >

MySQL 4.1.7: cast(1-2, unsigned) != cast('18446744073709551615' as unsigned)

2004-12-04 Thread Robin Bryce
Hi, I'm having trouble converting to and from strings that represent unsigned BIGINT's. My server is MySQL 4.1.7-standard and the following selects were entered at the prompt of my client with version "mysql Ver 14.7 Distrib 4.1.7, for pc-linux (i686)". select cast(1-2,

CAST( string AS UNSIGNED ) question about reliability

2004-06-20 Thread Wesley Furgiuele
TABLE_2 t2 WHERE CAST( t1.id AS UNSIGNED ) = t2.id". If anyone knows of a more reliable or elegant method for joining the tables based on these fields, any comments would be appreciated. Wes -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsub

Re: Problems retrieving int unsigned / Re: QVariant::toUInt problem

2003-11-18 Thread John A. Sullivan III
On Mon, 2003-11-17 at 13:42, Harald Fernengel wrote: > Hello John, > > ... We had some reports > about uint<->int problems with MySQL, but I believe we fixed them all in Qt > 3.3, so there should not be any problems. > > Best regards, > Harald I can confirm that the problem is fixed in 3.3. Th

RE: Problems retrieveing int unsigned fields

2003-11-17 Thread Victor Pendleton
It seems that 4294967295, the max value for an unsigned int, is not large enough. Is there an issue with using bigint or storing the value in char format? -Original Message- From: John A. Sullivan III [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 7:18 AM To: [EMAIL PROTECTED

Problems retrieveing int unsigned fields

2003-11-17 Thread John A. Sullivan III
We store the binary equivalent of dotted decimal IP addresses as int unsigned. We write and retrieve the variables to the database with unsigned long int variables from our Qt application. The variables appear to be written correctly to the database - at least when we query them with

Need some help accessing unsigned columns from Delphi

2003-02-18 Thread David Brodbeck
I'm trying to write a Delphi program that accesses a MySQL database via MyODBC. It's going pretty well except for a sticky problem I'm having with an unsigned integer column. I have a column named 'IP', type unsigned integer, that will hold IP addresses. However, De

"UNSIGNED" field in SET/ENUM doesn't work

2003-01-14 Thread cihar
>Description: When try to use "enum ('a','b','unsigned')" MySQL understands it as "enum ('a','b','') unsigned". >How-To-Repeat: Something like: alter table test change en en enum ('a','unsigned&#x

Converting signed and unsigned integers

2002-12-30 Thread Peter Hicks
;s ip2long uses signed integers, and inet_aton uses unsigned integers. If all my IP addresses were below 127.255.255.255, this would be fine :) Documentation suggests that converting signed to unsigned (and vice versa) is available in MySQL 4.0.2 through the CAST() function, but I'm

Re: Why "unsigned" doesn't work?

2002-12-29 Thread Georg Richter
On Sunday 29 December 2002 15:06, Octavian Rasnita wrote: > > mysql> create table aaa(id int not null unsigned, name text); > > Can you tell me why doesn't it work? > null can't be signed or unsigned. try int unsigned not null Regards

Re: Why "unsigned" doesn't work?

2002-12-29 Thread Joseph Bueno
Octavian Rasnita wrote: > Hi all, > > I've tried the following SQL line in MySQL 4.05 for Windows and it told me > that there is an error starting from "unsigned...". > > mysql> create table aaa(id int not null unsigned, name text); > > Can you te

Re: Why "unsigned" doesn't work?

2002-12-29 Thread Rick Pasotto
On Sun, Dec 29, 2002 at 04:06:39PM +0200, Octavian Rasnita wrote: > Hi all, > > I've tried the following SQL line in MySQL 4.05 for Windows and it told me > that there is an error starting from "unsigned...". > > mysql> create table aaa(id int not null unsign

Re: Why "unsigned" doesn't work?

2002-12-29 Thread Ryan Fox
- Original Message - From: "Octavian Rasnita" <[EMAIL PROTECTED]> > mysql> create table aaa(id int not null unsigned, name text); > Can you tell me why doesn't it work? You want: create table aaa(id int unsigned not null, name text); Your way d

RE: Why "unsigned" doesn't work?

2002-12-29 Thread Cal Evans
try: create table aaa(id int(5) unsigned not null, name text); not sure why but unsigned needs to come before not null. =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 29, 2002

Why "unsigned" doesn't work?

2002-12-29 Thread Octavian Rasnita
Hi all, I've tried the following SQL line in MySQL 4.05 for Windows and it told me that there is an error starting from "unsigned...". mysql> create table aaa(id int not null unsigned, name text); Can you tell me why doesn't it work? Thank you. Teddy, Teddy's

max() on an unsigned integer returns a string

2002-10-10 Thread Daniel Kasak
ting here... Table definition and some test data: CREATE TABLE Leads ( DanPK mediumint(8) unsigned NOT NULL auto_increment, MyStamp timestamp(14) NOT NULL, LeadNo mediumint(9) unsigned NOT NULL default '0', IssueDate date NOT NULL default '-00-00', IssuedTo tinyint(3)

RE: Unsigned Int / Signed Int issue when using MyODBC2.5

2002-07-02 Thread Will Lotto
ck hitting myself over the head with a plank of hardwood. Will Lotto Systems Administrator > -Original Message- > From: Will Lotto [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, 2 July 2002 12:42 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Unsigned Int /

Unsigned Int / Signed Int issue when using MyODBC2.5

2002-07-01 Thread Will Lotto
G'day, I've got a problem with the ODBC driver for MySQL, in that when I use an SQL select statement on a field of type UNSIGNED INTEGER, the resulting recordset in asp uses SIGNED INTEGER data types, so any data > 2^31 is dropped by asp. The offending code is as follows:

Re: Comparing UNSIGNED and INDEXED columns with negative numbers

2002-05-16 Thread Georg Richter
On Thursday, 16. May 2002 21:44, Benjamin Pflugmann wrote: > Hi. > > What you observe is the fact that "-1" will be converted to the format > of the index, else the index could not be used. > > Converting -1 to an unsigned number give the biggest possible number >

Re: Comparing UNSIGNED and INDEXED columns with negative numbers

2002-05-16 Thread Benjamin Pflugmann
Hi. What you observe is the fact that "-1" will be converted to the format of the index, else the index could not be used. Converting -1 to an unsigned number give the biggest possible number for the type in question (here BIGINT UNSIGNED). None of your numbers is bigger than this,

Comparing UNSIGNED and INDEXED columns with negative numbers

2002-05-16 Thread Charlie Thunderberg
Hi All, Using MySQL server version 3.23.49-nt I get strange results when running the following very simple test. I am wondering if this is a bug, feature or perhaps a standart SQL behaviour?? CREATE TABLE test(id BIGINT UNSIGNED); CREATE INDEX test_idx on test(id); INSERT INTO test VALUES (0

Re: Select returns negative values for unsigned datatypes using XSQL

2002-04-25 Thread David Collados Polidura
FYI, concerning my previous email, it's solved. I upgraded the JDBC drivers to the last ones and now it recognizes the unsigned data types. Great! :-) David On Thu, 25 Apr 2002, David Collados Polidura wrote: > Hi, I have a table in a MySQL database where some fi

Select returns negative values for unsigned datatypes using XSQL

2002-04-25 Thread David Collados Polidura
Hi, I have a table in a MySQL database where some fields are declared as "unsigned". Example: CREATE TABLE cities ( City_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, City_name VARCHAR(50) NOT NULL } My problem appears when inside a .xsql file (Oracle XDK), I

Re: Unsigned?

2002-03-13 Thread Paul DuBois
At 3:10 + 3/14/02, Gary Griffiths (Citydesk) wrote: > Hi, sql,query > >Could someone please explain in detail or point me to where the detail can >be explained in full the implications and benefits or otherwise of the >attribute "UNSIGNED" in a field definition. I

Re: Unsigned?

2002-03-13 Thread Gary Griffiths \(Citydesk\)
Hi, sql,query Could someone please explain in detail or point me to where the detail can be explained in full the implications and benefits or otherwise of the attribute "UNSIGNED" in a field definition. Thanks ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ Gary

Re: UNIX_TIMESTAMP() & INT unsigned problems

2001-12-21 Thread Colin Faber
Michael Widenius wrote: > > Hi! > > >>>>> "Colin" == Colin Faber <[EMAIL PROTECTED]> writes: > > >> Description: > > Colin> When attempting to select a result set by subtracting the value > Colin> of an unsigned I

UNIX_TIMESTAMP() & INT unsigned problems

2001-12-21 Thread Michael Widenius
Hi! >>>>> "Colin" == Colin Faber <[EMAIL PROTECTED]> writes: >> Description: Colin> When attempting to select a result set by subtracting the value Colin> of an unsigned INT column against UNIX_TIMESTAMP() the result set Colin> is invalid

Re: UNIX_TIMESTAMP() & INT unsigned problems

2001-12-21 Thread Sinisa Milivojevic
Colin Faber writes: > >Description: > When attempting to select a result set by subtracting the value > of an unsigned INT column against UNIX_TIMESTAMP() the result set > is invalid. > > >How-To-Repeat: > Test case: > [skip] Thank yo

UNIX_TIMESTAMP() & INT unsigned problems

2001-12-20 Thread Colin Faber
>Description: When attempting to select a result set by subtracting the value of an unsigned INT column against UNIX_TIMESTAMP() the result set is invalid. >How-To-Repeat: Test case: mysql> create table t (ts int unsigned not null); insert into

RE: Unsigned data with auto increment => Faster/better... ??

2001-07-13 Thread Don Read
On 13-Jul-01 David Bouw wrote: > > Something that I noticed was that you could also add an option to say if a > Int was unsigned ot signed.. > > Does it have any sence to use a signed int on a autoincrement table..? > E.g. When using a auto-increment correctly you will nev

Unsigned data with auto increment => Faster/better... ??

2001-07-13 Thread David Bouw
Hi there, I grabbed the MySQL reference book and was doing some reading on the different Integer types.. Something that I noticed was that you could also add an option to say if a Int was unsigned ot signed.. Does it have any sence to use a signed int on a autoincrement table..? E.g. When