SOURCES: fix_search_session_clear_issue.patch (NEW), fix_sql_synta...
arekm
arekm at pld-linux.org
Tue Jan 17 11:00:47 CET 2006
Author: arekm Date: Tue Jan 17 10:00:47 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- new; official patches
---- Files affected:
SOURCES:
fix_search_session_clear_issue.patch (NONE -> 1.1) (NEW), fix_sql_syntax_related_to_default_rra_id.patch (NONE -> 1.1) (NEW), nth_percentile_empty_return_set_issue.patch (NONE -> 1.1) (NEW), mysql_5x_strict.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/fix_search_session_clear_issue.patch
diff -u /dev/null SOURCES/fix_search_session_clear_issue.patch:1.1
--- /dev/null Tue Jan 17 11:00:47 2006
+++ SOURCES/fix_search_session_clear_issue.patch Tue Jan 17 11:00:41 2006
@@ -0,0 +1,27 @@
+--- cacti-0.8.6h/host.php 2006-01-03 21:08:30.000000000 -0600
++++ cacti-fixed/host.php 2006-01-06 22:45:51.630701318 -0600
+@@ -726,18 +726,18 @@
+ unset($_REQUEST["host_status"]);
+ }
+
+- if (!empty($_SESSION["sess_host_status"])) {
+- if ($_SESSION["sess_host_status"] != $_REQUEST["host_status"]) {
+- $_REQUEST["page"] = 1;
+- }
+- }
+-
+ /* remember these search fields in session vars so we don't have to keep passing them around */
+ load_current_session_value("page", "sess_device_current_page", "1");
+ load_current_session_value("filter", "sess_device_filter", "");
+ load_current_session_value("host_template_id", "sess_device_host_template_id", "-1");
+ load_current_session_value("host_status", "sess_host_status", "-1");
+
++ if (!empty($_SESSION["sess_host_status"])) {
++ if ($_SESSION["sess_host_status"] != $_REQUEST["host_status"]) {
++ $_REQUEST["page"] = 1;
++ }
++ }
++
+ html_start_box("<strong>Devices</strong>", "98%", $colors["header"], "3", "center", "host.php?action=edit&host_template_id=" . $_REQUEST["host_template_id"] . "&host_status=" . $_REQUEST["host_status"]);
+
+ include("./include/html/inc_device_filter_table.php");
================================================================
Index: SOURCES/fix_sql_syntax_related_to_default_rra_id.patch
diff -u /dev/null SOURCES/fix_sql_syntax_related_to_default_rra_id.patch:1.1
--- /dev/null Tue Jan 17 11:00:47 2006
+++ SOURCES/fix_sql_syntax_related_to_default_rra_id.patch Tue Jan 17 11:00:41 2006
@@ -0,0 +1,22 @@
+--- cacti-0.8.6h/graph.php 2006-01-03 21:08:30.000000000 -0600
++++ cacti-fixed/graph.php 2006-01-06 22:40:29.643671752 -0600
+@@ -130,13 +130,13 @@
+ $timespan = -($rra["timespan"]);
+
+ /* find the step and how often this graph is updated with new data */
+- $ds_step = db_fetch_cell("select
++ $ds_step = db_fetch_cell("SELECT
+ data_template_data.rrd_step
+- from (data_template_data,data_template_rrd,graph_templates_item)
+- where graph_templates_item.task_item_id=data_template_rrd.id
+- and data_template_rrd.local_data_id=data_template_data.local_data_id
+- and graph_templates_item.local_graph_id=" . $_GET["local_graph_id"] .
+- "limit 0,1");
++ FROM (data_template_data,data_template_rrd,graph_templates_item)
++ WHERE graph_templates_item.task_item_id=data_template_rrd.id
++ AND data_template_rrd.local_data_id=data_template_data.local_data_id
++ AND graph_templates_item.local_graph_id=" . $_GET["local_graph_id"] .
++ " LIMIT 0,1");
+ $ds_step = empty($ds_step) ? 300 : $ds_step;
+ $seconds_between_graph_updates = ($ds_step * $rra["steps"]);
+
================================================================
Index: SOURCES/nth_percentile_empty_return_set_issue.patch
diff -u /dev/null SOURCES/nth_percentile_empty_return_set_issue.patch:1.1
--- /dev/null Tue Jan 17 11:00:47 2006
+++ SOURCES/nth_percentile_empty_return_set_issue.patch Tue Jan 17 11:00:41 2006
@@ -0,0 +1,94 @@
+--- cacti-0.8.6h/lib/graph_variables.php 2006-01-03 21:08:30.000000000 -0600
++++ cacti-fixed/lib/graph_variables.php 2006-01-06 22:40:31.032460462 -0600
+@@ -302,27 +302,34 @@
+
+ /* format the output according to args passed to the variable */
+ if ($regexp_match_array[4] == "current") {
++ if (! empty($nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]})) {
+ $nth = $nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]};
+ $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
+ $nth /= pow(10,intval($regexp_match_array[3]));
++ }
+ }elseif ($regexp_match_array[4] == "total") {
+ for ($t=0;($t<count($graph_items));$t++) {
+ if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
++ if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
+ $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
+ $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
+ $local_nth /= pow(10,intval($regexp_match_array[3]));
+
+ $nth += $local_nth;
++ }
+
+ }
+ }
+ }elseif ($regexp_match_array[4] == "max") {
++ if (! empty($nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"])) {
+ $nth = $nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"];
+ $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
+ $nth /= pow(10,intval($regexp_match_array[3]));
++ }
+ }elseif ($regexp_match_array[4] == "total_peak") {
+ for ($t=0;($t<count($graph_items));$t++) {
+ if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
++ if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
+ $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
+ $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
+ $local_nth /= pow(10,intval($regexp_match_array[3]));
+@@ -330,9 +337,11 @@
+ $nth += $local_nth;
+ }
+ }
++ }
+ }elseif ($regexp_match_array[4] == "all_max_current") {
+ for ($t=0;($t<count($graph_items));$t++) {
+ if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
++ if (! empty($ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
+ $local_nth = $ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
+ $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
+ $local_nth /= pow(10,intval($regexp_match_array[3]));
+@@ -342,9 +351,11 @@
+ }
+ }
+ }
++ }
+ }elseif ($regexp_match_array[4] == "all_max_peak") {
+ for ($t=0;($t<count($graph_items));$t++) {
+ if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
++ if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
+ $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
+ $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
+ $local_nth /= pow(10,intval($regexp_match_array[3]));
+@@ -354,28 +365,23 @@
+ }
+ }
+ }
++ }
+ }elseif ($regexp_match_array[4] == "aggregate") {
+- if (empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
+- $nth = 0;
+- }else{
++ if (! empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
+ $local_nth = $nth_cache{0}["nth_percentile_aggregate_total"];
+ $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
+ $local_nth /= pow(10,intval($regexp_match_array[3]));
+ $nth = $local_nth;
+ }
+ }elseif ($regexp_match_array[4] == "aggregate_max") {
+- if (empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
+- $nth = 0;
+- }else{
++ if (! empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
+ $local_nth = $nth_cache{0}["nth_percentile_aggregate_max"];
+ $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
+ $local_nth /= pow(10,intval($regexp_match_array[3]));
+ $nth = $local_nth;
+ }
+ }elseif ($regexp_match_array[4] == "aggregate_sum") {
+- if (empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
+- $nth = 0;
+- }else{
++ if (! empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
+ $local_nth = $nth_cache{0}["nth_percentile_aggregate_sum"];
+ $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
+ $local_nth /= pow(10,intval($regexp_match_array[3]));
================================================================
Index: SOURCES/mysql_5x_strict.patch
diff -u /dev/null SOURCES/mysql_5x_strict.patch:1.1
--- /dev/null Tue Jan 17 11:00:47 2006
+++ SOURCES/mysql_5x_strict.patch Tue Jan 17 11:00:41 2006
@@ -0,0 +1,52 @@
+diff -ruBbd cacti-0.8.6h/cacti.sql yak/cacti.sql
+--- cacti-0.8.6h/cacti.sql 2006-01-03 22:08:36.000000000 -0500
++++ yak/cacti.sql 2006-01-07 16:21:36.406250000 -0500
+@@ -1846,7 +1846,7 @@
+ avg_time decimal(10,5) default '0.00000',
+ total_polls int(12) unsigned default '0',
+ failed_polls int(12) unsigned default '0',
+- availability decimal(7,5) NOT NULL default '100.00000',
++ availability decimal(8,5) NOT NULL default '100.00000',
+ PRIMARY KEY (id)
+ ) TYPE=MyISAM;
+
+diff -ruBbd cacti-0.8.6h/lib/database.php yak/lib/database.php
+--- cacti-0.8.6h/lib/database.php 2006-01-03 22:08:36.000000000 -0500
++++ yak/lib/database.php 2006-01-07 14:43:36.156250000 -0500
+@@ -214,14 +214,14 @@
+ @arg $table_name - the name of the table to make the replacement in
+ @arg $key_cols - the primary key(s)
+ @returns - the auto incriment id column (if applicable) */
+-function sql_save($array_items, $table_name, $key_cols = "id") {
++function sql_save($array_items, $table_name, $key_cols = "id", $autoinc = TRUE) {
+ global $cnn_id;
+
+ while (list ($key, $value) = each ($array_items)) {
+ $array_items[$key] = "\"" . sql_sanitize($value) . "\"";
+ }
+
+- if (!$cnn_id->Replace($table_name, $array_items, $key_cols, false)) { return 0; }
++ if (!$cnn_id->Replace($table_name, $array_items, $key_cols, FALSE, $autoinc)) { return 0; }
+
+ /* get the last AUTO_ID and return it */
+ if ($cnn_id->Insert_ID() == "0") {
+diff -ruBbd cacti-0.8.6h/lib/template.php yak/lib/template.php
+--- cacti-0.8.6h/lib/template.php 2006-01-03 22:08:36.000000000 -0500
++++ yak/lib/template.php 2006-01-07 15:08:31.953125000 -0500
+@@ -643,10 +642,16 @@
+
+ /* if there are no '|' characters, all of the substitutions were successful */
+ if (!strstr($subs_string, "|query")) {
++ if (sizeof(db_fetch_row("show columns from data_template_data like '" . $suggested_value["field_name"] . "'"))) {
+ db_execute("update data_template_data set " . $suggested_value["field_name"] . "='" . addslashes($suggested_value["text"]) . "' where local_data_id=" . $cache_array["local_data_id"]{$data_template["id"]});
++ }
+
+ /* once we find a working value, stop */
+ $suggested_values_ds{$data_template["id"]}{$suggested_value["field_name"]} = true;
++
++ if (sizeof(db_fetch_row("show columns from data_template_rrd like '" . $suggested_value["field_name"] . "'"))) {
++ db_execute("update data_template_rrd set " . $suggested_value["field_name"] . "='" . $subs_string . "' where local_data_id=" . $cache_array["local_data_id"]{$data_template["id"]});
++ }
+ }
+ }
+ }
================================================================
More information about the pld-cvs-commit
mailing list