[root] / trunk / sql / mysql / src / TMySQLStatement.cxx Repository:
ViewVC logotype

Log of /trunk/sql/mysql/src/TMySQLStatement.cxx

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 43515 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 27 21:15:53 2012 UTC (2 years, 9 months ago) by pcanal
File length: 40098 byte(s)
Diff to previous 38445
Fix coding convention R.RN7 (Avoid the raw C types 'long', 'unsigned long', 'long double', 'bool', 'long long' and 'unsigned long long'.)

Revision 38445 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 16 13:13:06 2011 UTC (3 years, 10 months ago) by pcanal
File length: 40153 byte(s)
Diff to previous 35527
Fix dereference after null check (coverity #23761)

Revision 35527 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 21 12:27:01 2010 UTC (4 years, 4 months ago) by brun
File length: 40111 byte(s)
Diff to previous 34910
do not include snprintf.h

Revision 34910 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 20 18:21:43 2010 UTC (4 years, 5 months ago) by pcanal
File length: 40133 byte(s)
Diff to previous 33530
Fix uninitialized data members (coverity)

Revision 33530 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 17 15:49:36 2010 UTC (4 years, 8 months ago) by brun
File length: 40084 byte(s)
Diff to previous 29321
From Sergey Linev:
another patch, now for MySQL, also concerning 64-bit problematic.

Here reason for error was misleading name of type identifier MYSQL_TYPE_LONG,
which is used together with C-type"int". I fix this error everywhere - some time ago only partial patch for this error was done.

I also put everywhere "long long" with type MYSQL_TYPE_LONGLONG, while this is a way how MySQL interface is defined.

Revision 29321 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 3 10:42:10 2009 UTC (5 years, 6 months ago) by brun
File length: 40065 byte(s)
Diff to previous 27842
From Sergei Linev:
1. New static methods to set/get time formatting in TOracleServer
2. Move float format constant for TBufferSQL2 to TSQLServer
3. Use that format in several other appropriate places like TODBCStatement, TOracleRow and so on.
4. Replace sprintf to snprintf calls in several places.

Revision 27842 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 17 10:56:23 2009 UTC (5 years, 10 months ago) by rdm
File length: 39985 byte(s)
Diff to previous 27302
fix portability problem between 32 and 64 bit as long is not a portable type.

Revision 27302 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 30 07:25:32 2009 UTC (5 years, 11 months ago) by brun
File length: 39995 byte(s)
Diff to previous 27220
Fix coding conventions

Revision 27220 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 23 08:59:46 2009 UTC (6 years ago) by brun
File length: 40000 byte(s)
Diff to previous 25637
From Sergei Linev:
Fix for the problem reported at: http://root.cern.ch/phpBB2/viewtopic.php?t=7881

Revision 25637 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Oct 1 09:49:57 2008 UTC (6 years, 3 months ago) by brun
File length: 39823 byte(s)
Diff to previous 23631
From Sergei Linev:
1. Support of MEDIUMBLOB and LONGBLOB binary types in TMySQLStatement
2. Support of read_timeout and write_timeout parameters in TMySQLServer connect string.
   Read/write timeout only works on Windows or with newest version of MySQL.

Revision 23631 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 1 10:50:11 2008 UTC (6 years, 8 months ago) by rdm
File length: 39514 byte(s)
Diff to previous 23123
Fix coding conventions.

Revision 23123 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 10 15:18:52 2008 UTC (6 years, 9 months ago) by rdm
File length: 39510 byte(s)
Diff to previous 22419
move the following directories to "sql":

mysql, odbc, oracle, pgsql, sapdb

Revision 22419 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 3 00:25:01 2008 UTC (6 years, 10 months ago) by rdm
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39510 byte(s)
Diff to previous 20882
From Andrew Savchenko:
ROOT can not be compiled with gcc-4.3.
Some ROOT source files doesn't contain required #include directives,
for example, they use strlen(), but #include <string.h> is missed or
malloc() is used and #include <stdlib.h> is missed. 

Earlier versions of gcc allowed some headers to be included implicitly,
but issued a warning (-Wimplicit-function-declaration). Newer one,
gcc-4.3 denies such silly behaviour: all required headers must be explicitly
included. 

Attached patch fixes this. Also it fixes another issue, which disallows
ROOT to compile under gcc-4.3: C functions don't belong to namespace std,
so expressions like std::memcpy() are no longer valid and plain memcpy()
should be used instead.

Revision 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39490 byte(s)
Diff to previous 19826
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39490 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39550 byte(s)
Diff to previous 19796
remove :$ from tag line

Revision 19796 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 13 18:16:31 2007 UTC (7 years, 4 months ago) by pcanal
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39560 byte(s)
Diff to previous 19550
update to follow coding convention

Revision 19550 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 3 18:50:13 2007 UTC (7 years, 5 months ago) by pcanal
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39566 byte(s)
Diff to previous 19549
Add a missing if MYSQL_VERSION_ID >= 50022

Revision 19549 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 3 18:18:16 2007 UTC (7 years, 5 months ago) by pcanal
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39658 byte(s)
Diff to previous 19546
temporary work-around macos compilation error

Revision 19546 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 3 17:15:59 2007 UTC (7 years, 5 months ago) by pcanal
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39522 byte(s)
Diff to previous 19544
Support MYSQL_TYPE_NEWDECIMAL only with mysql 5.0.22 and above

Revision 19544 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 3 16:55:45 2007 UTC (7 years, 5 months ago) by pcanal
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39519 byte(s)
Diff to previous 18959
Add support for MYSQL_TYPE_NEWDECIMAL (new MYSQL_TYPE fixed precision decimal)

Revision 18959 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 6 10:51:56 2007 UTC (7 years, 7 months ago) by rdm
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39227 byte(s)
Diff to previous 17176
From Dennis Box:
A Postgres implementation of TSQLStatement.
The purpose and intent of TSQLStatement is documented at

http://root.cern.ch/root/html/TSQLStatement.html

The following commentary corresponds item by item to the above url:

1) Creation of statement
Prepared statements were not explicitly
supported in PostGreSQL API libpq until server version 8.2.3
released 12/2006.

