473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

varchar and unique

Hi @all

i try to create a ssh public key database on a mysql-5.0.16 DB

the problem is the size of the varchar, i want a size 1024...

mysql> create table sshkeys ( absid integer unsigned zerofill NOT NULL
auto_increment, rsa varchar(1024) UNIQUE NULL, dsa varchar(1024) UNIQUE
NULL, PRIMARY KEY(absid) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ERROR 1005 (HY000): Can't create table './test/sshkeys.frm' (errno:
139)

it runs fine without unique :-(

mysql> create table sshkeys ( absid integer unsigned zerofill NOT NULL
auto_increment, rsa varchar(1024) NULL, dsa varchar(1024) NULL, PRIMARY
KEY(absid) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.07 sec)

with unique a can create varchar fields with a size ~700

is it a bug or a feature of mysql ? :-)

background of the table:
a system has rsa or dsa key, or both
has a system only one type, the entry in the other type is NULL.
Another table has a forgein key reference to the sshkeys table, this
table contains the system name or alias name.

Thanks for help

Frank

Dec 19 '05 #1
2 3146
<ro*****@web.de> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
it runs fine without unique :-(

mysql> create table sshkeys ( absid integer unsigned zerofill NOT NULL
auto_increment, rsa varchar(1024) NULL, dsa varchar(1024) NULL, PRIMARY
KEY(absid) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.07 sec)

with unique [i] can create varchar fields with a size ~700


http://dev.mysql.com/doc/refman/5.0/...te-index.html:
"Prefixes can be up to 1000 bytes long (767 bytes for InnoDB tables)."

Regards,
Bill K.
Dec 19 '05 #2
Hi,

I didn't even think that a varchar field can take 700 characters - I
thought, the limit was 512.

However, I guess, a text field might be more suitable for this.

Markus
Dec 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Randell D. | last post by:
Folks, I'm using MySQL 3.23.56-Max and I have several CREATE TABLEs similar to the following in structure (taken from my PHP script so ignore the double quotes and periods) "ID MEDIUMINT(10)...
2
by: ImraneA | last post by:
Hi there Got a interesting problem (depends on a point of view.....). Background :- Agent (within Domino) is run daily basis which extracts data from Domino Notes application to SQL Server...
5
by: jim_geissman | last post by:
One table I manage has a clustered index, and it includes some varchar columns. When it is initially created, all the columns in the clustered index are populated, and then some of the longer...
0
by: sfh | last post by:
Greetings all, I have a question concerning primary key types. In the past, I have always created tables with a primary key as an "int" such as: CREATE TABLE color_id ( color_id int(10)...
1
by: sfh | last post by:
Greetings all, (I had posted this in MS SQL on accident, my apologies :( ) I have a question concerning primary key types. In the past, I have always created tables with a primary key as...
2
by: Laurent | last post by:
DB2 8.1 ------- db2 => create table test (COL1 VARCHAR(10)) db2 => insert into test values ('A') db2 => insert into test values ('A ') db2 => insert into test values ('B') db2 => insert into...
7
by: James o'konnor | last post by:
hello. i have the next for create one table into db2 CREATE TABLE "MYSQUEMA"."TABLADEMO" ( "ID" INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY ( START WITH +0 INCREMENT BY +1 MINVALUE +0...
2
by: eflatunn | last post by:
Hi all, I paid 3 hours for it but couldn't get succeed. I'm writing a stored procedure to get a data entry in a table. The problem is that I can't simply use commands "SELECT" or "CASE" directy....
2
bugboy
by: bugboy | last post by:
I have a table of words which are all unique and will not change.. can i use the words themselves as the primary key or is it better to use an integer? I think it would simplify my queries a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.