Skip to content
Extraits de code Groupes Projets
Valider 7bb5b723 rédigé par marcimat's avatar marcimat
Parcourir les fichiers

Ajoute à SQLite de la compréhension de COS, SIN, TAN, ACOS, ASIN, ATAN, ATAN2, RADIANS, DEGREES.

Permet de calculer avec le plugin GIS les distances entre les points, aussi en SQLite.
parent 34e4484d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -43,14 +43,21 @@ function _sqlite_init_functions(&$sqlite) { ...@@ -43,14 +43,21 @@ function _sqlite_init_functions(&$sqlite) {
$fonctions = array( $fonctions = array(
// A
'ACOS' => array('acos', 1),
'ASIN' => array('asin', 1),
'ATAN' => array('atan', 1), // mysql accepte 2 params comme atan2… hum ?
'ATAN2' => array('atan2', 2),
// C // C
'CEIL' => array('_sqlite_func_ceil', 1), 'CEIL' => array('_sqlite_func_ceil', 1),
'CONCAT' => array('_sqlite_func_concat', -1), 'CONCAT' => array('_sqlite_func_concat', -1),
'COS' => array('cos', 1),
// D // D
'DATE_FORMAT' => array('_sqlite_func_strftime', 2), 'DATE_FORMAT' => array('_sqlite_func_strftime', 2),
'DAYOFMONTH' => array('_sqlite_func_dayofmonth', 1), 'DAYOFMONTH' => array('_sqlite_func_dayofmonth', 1),
'DEGREES' => array('rad2deg', 1),
// E // E
'EXTRAIRE_MULTI' => array('_sqlite_func_extraire_multi', 2), // specifique a SPIP/sql_multi() 'EXTRAIRE_MULTI' => array('_sqlite_func_extraire_multi', 2), // specifique a SPIP/sql_multi()
...@@ -83,17 +90,20 @@ function _sqlite_init_functions(&$sqlite) { ...@@ -83,17 +90,20 @@ function _sqlite_init_functions(&$sqlite) {
'PREG_REPLACE' => array('_sqlite_func_preg_replace', 3), 'PREG_REPLACE' => array('_sqlite_func_preg_replace', 3),
// R // R
'RAND' => array('_sqlite_func_rand', 0), // sinon random() v2.4 'RADIANS' => array('deg2rad', 1),
'REGEXP' => array('_sqlite_func_regexp_match', 2), // critere REGEXP supporte a partir de v3.3.2 'RAND' => array('_sqlite_func_rand', 0), // sinon random() v2.4
'RIGHT' => array('_sqlite_func_right', 2), 'REGEXP' => array('_sqlite_func_regexp_match', 2), // critere REGEXP supporte a partir de v3.3.2
# 'RTRIM' => array('rtrim', 1), // present 'RIGHT' => array('_sqlite_func_right', 2),
# 'RTRIM' => array('rtrim', 1), // present
// S // S
'SETTYPE' => array('settype', 2), // CAST present en v3.2.3 'SETTYPE' => array('settype', 2), // CAST present en v3.2.3
'SIN' => array('sin', 1),
'SQRT' => array('sqrt', 1), 'SQRT' => array('sqrt', 1),
'SUBSTRING' => array('_sqlite_func_substring' /*, 3*/), // peut etre appelee avec 2 ou 3 arguments, index base 1 et non 0 'SUBSTRING' => array('_sqlite_func_substring' /*, 3*/), // peut etre appelee avec 2 ou 3 arguments, index base 1 et non 0
// T // T
'TAN' => array('tan', 1),
'TIMESTAMPDIFF' => array('_sqlite_timestampdiff' /*, 3*/), 'TIMESTAMPDIFF' => array('_sqlite_timestampdiff' /*, 3*/),
'TO_DAYS' => array('_sqlite_func_to_days', 1), 'TO_DAYS' => array('_sqlite_func_to_days', 1),
# 'TRIM' => array('trim', 1), // present # 'TRIM' => array('trim', 1), // present
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter