Character Limit for check-in comments

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
MDW
Posts: 3
Joined: Mon Dec 19, 2005 8:05 am

Character Limit for check-in comments

Post by MDW » Mon Dec 19, 2005 8:15 am

Hi

Today I came across a really annoying 'feature' of Vault. After spending ages comparing two files and documenting the differences in my check-in comment, I wanted to go back to make a slight modification to the comment. Imagine my frustration when I saw that only a third of my comment had actually been written away to the Vault database. I confirmed this by trying to update the comment. The system allows you to enter more than the pre-defined limit without even so much as warning you that you will lose your comments. The limit seems to be around 2k (I managed to store 2292 characters). After taking a look at the underlying Vault tables I noticed that the fields used to store the comments are set to 2304 characters! Which explains my predicament.

Firstly, why has this been chosen as the limit given that some of the merge comments can easily break this, and secondly, why does the GUI allow you to enter the text without any warning that it will be lost after the 2292nd-ish character?

Thanks in advance

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Mon Dec 19, 2005 8:25 am

Firstly, why has this been chosen as the limit given that some of the merge comments can easily break this, and secondly, why does the GUI allow you to enter the text without any warning that it will be lost after the 2292nd-ish character?
It may be a bug. What version of Vault are you using?
Linda Bauer
SourceGear
Technical Support Manager

MDW
Posts: 3
Joined: Mon Dec 19, 2005 8:05 am

Version Information

Post by MDW » Mon Dec 19, 2005 8:39 am

Hi

Thanks for responding so quickly...

The Client and Server version is 3.1.0 (3494)

mlippert
Posts: 252
Joined: Wed Oct 06, 2004 10:49 am
Location: Cambridge, MA

Post by mlippert » Tue Dec 20, 2005 10:59 am

I've also had comments truncated, and this message made me wonder about the limit.

I see the type "ulongcomment" defined to be an nvarchar of size 2304 as MDW says. I know that there is a limit imposed by SQL Server on the size of an nvarchar field, but I just looked it up and it seems to be 4000.

So I'd like to know why the limit of 2304 instead of 4000 as well.

Thanks,
Mike

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Tue Dec 20, 2005 11:07 am

SQL Server defines the max size of any row size in a table at 8060 bytes.

When the Vault Server retrieves some information from the database, temporary tables are used. The width of these temp tables eventually defined the size of ulongcomment at 2304 (2048 + 256).

I've logged a bug to not allow more than 2304 input characters in the change set comment dialogs.
Last edited by jclausius on Tue Dec 20, 2005 11:11 am, edited 1 time in total.
Jeff Clausius
SourceGear

mlippert
Posts: 252
Joined: Wed Oct 06, 2004 10:49 am
Location: Cambridge, MA

Post by mlippert » Tue Dec 20, 2005 11:09 am

Thanks for the explanation Jeff, now I understand.

Mike

MDW
Posts: 3
Joined: Mon Dec 19, 2005 8:05 am

NTEXT instead?

Post by MDW » Wed Dec 21, 2005 2:10 am

Could you have not used an NTEXT field instead of a NVARCHAR? That way the limit of these comment fields is vastly increased. I think this would be a better solution as some of the merge comments reach the current limit.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Wed Dec 21, 2005 9:11 am

That could have been done, but it was decided against because it might limit what we could do with the SQL statements. Also, we wanted to keep row information smaller for performance reasons (avoiding out of row storage).
Jeff Clausius
SourceGear

Post Reply