mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 03:01:07 +08:00
Search on server: Lower-case columns after casting to text, to prevent data type error: "function lower(integer) does not exist". Closes #235
This commit is contained in:
@ -889,22 +889,21 @@ begin
|
||||
|
||||
end else begin
|
||||
// Search case insensitive
|
||||
Column := 'LOWER('+Column+')';
|
||||
case DBObj.Connection.Parameters.NetTypeGroup of
|
||||
ngMySQL: begin
|
||||
if IsRegExp then
|
||||
SQL := SQL + 'CONVERT('+Column+' USING '+DBObj.Connection.CharacterSet+') REGEXP ' + esc(FindText) + ' OR '
|
||||
SQL := SQL + 'LOWER(CONVERT('+Column+' USING '+DBObj.Connection.CharacterSet+')) REGEXP ' + esc(FindText) + ' OR '
|
||||
else
|
||||
SQL := SQL + 'CONVERT('+Column+' USING '+DBObj.Connection.CharacterSet+') LIKE ' + esc(FindTextJokers) + ' OR ';
|
||||
SQL := SQL + 'LOWER(CONVERT('+Column+' USING '+DBObj.Connection.CharacterSet+')) LIKE ' + esc(FindTextJokers) + ' OR ';
|
||||
end;
|
||||
ngMSSQL: begin
|
||||
SQL := SQL + Column+' LIKE ' + esc(FindTextJokers) + ' OR ';
|
||||
SQL := SQL + 'LOWER('+Column+') LIKE ' + esc(FindTextJokers) + ' OR ';
|
||||
end;
|
||||
ngPgSQL: begin
|
||||
if IsRegExp then
|
||||
SQL := SQL + 'CAST('+Column+' AS TEXT) SIMILAR TO ' + esc(FindTextJokers) + ' OR '
|
||||
SQL := SQL + 'LOWER(CAST('+Column+' AS TEXT)) SIMILAR TO ' + esc(FindTextJokers) + ' OR '
|
||||
else
|
||||
SQL := SQL + 'CAST('+Column+' AS TEXT) LIKE ' + esc(FindTextJokers) + ' OR ';
|
||||
SQL := SQL + 'LOWER(CAST('+Column+' AS TEXT)) LIKE ' + esc(FindTextJokers) + ' OR ';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Reference in New Issue
Block a user