Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Gavin Towey
"I've run up on the rock of a binary (meaning: indecipherable) field." SELECT hex(some_binary_field) FROM table; Solved. The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Gavin Towey
A MAC address is just a number, it doesn't contain letters unless you're doing something silly like storing the HEX representation of it. Do not use CHAR! This does DOUBLE for all of you storing IP addresses! Since a MAC address is going to be between 48 and 64 bits, then

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Daevid Vincent
e an IP like 192.168.0.0 now. Validate it. if ( false !== ip2long( $temp ) ) { $result = $temp."/".$cidr_bits; } } return $result; } /** * Returns true if the string is a valid CIDR. * * @access public * @param

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Pete Wilson
I agree, and didn't mean to say that I disagreed. This is certainly one of the top five principles to follow, imo. Too many times, while trouble-shooting, I've run up on the rock of a binary (meaning: indecipherable) field. What is the cost of including the binary representation (for indexing)

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Jim Lyons
er. > > I'll be interested in the answer, though, from someone with experience. > > -- Pete Wilson > http://www.pwilson.net/ > > > --- On Thu, 5/14/09, Jim Lyons wrote: > > > From: Jim Lyons > > Subject: Re: MAC address as primary key - BIGINT or CHAR(12) >

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Pete Wilson
be interested in the answer, though, from someone with experience. -- Pete Wilson http://www.pwilson.net/ --- On Thu, 5/14/09, Jim Lyons wrote: > From: Jim Lyons > Subject: Re: MAC address as primary key - BIGINT or CHAR(12) > To: "Ilia KATZ" > Cc: mysql@lists.mysql.

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Jim Lyons
e: > 1. MAC address defined as BIGINT > 2. MAC address set as primary key > > Should I consider changing it to CHAR(12)? > > Replies will be appreciated. > Ilia > > > > -- Jim Lyons Web developer / Database administrator http://www.weblyons.com

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Thomas Spahni
On Thu, 14 May 2009, Ilia KATZ wrote: Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider changing it to CHAR(12)? Replies will be appreciated. Ilia Hi It depends. You may convert the MAC address to a decimal integer and store

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Ilia KATZ
6th byte the last 2 bytes (of the BIGINT) left unused. Ilia From: Fish Kungfu [mailto:fish.kun...@gmail.com] Sent: Thursday, May 14, 2009 3:54 PM To: Ilia KATZ Cc: mysql@lists.mysql.com Subject: Re: MAC address as primary key - BIGINT or CHAR(12

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Jerry Schwartz
a problem. >-Original Message- >From: Ilia KATZ [mailto:ik...@dane-elec.co.il] >Sent: Thursday, May 14, 2009 9:26 AM >To: mysql@lists.mysql.com >Subject: MAC address as primary key - BIGINT or CHAR(12) > >Hi. >Currently I have a table: >1. MAC address defined as BIGI

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread kabel
On Thursday 14 May 2009 09:53:58 am Fish Kungfu wrote: > Since MAC addreses also contain letters, BIGINT wouldn't work. So, yes, I > would say go with CHAR(12). > > On May 14, 2009 9:43 AM, "Ilia KATZ" wrote: > > Hi. > Currently I have a table: > 1. MAC add

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Fish Kungfu
Since MAC addreses also contain letters, BIGINT wouldn't work. So, yes, I would say go with CHAR(12). On May 14, 2009 9:43 AM, "Ilia KATZ" wrote: Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider changin

MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Ilia KATZ
Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider changing it to CHAR(12)? Replies will be appreciated. Ilia

Re: Bigint

2008-01-16 Thread Baron Schwartz
Hi, On Jan 16, 2008 5:13 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > I think it's the same. > > I seem to remember that a BIGINT id two INTs tacked together, so how is > that possible? MySQL uses BIGINT for most internal math. The data types influence only how t

Re: Bigint

2008-01-16 Thread Richard Heyes
I think it's the same. I seem to remember that a BIGINT id two INTs tacked together, so how is that possible? -- Richard Heyes http://www.websupportsolutions.co.uk Mailing list management service allowing you to reach your Customers and increase your sales. ** NOW OFFERING FREE ACCOUN

Re: Bigint

2008-01-16 Thread Moon's Father
I think it's the same. On Jan 16, 2008 6:03 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: > Performance wise, what is a BIGINT like in comparison to an INT on a 32 > bit machine? > > Thanks. > > -- > Richard Heyes > http://www.websupportsolutions.co.uk > >

Bigint

2008-01-16 Thread Richard Heyes
Performance wise, what is a BIGINT like in comparison to an INT on a 32 bit machine? Thanks. -- Richard Heyes http://www.websupportsolutions.co.uk Mailing list management service allowing you to reach your Customers and increase your sales. ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON

Re: help with storing a large binary number as bigint

2006-06-02 Thread Jeremy Cole
t and I loose all all precision witch makes it worthless to me. Is there a way to let mysql do the conversion since the number I am working with is 48bits and bigint can store 63bits??? I would need to be able to insert and select it as a binary string? Yes, you can do this. Probably the best way

Re: help with storing a large binary number as bigint

2006-06-01 Thread Sameer
y and convert it to a int in php its too big so it converts it to a float and I loose all all precision witch makes it worthless to me. Is there a way to let mysql do the conversion since the number I am working with is 48bits and bigint can store 63bits??? I would need to be able to insert and sele

help with storing a large binary number as bigint

2006-06-01 Thread Byron.Albert
and I loose all all precision witch makes it worthless to me. Is there a way to let mysql do the conversion since the number I am working with is 48bits and bigint can store 63bits??? I would need to be able to insert and select it as a binary string? Thanks for any help. Byron Albert --

Re: UDF help, convert BLOB to BIGINT

2006-03-22 Thread David Godsey
ata is type BLOB. It is raw data collected. The substr will get >> the specific bytes I'm interested in. What I need to do, is if the data >> is <= 8bytes, convert it to a BIGINT, so I can do some masking on the >> data. >> >> So I am writing a UDF to do the job

Re: UDF help, convert BLOB to BIGINT

2006-03-22 Thread SGreen
ytes I'm interested in. What I need to do, is if the data > is <= 8bytes, convert it to a BIGINT, so I can do some masking on the > data. > > So I am writing a UDF to do the job, but I am apparently unfamiliar with > the Mysql data types and how I can convert them. >

UDF help, convert BLOB to BIGINT

2006-03-22 Thread David Godsey
f the data is <= 8bytes, convert it to a BIGINT, so I can do some masking on the data. So I am writing a UDF to do the job, but I am apparently unfamiliar with the Mysql data types and how I can convert them. In a procedure. DECLARE fdata_bigint BIGINT UNSIGNED; SELECT BlobToInt(binary

Re: Bad MySQL performance with LEFT JOINS in combination with BIGINT(16)Keys

2005-09-21 Thread Alexey Polyakov
Looks like you don't have index on `lad_id` field in second table. So when you do the first query, mysql first does a full scan of 2nd table, then does eqref lookup for 1st table, which is rather fast operation. But when you do the left join, it scans first table and for each value of id does a sca

Re: Bad MySQL performance with LEFT JOINS in combination with BIGINT(16)Keys

2005-09-21 Thread Christofer Dutz
Ok ... here all the information I could find: CREATE TABLE `disco_lad` ( `id` bigint(16) unsigned NOT NULL auto_increment, `import_datum` date default NULL, `import_zeit` time default NULL, `gst` smallint(4) unsigned default '0', `gst_bez` varchar(40) default NULL, `betrie

Re: Bad MySQL performance with LEFT JOINS in combination with BIGINT(16) Keys

2005-09-21 Thread Devananda
Christofer Dutz wrote: Hi, I just ran into a very strange problem. I have two simple tables with BIGINT(16) PKs. The primary table has 7500 records and the secondars has 15000. If I execute: SELECT * FROM lad JOIN snd ON lad.id = snd.lad_id The query takes 8 seconds. If I execute this one

Bad MySQL performance with LEFT JOINS in combination with BIGINT(16) Keys

2005-09-21 Thread Christofer Dutz
Hi, I just ran into a very strange problem. I have two simple tables with BIGINT(16) PKs. The primary table has 7500 records and the secondars has 15000. If I execute: SELECT * FROM lad JOIN snd ON lad.id = snd.lad_id The query takes 8 seconds. If I execute this one: SELECT * FROM lad LEFT

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

Select problem with BigInt

2004-03-09 Thread Randall Cayford
I am new to mysql and am converting an existing program. I have encountered what appears to be a problem with bigints I have a large integer number (milliseconds since 1970) which is 13 digits. So I tried to store it in a table as a bigint type. Storing works fine. When I try to retrieve

Re: bigint support in MySql 4

2004-02-20 Thread Jeff Mathis
sorry, I don't know that one. Never have used any version of mysql lower than 4.04. a suggestion might be to call your 4.0 column an unsigned bigint, or if possible an unsigned int if the numbers can fit in 32 bits. unsigned means its always positive. jeff ps. you may want top "rep

Re: bigint support in MySql 4

2004-02-18 Thread Jeff Mathis
yes it does. we use a bigint(20) for example. [EMAIL PROTECTED] wrote: Hi, I would like to know whether MySql 4.0 supports bigint. If not what is the corresponding data type that I ccould use if I am imoprting tables from MySql 3.2 to MySql 4.0 Thanks, Sharath -- Jeff Mathis, Ph.D

bigint support in MySql 4

2004-02-18 Thread hegde
Hi, I would like to know whether MySql 4.0 supports bigint. If not what is the corresponding data type that I ccould use if I am imoprting tables from MySql 3.2 to MySql 4.0 Thanks, Sharath -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: Problem with ADO, MyOLEDB and BigInt columns

2002-12-04 Thread Natale Babbo
i had the same problem too ... also with blob fields ... never solved! please keep me informed. thanks. bye --- Andre Michel Descombes <[EMAIL PROTECTED]> ha scritto: > Hi, > > I am trying to access a third party MySQL table > containing a BigInt field, > using ADO

Problem with ADO, MyOLEDB and BigInt columns

2002-12-04 Thread Andre Michel Descombes
Hi, I am trying to access a third party MySQL table containing a BigInt field, using ADO with a MyOLEDB driver. The problem is that all this field ever returns are 0's. I tried using ODBC with the Convert BigInt to Int option but then the numbers get truncated. Is there a way around

Re:myODBC BIGINT conversion

2002-07-18 Thread Oliver Six
Dennis <[EMAIL PROTECTED]> wrote on 17.07.2002 20:37:50: > >sql query > >We have data stored as BIGINT in unix, and there are 32bit unsigned values >but nothing larger. I would assume if we convert this to integer in win98 >it would seem that values over 31bits w

myODBC BIGINT conversion

2002-07-17 Thread Dennis
sql query We have data stored as BIGINT in unix, and there are 32bit unsigned values but nothing larger. I would assume if we convert this to integer in win98 it would seem that values over 31bits would be wrong. Are there workarounds for this? Is this also an issue in later version of

Re: BIGINT -> INT in ODBC

2002-07-16 Thread Dennis
ample. > >You have written the following: > > >Is it possible to export 32-bit unsigned values stored as a BIGINT in unix >as a usable value in Access? there doesnt seem to be an "unsigned" option. > >Dennis ---

BigINT inserts

2002-07-04 Thread Eric Frazier
"You can always store an exact integer value in a BIGINT column by storing it as a string. In this case, MySQL will perform a string-to-number conversion that involves no intermediate double representation." I don't understand this, does this mean that the fastest way to insert

Re: TIMESTAMP(14) or Bigint ??

2002-04-10 Thread Thomas Spahni
On Tue, 9 Apr 2002, David BORDAS wrote: > Sent: Tuesday, April 09, 2002 2:14 PM > Subject: Re: TIMESTAMP(14) or Bigint ?? > > TIMESTAMP is 4 Bytes and DATETIME is 8 Bytes. So, 4 Bytes difference > per 5 Millions records = a 20 MB bigger table ... David If storage space is a

MySQL Manual | 6.2.6.1: Range of MEDIUMINT, and BIGINT of mySQL type ? (sql query)

2002-04-09 Thread Land, Christopher
, and BIGINT of mySQL type ? (sql query) Do anybody knows the range of MEDIUMINT, and BIGINT type to use when I do the create table in mySQL ? Son Nguyen sql, query __ Do You Yahoo!? Yahoo! Tax Center - online filing with

Re: Range of MEDIUMINT, and BIGINT of mySQL type ? (sql query)

2002-04-09 Thread Kim Kohen
G'day Son Nguyen > Do anybody knows the range of MEDIUMINT, and BIGINT type to use > when I do the create table in mySQL ? >From the manual at http://www.mysql.com/doc/C/o/Column_types.html MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL] A medium-size integer. The signed range

Range of MEDIUMINT, and BIGINT of mySQL type ? (sql query)

2002-04-09 Thread Son Nguyen
Do anybody knows the range of MEDIUMINT, and BIGINT type to use when I do the create table in mySQL ? Son Nguyen sql, query __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com

Range of MEDIUMINT, and BIGINT of mySQL type ?

2002-04-09 Thread Son Nguyen
Do anybody knows the range of MEDIUMINT, and BIGINT type to use when I do the create table in mySQL ? Son Nguyen __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com

Re: TIMESTAMP(14) or Bigint ??

2002-04-09 Thread David BORDAS
Sent: Tuesday, April 09, 2002 2:14 PM Subject: Re: TIMESTAMP(14) or Bigint ?? > David, > I could be wrong but since bigint isn't a date or time oriented data > type I imagine this would be completely useless to you unless you are > storing unix timestamps. In fact i'

Re: TIMESTAMP(14) or Bigint ??

2002-04-09 Thread David BORDAS
Sent: Tuesday, April 09, 2002 2:14 PM Subject: Re: TIMESTAMP(14) or Bigint ?? > David, > I could be wrong but since bigint isn't a date or time oriented data > type I imagine this would be completely useless to you unless you are > storing unix timestamps. In fact i'

Re: TIMESTAMP(14) or Bigint ??

2002-04-09 Thread Richard Clarke
David, I could be wrong but since bigint isn't a date or time oriented data type I imagine this would be completely useless to you unless you are storing unix timestamps. You also have the option of using datetime data types. I'm not quite sure what you are asking nor what differenc

TIMESTAMP(14) or Bigint ??

2002-04-09 Thread David BORDAS
ne unique field i can. So, for this new field that i'll insert and update manually, should i use a Bigint which required 8 Bytes or a Timestamp(14) with 4 Bytes ? Timestamp looks great but, can i insert and update it manua

RE: data type bigint(20)

2002-02-14 Thread Daniel Rosher
uary 2002 12:27 p.m. > To: [EMAIL PROTECTED] > Subject: Re: data type bigint(20) > > > MySQL Gurus, > > I'm trying to figure out what the number after the type means for numbers. > I noticed in someone's code that for the ID field they used bigint(20). > bigint I t

Re: data type bigint(20)

2002-02-14 Thread John D. Kirkpatrick
D]>; <[EMAIL PROTECTED]> Sent: Thursday, February 14, 2002 3:35 PM Subject: RE: data type bigint(20) John, The number in the parenthsis tells mysql how to format the column when it goes to display it.. Here is the relevant section of http://www.mysql.com/doc/N/u/Numeric_types.html: "A

RE: data type bigint(20)

2002-02-14 Thread Eric Mayers
-Original Message- > From: John D. Kirkpatrick [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 14, 2002 3:27 PM > To: [EMAIL PROTECTED] > Subject: Re: data type bigint(20) > > > MySQL Gurus, > > I'm trying to figure out what the number after t

Re: data type bigint(20)

2002-02-14 Thread John D. Kirkpatrick
MySQL Gurus, I'm trying to figure out what the number after the type means for numbers. I noticed in someone's code that for the ID field they used bigint(20). bigint I thought was fixed at 8 bytes. Does this override the size? 20 bytes??? 20 bits? T

converting bigint to int and keeping last bit

2002-02-01 Thread Roger Karnouk
Bigint int 2147483648 should become -2147483648 2147483649 should become -2147483647 Is there an easy way to do this if not does anyone know an update query that I could run to convert the numbers before I do the alter? Roger Karnouk

Re: max() fails on large (but <63bit) bigint values

2001-12-19 Thread Sinisa Milivojevic
[EMAIL PROTECTED] writes: > >Description: > max() and possibly other builtins fail due to apparent rounding > errors for any bigints larger than 53 bits or so. Caveats exist > in the manual (section 6.2) about bigints larger than 63bit, but > the actual useful limit (for t

max() fails on large (but <63bit) bigint values

2001-12-19 Thread hlein
uch lower. >How-To-Repeat: $ echo '2^53' | bc 9007199254740992 mysql> create table big_nums ( big bigint ); Query OK, 0 rows affected (0.00 sec) mysql> insert into big_nums (big) values (9007199254740992); Query OK, 1

a bug for bigint

2001-09-11 Thread lu cao
Hi, I found a bug about bigint and max(), here is error result caused by bigint & max(): -- mysql> create table dick ( big bigint ); Query OK, 0 rows affected (0.00 sec) mysql> insert into d

a bug for bigint

2001-09-11 Thread cao lu
Hi, I found a bug about bigint and max(), here is error result caused by bigint & max(): -- mysql> create table dick ( big bigint ); Query OK, 0 rows affected (0.00 sec) mysql> insert into d

Bigint BUG

2001-02-21 Thread chchen
hi all i have make sure there is a bug of mysql with mysql-3.23.32 repeat this bug. CREATE TABLE A ( B bigint(20) unsigned DEFAULT '0' NOT NULL, value bigint(20) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (B) ); *p.s the same with take off primary key

Re: BigInt with primary key

2001-02-20 Thread Eric Pickup
u see this error. We ended up writing a wrapper around the MySQL object to test to see if the value is 100% numeric and if so not quote it. I'm not sure why MySQL can't reliably compare a bigint with quotes around it, but that is definitely the problem. Despite the docs, we use a lot

Re: BigInt with primary key

2001-02-20 Thread Fred van Engen
On Tue, Feb 20, 2001 at 06:56:28PM +0800, chchen wrote: > hi all > > i use mysql-3.23.32 > > my project need to use unsigned Bigint as a primary key. > but when i insert many rows in this table. > sometimes it will error with Duplicate such like > >

Re: BigInt with primary key

2001-02-20 Thread chchen
First, i am really sorry about that. my fields is quite simple. CREATE TABLE TEST ( A bigint(20) unsigned DEFAULT '0' NOT NULL, C0 bigint(20) unsigned DEFAULT '0' NOT NULL, C1 bigint(20) unsigned DEFAULT '0' NOT NULL, C2 bigint(20) unsigned DEFAULT

Re: BigInt with primary key

2001-02-20 Thread Rolf Hopkins
Firstly, why do you have quotes around the numbers? I thought you said it was bigint, not a string? Secondly, if you are going reply/repost to the list, could you please simplify it a bit. Provide field names, etc. Your insert is very difficult to figure out especially with unmatched brackets

BigInt with primary key

2001-02-20 Thread chchen
hi all i use mysql-3.23.32 my project need to use unsigned Bigint as a primary key. but when i insert many rows in this table. sometimes it will error with Duplicate such like insert into Table values('9231852172526977164',0,0,52056,0,0,0,0,0,52056,0,0,0,0,0,0,0,11,0,'184

RE: Windows ME / 2000 VB problem with BIGINT data type

2001-01-17 Thread Lee Jenkins
river, because I used the same MyODBC driver under Windows 98, and I had no problems whatsoever. Yes, I'm using ADO -- that explains why Access still works. Somehow, there's some ADO functionality in Windows ME and 2000 that does not recognize BIGINT datatypes. It can't be anythin

Re: Windows ME / 2000 VB problem with BIGINT data type

2001-01-17 Thread Laszlo G. Szijarto
nality in Windows ME and 2000 that does not recognize BIGINT datatypes. It can't be anything in VB, since in both cases I'm using VB 6.0 with service pak 4. Only thing that changed was the O/S from Win 98 to Windows ME and Windows 2000. Everything else was the same, same version My

RE: Windows ME / 2000 VB problem with BIGINT data type

2001-01-17 Thread Lee Jenkins
ws ME / 2000 VB problem with BIGINT data type Thank you, Quentin, Hey, does anyone know where the problem lies here? Where in Windows ME / 2000? Why does Access still import OK? Is there something that needs to be done with MyODBC to handle BIGINT types in the future? Thank you, Laszlo - Ori

Re: Windows ME / 2000 VB problem with BIGINT data type

2001-01-17 Thread Laszlo G. Szijarto
Thank you, Quentin, Hey, does anyone know where the problem lies here? Where in Windows ME / 2000? Why does Access still import OK? Is there something that needs to be done with MyODBC to handle BIGINT types in the future? Thank you, Laszlo - Original Message - From: "Quentin Be

RE: Windows ME / 2000 VB problem with BIGINT data type

2001-01-17 Thread Quentin Bennett
oblem with BIGINT data type I isolated the problem because if I do a "select * from table" -- I get the error. but if I do "select field1, field3, field4 from table", where I leave out the BIGINT column, I'm fine. and when I do a "select field2 form table" where fie

Re: Windows ME / 2000 VB problem with BIGINT data type

2001-01-17 Thread Laszlo G. Szijarto
I isolated the problem because if I do a "select * from table" -- I get the error. but if I do "select field1, field3, field4 from table", where I leave out the BIGINT column, I'm fine. and when I do a "select field2 form table" where field2 is the BIGINT colu

Windows ME / 2000 VB problem with BIGINT data type

2001-01-17 Thread Laszlo G. Szijarto
I wrote to the list earlier on the above problem. I had a VB app that accessed a mysql (on Linux) table through MyODBC. Apparently the problem is that the new ODBC connection providers in Windows ME / 2000 do not like the BIGINT datatype. Yet, strangely, MS Access 97 can import the data