1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

This patch contains the beginnings of the data-typing infrastructure.

The new build-in TypeOf() function is added.  New opcodes for doing
pure text comparisons are added.  Most changes are disabled pending
the 2.6.0 release. (CVS 632)

FossilOrigin-Name: cbbc858d973c2d515c6a2464981316549a241b73
This commit is contained in:
drh
2002-06-20 11:36:48 +00:00
parent c926afbc2d
commit c9b84a1fb1
10 changed files with 497 additions and 85 deletions

View File

@@ -12,7 +12,7 @@
** This header file defines the interface that the SQLite library
** presents to client programs.
**
** @(#) $Id: sqlite.h.in,v 1.31 2002/05/10 05:44:56 drh Exp $
** @(#) $Id: sqlite.h.in,v 1.32 2002/06/20 11:36:50 drh Exp $
*/
#ifndef _SQLITE_H_
#define _SQLITE_H_
@@ -426,6 +426,27 @@ int sqlite_create_aggregate(
void *pUserData /* Available via the sqlite_user_data() call */
);
/*
** Use the following routine to define the datatype returned by a
** user-defined function. The second argument can be one of the
** constants SQLITE_NUMERIC, SQLITE_TEXT, or SQLITE_ARGS or it
** can be an integer greater than or equal to zero. The datatype
** will be numeric or text (the only two types supported) if the
** argument is SQLITE_NUMERIC or SQLITE_TEXT. If the argument is
** SQLITE_ARGS, then the datatype is numeric if any argument to the
** function is numeric and is text otherwise. If the second argument
** is an integer, then the datatype of the result is the same as the
** parameter to the function that corresponds to that integer.
*/
int sqlite_function_type(
sqlite *db, /* The database there the function is registered */
const char *zName, /* Name of the function */
int datatype /* The datatype for this function */
);
#define SQLITE_NUMERIC (-1)
#define SQLITE_TEXT (-2)
#define SQLITE_ARGS (-3)
/*
** The user function implementations call one of the following four routines
** in order to return their results. The first parameter to each of these