1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-09 08:01:34 +03:00
Files
mariadb/mysql-test/r
unknown 10805ec234 item_strfunc.cc:
BUG #11104 
      Took out the offset-=delimiter_length-1 out of the for loop. It was causing
      basically this: 
      select substring_index('the king of the the hill', 'the', -2) to not work.
      The first iteration, offset would be initialised to 24, then strstr would 
      point at 'the king of the the* hill' ('*'means right before the 
      character following), returning a offset of 16. The for loop would then 
      decrement offset by two (3 - 1), to 14, now pointing at 
      "the king of th*e the hill", _skipping_ past the 'e' in the second to last
      'the', and therefore strstr would never have a chance of matching the 
      second to last 'the', then moving on to the 'the' at the begginning of the 
      string!
      In a nutshell, offset was being decremented by too great a value, preventing
      the second to last 'the' from being ever found, hence the result of 
      'king of the the hill' from the query that is reported in the bug report
func_str.test:
  BUG #11104
  Added tests to make sure fix addresses issues in original bug report
func_str.result:
  BUG #11104 
  New results for new tests


mysql-test/r/func_str.result:
  BUG #11104 
  
  New results for new tests
mysql-test/t/func_str.test:
  BUG #11104
  
  Added tests to make sure fix addresses issues in original bug report
sql/item_strfunc.cc:
  BUG #11104 
      Took out the offset-=delimiter_length-1 out of the for loop. It was causing
      basically this: 
      select substring_index('the king of the the hill', 'the', -2) to not work.
      The first iteration, offset would be initialised to 24, then strstr would 
      point at 'the king of the the* hill' ('*'means right before the 
      character following), returning a offset of 16. The for loop would then 
      decrement offset by two (3 - 1), to 14, now pointing at 
      "the king of th*e the hill", _skipping_ past the 'e' in the second to last
      'the', and therefore strstr would never have a chance of matching the 
      second to last 'the', then moving on to the 'the' at the begginning of the 
      string!
  
      In a nutshell, offset was being decremented by too great a value, preventing
      the second to last 'the' from being ever found, hence the result of 
      'king of the the hill' from the query that is reported in the bug report
2005-08-08 13:46:13 -07:00
..
2004-05-05 17:05:24 +03:00
2005-05-14 16:24:36 +03:00
2005-06-03 17:13:43 +02:00
2005-05-14 00:01:40 +03:00
2005-06-16 10:09:05 +02:00
2004-03-30 02:32:41 +03:00
2004-08-26 18:26:38 +03:00
2004-08-26 18:26:38 +03:00
2005-08-02 14:27:52 +05:00
2005-07-06 17:16:22 +05:00
2005-07-22 21:06:02 +05:00
2004-11-02 16:02:12 +04:00
2005-07-06 17:16:22 +05:00
2005-04-04 17:55:12 +05:00
2005-07-06 17:16:22 +05:00
2005-02-15 21:03:17 -08:00
2005-02-11 15:00:29 -08:00
2004-10-07 10:50:13 +03:00
2004-05-13 23:47:20 +03:00
2005-06-27 20:31:00 +03:00
2005-06-13 11:38:16 -07:00
2005-01-20 15:38:56 +04:00
2004-08-18 12:11:26 +05:00
2004-05-13 23:47:20 +03:00
2005-08-08 13:46:13 -07:00
2005-03-27 15:46:06 +02:00
2005-08-04 15:25:03 +05:00
2004-10-07 10:50:13 +03:00
2005-05-05 10:36:17 -07:00
2004-06-20 19:11:02 +02:00
2005-07-22 21:06:02 +05:00
2004-08-26 18:26:38 +03:00
2004-03-31 03:32:38 +03:00
2005-06-27 16:46:41 +03:00
2005-06-27 16:46:41 +03:00
2005-04-04 18:29:18 -07:00
2004-09-02 22:06:30 -07:00
2005-04-11 22:36:07 +02:00
2005-02-02 08:38:24 +02:00
2005-03-30 23:08:03 +03:00
2004-12-11 16:36:12 +03:00
2004-09-09 11:22:23 -05:00
2004-11-08 11:06:36 +01:00
2004-12-22 13:38:15 +01:00
2004-09-30 21:36:25 +00:00
2004-05-11 10:40:48 +02:00
2005-05-04 10:16:03 +02:00
2004-10-07 08:42:11 +00:00
2004-08-31 21:10:57 +03:00
2005-07-01 07:40:22 -07:00
2005-05-14 16:24:36 +03:00
2005-02-12 00:05:13 +01:00
2004-05-05 23:29:35 +03:00
2005-06-23 10:56:44 +03:00
2004-10-07 10:50:13 +03:00
2004-05-13 23:47:20 +03:00
2004-07-20 11:00:10 +02:00
2004-06-21 10:21:20 +03:00
2004-06-21 10:21:20 +03:00
2005-02-24 17:25:06 +01:00
2004-05-05 21:24:21 +03:00
2005-01-31 13:18:36 +00:00
2004-05-05 17:05:24 +03:00
2004-05-24 21:12:05 +04:00
2005-04-06 12:20:55 +02:00
2004-05-17 01:52:13 +03:00
2004-09-07 21:30:28 +02:00
2004-05-19 05:09:10 +03:00
2005-02-28 19:59:38 +04:00
2004-07-20 11:00:10 +02:00
2005-08-07 14:03:46 -07:00
2004-11-12 17:44:17 +02:00
2004-08-24 17:24:23 +02:00
2004-06-21 10:24:40 +03:00
2005-03-23 20:38:42 +01:00
2004-08-19 03:02:09 +02:00
2005-05-26 18:33:57 +03:00