Re: [sqlite] Which built-in functions are mandatory?

2007-11-05 Thread Joe Wilson
--- Aladdin Lampé <[EMAIL PROTECTED]> wrote:
> In other terms, which built-in functions can I safely remove (or rename) 
> without getting
> internal errors?
> I hope I can remove or rename all of them without compilation or execution 
> errors... What do you
> think?

It depends on your use.
Some functions are used internally and cannot be renamed:

  substr()
  quote()
  LIKE operator (likeFunc)

You may need these as well:

  sqlite_rename_table()
  sqlite_rename_trigger()
  sqlite_detach()
  sqlite_attach()

If you run your program with this print statement, you should see 
all functions called by your program:

Index: src/expr.c
===
RCS file: /sqlite/sqlite/src/expr.c,v
retrieving revision 1.315
diff -u -3 -p -r1.315 expr.c
--- src/expr.c  23 Oct 2007 18:55:49 -  1.315
+++ src/expr.c  6 Nov 2007 05:09:47 -
@@ -1371,6 +1371,7 @@ static int nameResolverStep(void *pArg,

   zId = (char*)pExpr->token.z;
   nId = pExpr->token.n;
+  if (nId>0 && zId) printf("TK_FUNCTION: %.*s\n", nId, zId);
   pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0);
   if( pDef==0 ){
 pDef = sqlite3FindFunction(pParse->db, zId, nId, -1, enc, 0);


For example:

SQLite version 3.5.1
Enter ".help" for instructions
sqlite> create table foo(a);
sqlite> alter table "foo" rename to "goo";
TK_FUNCTION: sqlite_rename_table
TK_FUNCTION: sqlite_rename_trigger
TK_FUNCTION: LIKE
TK_FUNCTION: substr
sqlite> vacuum;
TK_FUNCTION: substr
TK_FUNCTION: substr
TK_FUNCTION: LIKE
TK_FUNCTION: substr
TK_FUNCTION: LIKE
TK_FUNCTION: quote
TK_FUNCTION: quote
TK_FUNCTION: quote
TK_FUNCTION: quote
TK_FUNCTION: quote


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Which built-in functions are mandatory?

2007-11-05 Thread Aladdin Lampé

Hi sqlite-users!
In other terms, which built-in functions can I safely remove (or rename) 
without getting internal errors?
I hope I can remove or rename all of them without compilation or execution 
errors... What do you think?
Thanks a lot!

Here's the list! ;-)

min FUNCTION
max FUNCTION
typeof FUNCTION
length FUNCTION
substr FUNCTION
abs FUNCTION
round FUNCTION
upper FUNCTION
lower FUNCTION
coalesce FUNCTION
hex FUNCTION
ifnull FUNCTION
random FUNCTION
randomblob FUNCTION
nullif FUNCTION
sqlite_version FUNCTION
quote FUNCTION
last_insert_rowid FUNCTION
changes FUNCTION
total_changes FUNCTION
replace FUNCTION
ltrim FUNCTION
rtrim FUNCTION
trim FUNCTION
zeroblob FUNCTION
soundex FUNCTION
load_extension FUNCTION
min AGGREGATE
max AGGREGATE
sum AGGREGATE
total AGGREGATE
avg AGGREGATE
count AGGREGATE

_
Vous êtes plutôt Desperate ou LOST ? Personnalisez votre PC avec votre série TV 
préférée !
http://specials.divertissements.fr.msn.com/SeriesTV.aspx
-
To unsubscribe, send email to [EMAIL PROTECTED]
-