When did MySQL start supporting XML functions? - mysql

How long have the MySQL XML functions like ExtractValue() and UpdateXML() been supported?
A rough version number will do.

5.1.5.
MySql 5.1 documentation Section 11.11 XML Functions
Beginning with MySQL 5.1.5, two functions providing basic XPath 1.0 (XML Path Language, version 1.0) capabilities are available. Some basic information about XPath syntax and usage is provided later in this section; however, an in-depth discussion...

Related

How to convert from JSONSchema6 to JSONSchema4

I have been using the module https://www.npmjs.com/package/json-schema and have the schemas for validations in JSONSchema6.I have read that JSONSchema6 is backward compatible with JSONSchema4. Is there any utility code to convert JSONSchema6 to JSONSchema4? I need this as AWS API Gateway supports only JSONSchema4 (as per https://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html#models-mappings-models)
It's not difficult to do by hand, or write a program to do so, as the differences between the two versions are straightforward. They are itemized here: https://json-schema.org/specification.html (scroll down for the links to differences between 4 and 6 for the two specification documents).

What is the difference between Apache Drill's ValueVectors and Apache Arrow?

Apache Drill has its own columnar representation like Apache Arrow. But Apache Arrow has support for more programming languages. I am looking forward to use Apache Drill but still I want the programming language support of Apache Arrow.
Some sources say that, Apache Arrow has its roots in Apache Drill's ValueVectors.
Drill represents data internally as JSON documents – similar to
MongoDB and Elasticsearch. These JSON documents are "shredded" into
columns, which allows Drill to deliver the performance enhancements of
columnar analytics but retain the ability to query complex data. Note,
this internal representation is not based on Apache Arrow. - Source
Why cannot Apache Drill make use of the Apache Arrow project? How is Drill's internal representation differ from Apache Arrow and what advantages Arrow has over Drill's ValueVectors and vice-versa.
The Apache Arrow Java library started out as a fork of Drill's ValueVectors as the Apache Arrow project began at the beginning of 2016. The memory representation is nearly the same; one significant difference is that Arrow uses 1 bit to represent whether a vector slot is null, will Drill uses 1 byte. We decided to change this for reasons of memory efficiency and for using popcount intrinsic operations to check whether a batch of values contain any nulls.
It has been discussed whether to use exactly Arrow's representation in Apache Drill, but there is no timeline for this to happen. The relevant issue is https://issues.apache.org/jira/browse/DRILL-4455
Apache Arrow has been developed as an open standard with a public API in many programming languages. We have some level of support now for 11 programming languages, either through native implementations or bindings. This include C, C++, C#, Go, Java, JavaScript, MATLAB, Python, R, Ruby, and Rust.
I am not aware of any performance analysis comparing the memory representations, but the difference relating to null representation is unlikely to cause a significant difference.
Drill's community is considering to move onto Apache Arrow. Please take a look the following tickets:
https://issues.apache.org/jira/browse/ARROW-3164
https://issues.apache.org/jira/browse/DRILL-4455
But it is on hold right now, since there were a lot of changes and improvements in both projects. So there are some differences in Terminology, Metadata Notation, Data Types, Data Layout..
You can reply to this mail thread in drill dev mailing list to discuss it further:
https://lists.apache.org/thread.html/8d895fb40702f3120532f15594ea935a818ac0eb5acdb4fd1248d89f#%3Cdev.drill.apache.org%3E
Also contributions are very welcome :)

No Initialization Functions in MySQL Library

I have downloaded the MySQL Connector/C driver from the official website, the version that I believe is supposed to be released next to 5.6.
I then obviously wanted to use the library so I wrote a small application. During linkage, I however got a strange linker errors saying it cannot find the functions mysql_library_init() and mysql_library_end().
When I use a command to check for the functions inside the library, nm /usr/lib64/mysql/libmysqlclient.a > ~/Desktop/symbols, I indeed cannot find the functions the linker mentioned.
The functions I do find however are mysql_server_init and mysql_server_end, which are according to the documentation, marked as deprecated. (There are more functions in there too)
What am I doing wrong? I am using version 6.1.2 of the driver.
It seems like the problem is that the documentation is ahead of the code.
I am a DBA, not a C programmer, though I dabble in server internals. If the file include/mysql.h in the MySQL Server source files is any indication, the mysql_server_* functions are the ones you're looking for.
/*
mysql_server_init/end need to be called when using libmysqld or
libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
you don't need to call it explicitely; but you need to call
mysql_server_end() to free memory). The names are a bit misleading
(mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
names which suit well whether you're using libmysqld or libmysqlclient. We
intend to promote these aliases over the mysql_server* ones.
*/
#define mysql_library_init mysql_server_init
#define mysql_library_end mysql_server_end
"We intend to promote these aliases over the mysql_server* ones."
They promoted them in the documentation, apparently.
It looks like Bug #65887 was a report of the same problem, that they never really got around to doing anything with.
You might also find MariaDB's implementation of the C API "for MariaDB and MySQL" to be a viable and perhaps more agreeably-licensed alternative.

