Yes, I know its not possible
Here's my situation. I'm trying to add DB2 support to a CMS. I have everything working (with help from people here) except for 1 issue. I thought about multiple ways to address the issue but at this point, its time to ask for help. All the DBs that the CMS officially supports allow for GROUP BY on blob fields.
Here's what sample output looks like with MySQL ('variables' being a blob field):
> SELECT w.message AS message, w.variables AS variables, COUNT(wid) AS count FROM watchdog w WHERE (w.type = 'search') GROUP BY message, variables ORDER BY count DESC LIMIT 30 OFFSET 0;
+---------------------------+---------------------------------------------------------+-------+
| message | variables | count |
+---------------------------+---------------------------------------------------------+-------+
| Searched %type for %keys. | a:2:{s:5:"%keys";s:4:"test";s:5:"%type";s:7:"Conte nt";} | 1 |
+---------------------------+---------------------------------------------------------+-------+
1 row in set (0.00 sec)
In reality, the 'variables' column probably wouldn't require the blob type 99.9% of the time. But I can't in good faith create the field as varchar (the deprecation of long varchar isn't helping my cause either!).
So my question is what can be done about this. I saw a previous post by Knut where he said an external UDF that did something with the column was the way to go. I don't have the luxury of requiring external functions so anything needed would need to be in the support driver I'm writing.
I do have the ability to modify the query. I can't modify the CMS schema but I can use custom datatypes, functions, etc.
Any ideas or suggestions are appreciated.