Details
-
Type:
Task
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: Data Definition - Alter Table
-
Labels:None
Description
In a project I'm working on, binary string 'varbinary' used as fixed array. Array elements change by INSERT(str,pos,len,newstr) function. Varbinary fields filled at insert with 0x00 (the zero byte) by setting DEFAULT option to '\0\0\0 ... \0'. The problem is that in my company use such programs, as NaviŃat, which clears default '\0\0\0 ... \0' value at any table edit. Alternative - use datatype 'binary', that filled with 0x00 (the zero byte) by default. But its limited by 255 bytes only, error: "1074 - Column length too big for column 'row_array' (max = 255)". It will be great if limit of binary datatype increases to 65536 bytes or more.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
I use this method too. In my tables contains many columns like this: `comma` varbinary(20000) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 ... \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', with repetition of zeros many thousands of times. But I think it would be more effective to use varbinary and add new INSERT(str,pos,len,newstr) function, which will padded string with zeros to pos, if pos is not within the length of the string. Or add a new syntax for accessing the elements of string, like this: UPDATE `table` SET `comma`[4] = '1111' , which will write bytes starting from specified in brackets position, with autopadded string with zeros to position...