How to consolidate documentation across different languages/environments?

I am designing a class library designed to solve a wide scope of problems. One thing about this library is that it will be usable by several different languages and environments natively. For example, there will be a C++ version written entirely in C++, a .NET version written in C# and a Java version written in Java, without any dependencies on each other... as opposed to writing the core library in C++ and simply providing .NET and Java bindings to it.
The library in each of its different forms sets out to solve a different but sometimes very similar set of problems. For example, there might be many classes whose members will be functionally identical in each language, and there will also be many classes that will be present in only one or two language-versions of the library, but not the others. Take a class or struct representing a program's version number. .NET already has such as class (System.Version) so I would not include it in my .NET version but the C++ and Java libraries would provide one.
The problem I am facing is that for classes which will exist in most or all versions of the library, the documentation will remain relatively the same (obviously). The brief text for both the C++ and Java version for a Version struct would be something like "Represents a software version number in the form major.minor.build.revision"... as would the detailed class description, and all the members' documentation, etc. As you know, .NET, Java and C++ all have their own documentation syntax. Is there any way I can attempt to consolidate documentation in a language-neutral way (WITHOUT writing the documentation separately from the source code - e.g. manual documentation as opposed to generating it using doxygen/sandcastle/javadoc) or am I stuck copying and pasting the same text into the source files of each version?
I was having the same issues and decided there were just two options for me:
Using the same documentation generator in all languages. If you use doxygen (or ROBODoc, or whatever) for all of them, you would have just one doc syntax for all languages. This means that you have to break with language-specific conventions, though.
Write your own doc parser. Which is hard work, especially for a language with quite complex syntactic rules (as C++.)
We are currently using doxygen for such projects.

Repository of BNF Grammars?

Is there a place I can find Backus–Naur Form or BNF grammars for popular languages? Whenever I do a search I don't turn up much, but I figure they must be published somewhere. I'm most interested in seeing one for Objective-C and maybe MySQL.
you have to search on tools used to create grammars: "lex/yacc grammar", "antlr grammar" "railroad diagram"
http://www.antlr3.org/grammar/list.html
Here's some grammar files
objective-c
http://www.omnigroup.com/mailman/archive/macosx-dev/2001-March/022979.html
http://www.cilinder.be/docs/next/NeXTStep/3.3/nd/Concepts/ObjectiveC/B_Grammar/Grammar.htmld/index.html
https://github.com/pornel/objc2grammar
python
http://www.python.org/dev/summary/2006-04-16_2006-04-30/#the-grammar-file-and-syntaxerrors
javascript
http://tomcopeland.blogs.com/EcmaScript.html
http://www.ccs.neu.edu/home/dherman/javascript/
ruby
http://www.ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/yacc.html
FWIW, the MySQL grammar file (mysql-server/sql/sql_yacc.y) is open source and browseable at launchpad.net (though it's a bit slow and I got an error when I tried to pull up the specific file).
Also, a snapshot of the whole MySQL Server source is downloadable from dev.mysql.com.
There are some links from w:BNF#Language Grammars.
BNF Grammars for SQL-92, SQL-99 and SQL-2003
I also found a page that lists grammars for Objective C.
Objective-C grammar for Lex/Yacc Flex/Bison
Reference Manual for the Objective-C Language
IIRC, BNF grammars are just different enough from what yacc/bison want as input to be really annoying :) If you intend to feed these files into a parser generator, you may want to look for files in the appropriate format. I recall seeing such files for Java, JavaScript and C++ at one point. Probably as part of Eclipse, Firefox and GCC, respectively, but I can't remember for sure. I would assume you can find pretty much any parser input file by finding an open source project that uses that language.
I also searched this and i collected this repository
http://slps.github.io/zoo/