Partial fix for bug #3291306 - Inline edit does not honor bit fields. Works with mysqli extension.

This commit is contained in:
Madhura Jayaratne
2011-06-04 00:02:11 +05:30
parent ab1a2394c3
commit 612f8f3d67
2 changed files with 17 additions and 4 deletions

View File

@@ -888,16 +888,20 @@ $(document).ready(function() {
*/
var is_null = $this_field.find('input:checkbox').is(':checked');
var value;
var addQuotes = true;
if (is_null) {
sql_query += ' `' + field_name + "`=NULL , ";
need_to_post = true;
} else {
if($this_field.is(":not(.relation, .enum, .set)")) {
if($this_field.is(":not(.relation, .enum, .set, .bit)")) {
this_field_params[field_name] = $this_field.find('textarea').val();
if($this_field.is('.transformed')) {
$.extend(transform_fields, this_field_params);
}
} else if ($this_field.is('.bit')) {
this_field_params[field_name] = '0b' + $this_field.find('textarea').val();
addQuotes = false;
} else if ($this_field.is('.set')) {
$test_element = $this_field.find('select');
this_field_params[field_name] = $test_element.map(function(){
@@ -924,7 +928,11 @@ $(document).ready(function() {
new_clause += '`' + window.parent.table + '`.' + '`' + field_name + "` = '" + this_field_params[field_name].replace(/'/g,"''") + "'" + ' AND ';
}
if (this_field_params[field_name] != $this_field.data('original_data')) {
sql_query += ' `' + field_name + "`='" + this_field_params[field_name].replace(/'/g, "''") + "' , ";
if (addQuotes == true) {
sql_query += ' `' + field_name + "`='" + this_field_params[field_name].replace(/'/g, "''") + "', ";
} else {
sql_query += ' `' + field_name + "`=" + this_field_params[field_name].replace(/'/g, "''") + ", ";
}
need_to_post = true;
}
}