Skip to content
Extraits de code Groupes Projets
Valider 4c1a921f rédigé par esj's avatar esj
Parcourir les fichiers

compatibilite Postgres (INSERT)

parent 03ee32f6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -69,17 +69,17 @@ function creer_base() { ...@@ -69,17 +69,17 @@ function creer_base() {
spip_create_table($k, $v['field'], $v['key'], false); spip_create_table($k, $v['field'], $v['key'], false);
foreach($tables_images as $k => $v) foreach($tables_images as $k => $v)
spip_query_db("INSERT IGNORE spip_types_documents (extension, inclus, titre, id_type) VALUES ('$k', 'image', '" . spip_query_db("INSERT IGNORE INTO spip_types_documents (extension, inclus, titre, id_type) VALUES ('$k', 'image', '" .
(is_numeric($v) ? (is_numeric($v) ?
(strtoupper($k) . "', $v") : (strtoupper($k) . "', $v") :
"$v', 0") . "$v', 0") .
")"); ")");
foreach($tables_sequences as $k => $v) foreach($tables_sequences as $k => $v)
spip_query_db("INSERT IGNORE spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'embed')"); spip_query_db("INSERT IGNORE INTO spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'embed')");
foreach($tables_documents as $k => $v) foreach($tables_documents as $k => $v)
spip_query_db("INSERT IGNORE spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'non')"); spip_query_db("INSERT IGNORE INTO spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'non')");
foreach ($tables_mime as $extension => $type_mime) foreach ($tables_mime as $extension => $type_mime)
spip_query_db("UPDATE spip_types_documents spip_query_db("UPDATE spip_types_documents
......
...@@ -390,9 +390,9 @@ function indexer_objet($type, $id_objet, $forcer_reset = true) { ...@@ -390,9 +390,9 @@ function indexer_objet($type, $id_objet, $forcer_reset = true) {
spip_query($mots); spip_query($mots);
} }
reset($index); reset($index);
unset($q); while (list($hash, $points) = each($index)) {
while (list($hash, $points) = each($index)) $q[] = "(0x$hash,".ceil($points).",$id_objet)"; spip_query("INSERT INTO $table_index (hash, points, $col_id) VALUES (0x$hash,".ceil($points).",$id_objet)");
spip_query("INSERT INTO $table_index (hash, points, $col_id) VALUES ".join(',',$q)); }
} }
// marquer "indexe" // marquer "indexe"
......
...@@ -273,7 +273,7 @@ else if ($etape == 4) { ...@@ -273,7 +273,7 @@ else if ($etape == 4) {
// Tester $mysql_rappel_nom_base // Tester $mysql_rappel_nom_base
$GLOBALS['mysql_rappel_nom_base'] = true; $GLOBALS['mysql_rappel_nom_base'] = true;
$GLOBALS['spip_mysql_db'] = $sel_db; $GLOBALS['spip_mysql_db'] = $sel_db;
$ok_rappel_nom = spip_query("INSERT spip_meta (nom,valeur) $ok_rappel_nom = spip_query("INSERT INTO spip_meta (nom,valeur)
VALUES ('mysql_rappel_nom_base', 'test')"); VALUES ('mysql_rappel_nom_base', 'test')");
if ($ok_rappel_nom) { if ($ok_rappel_nom) {
echo " (ok rappel nom base `$sel_db`.spip_meta) "; echo " (ok rappel nom base `$sel_db`.spip_meta) ";
...@@ -287,7 +287,7 @@ else if ($etape == 4) { ...@@ -287,7 +287,7 @@ else if ($etape == 4) {
} }
if ($nouvelle) { if ($nouvelle) {
spip_query("INSERT spip_meta (nom, valeur) VALUES ('nouvelle_install', 'oui')"); spip_query("INSERT INTO spip_meta (nom, valeur) VALUES ('nouvelle_install', 'oui')");
$result_ok = !spip_sql_errno(); $result_ok = !spip_sql_errno();
} else { } else {
$result = spip_query("SELECT COUNT(*) FROM spip_articles"); $result = spip_query("SELECT COUNT(*) FROM spip_articles");
......
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