This implementation checks if prepared statements are supported
at compile time and 'stubs' out TPgSQLStatement if necessary.

2) Insert data into data base

MySQL and ODBC both use the following idiom for insert placeholders:

  TSQLStatement* stmt = serv->Statement("INSERT INTO TESTTABLE (ID1,\
      ID2, FFIELD ) VALUES (?, ?, ? )", 100);

Unfortunately for code portability, Oracle implements the same statement
like so:

  TSQLStatement* stmt = serv->Statement("INSERT INTO TESTTABLE (ID1,\
      ID2, FFIELD ) VALUES (:1,:2,:3 )", 100);

Even more unfortunately, postgres chose to do it this way:

  TSQLStatement* stmt = serv->Statement("INSERT INTO TESTTABLE (ID1,\
      ID2, FFIELD ) VALUES ($1, $2, $3 )", 100);

3) Getting data from database
Libpq API supports sending/retrieving data as choice of string types or
native types from server. Unfortunately, some native types are poorly
documented, for example date and time native representation varies depending
on compiler options given when server was built. Dates can be
either 64 bit ints or double precision floating point, representing
(+/-)microseconds since epoch (which was chosen to be 2001-01-01 00:00:01)

Native format values come as big-endian values meaning they need to
be swapped on linux but not on solaris, and the various time
manipulation functions the server uses are not exposed in the libpq
API.

I elected to use the 'string' format for this first implementation, if
the API changes to make dealing with dates and times in native format
more palatable I may re-write this class in hopes of making it faster.

4. Working with date/time parameters
Fully supported, see item 3

5. Binary data
Fully supported, see attached test program.  Note that postgres calls
these columns 'bytea'  type instead of 'blob' type.

Revision 17176 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 12 11:29:45 2006 UTC (8 years, 1 month ago) by rdm
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39490 byte(s)
Diff to previous 16204
Remove dos line endings.

Revision 16204 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 5 13:37:08 2006 UTC (8 years, 4 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 39516 byte(s)
Diff to previous 16162
From Sergey Linev:
1. Support of date/time/date&time/timestamp data introduced in TSQLStatement
   All such data now can be accessed without text conversion.
   The following methods can be used:

   SetTime()/GetTime() - only time (hour:min:sec),
   SetDate()/GetDate() - only date (year-month-day),
   SetDatime()/GetDatime() - date and time
   SetTimestamp()/GetTimestamp() - timestamp with seconds fraction
   For some of these methods TDatime type can be used as parameter / return value.
   Be aware, that TDatime supports only dates after 1995-01-01.
   There are also methods to get separately year, month, day, hour, minutes and seconds.

2. Support of binary data in TSQLStatement
    Most of modern data bases support just binary data, which is
    typically has SQL type name 'BLOB'. To access data in such
    columns, GetBinary()/SetBinary() methods should be used.
    Current implementation supposes, that complete content of the
    column must be retrieved at once. Therefore very big data of
    gigabytes size may cause a problem.

Revision 16162 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 30 12:55:09 2006 UTC (8 years, 4 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 30628 byte(s)
Diff to previous 15815
From Sergey Linev:
1. Lightweight support of DATE, TIME, DATETIME and TIMESTAMP SQL types for mysql plugin.
Now stmt->GetString() and stmt->GetInt() calls return meaningfull infotmation for that types.
In the future I will add methods like stmt->GetDate() for all SQL plugins.

2. Fix error with reading of unsigned data types from MySQL.
I was ignoring this flag, therefore methods like GetUInt(), GetULong() were not working
properly.

3. Support of TEXT/BLOB types in TMySQLStatement.
There are several small changes, which allows to read BLOB/TEXT data with TSQLStatement methods.
I also modify TMySQLServer::GetTableInfo() method to provide correct metainformation about
BLOB/TEXT columns.

Revision 15815 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 17 12:36:49 2006 UTC (8 years, 6 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 28397 byte(s)
Diff to previous 15633
From Sergey:
I have used "errno" name for variable, which is used in <errno.h> include.
Problem appears in MaxOS. In fix I just rename "errno" to "sqlerrno".

Revision 15633 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 30 06:36:35 2006 UTC (8 years, 6 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 28365 byte(s)
Diff to previous 15625
Fix coding convention violation.

Revision 15625 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 29 20:36:43 2006 UTC (8 years, 6 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 28363 byte(s)
Diff to previous 15538
From Sergey Linev:
Fix coding conventions violations

Revision 15538 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 25 18:43:24 2006 UTC (8 years, 7 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 28384 byte(s)
Diff to previous 15305
From Sergey Linev:
1. Support for MySQL version 3.2.x and 4.0 enabled again. For that old MySQL versions TSQLStatement is not supported.
2. Small fix in TSQLFile. With old MySQL versions it does not try to use TSQLStatement class.
3. Enabling/disabling error output for TSQLStatement class.
4. Fix in error handling in TMySQLServer::Statement() method. Previousely error code was not correctly stored.

Revision 15305 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 2 14:02:03 2006 UTC (8 years, 7 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 21276 byte(s)
Diff to previous 15124
From Sergey Linev:
1. New methods of TSQLServer class (also for Oracle, MySQL, ODBC):
     Exec() - execute query which does not produce any result
     GetTablesList() - return list of tables names in data-base independent form
     IsTableExists() - check if table of given name exists
     GetTableInfo() - returns instance of TSQLTableInfo with list of columns.
2. New methods of TSQLStatement class (also for Oracle, MySQL, ODBC):
     IsNull() - checks, if field value is NULL
     SetNull() - sets parameter value to NULL


New TSQLTableInfo contains information about table and table columns.
For MySQL additional information like engine type, creation and last update time is provided


New TSQLColumnInfo class contains information about single column from SQL table
Has following methods:
   GetTypeName() - field type name in string form as it is reported by correspondent
          database method. Some databases providing full type name like "numeric(20)",
          other showing only "NUMERIC". As a result, one cannot use this string directly
          to create new field of similar types in other table
   IsNullable() - says if field value can be NULL or not
   GetSQLType() - returns kind of sql type. Possible values:
      TSQLServer::kSQL_NONE        data type unknown
      TSQLServer::kSQL_CHAR        CHAR(n) - string with fixed length n
      TSQLServer::kSQL_VARCHAR     VARCHAR(n) - string with variable length upto n
      TSQLServer::kSQL_INTEGER     INTEGER, INT, TINYINT - any integer types
      TSQLServer::kSQL_FLOAT       FLOAT - float value
      TSQLServer::kSQL_DOUBLE      DOUBLE - double precision value
      TSQLServer::kSQL_NUMERIC     NUMERIC(n,s), NUMBER(n,s) - numeric values with length and precion
      TSQLServer::kSQL_BINARY      BLOB, VARBINARY  - binary data (vriable or fixed size)
      TSQLServer::kSQL_TIMESTAMP   TIMESTAMP - time and date stamp
   GetSize() - size of field in database. -1 if not known.
   GetLength() - length argument in type declaration like CHAR(len) or NUMERIC(len), -1 if not defined
   GetScale() - second argument in declarations like NUMERIC(len, s), -1 if not defined
   GetSigned() - is type signed(==1) or unsigned(==0), -1 if not defined

Revision 15124 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 22 08:55:30 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 18395 byte(s)
Diff to previous 14675
From Sergei Linev:
1. Error handling is introduced. Now TSQLServer/TSQLStatement returns error code - GetErrorCode()
   and message - GetErrorMsg() of last operation.
   If desired, error output can be suppressed for TSQLServer. Correspondent changes done in implementation
   for Oracle, MySQL, ODBC
2. New methods of TSQLServer class for transactions control: StartTransaction() / Commit() / Rollback().
   As desfault implmenetaion in TSQLServer class they corresopnd to SQL "START TRANSACTION", "COMMIT", "ROLLBACK" queries.
   For Oracle, MySQL and ODBC specific implmentaion were done while there special methods should be called.
3. Some other new methods of TSQLServer class:
     IsSupportStatement() - return kTRUE if plugin has TSQLStatement implementation
     GetMaxIdentifierLength() - return maximum allowed length of identifiers
4. Bugfix in TODBCRow class

Revision 14675 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed Apr 12 20:53:45 2006 UTC (8 years, 9 months ago) by rdm
Original Path: trunk/mysql/src/TMySQLStatement.cxx
File length: 16678 byte(s)
From Sergei Linev:
Added TSQLStatment abstract class and TMySQLStatment and TOracleStatement
classes to support bulk DB operations. For more details see the description
in the TSQLStatement.cxx file.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9