This commit replaces sprintf(buf, ...) with
snprintf(buf, sizeof(buf), ...),
specifically in the "easy" cases where buf is allocated with a size
known at compile time.
The changes make sure we are not write outside array/string bounds which
will lead to undefined behaviour. In case the code is trying to write
outside bounds - safe version of functions simply cut the string
messages so we process this gracefully.
All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the BSD-new
license. I am contributing on behalf of my employer Amazon Web Services,
Inc.
bsonudf.cpp warnings cleanup by Daniel Black
Reviewer: Daniel Black
Added checking for support of vfork by a platform where
building being done. Set HAVE_VFORK macros in case vfork()
system call is supported. Use vfork() system call if the
macros HAVE_VFORK is set, else use fork().
modified: storage/connect/ha_connect.cc
- Use NOTE instead of WARNING in connect_assisted_discovery
This because MariaDB raise an error when doing so
modified: storage/connect/ha_connect.cc
modified: storage/connect/tabrest.cpp
- Make MONGO tables recognize STRINGIFY and JsonAllPath
modified: storage/connect/mongo.cpp
modified: storage/connect/mongo.h
modified: storage/connect/tabcmg.h
modified: storage/connect/tabjmg.cpp
modified: storage/connect/tabcmg.cpp
modified: storage/connect/tabjmg.h
- Fix OBJECT option for Pretty != 2 JSN and BSON tables
Accept all syntaxes for the OBJECT option
modified: storage/connect/tabbson.cpp
modified: storage/connect/tabjson.cpp
- Use my_snprintf in function xcurl (by vuvova)
modified: storage/connect/tabrest.cpp
- Format dates entered as integer when formatted
modified: storage/connect/value.cpp
modified: storage/connect/value.h
modified: storage/connect/CMakeLists.txt
modified: storage/connect/javaconn.cpp
- Check privileges while creating tables with Discovery
modified: storage/connect/ha_connect.cc
- Calculate LRECL for JSON tables created with Discovery
modified: storage/connect/tabjson.cpp
- Use CreateProcess (Windows) or fork/exec (linux)
to retrieve the result from REST queries
modified: storage/connect/tabrest.cpp
- Typo
modified: storage/connect/jmgoconn.cpp
This when the HTTP contains & characters
modified: storage/connect/tabbson.cpp
modified: storage/connect/tabjson.cpp
- Make stringfy option work on only one Json item
modified: storage/connect/tabbson.cpp
modified: storage/connect/tabbson.h
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabjson.h
- Make Json/Bson DATE columns accept JSON date syntax
modified: storage/connect/tabbson.cpp
modified: storage/connect/tabjson.cpp
- Fix bug making REST table default file not being
erased when dropping the table
modified: storage/connect/tabbson.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabrest.cpp
modified: storage/connect/tabxml.cpp
- Suppress CHAR(36) --> VARCHAR(36) when DEVELOPMENT
This was fixed in MyClient
modified: storage/connect/ha_connect.cc
All variables handling sizes that were uint are now size_t.
The variable connect_work_size is now ulong (was uint);
Also make Json functiosn to allocate a larger memory (M=9 was 7)
modified: storage/connect/global.h
modified: storage/connect/ha_connect.cc
modified: storage/connect/json.cpp
modified: storage/connect/jsonudf.cpp
modified: storage/connect/plgdbutl.cpp
modified: storage/connect/plugutil.cpp
modified: storage/connect/user_connect.cc
- Fix uninitialised variable (pretty) in Json_File.
Make Jbin_file accept the same arguments as Json_File ones.
modified: storage/connect/jsonudf.cpp
- Change the Level option to Depth (the word currently used)
(Level being still accepted)
modified: storage/connect/mongo.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabxml.cpp
- Suppress 2nd argument default value for MYSQLtoPLG function
modified: storage/connect/myutil.h
- Allow REST tables to be create not specifying a file_name
modified: storage/connect/tabrest.cpp
Failed compile when XML table type is not supported.
Was because XMLDEF was unconditionally called from REST table.
modified: storage/connect/tabrest.cpp
- Make cmake less verbose
modified: storage/connect/CMakeLists.txt
- Hide Switch_to_definer_security_ctx not defined for 10.1 and 10.0
modified: storage/connect/ha_connect.cc
Problem with NOT LIKE queries.
modified: storage/connect/ha_connect.cc
modified: sql/item_cmpfunc.h
- Fix MDEV-21084
Misusage of strncat could cause buffer overflow.
modified: storage/connect/reldef.cpp
modified: storage/connect/tabcmg.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabrest.cpp
modified: storage/connect/tabxml.cpp
This new CONNECT version 1.07 fully implements NOSQL support.
It allows working on JSON or XML data retrieved as REST query results
from all binary distributions of MariaDB when cpprestsdk is installed
and the GetRest library is available.
=====================================================================
- Make Rest available for MariaDB binary distributed versions.
Change RestGet function so it can be called from a library.
modified: storage/connect/CMakeLists.txt
modified: storage/connect/restget.cpp
modified: storage/connect/tabrest.cpp
- Make column FLAG option available to discovery functions.
modified: storage/connect/ha_connect.cc
modified: storage/connect/plgdbsem.h
- Update CONNECT version number and date.
modified: storage/connect/ha_connect.cc
- Move OEMColumns function from mycat.cc to reldef.cpp.
modified: storage/connect/mycat.cc
modified: storage/connect/reldef.cpp
- Allocate tables as TABREF (was RELDEF)
modified: storage/connect/mycat.cc
modified: storage/connect/mycat.h
- Fix MDEV-20845 by commenting out TIMEOUT setting.
modified: storage/connect/myconn.cpp
- Call DefineAM before calling GetColCatInfo. Column offset
is now based on record format instead of table type.
The RECFM_VCT format was added.
This enables tables to specify the record format and is
useful in particular for OEM tables.
modified: storage/connect/plgdbsem.h
modified: storage/connect/reldef.cpp
modified: storage/connect/reldef.h
modified: storage/connect/tabdos.cpp
modified: storage/connect/tabdos.h
modified: storage/connect/tabfix.cpp
modified: storage/connect/tabfmt.cpp
modified: storage/connect/tabmysql.cpp
modified: storage/connect/tabutil.cpp
modified: storage/connect/tabutil.h
modified: storage/connect/tabvct.cpp
modified: storage/connect/xindex.cpp
===================
- Modify tracing to use htrc to be compatible with old versions
when this code is used to make an EOM module.
modified: storage/connect/restget.cpp
modified: storage/connect/tabrest.cpp
- Path apparently not needed for the cpprest lib on Linux
modified: storage/connect/CMakeLists.txt
In addition to files and Mongo collections, JSON as well as XML and CSV data can be retrieved
from the net as answers from REST queries. Because it uses and external package (cpprestsdk)
this is currently available only to MariaDB servers compiled from source.
-- Add compile flags needed on Windows /MD or /MDd (debug)
-- Also include some changes needed on Linux
modified: storage/connect/CMakeLists.txt
- Add the xtrc tracing function
modified: storage/connect/global.h
modified: storage/connect/plugutil.cpp
- Modify tracing to use xtrc and some typo
modified: storage/connect/array.cpp
modified: storage/connect/block.h
modified: storage/connect/restget.cpp
- Fix compilation error when ZIP is not supported
modified: storage/connect/ha_connect.cc
modified: storage/connect/tabfmt.cpp
- Add some tracing + typo
modified: storage/connect/mycat.cc
modified: storage/connect/tabjson.cpp
- Add conditional code based on MARIADB
This to be able to use the same code in CONNECT and EOM modules
modified: storage/connect/osutil.h
modified: storage/connect/tabrest.cpp
- Replace PlugSetPath by some concat (crashed on Fedora) + typo
modified: storage/connect/reldef.cpp
- Try to fix test failures
modified: zlib/CMakeLists.txt
In addition to files and Mongo collections, JSON as well as XML and CSV data can be retrieved
from the net as answers from REST queries. Because it uses and external package (cpprestsdk)
this is currently available only to MariaDB servers compiled from source.
-- Add the REST support when Microsoft Casablanca package (cpprestsdk) is installed.
-- Also include some changes specific to MariaDB 10.3.
modified: storage/connect/CMakeLists.txt
-- Add conditional REST support
-- Added string options HTTP and URI.
-- Added added internal table type TAB_REST.
modified: storage/connect/ha_connect.cc
modified: storage/connect/mycat.cc
modified: storage/connect/mycat.h
modified: storage/connect/plgdbsem.h
-- Fix MDEV-19648 Variable connect_conv_size doesn't change
-- Change Variable wrong block parameter from 8169 to 1.
-- Also change connect_conv_size default value to 1024.
modified: storage/connect/ha_connect.cc
-- Avoid possible buffer overflow
-- In particular by the function ShowValue.
modified: storage/connect/tabdos.cpp
modified: storage/connect/tabfmt.cpp
modified: storage/connect/value.cpp
modified: storage/connect/value.h
-- Add some cast to avoid some compiler warnings
modified: storage/connect/filamdbf.cpp
-- Fix some C++ error
modified: storage/connect/javaconn.cpp
modified: storage/connect/jmgoconn.cpp
modified: storage/connect/plugutil.cpp
-- Miscellaneous Typo and warning suppressing changes
modified: storage/connect/connect.cpp
modified: storage/connect/connect.h
modified: storage/connect/filamvct.cpp
modified: storage/connect/inihandl.cpp
modified: storage/connect/jsonudf.cpp
modified: storage/connect/libdoc.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabtbl.cpp
modified: storage/connect/tabxml.cpp
modified: storage/connect/user_connect.cc
modified: storage/connect/user_connect.h
-- Update failing test results and disbling
modified: storage/connect/mysql-test/connect/disabled.def
modified: storage/connect/mysql-test/connect/r/dir.result
modified: storage/connect/mysql-test/connect/r/grant.result
modified: storage/connect/mysql-test/connect/r/jdbc.result
modified: storage/connect/mysql-test/connect/r/jdbc_postgresql.result
modified: storage/connect/mysql-test/connect/r/xml.result
modified: storage/connect/mysql-test/connect/r/xml2.result
modified: storage/connect/mysql-test/connect/r/xml2_mult.result
modified: storage/connect/mysql-test/connect/r/xml_mult.result
-- Add an option
modified: storage/connect/mysql-test/connect/t/grant.test