← Back to team overview

maria-discuss team mailing list archive

Re: getting all name-value pairs from a dynamic column


Isn't this request something like this
http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html - only not only
XML but also JSON should be supported?

I remember when this XML functionality was introduced in early MySQL 5.1
there was quite a lot of *buzz* about it.  I never heard anything about it
since. I have not even seen a bug report! It seems that nobody knows it and
nobody uses it.

I agree that JSON is an important format.  But there are lots such. A
little polemically I could say that as since some people store .mp3/.mp4
snippets in a BLOB why not add a media streaming functionality to the
server ... and playback functionalities to the standard client :-)

I think such stuff belongs in a 'stored functions library' and are not a
core server feature.  But I realize that as long as stored functions
programming only supports SQL (and not Perl like in Postgsql and not C# as
in recent SQL Server) it is not really much feasible. Currently it requires
coding in the application/client environment (such as a PHP class for

(you may find this an off-topic comment from a non-coder (and you are
right) - but I wanted to put a little perspective on this.  IMHO this
reqeust arises bcos of poor 'stored programs' programming options in MySQL)

-- Peter
-- Webyog

On Wed, Apr 11, 2012 at 19:40, MARK CALLAGHAN <mdcallag@xxxxxxxxx> wrote:

> I think I want a function that converts the blob into a JSON formatted
> set of key-value pairs.
> On Wed, Dec 7, 2011 at 9:19 PM, MARK CALLAGHAN <mdcallag@xxxxxxxxx> wrote:
> > On Fri, Dec 2, 2011 at 5:23 AM, Michael Widenius <monty@xxxxxxxxxxxx>
> wrote:
> >> MARK> How do you fetch all name-value pairs from a dynamic column in a
> >> MARK> format that can be consumed by a client?
> >>
> >> Do you mean from SQL or in the client library?
> >
> > In the client
> >
> >>
> >> MARK> The client can select the
> >> MARK> column as is but then must know how mariadb encoded it.
> >>
> >> Sorry, don't understand the question.
> >>
> >> When asking for a value for a column in the client , you get back a
> >> structure that tells how the data is encoded. See the 'struct
> >> st_dynamic_column_value'
> >>
> >> MARK> The function
> >> MARK> column_list returns the column names.
> >
> > Dynamic columns are dynamic. The client doesn't know which key names
> > are used for each row selected. With the current code there is no way
> > for the client to get all key:value pairs set in a dynamic column for
> > some number of rows. They can select the column but probably won't
> > know how to decode the name:value pairs stored in it.
> >
> > Apparently Jakob has code for this. So I don't have much more to add
> > for this thread.
> >
> > --
> > Mark Callaghan
> > mdcallag@xxxxxxxxx
> --
> Mark Callaghan
> mdcallag@xxxxxxxxx
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-discuss
> Post to     : maria-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-discuss
> More help   : https://help.launchpad.net/ListHelp

Follow ups